From e.caspar at ucl.ac.uk Mon Sep 1 09:02:16 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Mon, 1 Sep 2014 07:02:16 +0000 Subject: [FieldTrip] Grand Average on time lock data Message-ID: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Dear all, I would like to perform the grand average in a separate script than the preprocessing one, to avoid a crash, because of the number of participants. In the preprocessing script, I performed a timelockanalysis for each participants : avgFC = ft_timelockanalysis(cfg, cleandata); and then save this file : finfname = [subjID{s} '_RP']; mkdir(subjID{s}) save([subjPath filesep finfname '.mat'], 'avgFC'); So, in my grand average script, I wrote the following : cfg = []; homePath = '/Users/emilie/Desktop/EEG_RP/Grandaverage/'; eegPath = homePath; %% Subjects datafiles = {'S83_RP','S84_RP','S85_RP','S87_RP','S88_RP','S89_RP','S90_RP','S91_RP','S92_RP','S93_RP','S94_RP','S97_RP','S98_RP','S99_RP','S100_RP', 'S101_RP'}; nFiles = length(datafiles); avgs = cell(1,nFiles); cfg.channel = 'all'; cfg.latency = 'all'; %cfg.parameter = 'avg'; for iFile = 1:nFiles thisfile = datafiles{iFile}; subjPath = [eegPath thisfile]; file = dir([subjPath '*.mat']); avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', 'feedback', 'no'); avgs{iFile} = load(datafiles{iFile}); end GA = ft_timelockgrandaverage(cfg, avgs{:}); But I'm not pretty sure to understand the error message : Error using ft_checkdata (line 366) This function requires timelock data as input. Error in Averaging (line 33) avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', 'feedback', 'no'); Because If I'm right, the files in 'datafiles' are the time locked data from the preprocessing script. Thank you, Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Sep 1 09:28:21 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 1 Sep 2014 09:28:21 +0200 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Message-ID: Dear Emilie, If you assign the return value of MATLAB's load() to a variable, that variable will become a struct with the variables in the specified mat-file as its fields. In your case avgs{k} will probably (have not read your script very thoroughly) be a struct, so avgs{k}.avgFC is the actual timelock structure. You should replace avgs{iFile} = load(datafiles{iFile}); with tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; and then I think it should work. Best, Eelke On 1 September 2014 09:02, Caspar, Emilie wrote: > Dear all, > > > I would like to perform the grand average in a separate script than the > preprocessing one, to avoid a crash, because of the number of participants. > In the preprocessing script, I performed a timelockanalysis for each > participants : avgFC = ft_timelockanalysis(cfg, cleandata); > and then save this file : > finfname = [subjID{s} '_RP']; > mkdir(subjID{s}) > save([subjPath filesep finfname '.mat'], 'avgFC'); > > > So, in my grand average script, I wrote the following : > > cfg = []; > homePath = '/Users/emilie/Desktop/EEG_RP/Grandaverage/'; > eegPath = homePath; > > > > %% Subjects > datafiles = > {'S83_RP','S84_RP','S85_RP','S87_RP','S88_RP','S89_RP','S90_RP','S91_RP','S92_RP','S93_RP','S94_RP','S97_RP','S98_RP','S99_RP','S100_RP', > 'S101_RP'}; > nFiles = length(datafiles); > avgs = cell(1,nFiles); > > > > cfg.channel = 'all'; > cfg.latency = 'all'; > %cfg.parameter = 'avg'; > > > > for iFile = 1:nFiles > thisfile = datafiles{iFile}; > subjPath = [eegPath thisfile]; > file = dir([subjPath '*.mat']); > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > 'feedback', 'no'); > avgs{iFile} = load(datafiles{iFile}); > end > > > > GA = ft_timelockgrandaverage(cfg, avgs{:}); > > But I'm not pretty sure to understand the error message : > Error using ft_checkdata (line 366) > This function requires timelock data as input. > > Error in Averaging (line 33) > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > 'feedback', 'no'); > > Because If I'm right, the files in 'datafiles' are the time locked data from > the preprocessing script. > > Thank you, > > Emilie > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Mon Sep 1 09:48:30 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 1 Sep 2014 09:48:30 +0200 Subject: [FieldTrip] Using clusterstat.m straight giving her specific statobs and statrnd In-Reply-To: References: Message-ID: Dear Constantino, First, you need to specify cfg.dim as the size of the data matrix, in your case probably just [102 500], the size(statobs) before reshaping. Note that you need to put in statobs as a vector (statobs(:)) and statrnd as a numel(statobs) X nRand matrix. Second, I don't know why you are specifying a cfg.layout, this is not used by the function. The same goes for cfg.neighbours, this is also not used. The higher-level statistics functions convert the cfg.neighbours struct-array into a logical connectivity array using the low-level private function channelconnectivity. To use clusterstat (a low-level function) directly, you need to do this beforehand. So, do something like this: cfg = []; cfg.neighbours = neighbours; cfg.channel = datachannels; % order is important here, must be the same as the data connectivity = channelconnectivity(cfg); cfg = []; ... cfg.dim = size(statobs); % assuming statobs is still a chan X time matrix cfg.connectivity = connectivity; % this assumes statrnd is a chan X time X nRand array statrnd = reshape(statrnd, [numel(statobs), size(statrnd,3)]); statobs = statobs(:); stat = clusterstat(cfg, statrnd, statobs); Best, Eelke On 29 August 2014 18:36, Constantino Méndez Bértolo < constantino.mendezbertolo at ctb.upm.es> wrote: > Dear Fieldtrippers > > We have a 3x3 design and MEG data, say only mag channels (n102) to > simplify. > > We want to perform a cluster-based permutation approach but > timelockstatistics (cfg.method = 'montecarlo', cfg.correctm = 'cluster', > etc) cannot deal with interactions when you have more than three levels > (true?) > > So we built our 'statobs' and 'statrnd' doing a GLM in -R Statistical > Package- and feed 'clusterstat.m' with them > > We have done this with one channel over time with success. However, I am > clueless now about how to solve the problem when dealing with the whole > channel set. > > I wonder what is the nature of the cfg.dim that we need to feed > 'clusterstat.m' with. > > Up to now, we use, (cioming out of -R-): > > size(statobs) = nchan*ntime % (102*500) % twin = [0 .5] % seconds > size(statrnd) = nchan*ntime*nrandomizations % (102*500*1000) > > > and the following presets: > > cfg=[]; > cfg.clustercritval = Fcritmain; % We genereate this before hand > cfg.tail = 1; cfg.clustertail = 1; cfg.clusterthreshold = 'parametric'; > cfg.dim = [1 size(statobs,1) size(statobs,2) ] % <<< The key may be here > load('neuromag306mag_neighb.mat'); > cfg.neighbours = neighbours; > cfg.feedback = 'yes'; > cfg.numrandomization = 1000; > cfg.clusterstatistic = 'maxsum'; > cfg.layout = 'neuromag306mag.lay'; > for i = 1:length(cfg.neighbours) > cfg.channel{i} = cfg.neighbours(i).label; > end > > stat = clusterstat(cfg,statrnd, statobs) > > > Which lead us to an error within findcluster > > Error using findcluster (line 59) > invalid dimension of spatdimneighbstructmat > > Error in clusterstat (line 197) > posclusobs = findcluster(reshape(postailobs, > [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); > > > If anybody has got some insigth it would be greatly appreciated. Or any > hints. Are the size of my statobs and starnd correct? I can share more > information and firstly apologize if I was not able to describe the > problem accurately, I am confused regarding that 'reshape' and the addition > of one dimension at "...reshape(postailobs,[cfg.dim,1])...", but the > problem arises first when findcluster.m tries to calculate the size of > spatdimneighbstructmat > > First line of findcluster.m calcualtes 'spatdimlength' by : " > spatdimlength = size(onoff, 1);" which in our case is "1", which is > obviously wrong?. > > manythanks&peace2all > > -- > Constantino Méndez-Bértolo > Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) > > Parque Científico y Tecnológico de la UPM, Campus de Montegancedo > > 28223 Pozuelo de Alarcón, Madrid, SPAIN > > > > _______________________________________________ > 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 Christoph.Maier at hs-heilbronn.de Mon Sep 1 11:54:28 2014 From: Christoph.Maier at hs-heilbronn.de (Maier, Christoph) Date: Mon, 1 Sep 2014 09:54:28 +0000 Subject: [FieldTrip] Realtime question: tmsi2ft saving to gdf file Message-ID: <2401574ECDCE3246B11D77FD57BFEB1E010D5D31E2@exmbx2.hhn.hs-heilbronn.de> Dear Fieldtrip Users, from the tmsi2ft description on the web (http://fieldtrip.fcdonders.nl/development/realtime/tmsi) I understand that tmsi2ft should allow to transparently save the acquired data to a gdf file while streaming it out. I successfully can read the Signal/Event data acquired with tmsi2ft into Matlab using the realtime functions. However, I can't find a gdf file, and I can't see any place where a file name could be specified. The command line accepts only the parameters tmsi2ft config.txt [hostname [port [ctrlPort]]] The parseFile() Method of the SignalConfiguration-Class does not seem to permit a specification of a filename in the configuration file, and I couldn't identify a call to ODM->setFilename() or ODM->enableSaving() in the tmsi2ft code (as opposed to the biosemi2ft code, where such calls are present and where the filename can be specified in the command line). Therefore my question is: Did I overlook anything and can a filename for a gdf file be specified anyhwere during startup of tmsi2ft? Or is the only intended way to use the TCP command interface of the OnlineDataManager? Thanks in advance for your help Christoph Maier ------------------------------------------------------------------------------------------------- Dr. Christoph Maier, Dipl.-Inform. Med. Department of Medical Informatics Faculty of Informatics (IT) Max-Planck-Str. 39 D-74081 Heilbronn Germany Tel.: +49 (0)7131 504-355 Fax: +49 (0)7131 252 470 E-Mail: christoph.maier at hs-heilbronn.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Mon Sep 1 16:51:48 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Mon, 1 Sep 2014 14:51:48 +0000 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Message-ID: <0AD437C8-8D04-4598-AD49-F50B41E0E046@live.ucl.ac.uk> Dear Eelke, Thank you for your answer. Unfortunately, I still have the same error message. It occurs at the lines you mention, as they occurred in the line I had written in the previous script: tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; Error message: Error using ft_checkdata (line 366) This function requires timelock data as input. And I still don't understand the error. Emilie Le 1 sept. 2014 à 09:28, Eelke Spaak > a écrit : tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Sep 1 16:57:56 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 1 Sep 2014 16:57:56 +0200 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: <0AD437C8-8D04-4598-AD49-F50B41E0E046@live.ucl.ac.uk> References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> <0AD437C8-8D04-4598-AD49-F50B41E0E046@live.ucl.ac.uk> Message-ID: I just now noticed you are calling ft_checkdata yourself, inside the loop. I don't understand why this is, but to me it seems you can remove it. Does it work then? Best, Eelke On 1 September 2014 16:51, Caspar, Emilie wrote: > Dear Eelke, > > Thank you for your answer. Unfortunately, I still have the same error > message. It occurs at the lines you mention, as they occurred in the line I > had written in the previous script: > > tmp = load(datafiles{iFile}); > avgs{iFile} = tmp.avgFC; > > Error message: > Error using ft_checkdata (line 366) > This function requires timelock data as input. > > And I still don't understand the error. > > Emilie > > > > Le 1 sept. 2014 à 09:28, Eelke Spaak a écrit : > > tmp = load(datafiles{iFile}); > avgs{iFile} = tmp.avgFC; > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Tue Sep 2 11:08:59 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Tue, 2 Sep 2014 09:08:59 +0000 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> <0AD437C8-8D04-4598-AD49-F50B41E0E046@live.ucl.ac.uk> Message-ID: Yes! Thank you again! Emilie Le 1 sept. 2014 à 16:57, Eelke Spaak > a écrit : I just now noticed you are calling ft_checkdata yourself, inside the loop. I don't understand why this is, but to me it seems you can remove it. Does it work then? Best, Eelke On 1 September 2014 16:51, Caspar, Emilie > wrote: Dear Eelke, Thank you for your answer. Unfortunately, I still have the same error message. It occurs at the lines you mention, as they occurred in the line I had written in the previous script: tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; Error message: Error using ft_checkdata (line 366) This function requires timelock data as input. And I still don't understand the error. Emilie Le 1 sept. 2014 à 09:28, Eelke Spaak > a écrit : tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; _______________________________________________ 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 Wed Sep 3 08:59:06 2014 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 3 Sep 2014 09:59:06 +0300 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Message-ID: Dear fieldtrippers, I found it uncomfortable having to know the names of different variables as I load them, so I have written a function called "load2struct" (see below). It should be used in cases in which the mat file holds only one variable (a volume, a grid, etc), otherwise only the first variable is loaded. In your example, Emilie, you could use: avgs{iFile} = load2struct(datafiles{iFile}); For me it helped increase the code readability, and allowed my codes to be more compatible with changes I did along the way, like changing the naming format for variables used for specific subjects. I hope you find it useful (and also that it's not silly (maybe there's a much simpler solution), or just wrong). Best, Roey =========================================================== function struct = load2struct(filePath) % LOAD2STRUCT loads the struct in the filePath mat file to a variable, % without needing to know the original field name of this struct. struct = load(filePath); structFieldName = fieldnames(struct); if (length(structFieldName) > 1) warning('Note: load2struct only loads the first variable in the mat file') end eval(['struct = struct.' structFieldName{1} ';']); end On Mon, Sep 1, 2014 at 10:28 AM, Eelke Spaak wrote: > Dear Emilie, > > If you assign the return value of MATLAB's load() to a variable, that > variable will become a struct with the variables in the specified > mat-file as its fields. In your case avgs{k} will probably (have not > read your script very thoroughly) be a struct, so avgs{k}.avgFC is the > actual timelock structure. You should replace > > avgs{iFile} = load(datafiles{iFile}); > > with > > tmp = load(datafiles{iFile}); > avgs{iFile} = tmp.avgFC; > > and then I think it should work. > > Best, > Eelke > > On 1 September 2014 09:02, Caspar, Emilie wrote: > > Dear all, > > > > > > I would like to perform the grand average in a separate script than the > > preprocessing one, to avoid a crash, because of the number of > participants. > > In the preprocessing script, I performed a timelockanalysis for each > > participants : avgFC = ft_timelockanalysis(cfg, cleandata); > > and then save this file : > > finfname = [subjID{s} '_RP']; > > mkdir(subjID{s}) > > save([subjPath filesep finfname '.mat'], 'avgFC'); > > > > > > So, in my grand average script, I wrote the following : > > > > cfg = []; > > homePath = '/Users/emilie/Desktop/EEG_RP/Grandaverage/'; > > eegPath = homePath; > > > > > > > > %% Subjects > > datafiles = > > > {'S83_RP','S84_RP','S85_RP','S87_RP','S88_RP','S89_RP','S90_RP','S91_RP','S92_RP','S93_RP','S94_RP','S97_RP','S98_RP','S99_RP','S100_RP', > > 'S101_RP'}; > > nFiles = length(datafiles); > > avgs = cell(1,nFiles); > > > > > > > > cfg.channel = 'all'; > > cfg.latency = 'all'; > > %cfg.parameter = 'avg'; > > > > > > > > for iFile = 1:nFiles > > thisfile = datafiles{iFile}; > > subjPath = [eegPath thisfile]; > > file = dir([subjPath '*.mat']); > > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > > 'feedback', 'no'); > > avgs{iFile} = load(datafiles{iFile}); > > end > > > > > > > > GA = ft_timelockgrandaverage(cfg, avgs{:}); > > > > But I'm not pretty sure to understand the error message : > > Error using ft_checkdata (line 366) > > This function requires timelock data as input. > > > > Error in Averaging (line 33) > > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > > 'feedback', 'no'); > > > > Because If I'm right, the files in 'datafiles' are the time locked data > from > > the preprocessing script. > > > > Thank you, > > > > Emilie > > > > > > _______________________________________________ > > 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 jm.horschig at donders.ru.nl Wed Sep 3 10:29:43 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 03 Sep 2014 10:29:43 +0200 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Message-ID: <5406D177.3060105@donders.ru.nl> Hi all, there is also a feature in FieldTrip to load or save data, which is supported by nearly all functions (if you find one which does not support it and it should, let us know). You can set cfg.inputfile = 'filename' for loading data or cfg.outputfile = 'filename' for saving data. Note, however, that cfg.inputfile is to my knowldge exclusively compatible to having used cfg.outputfile, i.e. if the variable that is saved/loaded has a different name than what FieldTrip expects, this won't work. It might be worth a try for you guys, because then everything is 'in Fieldtrip style' (and more importantly, history is kept on what data was loaded in data.cfg.previous). Apart from that, thanks Roey for sharing your code! I am sure people will use your function ;) Best, Jörn On 9/3/2014 8:59 AM, Roey Schurr wrote: > Dear fieldtrippers, > > I found it uncomfortable having to know the names of different > variables as I load them, so I have written a function called > "load2struct" (see below). > It should be used in cases in which the mat file holds only one > variable (a volume, a grid, etc), otherwise only the first variable is > loaded. In your example, Emilie, you could use: > > avgs{iFile} = load2struct(datafiles{iFile}); > > For me it helped increase the code readability, and allowed my codes > to be more compatible with changes I did along the way, like changing > the naming format for variables used for specific subjects. > I hope you find it useful (and also that it's not silly (maybe there's > a much simpler solution), or just wrong). > > Best, > Roey > > > =========================================================== > function struct = load2struct(filePath) > % LOAD2STRUCT loads the struct in the filePath mat file to a variable, > % without needing to know the original field name of this struct. > struct = load(filePath); > structFieldName = fieldnames(struct); > if (length(structFieldName) > 1) > warning('Note: load2struct only loads the first variable in > the mat file') > end > eval(['struct = struct.' structFieldName{1} ';']); > end > > > On Mon, Sep 1, 2014 at 10:28 AM, Eelke Spaak > > wrote: > > Dear Emilie, > > If you assign the return value of MATLAB's load() to a variable, that > variable will become a struct with the variables in the specified > mat-file as its fields. In your case avgs{k} will probably (have not > read your script very thoroughly) be a struct, so avgs{k}.avgFC is the > actual timelock structure. You should replace > > avgs{iFile} = load(datafiles{iFile}); > > with > > tmp = load(datafiles{iFile}); > avgs{iFile} = tmp.avgFC; > > and then I think it should work. > > Best, > Eelke > > On 1 September 2014 09:02, Caspar, Emilie > wrote: > > Dear all, > > > > > > I would like to perform the grand average in a separate script > than the > > preprocessing one, to avoid a crash, because of the number of > participants. > > In the preprocessing script, I performed a timelockanalysis for each > > participants : avgFC = ft_timelockanalysis(cfg, cleandata); > > and then save this file : > > finfname = [subjID{s} '_RP']; > > mkdir(subjID{s}) > > save([subjPath filesep finfname '.mat'], 'avgFC'); > > > > > > So, in my grand average script, I wrote the following : > > > > cfg = []; > > homePath = '/Users/emilie/Desktop/EEG_RP/Grandaverage/'; > > eegPath = homePath; > > > > > > > > %% Subjects > > datafiles = > > > {'S83_RP','S84_RP','S85_RP','S87_RP','S88_RP','S89_RP','S90_RP','S91_RP','S92_RP','S93_RP','S94_RP','S97_RP','S98_RP','S99_RP','S100_RP', > > 'S101_RP'}; > > nFiles = length(datafiles); > > avgs = cell(1,nFiles); > > > > > > > > cfg.channel = 'all'; > > cfg.latency = 'all'; > > %cfg.parameter = 'avg'; > > > > > > > > for iFile = 1:nFiles > > thisfile = datafiles{iFile}; > > subjPath = [eegPath thisfile]; > > file = dir([subjPath '*.mat']); > > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > > 'feedback', 'no'); > > avgs{iFile} = load(datafiles{iFile}); > > end > > > > > > > > GA = ft_timelockgrandaverage(cfg, avgs{:}); > > > > But I'm not pretty sure to understand the error message : > > Error using ft_checkdata (line 366) > > This function requires timelock data as input. > > > > Error in Averaging (line 33) > > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > > 'feedback', 'no'); > > > > Because If I'm right, the files in 'datafiles' are the time > locked data from > > the preprocessing script. > > > > Thank you, > > > > Emilie > > > > > > _______________________________________________ > > 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 agreene24 at gmail.com Wed Sep 3 11:58:29 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Wed, 3 Sep 2014 18:58:29 +0900 Subject: [FieldTrip] ft_rejectvisual: removing trials marked as bad Message-ID: Hello, I have used the rejectvisual function in attempt to remove bad trials, but after marking them and pressing the quit button, although the command window states that the selected trials have been removed, there is no obvious change in the data; all of the trials are still intact. Have I overlooked something? Thanks, Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Thu Sep 4 20:30:50 2014 From: mcantor at umich.edu (Max Cantor) Date: Thu, 4 Sep 2014 14:30:50 -0400 Subject: [FieldTrip] TRENTOOL pipeline help Message-ID: Hi fieldtrippers, I know trentool is not produced by the Donders Institute, so I'm not 100% sure if it is appropriate to ask questions about it here, but to the best of my knowledge they do not have a mailing list and I saw a few trentool questions in the archives, so I'm going to assume it's ok... In any case, below is my current pipeline (slightly modified for comprehensibility): (notes in bold are comments/questions made in this email, not present in the pipeline. Sorry in advance for the long post! Any help would be greatly appreciated as I'm a bit over my head on this but I think I'm close!) ***** % Prepare group TE data cfgP = []; cfgP.Path2TSTOOL = *TSTOOLPATH* cfgP.TEcalctype = 'VW_ds'; cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; *I'm trying to find the transfer entropy between the left and right auditory cortices in my experiment. The input is virtual sensor data that was produced using SAM in fieldtrip on real MEG data. * % specify u to be scanned cfgP.predicttime_u = 30; cfgP.toi = [-0.4 0.4]; *For clarification, the predicttime_u is in seconds but the toi is in milliseconds. If I understand correctly, the predicttime_u must fit within the toi, but beyond that are there any benefits to it being earlier or later?* % ACT (Autocorrelation Time) estimation and constraints cfgP.maxlag = 150; cfgP.actthrvalue = 7.5; cfgP.minnrtrials = 5; *My understanding is maxlag should be 1/2 the sampling rate, so since the data are downsampled to 300hz, it should be 150. I know that the sample rate and filters are used to determine the actthrvalue, but I don't actually know the calculation. 7.5 was a rough guess just to test the pipeline. I'm also uncertain of what minnrtrials should be.* % Optimization cfgP.optimizemethod = 'ragwitz'; cfgP.ragdim = 4:8; cfgP.ragtaurange = [0.2 0.4]; cfgP.ragtausteps = 15; cfgP.repPred = 100; *I am completely at a loss for this. I've done some reading into transfer entropy, mutual information, etc., cited in trentool, but I'm yet to understand how exactly this optimization works and what the configuration should be, given my data and experimental intentions.* % Kernel-based TE estimation cfgP.flagNei = 'Mass'; cfgP.sizeNei = 4; % Default cfgP.ensemblemethod = 'no'; cfgP.outputpath = *OUTPUT PATH*; if ~exist(*Path for TEprepare data object*) load VSdat; TE_Wrd = {}; for i = 1:nConds for j = 1:Nsub TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); end end clear VSdat; save('TE_Wrd', 'TE_Wrd'); end *The configuration and virtual sensor data, organized in a 3 x 15 cell of structures (condition by subject) are the input. The TEprepare substructure is added to each individual condition x subject .mat files' data structure which are stored on disk independently.* % Use object_to_mat_conversion.m to replace individual condition x subject virtual sensor data % .mat files with their TE_Wrd equivalent *I'm using a separate script to make some manipulations to the objects from disk; this will all eventually be integrated into the main pipeline*.* TRENTOOL seems to handle data output very differently from fieldtrip and I've had trouble thinking through the most logical way to handle the data so it's a bit haphazard right now.* load cond080sub01.mat cfgG = []; cfgG.dim = cond080sub01.TEprepare.optdim; cfgG.tau = cond080sub01.TEprepare.opttau; if isfield(cond080sub01, 'TEprepare') TEgroup_prepare(cfgG, fileCell); else error('Need to run TEprepare before TEgroup_prepare'); end *For clarification, fileCell is a cell with the name of each condition x subject .mat file, which as I said before is collectively the same as the 3 x 15 VSdat structure (condition x subject).* % Replace .mat files with '_for_TEgroup_calculate' version in % object_to_mat_conversion.m % TE Group Calculate load cond080sub01.mat if isfield(cond080sub01, 'TEgroupprepare') for i = 1:length(fileCell) TEgroup_calculate(fileCell{i}); end else error('Need to run TEgroup_prepare before TEgroup_calculate'); end *At this step I get the following error:Error using transferentropy (line 337)\nTRENTOOL ERROR: not enough data points left after embeddingError in TEgroup_calculate (line 133)[TEresult] = transferentropy(cfg,data);* % TE Group Stats cfgGSTAT = []; cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; cfgGSTAT.uvar = 1; cfgGSTAT.ivar = 2; cfgGSTAT.fileidout = 'test_groupstats'; TEgroup_stats(cfgGSTAT, fileCell); *Given the error above, I am yet to get to this step, but it does not seem fundamentally different from normal fieldtrip stats.* ***** In case my notes were not clear or you skipped to the bottom, *my primary concern is whether the error I'm getting in TEgroup_calculate is a pipeline issue* (I noticed the example pipeline in trentool, the manual, and published methods articles all seem to have slightly or significantly different pipeline compositions), *or if the error is* due to ACT, ragwitz optimization, or some other faulty parameterization *on my part due to a lack of understanding of how transfer entropy works on a more theoretical/mathematical level*. If the latter is the case, is there any relatively straightforward way to conceptualize this, or is this something where I'm just going to have to keep reading and rereading until it eventually makes sense? I've already done quite a bit of that and it hasn't pierced my thick skull yet but I'm sure it will eventually! Thank you so much, Max Cantor -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Fri Sep 5 14:06:36 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Fri, 5 Sep 2014 12:06:36 +0000 Subject: [FieldTrip] Data Interpolation Message-ID: Dear Fieldtrippers, I need to interpolate my data to remove artifacts due to the electric stimulation at the moment of the trigger. So I wrote : cfg = []; epData = ft_redefinetrial(epData_cfg, allData_prepross); fname = [contfname]; save([subjPath filesep fname '.mat'], 'epData'); electric_windows = [0.002 0.013]; electric_window_idx = [nearest(epData.time{1},electric_window(1)) nearest(epData.time{1},electric_window(2))]; for i=1:numel(epData.trial) % Loop through all trials epData.trial{i}(:,electric_window_idx(1):electric_window_idx(2))=nan; % Replace the segment of data corresponding to our window of interest with nans end; cfg.method = 'linear'; cfg.prewindow = 0.01; cfg.postwindow = 0.01; interpoldata = ft_interpolatenan(cfg, epData); But I get the following error: Undefined function 'electric_window' for input arguments of type 'double'. Even if I see what the problem is, I don't know how to solve it without doing any mistakes. Thank you! Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Sep 5 14:22:09 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 5 Sep 2014 14:22:09 +0200 Subject: [FieldTrip] Data Interpolation In-Reply-To: References: Message-ID: The error is here: electric_window_idx = [nearest(epData.time{1},electric_window(1)) nearest(epData.time{1},electric_window(2))]; Find the missing 's' ;) On 5 September 2014 14:06, Caspar, Emilie wrote: > Dear Fieldtrippers, > > I need to interpolate my data to remove artifacts due to the electric > stimulation at the moment of the trigger. So I wrote : > > > cfg = []; > epData = ft_redefinetrial(epData_cfg, > allData_prepross); > fname = [contfname]; > save([subjPath filesep fname '.mat'], 'epData'); > > > electric_windows = [0.002 0.013]; > electric_window_idx = [nearest(epData.time{1},electric_window(1)) > nearest(epData.time{1},electric_window(2))]; > for i=1:numel(epData.trial) % Loop through all trials > > epData.trial{i}(:,electric_window_idx(1):electric_window_idx(2))=nan; % > Replace the segment of data corresponding to our window of interest with > nans > end; > > > > cfg.method = 'linear'; > cfg.prewindow = 0.01; > cfg.postwindow = 0.01; > interpoldata = ft_interpolatenan(cfg, epData); > > But I get the following error: > Undefined function 'electric_window' for input arguments of type 'double'. > > Even if I see what the problem is, I don't know how to solve it without > doing any mistakes. > > Thank you! > > Emilie > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Fri Sep 5 14:41:52 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Fri, 5 Sep 2014 12:41:52 +0000 Subject: [FieldTrip] Data Interpolation In-Reply-To: References: Message-ID: <18261BAB-F049-4920-A2DA-EC31DA16F9A3@live.ucl.ac.uk> Oh yes! scatterbrained, sorry ;) Thanks! Le 5 sept. 2014 à 14:06, "Caspar, Emilie" > a écrit : Dear Fieldtrippers, I need to interpolate my data to remove artifacts due to the electric stimulation at the moment of the trigger. So I wrote : cfg = []; epData = ft_redefinetrial(epData_cfg, allData_prepross); fname = [contfname]; save([subjPath filesep fname '.mat'], 'epData'); electric_windows = [0.002 0.013]; electric_window_idx = [nearest(epData.time{1},electric_window(1)) nearest(epData.time{1},electric_window(2))]; for i=1:numel(epData.trial) % Loop through all trials epData.trial{i}(:,electric_window_idx(1):electric_window_idx(2))=nan; % Replace the segment of data corresponding to our window of interest with nans end; cfg.method = 'linear'; cfg.prewindow = 0.01; cfg.postwindow = 0.01; interpoldata = ft_interpolatenan(cfg, epData); But I get the following error: Undefined function 'electric_window' for input arguments of type 'double'. Even if I see what the problem is, I don't know how to solve it without doing any mistakes. Thank you! Emilie _______________________________________________ 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 constantino.mendezbertolo at ctb.upm.es Fri Sep 5 17:30:26 2014 From: constantino.mendezbertolo at ctb.upm.es (=?UTF-8?Q?Constantino_M=C3=A9ndez_B=C3=A9rtolo?=) Date: Fri, 5 Sep 2014 17:30:26 +0200 Subject: [FieldTrip] Using clusterstat.m straight giving her specific statobs and statrnd In-Reply-To: References: Message-ID: Dear Eelke, Many thank yous - just a follow-up after your response on how to call clusterstat with proper dimensions (days later because it took sometime to compute the statobs and the statrnd) Yes it works! :) ps: To make this message less spammy, I will add the things we finally need to consider in case it helps anyone. This assumes you have computed the statobs and the statrnd structure (using whatever statistic you are into, in this case, the interaction effect of two factors within a manova was tested for each time point and channel in -R-). Statobs should be Nchan*Ntime and statrnd Nchan*Ntime*Nrand (randomizations performed) Statobs should be converted int oa single vector and statrnd a matrix as long * Nrand Cfg.dim will have the same dimensions and statobs. Use cfg.connectivity by calling ft_channelconnectivity Of course you need to provide clusterstat with the specific critvalue calculated beforehand. You will encounter that you need to reshape back fields prob and clusterlabelmat (eg: reshape(stat.posclusterslabelmat,[Nchan Ntime]) to make it readable for humans Last advice: you may be asking yourself why matlab says there is no channelconnectivity functions or clusterstat.m --- they are inside fieldtrip##\private and you may need to includes them in the path/alter the name of the folder Thanks a lot again Eelke, Tino 2014-09-01 9:48 GMT+02:00 Eelke Spaak : > Dear Constantino, > > First, you need to specify cfg.dim as the size of the data matrix, in your > case probably just [102 500], the size(statobs) before reshaping. Note that > you need to put in statobs as a vector (statobs(:)) and statrnd as a > numel(statobs) X nRand matrix. > > Second, I don't know why you are specifying a cfg.layout, this is not used > by the function. The same goes for cfg.neighbours, this is also not used. > The higher-level statistics functions convert the cfg.neighbours > struct-array into a logical connectivity array using the low-level private > function channelconnectivity. To use clusterstat (a low-level function) > directly, you need to do this beforehand. > > So, do something like this: > > cfg = []; > cfg.neighbours = neighbours; > cfg.channel = datachannels; % order is important here, must be the same as > the data > connectivity = channelconnectivity(cfg); > > cfg = []; > ... > cfg.dim = size(statobs); % assuming statobs is still a chan X time matrix > cfg.connectivity = connectivity; > > % this assumes statrnd is a chan X time X nRand array > statrnd = reshape(statrnd, [numel(statobs), size(statrnd,3)]); > > statobs = statobs(:); > stat = clusterstat(cfg, statrnd, statobs); > > Best, > Eelke > > > On 29 August 2014 18:36, Constantino Méndez Bértolo < > constantino.mendezbertolo at ctb.upm.es> wrote: > >> Dear Fieldtrippers >> >> We have a 3x3 design and MEG data, say only mag channels (n102) to >> simplify. >> >> We want to perform a cluster-based permutation approach but >> timelockstatistics (cfg.method = 'montecarlo', cfg.correctm = 'cluster', >> etc) cannot deal with interactions when you have more than three levels >> (true?) >> >> So we built our 'statobs' and 'statrnd' doing a GLM in -R Statistical >> Package- and feed 'clusterstat.m' with them >> >> We have done this with one channel over time with success. However, I am >> clueless now about how to solve the problem when dealing with the whole >> channel set. >> >> I wonder what is the nature of the cfg.dim that we need to feed >> 'clusterstat.m' with. >> >> Up to now, we use, (cioming out of -R-): >> >> size(statobs) = nchan*ntime % (102*500) % twin = [0 .5] % seconds >> size(statrnd) = nchan*ntime*nrandomizations % (102*500*1000) >> >> >> and the following presets: >> >> cfg=[]; >> cfg.clustercritval = Fcritmain; % We genereate this before hand >> cfg.tail = 1; cfg.clustertail = 1; cfg.clusterthreshold = 'parametric'; >> cfg.dim = [1 size(statobs,1) size(statobs,2) ] % <<< The key may be here >> load('neuromag306mag_neighb.mat'); >> cfg.neighbours = neighbours; >> cfg.feedback = 'yes'; >> cfg.numrandomization = 1000; >> cfg.clusterstatistic = 'maxsum'; >> cfg.layout = 'neuromag306mag.lay'; >> for i = 1:length(cfg.neighbours) >> cfg.channel{i} = cfg.neighbours(i).label; >> end >> >> stat = clusterstat(cfg,statrnd, statobs) >> >> >> Which lead us to an error within findcluster >> >> Error using findcluster (line 59) >> invalid dimension of spatdimneighbstructmat >> >> Error in clusterstat (line 197) >> posclusobs = findcluster(reshape(postailobs, >> [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); >> >> >> If anybody has got some insigth it would be greatly appreciated. Or any >> hints. Are the size of my statobs and starnd correct? I can share more >> information and firstly apologize if I was not able to describe the >> problem accurately, I am confused regarding that 'reshape' and the addition >> of one dimension at "...reshape(postailobs,[cfg.dim,1])...", but the >> problem arises first when findcluster.m tries to calculate the size of >> spatdimneighbstructmat >> >> First line of findcluster.m calcualtes 'spatdimlength' by : " >> spatdimlength = size(onoff, 1);" which in our case is "1", which is >> obviously wrong?. >> >> manythanks&peace2all >> >> -- >> Constantino Méndez-Bértolo >> Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) >> >> Parque Científico y Tecnológico de la UPM, Campus de Montegancedo >> >> 28223 Pozuelo de Alarcón, Madrid, SPAIN >> >> >> >> _______________________________________________ >> 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 > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Sat Sep 6 09:55:25 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Sat, 6 Sep 2014 07:55:25 +0000 Subject: [FieldTrip] ft_channelrepair and connectivity Message-ID: <1409990124934.33614@flinders.edu.au> ?Hello fieldtrip, I was just wondering whether there would be potential issues with using the function ft_channelrepair to effectively fill in missing EEG channels (which would have been originally dirty) and calculating connectivity (in the time domain). I cant really see an issue because of how well it is implemented, but its making me doubt myself. Any thoughts? Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66125 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Sat Sep 6 14:07:33 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Sat, 6 Sep 2014 12:07:33 +0000 Subject: [FieldTrip] timelockanalysis and beamformer Message-ID: <1410005248989.24450@flinders.edu.au> ?Hello fieldtrip, I was just wondering when it is appropriate to use the configuration cfg.keeptrials = 'yes' in ft_timelockanalysis, and when it is appropriate to have it as 'no'. I have continuous data of 30 seconds. However its separated into a 5, 6 and 19 second segments. So they arent event-related events. At present I am not asking timelockanalysis to keep the trials, or ft_sourceanalysis (LCMV beamformer) for that matter. Is this bad? Im worried about unstable spatial filters (if I calculate covariance matrices and spatial filters for each trial) and loss of phase (if I average the covariance matrices over trials and produce one spatial filter). I noticed that in the tutorial connectivityextended that they never specify these things and therefore use the default, which is cfg.keeptrials = 'no' and they calculate . Is that my answer? Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66125 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdien07 at mac.com Sun Sep 7 07:53:57 2014 From: jdien07 at mac.com (Joseph Dien) Date: Sun, 07 Sep 2014 01:53:57 -0400 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: Message-ID: <85691A9F-3696-4881-B2C6-147935FBFB9A@mac.com> Hi, I’m one of the main Fieldtrip contributors working on supporting EGI data. A couple things. First of all, exactly which net do you use? If they are 129-channel, there is still the question of whether they are the Hydrocel or the older geodesic nets. Regardless, that shouldn't cause an error like this. Could you send me the file you are trying to process and the script you are using and I’ll try troubleshooting it. Joe On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini wrote: > Which nets do you use? I use EGI. I tried both the ones you mention and they didn't work. It was hard to find that exact one online but it was the only file that actually worked. > > > On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann wrote: > Dear Ana, dear all, > the layout you used does not correspond to our nets. I tried the > GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. Please can anybody help? > Cheers > Katrin > > > 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : > > Try this one I use > > > On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann wrote: > Dear all, my problems seem neverending. This time however i really need help. > I implemented a pipeline for ERPs. All works now, trialdefinition, preprocessing, channelreplacement, ica, componentrejection, final artifactdetection, timelock of the single subject data. However, when I wanna compute the grandaverage of the single subjects I get the following error message: > > computing average of avg over 19 subjects > Warning: discarding electrode information because it cannot be averaged > > In ft_timelockgrandaverage at 249 > the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 3 MB > computing average of avg over 2 subjects > Warning: discarding electrode information because it cannot be averaged > > In ft_timelockgrandaverage at 249 > the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 0 MB > the call to "ft_prepare_layout" took 0 seconds and required the additional allocation of an estimated 0 MB > the call to "ft_topoplotER" took 0 seconds and required the additional allocation of an estimated 0 MB > > Furthermore in the plot of the significant clusters, the channelnames are mixed up (do not correspond to my net) > > > I guess that there is a problem with the layout I use. > Here the code that I use > > %For generating the layout (also in the single subjects): > cfg = []; > > cfg.channel = obs_data.label; > > cfg.layout = 'GSN-HydroCel-129.sfp'; > > cfg.feedback = 'yes'; > > lay = ft_prepare_layout(cfg); > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = lay; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > > > > %For computing the grand average > > cfg = []; > > cfg.channel = 'all'; > > cfg.latency = 'all'; > > cfg.parameter = 'avg'; > > cfg.keepindividual = 'no' > > GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > > GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > > % "{:}" means to use data from all elements of the variable > > > For plotting the significant clusters > > cfg = []; > > cfg.style = 'blank'; > > cfg.layout = lay; > > cfg.channellabels = 'yes'; > > cfg.highlight = 'labels'; > > cfg.highlightchannel = find(stat.mask); > > cfg.comment = 'no'; > > figure; ft_topoplotER(cfg, GA_90) > > title('Nonparametric: significant with cluster multiple comparison correction') > > > > Do you have ANY idea to this? I am really completely helpless.... > > thanks and best > > Katrin > > > _______________________________________________ > 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 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------------------------------------------------------------------------- Joseph Dien, PhD Research Associate Cognitive Neurology The Johns Hopkins University School of Medicine Lab E-mail: jdien1 at jhmi.edu Private E-mail: jdien07 at mac.com Office Phone: 410-614-3115 Cell Phone: 202-297-8117 Fax: 410-955-0188 http://joedien.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Mon Sep 8 14:22:13 2014 From: roeysc at gmail.com (Roey Schurr) Date: Mon, 8 Sep 2014 15:22:13 +0300 Subject: [FieldTrip] MNE Source Reconstruction Sanity Check In-Reply-To: References: <346147900.8004488.1406126123454.JavaMail.root@sculptor.zimbra.ru.nl> <790E6AB9-6372-4F70-9B98-2DE6E084F552@donders.ru.nl> <53D1FD3B.7040600@donders.ru.nl> Message-ID: Dear fieldtrippers, I am reposting this question in hope someone could help me use the template BEM head model in EEG source reconstruction. Any help would be greatly appreciated! Thank you all, roey On Wed, Aug 20, 2014 at 5:23 PM, Roey Schurr wrote: > Dear fieldtrippers, dear Jörn, > > > > I am currently trying to use the standard BEM head model provided in the > fieldtrip toolbox (on a 19 electrodes EEG recording, segmented into > 10-seconds trials, not time-locked), but I have encountered a problem I > could not resolve: > > > > Error using svd > > Input to SVD must not contain NaN or Inf. > > > > Error in pinv (line 29) > > [U,S,V] = svd(A,0); > > > > Error in pinv (line 27) > > X = pinv(A',varargin{:})'; > > > > Error in minimumnormestimate (line 151) > > w = pinv(lf); > > > > Error in ft_sourceanalysis (line 876) > > dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, > optarg{:}); > > > > Following some old posts in the mailing list I made sure the electrodes > data structure of the data is the same as that given in the cfg > of ft_sourceanalysis. However, it is still possible that using a 19 > electrodes recording is not possible using the source model I am using? > > > > I am also afraid computing the source reconstruction on such continuous > data, that is not time-locked, could be a problem. For example, having to > calculate the “avg” field artificially seems a little fishy. > > > > I also tried running the code on the EEG data of the continuous data > preprocessing tutorial (after choosing only 19 of its electrodes, though > possibly not the right ones). > > > > Any advice would be greatly appreciated! > > Thank you all, > > Roey > > > > > > > THE CODE > > --------------- > > % Load head model, “vol” > > hdmfile = fullfile(which('standard_bem.mat')); > > load(hdmfile); > > > > % Create grid > > gridcfg = []; > > gridcfg.grid.xgrid = -20:1:20; > > gridcfg.grid.ygrid = -20:1:20; > > gridcfg.grid.zgrid = -20:1:20; > > gridcfg.grid.unit = 'cm'; > > gridcfg.grid.tight = 'yes'; > > gridcfg.inwardshift = -1.5; > > gridcfg.vol = vol; > > > > gridVar = ft_prepare_sourcemodel(gridcfg); > > > > % Restrict source reconstruction to outside of the cerrebellum > > gridVar = getRidOfCerrebellum([], gridVar); > > > > % Source reconstruction > > slcfg = struct; > > slcfg.method = ‘mne’; > > slcfg.elec = data.elec; > > slcfg.grid = gridVar; > > slcfg.vol = vol; > > slcfg.rawtrial = 'yes'; > > slcfg.hdmfile = hdmfile; > > slcfg.mne.lambda = '5%'; > > slcfg.keepfilter = 'yes'; > > slcfg.rawtrial = 'no'; % this is because we are now just computing the > spatial filter > > slcfg.singletrial = 'no'; > > slcfg.keeptrials = 'yes'; > > > > % calculate the avg of each trial, for use in ft_sourceanalysis > > for trialI = 1:length(data.trial) > > data.avg(:,trialI) = mean(data.trial{trialI}')'; > > end > > > > source_for_filter = ft_sourceanalysis(slcfg, data); %this source structure > is used to compute the filter to be used later > > > > On Fri, Jul 25, 2014 at 9:46 AM, "Jörn M. Horschig" < > jm.horschig at donders.ru.nl> wrote: > >> Dear Roey, >> >> I agreet that this is a bad idea - independently of what result you will >> get, the error is just too big to draw any reliable conclusions. Imho, you >> can better try using ICA to decompose your data into components. >> >> Concerning the headmodel, there is a standard BEM headmodel template >> available in FieldTrip. >> >> Best, >> Jörn >> >> >> On 7/24/2014 8:50 PM, Roey Schurr wrote: >> >>> Dear Jim, >>> Thank you for drawing my attention to this problem. I have actually >>> tried building a realistic head model using OPENMEG but encountered some >>> compitability problems since our lab does not use Linux. This is indeed one >>> of the most important (short) future tasks - being able to use such >>> realistic head models. >>> Best, >>> roey >>> >>> >>> On Thu, Jul 24, 2014 at 6:34 PM, E688205 >> > wrote: >>> >>> Dear Roey, >>> >>> To add to Diego's comments, since you are dealing with EEG data a >>> single sphere headmodel is not a good idea because it does not >>> take into account the differences in conductivity between the >>> skull, scalp, and brain. This is not a problem for MEG but is >>> important for EEG. Therefore it is better to use, for example, a >>> BEM head model. >>> >>> Best, >>> >>> Jim >>> >>> On 23 jul. 2014, at 16:38, "Lozano Soldevilla, D. (Diego)" >>> >> > wrote: >>> >>> Dear Roey, >>>> >>>> In my opinion it's definitely not a good idea to compute MNE >>>> using 19 sensors. There are studies that have found a drastic >>>> localization precision from 31 to 63 electrodes and further >>>> improvements till 123: >>>> >>>> http://www.ncbi.nlm.nih.gov/pubmed/15351361 (see figure 1) >>>> http://www.ncbi.nlm.nih.gov/pubmed/12495765 >>>> >>>> Although it's very difficult to know the "minimum" number of >>>> electrodes needed to accurately localize a given source (it >>>> depends on the strength of the source you want to localize, >>>> source reconstruction algorithm, data noise...), 19 electrodes >>>> are too low to trust the results you can get. >>>> >>>> best, >>>> >>>> Diego >>>> >>>> >>>> ------------------------------------------------------------ >>>> ------------ >>>> From roeysc atgmail.com Mon Jul 21 11:21:32 >>>> 2014 >>>> From: roeysc atgmail.com (Roey Schurr) >>>> >>>> Date: Mon, 21 Jul 2014 12:21:32 +0300 >>>> Subject: [FieldTrip] MNE Source Reconstruction Sanity Check >>>> Message-ID: >>> mail.gmail.com >>> AQ_W43cHF_8J2b+rNyzd55x4aRviw at mail.gmail.com>> >>>> >>>> >>>> Dear fieldtrippers, >>>> >>>> >>>> >>>> I want to do a sanity check on mne source reconstruction. >>>> >>>> I'm working on continuous EEG recordings (19 electrodes), >>>> estimating the >>>> source reconstruction activity using the *mne* (minimum norm >>>> estimate) >>>> method, a *template MRI* (Colin27) and a *singlesphere* headmodel. >>>> As a >>>> sanity check for the source reconstruction itself, I wanted to >>>> compare >>>> conditions in which I could estimate the loci of significant >>>> changes, e.g.: >>>> rest vs movement of the hand, moving the right hand vs the left >>>> hand, etc. >>>> I have about 60 seconds of recording for each condition. >>>> >>>> >>>> >>>> What I did was: >>>> >>>> 1) Segment the recording of each condition into many "trials" of 2 >>>> seconds >>>> each. >>>> >>>> 2) For each trial, average the activity in each of the 90 ROIs of >>>> the aal >>>> atlas (I excluded the cerebellum from the source reconstruction). >>>> >>>> >>>> >>>> I was wondering what comparison would be best in this case. Since >>>> this is >>>> not Evoked Responses data, I find it hard to find relevant ideas, >>>> and would >>>> like to hear your thoughts. >>>> >>>> >>>> >>>> 1) I did a frequency analysis (mtmfft) in conventional bands of >>>> interest >>>> and ran ft_freqstatistics on the resulting structures (using ttest2 >>>> and the >>>> bonferoni correction for the multiple comparison problem). This >>>> gave some >>>> results, however for most conditions they are not very encouraging >>>> (the >>>> ROIs that showed significant differences were not close to those >>>> that I >>>> have assumed). >>>> >>>> >>>> >>>> *QUESTION 1*: do you think this is a proper method? Note that I did >>>> not use >>>> a frequency based source reconstruction in the first place, because >>>> I'm >>>> ultimately interested in the time course in the source space. >>>> >>>> >>>> >>>> 2) I was wondering if a cluster based permutation test is >>>> impossible to use >>>> here, since this is a continuous recording, so clustering according >>>> to time >>>> adjacency seems irrelevant. >>>> >>>> >>>> >>>> *QUESTION 2*: is it possible to use a cluster based statistical >>>> test here? >>>> If so, it could be better than a-priori averaging the source >>>> activity in >>>> the atlas ROIs, which could mask some of the effects, if they are >>>> located >>>> in a small area. >>>> >>>> >>>> >>>> 3) Another possibility is looking at the data itself. Unfortunately >>>> I >>>> encountered some problems using ft_sourcemovie, though this is a >>>> subject >>>> for a different thread. >>>> >>>> >>>> >>>> Any thoughts and advice are highly appreciated! >>>> >>>> Thank you for taking the time, >>>> >>>> roey >>>> _______________________________________________ >>>> >>>> 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 >> >> >> _______________________________________________ >> 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 e.maris at psych.ru.nl Mon Sep 8 15:46:11 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) Subject: [FieldTrip] Question regarding nonparametric testing for coherence differences In-Reply-To: References: Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris@psych.ru.nl> Dear Hwee Ling, In the paper you refer to (Maris et al, JNM, 2007), I did not perform a cluster-based permutation test at the level of the channel pairs. Instead, all coherences mentioned in the paper are coherence between a single EMG channel (2 electrodes mounted on the forearm) and all MEG electrodes. Thus, there are as many EMG-MEG coherences as there are MEG channels (275 in our lab), and the clustering of these coherences involves the same neighbourhood structure as the clustering of channel-specific statistics on power or evoked response. The analysis you propose involves clustering in a much more complex space, namely the formed by all (MEG,MEG) channel pairs (275*275=75625 pairs). In the early days of cluster-based permutation statistics, I have worked on this problem but did not pursue it because the resulting clusters are very hard to interpret. Best, Eric Maris Dear all and Prof Maris, I'm re-posting this question again, as I didn't get any replies previously. I’m interested to investigate if there are any differences in phase synchronization in resting state data at timepoint 2 versus timepoint 1. The EEG data was collected using 64 EEG channels, resting state, eyes opened and eyes closed. I’ve arbitrarily segmented the resting state data into epochs of 2s each, and the epochs with artifacts are excluded completely from further analyses. I then performed mtmfft to get the fourier representation of the data, extracted the coherence, and compared the coherence difference of timepoint 2 versus timepoint 1 of all channels paired with all other channels. I figured that if I extract the connectivity analyses without specifying the channelcmb, I get a 'chan_chan_freq' dimord variable that would allow me to perform cluster-based statistical analyses. I get an output with ‘chan_chan’ dimord variable. However, I was not 100% sure that this is correct, hence, I’ve inserted my code (see below). It’ll be great if you could tell me if what I’m doing makes any sense at all. Also, I don’t know how I can plot the results to see if it make any sense at all. Also, I checked the values obtained from when I specified "cfg.channelcmb" and when I did not specify "cfg.channelcmb", I noticed that the values were somehow different. I would assume that the values to be similar, although I'm not sure why they would have differences in the values obtained from specifying "cfg.channelcmb". This is my code that I've used thus far: for sub = 1:5 cfg = []; cfg.output = 'fourier'; cfg.channel = {'all'}; cfg.method = 'mtmfft'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 5; cfg.foilim = [0 100]; cfg.taper = 'dpss'; % find the index for the c200 condition pre_c200_idx = find(data5.trialinfo == 201); cfg.trials = pre_c200_idx; HLF_pre_c200 = ft_freqanalysis(cfg, data5); post_c200_idx = find(data5.trialinfo == 200); cfg.trials = post_c200_idx; HLF_post_c200 = ft_freqanalysis(cfg, data5); cfg = []; cfg.keeptrials = 'no'; cfg.channel = {'all'}; cfg.removemean = 'yes'; cfg.method = 'coh'; HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_pre_c200); HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_post_c200); end load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); cfg_neighb.method = 'template'; cfg_neighb.layout = lay; cfg_neighb.channel = 'all'; neighbours = ft_prepare_neighbours(cfg_neighb, sub_HLF_pre_c200coh{1}); cfg = []; cfg.layout = lay; cfg.neighbours = neighbours; cfg.channel = 'all'; cfg.channelcmb = {cfg.channel, cfg.channel}; cfg.latency = 'all'; cfg.avgovertime = 'no'; cfg.avgoverchan = 'no'; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.correctm = 'cluster'; cfg.tail = 0; % cfg.clustertail = 0; cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 frequency bands. cfg.numrandomization = 10000; cfg.ivar = 2; cfg.uvar = 1; % design matrices clear design; design(1,:) = [1:5, 1:5]; design(2,:) = [ones(1,5), ones(1,5) * 2]; cfg.design = design; % for theta band cfg.avgoverfreq = 'yes'; cfg.frequency = [4 8]; % I also performed the statistics for delta (2-4), alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma (30-40), and gamma (40-100). [diffc200_theta_stat] = ft_freqstatistics(cfg, sub_HLF_post_c200coh{:}, sub_HLF_pre_c200coh{:}); When I tried to plot the results, I used this code: cfg = []; cfg.channel = 'all'; cfg.layout = 'lay'; cfg.zlim = [-1 1]; cfg.alpha = 0.05; cfg.refchannel = 'all'; ft_clusterplot(cfg, diffc200_theta_stat); However, I was not sure how I could plot the results. I get an error message from Fieldtrip when using ft_clusterplot: Error using topoplot_common (line 366) no reference channel is specified Error in ft_topoplotTFR (line 192) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_clusterplot (line 372) ft_topoplotTFR(cfgtopo, stat); According to your paper in 2007, the topoplot of the results were masked by the spatio-spectral pattern of the significant clusters. I don't know how to do this, and I would really appreciate if you can show me how to make such a plot. Thank you very much. Kind regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Mon Sep 8 21:38:01 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Mon, 8 Sep 2014 21:38:01 +0200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: <85691A9F-3696-4881-B2C6-147935FBFB9A@mac.com> References: <85691A9F-3696-4881-B2C6-147935FBFB9A@mac.com> Message-ID: Dear Joseph, thanks so much, I really appreciate your help. I was also wandering, if maybe there is another bug in my code. Our nets are 128 channels, Hydrocel, but as a colleague of me adviced me to do so, I also tried the 129 layout. My code you find below (without selection of bad channels etc.) If you need also the data of two subjects to have a look, let me know!!! Best and thanks really! Katrin subject=input('Which subject do you want to analyse? ','s'); name = strcat(subject,'.raw'); subjectnumber=input('Which is the subjectnumber?', 's'); sb=subjectnumber %subjectnumber = strcat(subjectnumber, '.txt') %% cfg = []; cfg.dataset = name; cfg.trialfun = 'ft_trialfun_general'; % this is the default cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus trigger cfg.trialdef.prestim = 0.234; % in seconds cfg.trialdef.poststim = 7.266; % in seconds (whole time of video observation, but maybe we need less) cfg = ft_definetrial(cfg); cfg.trl([1:7],:) = []; %change timeline according to constant offset of 16 ms = 8 samples (because recorded with 500 hz)in %structure trial cfg.trl(:,3)=cfg.trl(:,3)-8 %change timeline to make the cut the zeropoint cfg.trl(:,3)=cfg.trl(:,3)- 1000; %% preprocess data cfg.channel = 'all'; cfg.preproc.detrend = 'yes'; cfg.preproc.demean = 'yes'; cfg.preproc.baselinewindow = [-2.1 -2.0] %cfg.preproc.bpfilter = 'yes'; - the data here has to be already filtered %(0.1-45) and bad channels have to be replaced!!!! %cfg.preproc.bpfreq = [6 32]; % % obs_data = ft_preprocessing(cfg); % save (strcat(sb,'obs_data') , 'obs_data') %% determining channel neighbours (necessary for Artifact detection) cfg = []; cfg.channel = obs_data.label; cfg.layout = 'GSN128.sfp'; cfg.feedback = 'yes'; lay = ft_prepare_layout(cfg); cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'GSN128.sfp'; neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); obs_data.elec = ft_read_sens('GSN128.sfp'); %% Artifacts - to detect bad channels - is not saved!!! cfg.method = 'summary'; cfg.latency=[0 1]; cfg.layout = 'GSN128.sfp'; % this allows for plotting obs_data_try = ft_rejectvisual(cfg, obs_data); cfg = []; cfg.viewmode = 'vertical'; cfg.latency=[0 1]; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs_data); %cfg.artfctdef.reject = 'complete'; obs_data_try = ft_rejectartifact (cfg,obs_data); %% Preparing neighbours for channel repair - but bad channel info in!!! % cfg_neighb = []; % cfg_neighb.feedback = 'yes'; % cfg_neighb.method = 'triangulation'; % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); % Interpolate and put into new data structure cfg = []; cfg.badchannel = {}; cfg.layout = 'GSN128.sfp'; cfg.method = 'nearest'; cfg.neighbours = neighbours; obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) % Check reconstruction cfg = []; cfg.viewmode = 'vertical'; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs_data_channelrepaired); %cfg.artfctdef.reject = 'complete'; obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); % dat1=obs_data; % dat2=obs_data_channelrepaired; % % x=dat1.trial{1}(62,:); % 68 is channel index of E68 % y=dat2.trial{1}(62,:); % plot(x);hold on;plot(y,'r'); % % x=dat1.trial{1}(72,:); % y=dat2.trial{1}(75,:); % figure; % plot(x);hold on;plot(y,'r') % % x=dat1.trial{1}(75,:); % y=dat2.trial{1}(75,:); % figure; % plot(x);hold on;plot(y,'r') %% artifact rejection/trial inspection - throw out electrode jumps etc. cfg = []; cfg.viewmode = 'vertical'; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs_data_channelrepaired); %cfg.artfctdef.reject = 'complete'; obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent according to channels interpolated %% 128-number of interp. channels) cfg = []; cfg.channel = {'all'}; cfg.numcomponent = 128 comp = ft_componentanalysis(cfg,obs_data_clean1); save (strcat(sb,'comp_all') , 'comp') %% cfg = []; cfg.viewmode = 'component'; cfg.continuous = 'no'; cfg.plotlabels='some'; cfg.layout = 'GSN128.sfp'; ft_databrowser(cfg,comp); %% poweranalysis components cfg = []; cfg.output = 'pow'; cfg.channel = 'all';%compute the power spectrum in all ICs cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = 0:0.2:50; obs_freq = ft_freqanalysis(cfg, comp); %And you can plot the spectra: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nsubplots = 16; nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain decimals, type doc subplot Nfigs = ceil(size(comp.topo,1)/nsubplots); tot = Nfigs*nsubplots; rptvect = 1:size(comp.topo,1); rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); rptvect = reshape(rptvect,nsubplots,Nfigs)'; for r=1:size(rptvect,1); figure;set(gcf,'units','normalized','outerposition',[0 0 1 1]);%full screen k=0; for j=1:size(rptvect,2); if~(rptvect(r,j)==0); k=k+1; cfg=[]; cfg.channel = rptvect(r,j); cfg.ylim =[0 500] cfg.xlim =[0 50] subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); end end end %For the IC topos you'll follow the same logic as above but with: figure cfg = []; cfg.component = [1:20]; % specify the component(s) that should be plotted cfg.layout = 'GSN128.sfp'; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) figure cfg = []; cfg.component = [21:40]; % specify the component(s) that should be plotted cfg.layout = 'GSN128.sfp'; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) figure cfg = []; cfg.component = [41:60]; % specify the component(s) that should be plotted cfg.layout = 'GSN128.sfp'; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) figure cfg = []; cfg.component = [61:80]; % specify the component(s) that should be plotted cfg.layout = 'GSN128.sfp'; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) %% Seperate observation conditions name1= strcat(num2str(sb),'_90.xls'); list1=xlsread (name1) name2= strcat(num2str(sb),'_180.xls'); list2=xlsread (name2) % cfg = [] cfg.trials = [list1] obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) cfg = [] cfg.trials = [list2] obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) %%PIPELINE FOR obs90 %% Decompose original data according to the components found before load (strcat(sb,'comp_all')) cfg = []; cfg.numcomponent = 128; cfg.unmixing = comp.unmixing; cfg.topolabel = comp.topolabel; comp_1 = ft_componentanalysis(cfg, obs90_data); %% Reject component cfg = []; cfg.component = []; obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') %% Artifacts - final detection cfg.method = 'summary'; cfg.latency=[0 1]; cfg.layout = 'GSN128.sfp'; % this allows for plotting obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); cfg = []; cfg.viewmode = 'vertical'; cfg.latency=[0 1]; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs90_data_clean3); %cfg.artfctdef.reject = 'complete'; obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); % Save clean data save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') %% Rereferencing data cfg = []; cfg.channel = 'all'; cfg.preproc.reref = 'yes'; cfg.preproc.refchannel = 'all'; obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) save (strcat(subject,'obs90_ref') , 'obs90_data_ref') %% Snap out smaller pieces (the third second) cfg = [] cfg.toilim = [0 1] obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) %% TIMELOCK ERP obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') %% plot it cfg = []; cfg.layout = lay ; cfg.interactive = 'yes'; ft_multiplotER(cfg, obs90_data_ERP) %% PIPELINE FOR obs180 %% Decompose original data according to the components found before load (strcat(sb,'comp_all')) cfg = []; cfg.numcomponent = 128 cfg.unmixing = comp.unmixing; cfg.topolabel = comp.topolabel; comp_2 = ft_componentanalysis(cfg, obs180_data); %% Reject component cfg = []; cfg.component = []; obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, obs180_data); save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') %% Artifacts final 180 cfg.method = 'summary'; cfg.latency=[0 1]; cfg.layout = 'GSN128.sfp'; % this allows for plotting obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); cfg = []; cfg.viewmode = 'vertical'; cfg.latency=[0 1]; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs180_data_clean3); %cfg.artfctdef.reject = 'complete'; obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); % Save clean data save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') %% Rereferencing data cfg = []; cfg.channel = 'all'; cfg.preproc.reref = 'yes'; cfg.preproc.refchannel = 'all'; obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) save (strcat(subject,'obs180_ref') , 'obs180_data_ref') %% Snap out smaller pieces (the third second) cfg = [] cfg.toilim = [0 1] obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) %% TIMELOCK ERP obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') %% plot 180 ERP cfg = []; cfg.layout = lay ; cfg.interactive = 'yes'; ft_multiplotER(cfg, obs180_data_ERP) %% plot both ERPs cfg = []; cfg.layout = lay ; cfg.interactive = 'yes'; cfg.showlabels = 'yes'; ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) %% plot difference wave difference = obs180_data_ERP; % copy one of the structures difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute the difference ERP cfg = []; cfg.layout = lay; cfg.interactive = 'yes'; ft_multiplotER(cfg, difference) 2014-09-07 7:53 GMT+02:00 Joseph Dien : > Hi, > I’m one of the main Fieldtrip contributors working on supporting EGI > data. A couple things. First of all, exactly which net do you use? If > they are 129-channel, there is still the question of whether they are the > Hydrocel or the older geodesic nets. Regardless, that shouldn't cause an > error like this. Could you send me the file you are trying to process and > the script you are using and I’ll try troubleshooting it. > > Joe > > > On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < > diezmartini at gmail.com> wrote: > > Which nets do you use? I use EGI. I tried both the ones you mention and > they didn't work. It was hard to find that exact one online but it was the > only file that actually worked. > > > On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > wrote: > >> Dear Ana, dear all, >> the layout you used does not correspond to our nets. I tried the >> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. >> Please can anybody help? >> Cheers >> Katrin >> >> >> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : >> >> Try this one >>> I use >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>> katrinheimann at gmail.com> wrote: >>> >>>> Dear all, my problems seem neverending. This time however i really need >>>> help. >>>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>>> preprocessing, channelreplacement, ica, componentrejection, final >>>> artifactdetection, timelock of the single subject data. However, when I >>>> wanna compute the grandaverage of the single subjects I get the following >>>> error message: >>>> >>>> computing average of avg over 19 subjects >>>> Warning: discarding electrode information because it cannot be averaged >>>> > In ft_timelockgrandaverage at 249 >>>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>>> additional allocation of an estimated 3 MB >>>> computing average of avg over 2 subjects >>>> Warning: discarding electrode information because it cannot be averaged >>>> > In ft_timelockgrandaverage at 249 >>>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>>> additional allocation of an estimated 0 MB >>>> the call to "ft_prepare_layout" took 0 seconds and required the >>>> additional allocation of an estimated 0 MB >>>> the call to "ft_topoplotER" took 0 seconds and required the additional >>>> allocation of an estimated 0 MB >>>> >>>> Furthermore in the plot of the significant clusters, the channelnames >>>> are mixed up (do not correspond to my net) >>>> >>>> >>>> I guess that there is a problem with the layout I use. >>>> Here the code that I use >>>> >>>> %For generating the layout (also in the single subjects): >>>> >>>> cfg = []; >>>> >>>> cfg.channel = obs_data.label; >>>> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>>> >>>> cfg.feedback = 'yes'; >>>> >>>> lay = ft_prepare_layout(cfg); >>>> >>>> >>>> cfg_neighb = []; >>>> >>>> cfg_neighb.feedback = 'yes'; >>>> >>>> cfg_neighb.method = 'triangulation'; >>>> >>>> cfg_neighb.layout = lay; >>>> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>>> >>>> >>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>>> >>>> >>>> %For computing the grand average >>>> >>>> cfg = []; >>>> >>>> cfg.channel = 'all'; >>>> >>>> cfg.latency = 'all'; >>>> >>>> cfg.parameter = 'avg'; >>>> >>>> cfg.keepindividual = 'no' >>>> >>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>>> >>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>>> >>>> % "{:}" means to use data from all elements of the variable >>>> >>>> >>>> For plotting the significant clusters >>>> >>>> cfg = []; >>>> >>>> cfg.style = 'blank'; >>>> >>>> cfg.layout = lay; >>>> >>>> cfg.channellabels = 'yes'; >>>> >>>> cfg.highlight = 'labels'; >>>> >>>> cfg.highlightchannel = find(stat.mask); >>>> >>>> cfg.comment = 'no'; >>>> >>>> figure; ft_topoplotER(cfg, GA_90) >>>> >>>> title('Nonparametric: significant with cluster multiple comparison >>>> correction') >>>> >>>> >>>> Do you have ANY idea to this? I am really completely helpless.... >>>> >>>> thanks and best >>>> >>>> Katrin >>>> >>>> _______________________________________________ >>>> 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 >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -------------------------------------------------------------------------------- > > Joseph Dien, PhD > Research Associate > Cognitive Neurology > The Johns Hopkins University School of Medicine > > Lab E-mail: jdien1 at jhmi.edu > Private E-mail: jdien07 at mac.com > Office Phone: 410-614-3115 > Cell Phone: 202-297-8117 > Fax: 410-955-0188 > http://joedien.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 jdien07 at mac.com Tue Sep 9 03:55:44 2014 From: jdien07 at mac.com (Joseph Dien) Date: Mon, 08 Sep 2014 21:55:44 -0400 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: <85691A9F-3696-4881-B2C6-147935FBFB9A@mac.com> Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03@mac.com> yes, please do send me the data. Thanks! Joe On Sep 8, 2014, at 3:38 PM, KatrinH Heimann wrote: > Dear Joseph, thanks so much, I really appreciate your help. I was also wandering, if maybe there is another bug in my code. > Our nets are 128 channels, Hydrocel, but as a colleague of me adviced me to do so, I also tried the 129 layout. > My code you find below (without selection of bad channels etc.) > If you need also the data of two subjects to have a look, let me know!!! > Best and thanks really! > Katrin > > > > subject=input('Which subject do you want to analyse? ','s'); > > name = strcat(subject,'.raw'); > > subjectnumber=input('Which is the subjectnumber?', 's'); > > sb=subjectnumber > > %subjectnumber = strcat(subjectnumber, '.txt') > > %% > > > > cfg = []; > > cfg.dataset = name; > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus trigger > > cfg.trialdef.prestim = 0.234; % in seconds > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video observation, but maybe we need less) > > cfg = ft_definetrial(cfg); > > > > cfg.trl([1:7],:) = []; > > > > %change timeline according to constant offset of 16 ms = 8 samples (because recorded with 500 hz)in > > %structure trial > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > > %change timeline to make the cut the zeropoint > > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > > > %% preprocess data > > cfg.channel = 'all'; > > cfg.preproc.detrend = 'yes'; > > cfg.preproc.demean = 'yes'; > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already filtered > > %(0.1-45) and bad channels have to be replaced!!!! > > %cfg.preproc.bpfreq = [6 32]; > > % > > % > > obs_data = ft_preprocessing(cfg); > > % > > save (strcat(sb,'obs_data') , 'obs_data') > > > > %% determining channel neighbours (necessary for Artifact detection) > > cfg = []; > > cfg.channel = obs_data.label; > > cfg.layout = 'GSN128.sfp'; > > cfg.feedback = 'yes'; > > lay = ft_prepare_layout(cfg); > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = 'GSN128.sfp'; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > > > %% Preparing neighbours for channel repair - but bad channel info in!!! > > > > % cfg_neighb = []; > > % cfg_neighb.feedback = 'yes'; > > % cfg_neighb.method = 'triangulation'; > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > % Interpolate and put into new data structure > > cfg = []; > > cfg.badchannel = {}; > > cfg.layout = 'GSN128.sfp'; > > cfg.method = 'nearest'; > > cfg.neighbours = neighbours; > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > > % Check reconstruction > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > % dat1=obs_data; > > % dat2=obs_data_channelrepaired; > > % > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > % y=dat2.trial{1}(62,:); > > % plot(x);hold on;plot(y,'r'); > > % > > % x=dat1.trial{1}(72,:); > > % y=dat2.trial{1}(75,:); > > % figure; > > % plot(x);hold on;plot(y,'r') > > % > > % x=dat1.trial{1}(75,:); > > % y=dat2.trial{1}(75,:); > > % figure; > > % plot(x);hold on;plot(y,'r') > > %% artifact rejection/trial inspection - throw out electrode jumps etc. > > > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent according to channels interpolated %% 128-number of interp. channels) > > > cfg = []; > > cfg.channel = {'all'}; > > cfg.numcomponent = 128 > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > save (strcat(sb,'comp_all') , 'comp') > > > > %% > > cfg = []; > > cfg.viewmode = 'component'; > > cfg.continuous = 'no'; > > cfg.plotlabels='some'; > > cfg.layout = 'GSN128.sfp'; > > ft_databrowser(cfg,comp); > > > > %% poweranalysis components > > cfg = []; > > cfg.output = 'pow'; > > cfg.channel = 'all';%compute the power spectrum in all ICs > > cfg.method = 'mtmfft'; > > cfg.taper = 'hanning'; > > cfg.foi = 0:0.2:50; > > obs_freq = ft_freqanalysis(cfg, comp); > > > > %And you can plot the spectra: > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > nsubplots = 16; > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain decimals, type doc subplot > > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > tot = Nfigs*nsubplots; > > > > rptvect = 1:size(comp.topo,1); > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > > for r=1:size(rptvect,1); > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 1]);%full screen > > k=0; > > for j=1:size(rptvect,2); > > if~(rptvect(r,j)==0); > > k=k+1; > > cfg=[]; > > cfg.channel = rptvect(r,j); > > cfg.ylim =[0 500] > > cfg.xlim =[0 50] > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > end > > end > > end > > > > %For the IC topos you'll follow the same logic as above but with: > > > > figure > > cfg = []; > > cfg.component = [1:20]; % specify the component(s) that should be plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > figure > > cfg = []; > > cfg.component = [21:40]; % specify the component(s) that should be plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > figure > > cfg = []; > > cfg.component = [41:60]; % specify the component(s) that should be plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > figure > > cfg = []; > > cfg.component = [61:80]; % specify the component(s) that should be plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > > > > > > > > > %% Seperate observation conditions > > > > name1= strcat(num2str(sb),'_90.xls'); > > list1=xlsread (name1) > > > > name2= strcat(num2str(sb),'_180.xls'); > > list2=xlsread (name2) > > > % > > > > cfg = [] > > cfg.trials = [list1] > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > cfg = [] > > cfg.trials = [list2] > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > %%PIPELINE FOR obs90 > > > > %% Decompose original data according to the components found before > > load (strcat(sb,'comp_all')) > > > > cfg = []; > > cfg.numcomponent = 128; > > cfg.unmixing = comp.unmixing; > > cfg.topolabel = comp.topolabel; > > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > > > %% Reject component > > cfg = []; > > cfg.component = []; > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > > > > %% Artifacts - final detection > > > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > %cfg.artfctdef.reject = 'complete'; > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > > > % Save clean data > > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > > > %% Rereferencing data > > cfg = []; > > > > cfg.channel = 'all'; > > cfg.preproc.reref = 'yes'; > > cfg.preproc.refchannel = 'all'; > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > %% Snap out smaller pieces (the third second) > > > > cfg = [] > > cfg.toilim = [0 1] > > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > > %% TIMELOCK ERP > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > > %% plot it > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > > > > > > > %% PIPELINE FOR obs180 > > > > > > %% Decompose original data according to the components found before > > load (strcat(sb,'comp_all')) > > > > cfg = []; > > cfg.numcomponent = 128 > > cfg.unmixing = comp.unmixing; > > cfg.topolabel = comp.topolabel; > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > > > %% Reject component > > cfg = []; > > cfg.component = []; > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, obs180_data); > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > > > > %% Artifacts final 180 > > > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > %cfg.artfctdef.reject = 'complete'; > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > > > % Save clean data > > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > > > %% Rereferencing data > > cfg = []; > > cfg.channel = 'all'; > > cfg.preproc.reref = 'yes'; > > cfg.preproc.refchannel = 'all'; > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > %% Snap out smaller pieces (the third second) > > > > cfg = [] > > cfg.toilim = [0 1] > > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > > %% TIMELOCK ERP > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > > %% plot 180 ERP > > > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, obs180_data_ERP) > > > > %% plot both ERPs > > > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > cfg.showlabels = 'yes'; > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > > %% plot difference wave > > > > difference = obs180_data_ERP; % copy one of the structures > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute the difference ERP > > > cfg = []; > > cfg.layout = lay; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, difference) > > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > Hi, > I’m one of the main Fieldtrip contributors working on supporting EGI data. A couple things. First of all, exactly which net do you use? If they are 129-channel, there is still the question of whether they are the Hydrocel or the older geodesic nets. Regardless, that shouldn't cause an error like this. Could you send me the file you are trying to process and the script you are using and I’ll try troubleshooting it. > > Joe > > > On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini wrote: > >> Which nets do you use? I use EGI. I tried both the ones you mention and they didn't work. It was hard to find that exact one online but it was the only file that actually worked. >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann wrote: >> Dear Ana, dear all, >> the layout you used does not correspond to our nets. I tried the >> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. Please can anybody help? >> Cheers >> Katrin >> >> >> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : >> >> Try this one I use >> >> >> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann wrote: >> Dear all, my problems seem neverending. This time however i really need help. >> I implemented a pipeline for ERPs. All works now, trialdefinition, preprocessing, channelreplacement, ica, componentrejection, final artifactdetection, timelock of the single subject data. However, when I wanna compute the grandaverage of the single subjects I get the following error message: >> >> computing average of avg over 19 subjects >> Warning: discarding electrode information because it cannot be averaged >> > In ft_timelockgrandaverage at 249 >> the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 3 MB >> computing average of avg over 2 subjects >> Warning: discarding electrode information because it cannot be averaged >> > In ft_timelockgrandaverage at 249 >> the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 0 MB >> the call to "ft_prepare_layout" took 0 seconds and required the additional allocation of an estimated 0 MB >> the call to "ft_topoplotER" took 0 seconds and required the additional allocation of an estimated 0 MB >> >> Furthermore in the plot of the significant clusters, the channelnames are mixed up (do not correspond to my net) >> >> >> I guess that there is a problem with the layout I use. >> Here the code that I use >> >> %For generating the layout (also in the single subjects): >> cfg = []; >> >> cfg.channel = obs_data.label; >> >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >> cfg.feedback = 'yes'; >> >> lay = ft_prepare_layout(cfg); >> >> >> cfg_neighb = []; >> >> cfg_neighb.feedback = 'yes'; >> >> cfg_neighb.method = 'triangulation'; >> >> cfg_neighb.layout = lay; >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >> >> >> %For computing the grand average >> >> cfg = []; >> >> cfg.channel = 'all'; >> >> cfg.latency = 'all'; >> >> cfg.parameter = 'avg'; >> >> cfg.keepindividual = 'no' >> >> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >> % "{:}" means to use data from all elements of the variable >> >> >> For plotting the significant clusters >> >> cfg = []; >> >> cfg.style = 'blank'; >> >> cfg.layout = lay; >> >> cfg.channellabels = 'yes'; >> >> cfg.highlight = 'labels'; >> >> cfg.highlightchannel = find(stat.mask); >> >> cfg.comment = 'no'; >> >> figure; ft_topoplotER(cfg, GA_90) >> >> title('Nonparametric: significant with cluster multiple comparison correction') >> >> >> >> Do you have ANY idea to this? I am really completely helpless.... >> >> thanks and best >> >> Katrin >> >> >> _______________________________________________ >> 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 >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------------------------------------------------------------------------- > > Joseph Dien, PhD > Research Associate > Cognitive Neurology > The Johns Hopkins University School of Medicine > > Lab E-mail: jdien1 at jhmi.edu > Private E-mail: jdien07 at mac.com > Office Phone: 410-614-3115 > Cell Phone: 202-297-8117 > Fax: 410-955-0188 > http://joedien.com > > > _______________________________________________ > 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 -------------------------------------------------------------------------------- Joseph Dien, PhD Research Associate Cognitive Neurology The Johns Hopkins University School of Medicine Lab E-mail: jdien1 at jhmi.edu Private E-mail: jdien07 at mac.com Office Phone: 410-614-3115 Cell Phone: 202-297-8117 Fax: 410-955-0188 http://joedien.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Tue Sep 9 08:37:13 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Tue, 9 Sep 2014 06:37:13 +0000 Subject: [FieldTrip] ft_rejectvisual: removing trials marked as bad In-Reply-To: References: Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6@live.ucl.ac.uk> Hi Ashley, Maybe the mistake is you did not integrate in your script the command to save the rejection. Normally, with the following command, you will see in the Matlab Window that artifacts are correctly rejected after the "quit" button. clean_data = ft_rejectvisual(cfg, interpoldata); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; cleandata = ft_rejectartifact(cfg,clean_data); Emilie Le 3 sept. 2014 à 11:58, Ashley Greene > a écrit : Hello, I have used the rejectvisual function in attempt to remove bad trials, but after marking them and pressing the quit button, although the command window states that the selected trials have been removed, there is no obvious change in the data; all of the trials are still intact. Have I overlooked something? Thanks, Ashley _______________________________________________ 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 Patricia.Wollstadt at gmx.de Tue Sep 9 14:16:20 2014 From: Patricia.Wollstadt at gmx.de (Patricia Wollstadt) Date: Tue, 09 Sep 2014 14:16:20 +0200 Subject: [FieldTrip] TRENTOOL pipeline help In-Reply-To: References: Message-ID: <540EEF94.9080601@gmx.de> Hello Max, I added a few comments to the questions regarding individual parameters below. To address the general problem of TRENTOOL telling you, that there are not enough sample points in your data: From what I can see in your script, you probably don't have enough data points in each time series to robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, which gives you 240 samples per time series. Can you maybe avoid downsampling to 300 Hz and downsample to 600 Hz instead? Or could you analyze a longer time window of interest? Note that you also 'lose' data to embedding and the interaction delay: The first point that can be used for TE estimation is at max. embedding length + max. interaction delay in samples. For example: max. embedding length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max interaction delay of 30 ms = 9 samples. In this example, you would be left with 240 - 29 samples for TE estimation per trial. There is also the possibility to estimate time resolved TE/TE for shorter time windows of interest (see section 4.4 in the manual); however, this method requires the use of a GPU for TE estimation. I would further recommend to use the new pipeline for group statistics described in the manual in section 4.5 (the function 'TEgroup_calculate' is deprecated). The new pipeline allows you to reconstruct the interaction delay and uses the following functions (see also comments in the script): TEgroup_prepare -> prepares all data sets (all subjects/all conditions) for group analysis (this means finding common embedding parameters such that estimates are not biased between groups) InteractionDelayReconstruction_calculate -> estimates TE for individual data sets and all assumed interaction delays u InteractionDelayReconstruction_analyze -> reconstructs the interaction delay by selecting the u that maximizes TE for each channel TEgroup_stats -> calculate group statistics using a permutation test I can send you an example script for group TE analysis using this pipeline to get you started. I hope this helps you to get the group analysis running. Just write again if you're having trouble setting up the pipeline or something is not clear about the parameters/my comments. Best, Patricia On 09/04/2014 08:30 PM, Max Cantor wrote: > Hi fieldtrippers, > > I know trentool is not produced by the Donders Institute, so I'm not > 100% sure if it is appropriate to ask questions about it here, but to > the best of my knowledge they do not have a mailing list and I saw a > few trentool questions in the archives, so I'm going to assume it's ok... > > In any case, below is my current pipeline (slightly modified for > comprehensibility): > > (notes in bold are comments/questions made in this email, not present > in the pipeline. Sorry in advance for the long post! Any help would be > greatly appreciated as I'm a bit over my head on this but I think I'm > close!) > > ***** > > % Prepare group TE data > > cfgP = []; > cfgP.Path2TSTOOL = *TSTOOLPATH* > cfgP.TEcalctype = 'VW_ds'; > cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > > *I'm trying to find the transfer entropy between the left and right > auditory cortices in my experiment. The input is virtual sensor data > that was produced using SAM in fieldtrip on real MEG data. * > > % specify u to be scanned > > cfgP.predicttime_u = 30; > cfgP.toi = [-0.4 0.4]; > > *For clarification, the predicttime_u is in seconds but the toi is in > milliseconds. If I understand correctly, the predicttime_u must fit > within the toi, but beyond that are there any benefits to it being > earlier or later?* PW: The predictiontime_u is in milliseconds and the > toi is in seconds. The prediction time is the assumed interaction > delay between your two sources and should fit within your toi. In > general it is preferable to use the method for interaction delay > reconstruction for TE estimation, because it allows you to reconstruct > the actual delay between your source and target times series. A > non-optimal u/interaction delay may cause an underestimation of TE, so > it is recommended to use the pipeline for interaction delay > reconstruction whenever estimating TE for unknown delays. > If you use the methods for interaction delay reconstruction > 'predicttime_u' is replaced by > cfgTEP.predicttimemin_u % minimum u to be scanned > cfgTEP.predicttimemax_u % maximum u to be scanned > cfgTEP.predicttimestepsize % time steps between u to be scanned > A large range for u values to be scanned increases computing time a > lot, so it is best to limit the u range to values that are > physiologically plausible. > > % ACT (Autocorrelation Time) estimation and constraints > > cfgP.maxlag = 150; > cfgP.actthrvalue = 7.5; > cfgP.minnrtrials = 5; > > *My understanding is maxlag should be 1/2 the sampling rate, so since > the data are downsampled to 300hz, it should be 150. I know that the > sample rate and filters are used to determine the actthrvalue, but I > don't actually know the calculation. 7.5 was a rough guess just to > test the pipeline. I'm also uncertain of what minnrtrials should be.* > PW: You can set the actthrvalue based on the filtering you did prior > to TE analysis. If you for example highpass filtered at 10 Hz, you > shouldn't find an ACT higher than 30 samples, because you filtered out > any components of the signal slower than 10 Hz/30 samples (given your > sampling frequency of 300 Hz). So in this scenario the actthrvalue > would be 30. > A good value for cfgP.minnrtrials is 12 (a minimum number of trials is > needed to realize the permutation test for estimated TE values). > > % Optimization > > cfgP.optimizemethod = 'ragwitz'; > cfgP.ragdim = 4:8; > cfgP.ragtaurange = [0.2 0.4]; > cfgP.ragtausteps = 15; > cfgP.repPred = 100; > * > * > *I am completely at a loss for this. I've done some reading into > transfer entropy, mutual information, etc., cited in trentool, but I'm > yet to understand how exactly this optimization works and what the > configuration should be, given my data and experimental intentions.* > PW: The Ragwitz criterion tries to find optimal embedding parameters > dim and tau for the data. To do that, the method iteratively takes all > possible combinations of dim and tau values that are provided in > cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well these > combinations embed the data. To test an embedding, the method builds > the embedding vectors from the data; it then tests for each point how > well the next point in time can be predicted from the reference > point's nearest neighbours. So for each embedded point, the method > searches for the nearest neighbours and calculates the average of > those nearest neighbours. The difference between the > averaged/predicted point and the actual next point is the error of the > local predictor. The Ragwitz criterion will then return the parameter > combination for which this error over all points is minimal. > The parameters set the following: 'ragdim' are dimensions to be tested > by the method (I would reccomend to start with 2:10), 'ragtaurange' > together with 'ragtausteps' specifies the tau values to be tested > (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, that > the values here are factors that are later multiplied with the ACT to > obtain the actual tau. 'repPred' is the number of points that will be > used for the local prediction, i.e. the Ragwitz criterion will test > the local prediction and calculate the error for the first 100 points > in your time series. The two parameters 'flagNei' ans 'sizeNei' below > specify the type of neighbour search conducted by the Ragwitz > criterion: 'flagNei' tells the method to either conduct a kNN or range > search; 'sizeNei' specifies the number of neighbours or the radius to > be searched by a range search. > > > % Kernel-based TE estimation > > cfgP.flagNei = 'Mass'; > cfgP.sizeNei = 4; % Default > > cfgP.ensemblemethod = 'no'; > cfgP.outputpath = *OUTPUT PATH*; > > if ~exist(*Path for TEprepare data object*) > load VSdat; > TE_Wrd = {}; > for i = 1:nConds > for j = 1:Nsub > TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > end > end > clear VSdat; > save('TE_Wrd', 'TE_Wrd'); > end > * > * > *The configuration and virtual sensor data, organized in a 3 x 15 cell > of structures (condition by subject) are the input. The TEprepare > substructure is added to each individual condition x subject .mat > files' data structure which are stored on disk independently.* > > % Use object_to_mat_conversion.m to replace individual condition x > subject virtual sensor data > % .mat files with their TE_Wrd equivalent > * > * > *I'm using a separate script to make some manipulations to the objects > from disk; this will all eventually be integrated into the main > pipeline*.*TRENTOOL seems to handle data output very differently from > fieldtrip and I've had trouble thinking through the most logical way > to handle the data so it's a bit haphazard right now.* > > load cond080sub01.mat > > cfgG = []; > cfgG.dim = cond080sub01.TEprepare.optdim; > cfgG.tau = cond080sub01.TEprepare.opttau; > > if isfield(cond080sub01, 'TEprepare') > TEgroup_prepare(cfgG, fileCell); > else > error('Need to run TEprepare before TEgroup_prepare'); > end > * > * > *For clarification, fileCell is a cell with the name of each condition > x subject .mat file, which as I said before is collectively the same > as the 3 x 15 VSdat structure (condition x subject).* > > % Replace .mat files with '_for_TEgroup_calculate' version in > % object_to_mat_conversion.m > > % TE Group Calculate > > load cond080sub01.mat > if isfield(cond080sub01, 'TEgroupprepare') > for i = 1:length(fileCell) > TEgroup_calculate(fileCell{i}); > end > else > error('Need to run TEgroup_prepare before TEgroup_calculate'); > end > * > * > *At this step I get the following error: > > Error using transferentropy (line 337) > \nTRENTOOL ERROR: not enough data points left after embedding > > Error in TEgroup_calculate (line 133) > [TEresult] = transferentropy(cfg,data);* > > % TE Group Stats > > cfgGSTAT = []; > cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > > cfgGSTAT.uvar = 1; > cfgGSTAT.ivar = 2; > cfgGSTAT.fileidout = 'test_groupstats'; > > TEgroup_stats(cfgGSTAT, fileCell); > > *Given the error above, I am yet to get to this step, but it does not > seem fundamentally different from normal fieldtrip stats.* > > ***** > > In case my notes were not clear or you skipped to the bottom, *my > primary concern is whether the error I'm getting in TEgroup_calculate > is a pipeline issue* (I noticed the example pipeline in trentool, the > manual, and published methods articles all seem to have slightly or > significantly different pipeline compositions), *or if the error is* > due to ACT, ragwitz optimization, or some other faulty > parameterization *on my part due to a lack of understanding of how > transfer entropy works on a more theoretical/mathematical level*. If > the latter is the case, is there any relatively straightforward way to > conceptualize this, or is this something where I'm just going to have > to keep reading and rereading until it eventually makes sense? I've > already done quite a bit of that and it hasn't pierced my thick skull > yet but I'm sure it will eventually! > > Thank you so much, > > Max Cantor > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > > _______________________________________________ > 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 Holger.Krause at med.uni-duesseldorf.de Tue Sep 9 15:21:20 2014 From: Holger.Krause at med.uni-duesseldorf.de (Holger Krause) Date: Tue, 9 Sep 2014 15:21:20 +0200 Subject: [FieldTrip] Latest FT version on ftp-server is from three days ago Message-ID: <201409091521.22589.Holger.Krause@med.uni-duesseldorf.de> Dear developers, Could you please check the process for creation/publication of zip-files on the FTP server? The latest file I can find there is fieldtrip-20140906.zip. Thanks in advance, Holger From mcantor at umich.edu Tue Sep 9 15:19:55 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 9 Sep 2014 09:19:55 -0400 Subject: [FieldTrip] TRENTOOL pipeline help In-Reply-To: <540EEF94.9080601@gmx.de> References: <540EEF94.9080601@gmx.de> Message-ID: This is immensely helpful, thank you. I was very confused about why some versions of the pipeline I saw were using group calculate and others were using interaction delay reconstruction and what that meant, and I think I have a more clear idea of what the different steps of the pipeline are doing. There are still a few things I'm a bit confused about though in terms of the pipeline. For instance, whether or not I need to do TEprepare before group prepare, and if I need to do graph analysis (which I'm not sure I fully understand but also haven't looked deeply into) before group stats. If you don't mind me taking you up on your offer, I think seeing your example script might help clarify some of these issues. Thank you! On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < Patricia.Wollstadt at gmx.de> wrote: > Hello Max, > > I added a few comments to the questions regarding individual parameters > below. To address the general problem of TRENTOOL telling you, that there > are not enough sample points in your data: From what I can see in your > script, you probably don't have enough data points in each time series to > robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, which > gives you 240 samples per time series. Can you maybe avoid downsampling to > 300 Hz and downsample to 600 Hz instead? Or could you analyze a longer time > window of interest? > Note that you also 'lose' data to embedding and the interaction delay: The > first point that can be used for TE estimation is at max. embedding length > + max. interaction delay in samples. For example: max. embedding length = > dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max interaction > delay of 30 ms = 9 samples. In this example, you would be left with 240 - > 29 samples for TE estimation per trial. There is also the possibility to > estimate time resolved TE/TE for shorter time windows of interest (see > section 4.4 in the manual); however, this method requires the use of a GPU > for TE estimation. > > I would further recommend to use the new pipeline for group statistics > described in the manual in section 4.5 (the function 'TEgroup_calculate' is > deprecated). The new pipeline allows you to reconstruct the interaction > delay and uses the following functions (see also comments in the script): > > TEgroup_prepare -> prepares all data sets (all subjects/all conditions) > for group analysis (this means finding common embedding parameters such > that estimates are not biased between groups) > InteractionDelayReconstruction_calculate -> estimates TE for > individual data sets and all assumed interaction delays u > InteractionDelayReconstruction_analyze -> reconstructs the > interaction delay by selecting the u that maximizes TE for each channel > TEgroup_stats -> calculate group statistics using a permutation test > > I can send you an example script for group TE analysis using this pipeline > to get you started. I hope this helps you to get the group analysis > running. Just write again if you're having trouble setting up the pipeline > or something is not clear about the parameters/my comments. > > Best, > Patricia > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: > > Hi fieldtrippers, > > I know trentool is not produced by the Donders Institute, so I'm not 100% > sure if it is appropriate to ask questions about it here, but to the best > of my knowledge they do not have a mailing list and I saw a few trentool > questions in the archives, so I'm going to assume it's ok... > > In any case, below is my current pipeline (slightly modified for > comprehensibility): > > (notes in bold are comments/questions made in this email, not present in > the pipeline. Sorry in advance for the long post! Any help would be greatly > appreciated as I'm a bit over my head on this but I think I'm close!) > > ***** > > % Prepare group TE data > > cfgP = []; > cfgP.Path2TSTOOL = *TSTOOLPATH* > cfgP.TEcalctype = 'VW_ds'; > cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > > *I'm trying to find the transfer entropy between the left and right > auditory cortices in my experiment. The input is virtual sensor data that > was produced using SAM in fieldtrip on real MEG data. * > > % specify u to be scanned > > cfgP.predicttime_u = 30; > cfgP.toi = [-0.4 0.4]; > > *For clarification, the predicttime_u is in seconds but the toi is in > milliseconds. If I understand correctly, the predicttime_u must fit within > the toi, but beyond that are there any benefits to it being earlier or > later?* PW: The predictiontime_u is in milliseconds and the toi is in > seconds. The prediction time is the assumed interaction delay between your > two sources and should fit within your toi. In general it is preferable to > use the method for interaction delay reconstruction for TE estimation, > because it allows you to reconstruct the actual delay between your source > and target times series. A non-optimal u/interaction delay may cause an > underestimation of TE, so it is recommended to use the pipeline for > interaction delay reconstruction whenever estimating TE for unknown delays. > If you use the methods for interaction delay reconstruction > 'predicttime_u' is replaced by > cfgTEP.predicttimemin_u % minimum u to be scanned > cfgTEP.predicttimemax_u % maximum u to be scanned > cfgTEP.predicttimestepsize % time steps between u to be scanned > A large range for u values to be scanned increases computing time a lot, > so it is best to limit the u range to values that are physiologically > plausible. > > > % ACT (Autocorrelation Time) estimation and constraints > > cfgP.maxlag = 150; > cfgP.actthrvalue = 7.5; > cfgP.minnrtrials = 5; > > *My understanding is maxlag should be 1/2 the sampling rate, so since > the data are downsampled to 300hz, it should be 150. I know that the sample > rate and filters are used to determine the actthrvalue, but I don't > actually know the calculation. 7.5 was a rough guess just to test the > pipeline. I'm also uncertain of what minnrtrials should be.* PW: You can > set the actthrvalue based on the filtering you did prior to TE analysis. If > you for example highpass filtered at 10 Hz, you shouldn't find an ACT > higher than 30 samples, because you filtered out any components of the > signal slower than 10 Hz/30 samples (given your sampling frequency of 300 > Hz). So in this scenario the actthrvalue would be 30. > A good value for cfgP.minnrtrials is 12 (a minimum number of trials is > needed to realize the permutation test for estimated TE values). > > > % Optimization > > cfgP.optimizemethod = 'ragwitz'; > cfgP.ragdim = 4:8; > cfgP.ragtaurange = [0.2 0.4]; > cfgP.ragtausteps = 15; > cfgP.repPred = 100; > > *I am completely at a loss for this. I've done some reading into > transfer entropy, mutual information, etc., cited in trentool, but I'm yet > to understand how exactly this optimization works and what the > configuration should be, given my data and experimental intentions.* PW: > The Ragwitz criterion tries to find optimal embedding parameters dim and > tau for the data. To do that, the method iteratively takes all possible > combinations of dim and tau values that are provided in cfgP.ragdim and > cfgP.ragtaurange/.ragtausteps and tests how well these combinations embed > the data. To test an embedding, the method builds the embedding vectors > from the data; it then tests for each point how well the next point in time > can be predicted from the reference point's nearest neighbours. So for each > embedded point, the method searches for the nearest neighbours and > calculates the average of those nearest neighbours. The difference between > the averaged/predicted point and the actual next point is the error of the > local predictor. The Ragwitz criterion will then return the parameter > combination for which this error over all points is minimal. > The parameters set the following: 'ragdim' are dimensions to be tested by > the method (I would reccomend to start with 2:10), 'ragtaurange' together > with 'ragtausteps' specifies the tau values to be tested (TRENTOOL will > build a vector from 0.2 to 0.4 in 15 steps). Note, that the values here are > factors that are later multiplied with the ACT to obtain the actual tau. > 'repPred' is the number of points that will be used for the local > prediction, i.e. the Ragwitz criterion will test the local prediction and > calculate the error for the first 100 points in your time series. The two > parameters 'flagNei' ans 'sizeNei' below specify the type of neighbour > search conducted by the Ragwitz criterion: 'flagNei' tells the method to > either conduct a kNN or range search; 'sizeNei' specifies the number of > neighbours or the radius to be searched by a range search. > > > % Kernel-based TE estimation > > cfgP.flagNei = 'Mass'; > cfgP.sizeNei = 4; % Default > > cfgP.ensemblemethod = 'no'; > cfgP.outputpath = *OUTPUT PATH*; > > if ~exist(*Path for TEprepare data object*) > load VSdat; > TE_Wrd = {}; > for i = 1:nConds > for j = 1:Nsub > TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > end > end > clear VSdat; > save('TE_Wrd', 'TE_Wrd'); > end > > *The configuration and virtual sensor data, organized in a 3 x 15 cell > of structures (condition by subject) are the input. The TEprepare > substructure is added to each individual condition x subject .mat files' > data structure which are stored on disk independently.* > > % Use object_to_mat_conversion.m to replace individual condition x subject > virtual sensor data > % .mat files with their TE_Wrd equivalent > > *I'm using a separate script to make some manipulations to the objects > from disk; this will all eventually be integrated into the main pipeline*.* > TRENTOOL seems to handle data output very differently from fieldtrip and > I've had trouble thinking through the most logical way to handle the data > so it's a bit haphazard right now.* > > load cond080sub01.mat > > cfgG = []; > cfgG.dim = cond080sub01.TEprepare.optdim; > cfgG.tau = cond080sub01.TEprepare.opttau; > > if isfield(cond080sub01, 'TEprepare') > TEgroup_prepare(cfgG, fileCell); > else > error('Need to run TEprepare before TEgroup_prepare'); > end > > *For clarification, fileCell is a cell with the name of each condition x > subject .mat file, which as I said before is collectively the same as the 3 > x 15 VSdat structure (condition x subject).* > > % Replace .mat files with '_for_TEgroup_calculate' version in > % object_to_mat_conversion.m > > % TE Group Calculate > > load cond080sub01.mat > if isfield(cond080sub01, 'TEgroupprepare') > for i = 1:length(fileCell) > TEgroup_calculate(fileCell{i}); > end > else > error('Need to run TEgroup_prepare before TEgroup_calculate'); > end > > > > > > > > *At this step I get the following error: Error using transferentropy (line > 337) \nTRENTOOL ERROR: not enough data points left after embedding Error in > TEgroup_calculate (line 133) [TEresult] = transferentropy(cfg,data);* > > % TE Group Stats > > cfgGSTAT = []; > cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > > cfgGSTAT.uvar = 1; > cfgGSTAT.ivar = 2; > cfgGSTAT.fileidout = 'test_groupstats'; > > TEgroup_stats(cfgGSTAT, fileCell); > > *Given the error above, I am yet to get to this step, but it does not > seem fundamentally different from normal fieldtrip stats.* > > ***** > > In case my notes were not clear or you skipped to the bottom, *my > primary concern is whether the error I'm getting in TEgroup_calculate is a > pipeline issue* (I noticed the example pipeline in trentool, the manual, > and published methods articles all seem to have slightly or significantly > different pipeline compositions), *or if the error is* due to ACT, > ragwitz optimization, or some other faulty parameterization *on my part > due to a lack of understanding of how transfer entropy works on a more > theoretical/mathematical level*. If the latter is the case, is there any > relatively straightforward way to conceptualize this, or is this something > where I'm just going to have to keep reading and rereading until it > eventually makes sense? I've already done quite a bit of that and it hasn't > pierced my thick skull yet but I'm sure it will eventually! > > Thank you so much, > > Max Cantor > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patricia.Wollstadt at gmx.de Tue Sep 9 15:51:33 2014 From: Patricia.Wollstadt at gmx.de (Patricia Wollstadt) Date: Tue, 09 Sep 2014 15:51:33 +0200 Subject: [FieldTrip] TRENTOOL pipeline help In-Reply-To: References: <540EEF94.9080601@gmx.de> Message-ID: <540F05E5.1000109@gmx.de> I'm glad that cleared things up a little. Sorry about the confusion, we will try to include warnings for deprecated function in the next release of TRENTOOL. You don't need to run TEprepare before running TEgroup_prepare. You just run the four functions - TEgroup_prepare - InteractionDelayReconstruction_calculate - InteractionDelayReconstruction_analyze - TEgroup_stats in that order. The graph analysis is an optional step that can be run on the individual outputs of InteractionDelayReconstruction_analyze. The function will partially correct the output for multivariate effects. Since you are looking at one connection only, you don't need to include the graph analysis step into your pipeline. (I also sent you an example script directly, because I think it is not a good idea to send attachments via the mailing list.) Best, Patricia On 09/09/2014 03:19 PM, Max Cantor wrote: > This is immensely helpful, thank you. I was very confused about why > some versions of the pipeline I saw were using group calculate and > others were using interaction delay reconstruction and what that > meant, and I think I have a more clear idea of what the different > steps of the pipeline are doing. There are still a few things I'm a > bit confused about though in terms of the pipeline. For instance, > whether or not I need to do TEprepare before group prepare, and if I > need to do graph analysis (which I'm not sure I fully understand but > also haven't looked deeply into) before group stats. > > If you don't mind me taking you up on your offer, I think seeing your > example script might help clarify some of these issues. > > Thank you! > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt > > wrote: > > Hello Max, > > I added a few comments to the questions regarding individual > parameters below. To address the general problem of TRENTOOL > telling you, that there are not enough sample points in your data: > From what I can see in your script, you probably don't have enough > data points in each time series to robustly estimate TE. You > analyze 800 ms of data sampled at 300 Hz, which gives you 240 > samples per time series. Can you maybe avoid downsampling to 300 > Hz and downsample to 600 Hz instead? Or could you analyze a longer > time window of interest? > Note that you also 'lose' data to embedding and the interaction > delay: The first point that can be used for TE estimation is at > max. embedding length + max. interaction delay in samples. For > example: max. embedding length = dim * tau_factor * ACT = 10 * 0.4 > * 5 = 20 samples plus the max interaction delay of 30 ms = 9 > samples. In this example, you would be left with 240 - 29 samples > for TE estimation per trial. There is also the possibility to > estimate time resolved TE/TE for shorter time windows of interest > (see section 4.4 in the manual); however, this method requires the > use of a GPU for TE estimation. > > I would further recommend to use the new pipeline for group > statistics described in the manual in section 4.5 (the function > 'TEgroup_calculate' is deprecated). The new pipeline allows you to > reconstruct the interaction delay and uses the following functions > (see also comments in the script): > > TEgroup_prepare -> prepares all data sets (all subjects/all > conditions) for group analysis (this means finding common > embedding parameters such that estimates are not biased between > groups) > InteractionDelayReconstruction_calculate -> estimates TE for > individual data sets and all assumed interaction delays u > InteractionDelayReconstruction_analyze -> reconstructs the > interaction delay by selecting the u that maximizes TE for each > channel > TEgroup_stats -> calculate group statistics using a > permutation test > > I can send you an example script for group TE analysis using this > pipeline to get you started. I hope this helps you to get the > group analysis running. Just write again if you're having trouble > setting up the pipeline or something is not clear about the > parameters/my comments. > > Best, > Patricia > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: >> Hi fieldtrippers, >> >> I know trentool is not produced by the Donders Institute, so I'm >> not 100% sure if it is appropriate to ask questions about it >> here, but to the best of my knowledge they do not have a mailing >> list and I saw a few trentool questions in the archives, so I'm >> going to assume it's ok... >> >> In any case, below is my current pipeline (slightly modified for >> comprehensibility): >> >> (notes in bold are comments/questions made in this email, not >> present in the pipeline. Sorry in advance for the long post! Any >> help would be greatly appreciated as I'm a bit over my head on >> this but I think I'm close!) >> >> ***** >> >> % Prepare group TE data >> >> cfgP = []; >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> cfgP.TEcalctype = 'VW_ds'; >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> *I'm trying to find the transfer entropy between the left and >> right auditory cortices in my experiment. The input is virtual >> sensor data that was produced using SAM in fieldtrip on real MEG >> data. * >> >> % specify u to be scanned >> >> cfgP.predicttime_u = 30; >> cfgP.toi = [-0.4 0.4]; >> >> *For clarification, the predicttime_u is in seconds but the toi >> is in milliseconds. If I understand correctly, the predicttime_u >> must fit within the toi, but beyond that are there any benefits >> to it being earlier or later?* PW: The predictiontime_u is in >> milliseconds and the toi is in seconds. The prediction time is >> the assumed interaction delay between your two sources and should >> fit within your toi. In general it is preferable to use the >> method for interaction delay reconstruction for TE estimation, >> because it allows you to reconstruct the actual delay between >> your source and target times series. A non-optimal u/interaction >> delay may cause an underestimation of TE, so it is recommended to >> use the pipeline for interaction delay reconstruction whenever >> estimating TE for unknown delays. >> If you use the methods for interaction delay reconstruction >> 'predicttime_u' is replaced by >> cfgTEP.predicttimemin_u % minimum u to be scanned >> cfgTEP.predicttimemax_u % maximum u to be scanned >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> A large range for u values to be scanned increases computing time >> a lot, so it is best to limit the u range to values that are >> physiologically plausible. >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> cfgP.maxlag = 150; >> cfgP.actthrvalue = 7.5; >> cfgP.minnrtrials = 5; >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> since the data are downsampled to 300hz, it should be 150. I know >> that the sample rate and filters are used to determine the >> actthrvalue, but I don't actually know the calculation. 7.5 was a >> rough guess just to test the pipeline. I'm also uncertain of what >> minnrtrials should be.* PW: You can set the actthrvalue based on >> the filtering you did prior to TE analysis. If you for example >> highpass filtered at 10 Hz, you shouldn't find an ACT higher than >> 30 samples, because you filtered out any components of the signal >> slower than 10 Hz/30 samples (given your sampling frequency of >> 300 Hz). So in this scenario the actthrvalue would be 30. >> A good value for cfgP.minnrtrials is 12 (a minimum number of >> trials is needed to realize the permutation test for estimated >> TE values). >> >> % Optimization >> >> cfgP.optimizemethod = 'ragwitz'; >> cfgP.ragdim = 4:8; >> cfgP.ragtaurange = [0.2 0.4]; >> cfgP.ragtausteps = 15; >> cfgP.repPred = 100; >> * >> * >> *I am completely at a loss for this. I've done some reading into >> transfer entropy, mutual information, etc., cited in trentool, >> but I'm yet to understand how exactly this optimization works and >> what the configuration should be, given my data and experimental >> intentions.* PW: The Ragwitz criterion tries to find optimal >> embedding parameters dim and tau for the data. To do that, the >> method iteratively takes all possible combinations of dim and tau >> values that are provided in cfgP.ragdim and >> cfgP.ragtaurange/.ragtausteps and tests how well these >> combinations embed the data. To test an embedding, the method >> builds the embedding vectors from the data; it then tests for >> each point how well the next point in time can be predicted from >> the reference point's nearest neighbours. So for each embedded >> point, the method searches for the nearest neighbours and >> calculates the average of those nearest neighbours. The >> difference between the averaged/predicted point and the actual >> next point is the error of the local predictor. The Ragwitz >> criterion will then return the parameter combination for which >> this error over all points is minimal. >> The parameters set the following: 'ragdim' are dimensions to be >> tested by the method (I would reccomend to start with 2:10), >> 'ragtaurange' together with 'ragtausteps' specifies the tau >> values to be tested (TRENTOOL will build a vector from 0.2 to 0.4 >> in 15 steps). Note, that the values here are factors that are >> later multiplied with the ACT to obtain the actual tau. 'repPred' >> is the number of points that will be used for the local >> prediction, i.e. the Ragwitz criterion will test the local >> prediction and calculate the error for the first 100 points in >> your time series. The two parameters 'flagNei' ans 'sizeNei' >> below specify the type of neighbour search conducted by the >> Ragwitz criterion: 'flagNei' tells the method to either conduct a >> kNN or range search; 'sizeNei' specifies the number of neighbours >> or the radius to be searched by a range search. >> >> >> % Kernel-based TE estimation >> >> cfgP.flagNei = 'Mass'; >> cfgP.sizeNei = 4; % Default >> >> cfgP.ensemblemethod = 'no'; >> cfgP.outputpath = *OUTPUT PATH*; >> >> if ~exist(*Path for TEprepare data object*) >> load VSdat; >> TE_Wrd = {}; >> for i = 1:nConds >> for j = 1:Nsub >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> end >> end >> clear VSdat; >> save('TE_Wrd', 'TE_Wrd'); >> end >> * >> * >> *The configuration and virtual sensor data, organized in a 3 x 15 >> cell of structures (condition by subject) are the input. The >> TEprepare substructure is added to each individual condition x >> subject .mat files' data structure which are stored on disk >> independently.* >> >> % Use object_to_mat_conversion.m to replace individual condition >> x subject virtual sensor data >> % .mat files with their TE_Wrd equivalent >> * >> * >> *I'm using a separate script to make some manipulations to the >> objects from disk; this will all eventually be integrated into >> the main pipeline*.*TRENTOOL seems to handle data output very >> differently from fieldtrip and I've had trouble thinking through >> the most logical way to handle the data so it's a bit haphazard >> right now.* >> >> load cond080sub01.mat >> >> cfgG = []; >> cfgG.dim = cond080sub01.TEprepare.optdim; >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> if isfield(cond080sub01, 'TEprepare') >> TEgroup_prepare(cfgG, fileCell); >> else >> error('Need to run TEprepare before TEgroup_prepare'); >> end >> * >> * >> *For clarification, fileCell is a cell with the name of each >> condition x subject .mat file, which as I said before is >> collectively the same as the 3 x 15 VSdat structure (condition x >> subject).* >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> % object_to_mat_conversion.m >> >> % TE Group Calculate >> >> load cond080sub01.mat >> if isfield(cond080sub01, 'TEgroupprepare') >> for i = 1:length(fileCell) >> TEgroup_calculate(fileCell{i}); >> end >> else >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> end >> * >> * >> *At this step I get the following error: >> >> Error using transferentropy (line 337) >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in TEgroup_calculate (line 133) >> [TEresult] = transferentropy(cfg,data);* >> >> % TE Group Stats >> >> cfgGSTAT = []; >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> cfgGSTAT.uvar = 1; >> cfgGSTAT.ivar = 2; >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> *Given the error above, I am yet to get to this step, but it does >> not seem fundamentally different from normal fieldtrip stats.* >> >> ***** >> >> In case my notes were not clear or you skipped to the bottom, *my >> primary concern is whether the error I'm getting in >> TEgroup_calculate is a pipeline issue* (I noticed the example >> pipeline in trentool, the manual, and published methods articles >> all seem to have slightly or significantly different pipeline >> compositions), *or if the error is* due to ACT, ragwitz >> optimization, or some other faulty parameterization *on my part >> due to a lack of understanding of how transfer entropy works on a >> more theoretical/mathematical level*. If the latter is the case, >> is there any relatively straightforward way to conceptualize >> this, or is this something where I'm just going to have to keep >> reading and rereading until it eventually makes sense? I've >> already done quite a bit of that and it hasn't pierced my thick >> skull yet but I'm sure it will eventually! >> >> Thank you so much, >> >> Max Cantor >> >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> >> _______________________________________________ >> 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 > > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > > _______________________________________________ > 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 mcantor at umich.edu Tue Sep 9 16:39:18 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 9 Sep 2014 10:39:18 -0400 Subject: [FieldTrip] TRENTOOL pipeline help In-Reply-To: <540F05E5.1000109@gmx.de> References: <540EEF94.9080601@gmx.de> <540F05E5.1000109@gmx.de> Message-ID: Looking at the sample script, it should be reasonably straightforward for me to adapt my pipeline, and between the ragwitz tutorial and your notes I should be able to develop a better understanding of what the pipeline is doing in a more sophisticated way. Again, thank you so much! I will try to incorporate this new information as soon as possible, and if I have any other issues I'll follow up, but hopefully this should solve most of my problems. On Tue, Sep 9, 2014 at 9:51 AM, Patricia Wollstadt < Patricia.Wollstadt at gmx.de> wrote: > I'm glad that cleared things up a little. Sorry about the confusion, we > will try to include warnings for deprecated function in the next release of > TRENTOOL. > > You don't need to run TEprepare before running TEgroup_prepare. You just > run the four functions > - TEgroup_prepare > - InteractionDelayReconstruction_calculate > - InteractionDelayReconstruction_analyze > - TEgroup_stats > in that order. > > The graph analysis is an optional step that can be run on the individual > outputs of InteractionDelayReconstruction_analyze. The function will > partially correct the output for multivariate effects. Since you are > looking at one connection only, you don't need to include the graph > analysis step into your pipeline. (I also sent you an example script > directly, because I think it is not a good idea to send attachments via the > mailing list.) > > Best, Patricia > > > > > On 09/09/2014 03:19 PM, Max Cantor wrote: > > This is immensely helpful, thank you. I was very confused about why some > versions of the pipeline I saw were using group calculate and others were > using interaction delay reconstruction and what that meant, and I think I > have a more clear idea of what the different steps of the pipeline are > doing. There are still a few things I'm a bit confused about though in > terms of the pipeline. For instance, whether or not I need to do TEprepare > before group prepare, and if I need to do graph analysis (which I'm not > sure I fully understand but also haven't looked deeply into) before group > stats. > > If you don't mind me taking you up on your offer, I think seeing your > example script might help clarify some of these issues. > > Thank you! > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > Patricia.Wollstadt at gmx.de> wrote: > >> Hello Max, >> >> I added a few comments to the questions regarding individual parameters >> below. To address the general problem of TRENTOOL telling you, that there >> are not enough sample points in your data: From what I can see in your >> script, you probably don't have enough data points in each time series to >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, which >> gives you 240 samples per time series. Can you maybe avoid downsampling to >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a longer time >> window of interest? >> Note that you also 'lose' data to embedding and the interaction delay: >> The first point that can be used for TE estimation is at max. embedding >> length + max. interaction delay in samples. For example: max. embedding >> length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >> interaction delay of 30 ms = 9 samples. In this example, you would be left >> with 240 - 29 samples for TE estimation per trial. There is also the >> possibility to estimate time resolved TE/TE for shorter time windows of >> interest (see section 4.4 in the manual); however, this method requires the >> use of a GPU for TE estimation. >> >> I would further recommend to use the new pipeline for group statistics >> described in the manual in section 4.5 (the function 'TEgroup_calculate' is >> deprecated). The new pipeline allows you to reconstruct the interaction >> delay and uses the following functions (see also comments in the script): >> >> TEgroup_prepare -> prepares all data sets (all subjects/all >> conditions) for group analysis (this means finding common embedding >> parameters such that estimates are not biased between groups) >> InteractionDelayReconstruction_calculate -> estimates TE for >> individual data sets and all assumed interaction delays u >> InteractionDelayReconstruction_analyze -> reconstructs the >> interaction delay by selecting the u that maximizes TE for each channel >> TEgroup_stats -> calculate group statistics using a permutation >> test >> >> I can send you an example script for group TE analysis using this >> pipeline to get you started. I hope this helps you to get the group >> analysis running. Just write again if you're having trouble setting up the >> pipeline or something is not clear about the parameters/my comments. >> >> Best, >> Patricia >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> I know trentool is not produced by the Donders Institute, so I'm not >> 100% sure if it is appropriate to ask questions about it here, but to the >> best of my knowledge they do not have a mailing list and I saw a few >> trentool questions in the archives, so I'm going to assume it's ok... >> >> In any case, below is my current pipeline (slightly modified for >> comprehensibility): >> >> (notes in bold are comments/questions made in this email, not present in >> the pipeline. Sorry in advance for the long post! Any help would be greatly >> appreciated as I'm a bit over my head on this but I think I'm close!) >> >> ***** >> >> % Prepare group TE data >> >> cfgP = []; >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> cfgP.TEcalctype = 'VW_ds'; >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> *I'm trying to find the transfer entropy between the left and right >> auditory cortices in my experiment. The input is virtual sensor data that >> was produced using SAM in fieldtrip on real MEG data. * >> >> % specify u to be scanned >> >> cfgP.predicttime_u = 30; >> cfgP.toi = [-0.4 0.4]; >> >> *For clarification, the predicttime_u is in seconds but the toi is in >> milliseconds. If I understand correctly, the predicttime_u must fit within >> the toi, but beyond that are there any benefits to it being earlier or >> later?* PW: The predictiontime_u is in milliseconds and the toi is in >> seconds. The prediction time is the assumed interaction delay between your >> two sources and should fit within your toi. In general it is preferable to >> use the method for interaction delay reconstruction for TE estimation, >> because it allows you to reconstruct the actual delay between your source >> and target times series. A non-optimal u/interaction delay may cause an >> underestimation of TE, so it is recommended to use the pipeline for >> interaction delay reconstruction whenever estimating TE for unknown delays. >> If you use the methods for interaction delay reconstruction >> 'predicttime_u' is replaced by >> cfgTEP.predicttimemin_u % minimum u to be scanned >> cfgTEP.predicttimemax_u % maximum u to be scanned >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> A large range for u values to be scanned increases computing time a lot, >> so it is best to limit the u range to values that are physiologically >> plausible. >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> cfgP.maxlag = 150; >> cfgP.actthrvalue = 7.5; >> cfgP.minnrtrials = 5; >> >> *My understanding is maxlag should be 1/2 the sampling rate, so since >> the data are downsampled to 300hz, it should be 150. I know that the sample >> rate and filters are used to determine the actthrvalue, but I don't >> actually know the calculation. 7.5 was a rough guess just to test the >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: You can >> set the actthrvalue based on the filtering you did prior to TE analysis. If >> you for example highpass filtered at 10 Hz, you shouldn't find an ACT >> higher than 30 samples, because you filtered out any components of the >> signal slower than 10 Hz/30 samples (given your sampling frequency of 300 >> Hz). So in this scenario the actthrvalue would be 30. >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials is >> needed to realize the permutation test for estimated TE values). >> >> >> % Optimization >> >> cfgP.optimizemethod = 'ragwitz'; >> cfgP.ragdim = 4:8; >> cfgP.ragtaurange = [0.2 0.4]; >> cfgP.ragtausteps = 15; >> cfgP.repPred = 100; >> >> *I am completely at a loss for this. I've done some reading into >> transfer entropy, mutual information, etc., cited in trentool, but I'm yet >> to understand how exactly this optimization works and what the >> configuration should be, given my data and experimental intentions.* PW: >> The Ragwitz criterion tries to find optimal embedding parameters dim and >> tau for the data. To do that, the method iteratively takes all possible >> combinations of dim and tau values that are provided in cfgP.ragdim and >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations embed >> the data. To test an embedding, the method builds the embedding vectors >> from the data; it then tests for each point how well the next point in time >> can be predicted from the reference point's nearest neighbours. So for each >> embedded point, the method searches for the nearest neighbours and >> calculates the average of those nearest neighbours. The difference between >> the averaged/predicted point and the actual next point is the error of the >> local predictor. The Ragwitz criterion will then return the parameter >> combination for which this error over all points is minimal. >> The parameters set the following: 'ragdim' are dimensions to be tested by >> the method (I would reccomend to start with 2:10), 'ragtaurange' together >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL will >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values here are >> factors that are later multiplied with the ACT to obtain the actual tau. >> 'repPred' is the number of points that will be used for the local >> prediction, i.e. the Ragwitz criterion will test the local prediction and >> calculate the error for the first 100 points in your time series. The two >> parameters 'flagNei' ans 'sizeNei' below specify the type of neighbour >> search conducted by the Ragwitz criterion: 'flagNei' tells the method to >> either conduct a kNN or range search; 'sizeNei' specifies the number of >> neighbours or the radius to be searched by a range search. >> >> >> % Kernel-based TE estimation >> >> cfgP.flagNei = 'Mass'; >> cfgP.sizeNei = 4; % Default >> >> cfgP.ensemblemethod = 'no'; >> cfgP.outputpath = *OUTPUT PATH*; >> >> if ~exist(*Path for TEprepare data object*) >> load VSdat; >> TE_Wrd = {}; >> for i = 1:nConds >> for j = 1:Nsub >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> end >> end >> clear VSdat; >> save('TE_Wrd', 'TE_Wrd'); >> end >> >> *The configuration and virtual sensor data, organized in a 3 x 15 cell >> of structures (condition by subject) are the input. The TEprepare >> substructure is added to each individual condition x subject .mat files' >> data structure which are stored on disk independently.* >> >> % Use object_to_mat_conversion.m to replace individual condition x >> subject virtual sensor data >> % .mat files with their TE_Wrd equivalent >> >> *I'm using a separate script to make some manipulations to the objects >> from disk; this will all eventually be integrated into the main pipeline* >> .* TRENTOOL seems to handle data output very differently from fieldtrip >> and I've had trouble thinking through the most logical way to handle the >> data so it's a bit haphazard right now.* >> >> load cond080sub01.mat >> >> cfgG = []; >> cfgG.dim = cond080sub01.TEprepare.optdim; >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> if isfield(cond080sub01, 'TEprepare') >> TEgroup_prepare(cfgG, fileCell); >> else >> error('Need to run TEprepare before TEgroup_prepare'); >> end >> >> *For clarification, fileCell is a cell with the name of each condition >> x subject .mat file, which as I said before is collectively the same as the >> 3 x 15 VSdat structure (condition x subject).* >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> % object_to_mat_conversion.m >> >> % TE Group Calculate >> >> load cond080sub01.mat >> if isfield(cond080sub01, 'TEgroupprepare') >> for i = 1:length(fileCell) >> TEgroup_calculate(fileCell{i}); >> end >> else >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> end >> >> >> >> >> >> >> >> *At this step I get the following error: Error using transferentropy >> (line 337) \nTRENTOOL ERROR: not enough data points left after embedding >> Error in TEgroup_calculate (line 133) [TEresult] = >> transferentropy(cfg,data);* >> >> % TE Group Stats >> >> cfgGSTAT = []; >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> cfgGSTAT.uvar = 1; >> cfgGSTAT.ivar = 2; >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> *Given the error above, I am yet to get to this step, but it does not >> seem fundamentally different from normal fieldtrip stats.* >> >> ***** >> >> In case my notes were not clear or you skipped to the bottom, *my >> primary concern is whether the error I'm getting in TEgroup_calculate is a >> pipeline issue* (I noticed the example pipeline in trentool, the manual, >> and published methods articles all seem to have slightly or significantly >> different pipeline compositions), *or if the error is* due to ACT, >> ragwitz optimization, or some other faulty parameterization *on my part >> due to a lack of understanding of how transfer entropy works on a more >> theoretical/mathematical level*. If the latter is the case, is there any >> relatively straightforward way to conceptualize this, or is this something >> where I'm just going to have to keep reading and rereading until it >> eventually makes sense? I've already done quite a bit of that and it hasn't >> pierced my thick skull yet but I'm sure it will eventually! >> >> Thank you so much, >> >> Max Cantor >> >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> >> _______________________________________________ >> fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 >> > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From cas243 at georgetown.edu Tue Sep 9 21:25:21 2014 From: cas243 at georgetown.edu (Clara A. Scholl) Date: Tue, 9 Sep 2014 15:25:21 -0400 Subject: [FieldTrip] data.sampleinfo when preprocessing was completed in EEGLAB Message-ID: Dear FieldTrip Community, I did preprocessing in EEGLAB and imported into FieldTrip using eeglab2fieldtrip (from EEGLAB version 13.3.2b). The resulting FieldTrip data structures do not have the data field "sampleinfo" to specify the position of each trial relative to the actual recording. As a result of this, I get the warning "reconstructing sampleinfo by assuming that the trials are consecutive segments of a continuous recording" when calling the functions ft_timelockanalysis and ft_mvaranalysis. My questions are twofold: 1) when can I ignore this warning? 2) has anyone imported the sampleinfo into FieldTrip from an EEGLAB EEG structure? Any guidance on the best way to do this? Thanks immensely for feedback! Respectfully, Clara -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Sep 10 10:49:58 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 10 Sep 2014 10:49:58 +0200 Subject: [FieldTrip] data.sampleinfo when preprocessing was completed in EEGLAB In-Reply-To: References: Message-ID: Dear Clara, 1) Some FT functions require a sampleinfo for their inner workings, so they reconstruct it in a simple way if it is not present. You can safely ignore this warning if you are not doing anything with sample indices yourself. Specifically, the FT artifact and event functions use sample indices (i.e. return segments of artifacts/events in terms of samples relative to the original recording), if you are not using these you are probably safe. 2) Not me ;) Best, Eelke On 9 September 2014 21:25, Clara A. Scholl wrote: > Dear FieldTrip Community, > > I did preprocessing in EEGLAB and imported into FieldTrip using > eeglab2fieldtrip (from EEGLAB version 13.3.2b). The resulting FieldTrip > data structures do not have the data field "sampleinfo" to specify the > position of each trial relative to the actual recording. As a result of > this, I get the warning "reconstructing sampleinfo by assuming that the > trials are consecutive segments of a continuous recording" when calling the > functions ft_timelockanalysis and ft_mvaranalysis. > > My questions are twofold: > > 1) when can I ignore this warning? > 2) has anyone imported the sampleinfo into FieldTrip from an EEGLAB EEG > structure? Any guidance on the best way to do this? > > Thanks immensely for feedback! > Respectfully, > Clara > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From barbara.schorr at uni-ulm.de Wed Sep 10 14:07:14 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Wed, 10 Sep 2014 14:07:14 +0200 Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' In-Reply-To: References: Message-ID: <20140910140714.9n2t9bxs008o400c@imap.uni-ulm.de> Dear fieldtripers. as mentioned in the subject line I would like to anaylse my timelocked ERP Data with the function ft_globalmeanfield. I get the Error: Undefined function or variable 'abort' Error in ft_globalmeanfield (line84) if abort in the function it says: %the abort variable is set to true or false in ft_preamble_inti if abort % do not continue function execution in case the outputfile is present and the user indicated to keep it return end I don't understand what this means. I would really appreciate your help to get this running. Also, what is the result when I run this function on my data? (This method was proposed from a reviewer. I never used it before, so I don't exactly know what it does and what the result will look like). Thank you very much in advance! Best, Barbara Schorr Zitat von 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: Question regarding nonparametric testing for coherence > differences (Eric Maris) > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) > 4. Re: ft_rejectvisual: removing trials marked as bad > (Caspar, Emilie) > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) > 6. Latest FT version on ftp-server is from three days ago > (Holger Krause) > 7. Re: TRENTOOL pipeline help (Max Cantor) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) > From: "Eric Maris" > To: , "'FieldTrip discussion list'" > > Subject: Re: [FieldTrip] Question regarding nonparametric testing for > coherence differences > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Dear Hwee Ling, > > > > In the paper you refer to (Maris et al, JNM, 2007), I did not perform a > cluster-based permutation test at the level of the channel pairs. Instead, > all coherences mentioned in the paper are coherence between a single EMG > channel (2 electrodes mounted on the forearm) and all MEG electrodes. Thus, > there are as many EMG-MEG coherences as there are MEG channels (275 in our > lab), and the clustering of these coherences involves the same neighbourhood > structure as the clustering of channel-specific statistics on power or > evoked response. The analysis you propose involves clustering in a much more > complex space, namely the formed by all (MEG,MEG) channel pairs > (275*275=75625 pairs). In the early days of cluster-based permutation > statistics, I have worked on this problem but did not pursue it because the > resulting clusters are very hard to interpret. > > > > Best, > > > > Eric Maris > > > > > > Dear all and Prof Maris, > > I'm re-posting this question again, as I didn't get any replies previously. > > I?m interested to investigate if there are any differences in phase > synchronization in resting state data at timepoint 2 versus timepoint 1. The > EEG data was collected using 64 EEG channels, resting state, eyes opened and > eyes closed. I?ve arbitrarily segmented the resting state data into epochs > of 2s each, and the epochs with artifacts are excluded completely from > further analyses. I then performed mtmfft to get the fourier representation > of the data, extracted the coherence, and compared the coherence difference > of timepoint 2 versus timepoint 1 of all channels paired with all other > channels. > > I figured that if I extract the connectivity analyses without specifying the > channelcmb, I get a 'chan_chan_freq' dimord variable that would allow me to > perform cluster-based statistical analyses. I get an output with ?chan_chan? > dimord variable. However, I was not 100% sure that this is correct, > hence, I?ve > inserted my code (see below). It?ll be great if you could tell me if what I?m > doing makes any sense at all. Also, I don?t know how I can plot the results > to see if it make any sense at all. > > Also, I checked the values obtained from when I specified "cfg.channelcmb" > and when I did not specify "cfg.channelcmb", I noticed that the values were > somehow different. I would assume that the values to be similar, although > I'm not sure why they would have differences in the values obtained from > specifying "cfg.channelcmb". > > This is my code that I've used thus far: > > for sub = 1:5 > > cfg = []; > > cfg.output = 'fourier'; > > cfg.channel = {'all'}; > > cfg.method = 'mtmfft'; > > cfg.keeptrials = 'yes'; > > cfg.tapsmofrq = 5; > > cfg.foilim = [0 100]; > > cfg.taper = 'dpss'; > > % find the index for the c200 condition > > pre_c200_idx = find(data5.trialinfo == 201); > > cfg.trials = pre_c200_idx; > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > post_c200_idx = find(data5.trialinfo == 200); > > cfg.trials = post_c200_idx; > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > cfg = []; > > cfg.keeptrials = 'no'; > > cfg.channel = {'all'}; > > cfg.removemean = 'yes'; > > cfg.method = 'coh'; > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_pre_c200); > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > HLF_post_c200); > > end > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); > > cfg_neighb.method = 'template'; > > cfg_neighb.layout = lay; > > cfg_neighb.channel = 'all'; > > neighbours = ft_prepare_neighbours(cfg_neighb, sub_HLF_pre_c200coh{1}); > > > > cfg = []; > > cfg.layout = lay; > > cfg.neighbours = neighbours; > > cfg.channel = 'all'; > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > cfg.latency = 'all'; > > cfg.avgovertime = 'no'; > > cfg.avgoverchan = 'no'; > > cfg.parameter = 'cohspctrm'; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'depsamplesT'; > > cfg.correctm = 'cluster'; > > cfg.tail = 0; > > % cfg.clustertail = 0; > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 frequency > bands. > > cfg.numrandomization = 10000; > > cfg.ivar = 2; > > cfg.uvar = 1; > > > > % design matrices > > clear design; > > design(1,:) = [1:5, 1:5]; > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > cfg.design = design; > > % for theta band > > cfg.avgoverfreq = 'yes'; > > cfg.frequency = [4 8]; % I also performed the statistics for delta (2-4), > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma (30-40), > and gamma (40-100). > > [diffc200_theta_stat] = ft_freqstatistics(cfg, sub_HLF_post_c200coh{:}, > sub_HLF_pre_c200coh{:}); > > > > When I tried to plot the results, I used this code: > > cfg = []; > > cfg.channel = 'all'; > > cfg.layout = 'lay'; > > cfg.zlim = [-1 1]; > > cfg.alpha = 0.05; > > cfg.refchannel = 'all'; > > ft_clusterplot(cfg, diffc200_theta_stat); > > However, I was not sure how I could plot the results. I get an error message > from Fieldtrip when using ft_clusterplot: > > Error using topoplot_common (line 366) > > no reference channel is specified > > Error in ft_topoplotTFR (line 192) > > [cfg] = topoplot_common(cfg, varargin{:}); > > Error in ft_clusterplot (line 372) > > ft_topoplotTFR(cfgtopo, stat); > > > > According to your paper in 2007, the topoplot of the results were masked by > the spatio-spectral pattern of the significant clusters. I don't know how to > do this, and I would really appreciate if you can show me how to make such a > plot. > > Thank you very much. > > Kind regards, > > Hweeling > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 2 > Date: Mon, 8 Sep 2014 21:38:01 +0200 > From: KatrinH Heimann > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Joseph, thanks so much, I really appreciate your help. I was also > wandering, if maybe there is another bug in my code. > Our nets are 128 channels, Hydrocel, but as a colleague of me adviced me to > do so, I also tried the 129 layout. > My code you find below (without selection of bad channels etc.) > If you need also the data of two subjects to have a look, let me know!!! > Best and thanks really! > Katrin > > > subject=input('Which subject do you want to analyse? ','s'); > > name = strcat(subject,'.raw'); > > subjectnumber=input('Which is the subjectnumber?', 's'); > > sb=subjectnumber > > %subjectnumber = strcat(subjectnumber, '.txt') > > %% > > > cfg = []; > > cfg.dataset = name; > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus trigger > > cfg.trialdef.prestim = 0.234; % in seconds > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > observation, but maybe we need less) > > cfg = ft_definetrial(cfg); > > > cfg.trl([1:7],:) = []; > > > %change timeline according to constant offset of 16 ms = 8 samples (because > recorded with 500 hz)in > > %structure trial > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > %change timeline to make the cut the zeropoint > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > %% preprocess data > > cfg.channel = 'all'; > > cfg.preproc.detrend = 'yes'; > > cfg.preproc.demean = 'yes'; > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already filtered > > %(0.1-45) and bad channels have to be replaced!!!! > > %cfg.preproc.bpfreq = [6 32]; > > % > > % > > obs_data = ft_preprocessing(cfg); > > % > > save (strcat(sb,'obs_data') , 'obs_data') > > > %% determining channel neighbours (necessary for Artifact detection) > > cfg = []; > > cfg.channel = obs_data.label; > > cfg.layout = 'GSN128.sfp'; > > cfg.feedback = 'yes'; > > lay = ft_prepare_layout(cfg); > > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = 'GSN128.sfp'; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > %% Preparing neighbours for channel repair - but bad channel info in!!! > > > % cfg_neighb = []; > > % cfg_neighb.feedback = 'yes'; > > % cfg_neighb.method = 'triangulation'; > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > % Interpolate and put into new data structure > > cfg = []; > > cfg.badchannel = {}; > > cfg.layout = 'GSN128.sfp'; > > cfg.method = 'nearest'; > > cfg.neighbours = neighbours; > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > % Check reconstruction > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > % dat1=obs_data; > > % dat2=obs_data_channelrepaired; > > % > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > % y=dat2.trial{1}(62,:); > > % plot(x);hold on;plot(y,'r'); > > % > > % x=dat1.trial{1}(72,:); > > % y=dat2.trial{1}(75,:); > > % figure; > > % plot(x);hold on;plot(y,'r') > > % > > % x=dat1.trial{1}(75,:); > > % y=dat2.trial{1}(75,:); > > % figure; > > % plot(x);hold on;plot(y,'r') > > %% artifact rejection/trial inspection - throw out electrode jumps etc. > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent according to > channels interpolated %% 128-number of interp. channels) > > > > cfg = []; > > cfg.channel = {'all'}; > > cfg.numcomponent = 128 > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > save (strcat(sb,'comp_all') , 'comp') > > > %% > > cfg = []; > > cfg.viewmode = 'component'; > > cfg.continuous = 'no'; > > cfg.plotlabels='some'; > > cfg.layout = 'GSN128.sfp'; > > ft_databrowser(cfg,comp); > > > %% poweranalysis components > > cfg = []; > > cfg.output = 'pow'; > > cfg.channel = 'all';%compute the power spectrum in all ICs > > cfg.method = 'mtmfft'; > > cfg.taper = 'hanning'; > > cfg.foi = 0:0.2:50; > > obs_freq = ft_freqanalysis(cfg, comp); > > > %And you can plot the spectra: > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > nsubplots = 16; > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain decimals, type > doc subplot > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > tot = Nfigs*nsubplots; > > > rptvect = 1:size(comp.topo,1); > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > for r=1:size(rptvect,1); > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 1]);%full > screen > > k=0; > > for j=1:size(rptvect,2); > > if~(rptvect(r,j)==0); > > k=k+1; > > cfg=[]; > > cfg.channel = rptvect(r,j); > > cfg.ylim =[0 500] > > cfg.xlim =[0 50] > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > end > > end > > end > > > %For the IC topos you'll follow the same logic as above but with: > > > figure > > cfg = []; > > cfg.component = [1:20]; % specify the component(s) that should be > plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > figure > > cfg = []; > > cfg.component = [21:40]; % specify the component(s) that should be > plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > figure > > cfg = []; > > cfg.component = [41:60]; % specify the component(s) that should be > plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > figure > > cfg = []; > > cfg.component = [61:80]; % specify the component(s) that should be > plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > > > > %% Seperate observation conditions > > > name1= strcat(num2str(sb),'_90.xls'); > > list1=xlsread (name1) > > > > > > name2= strcat(num2str(sb),'_180.xls'); > > list2=xlsread (name2) > > > > % > > > cfg = [] > > cfg.trials = [list1] > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > cfg = [] > > cfg.trials = [list2] > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > %%PIPELINE FOR obs90 > > > %% Decompose original data according to the components found before > > load (strcat(sb,'comp_all')) > > > cfg = []; > > cfg.numcomponent = 128; > > cfg.unmixing = comp.unmixing; > > cfg.topolabel = comp.topolabel; > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > %% Reject component > > cfg = []; > > cfg.component = []; > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > %% Artifacts - final detection > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > %cfg.artfctdef.reject = 'complete'; > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > % Save clean data > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > %% Rereferencing data > > cfg = []; > > > cfg.channel = 'all'; > > cfg.preproc.reref = 'yes'; > > cfg.preproc.refchannel = 'all'; > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > %% Snap out smaller pieces (the third second) > > > cfg = [] > > cfg.toilim = [0 1] > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > %% TIMELOCK ERP > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > %% plot it > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > %% PIPELINE FOR obs180 > > > > %% Decompose original data according to the components found before > > load (strcat(sb,'comp_all')) > > > cfg = []; > > cfg.numcomponent = 128 > > cfg.unmixing = comp.unmixing; > > cfg.topolabel = comp.topolabel; > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > %% Reject component > > cfg = []; > > cfg.component = []; > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, obs180_data); > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > %% Artifacts final 180 > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > %cfg.artfctdef.reject = 'complete'; > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > % Save clean data > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > %% Rereferencing data > > cfg = []; > > cfg.channel = 'all'; > > cfg.preproc.reref = 'yes'; > > cfg.preproc.refchannel = 'all'; > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > %% Snap out smaller pieces (the third second) > > > cfg = [] > > cfg.toilim = [0 1] > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > %% TIMELOCK ERP > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > %% plot 180 ERP > > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, obs180_data_ERP) > > > %% plot both ERPs > > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > cfg.showlabels = 'yes'; > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > %% plot difference wave > > > difference = obs180_data_ERP; % copy one of the > structures > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute the > difference ERP > > > > cfg = []; > > cfg.layout = lay; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, difference) > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > >> Hi, >> I?m one of the main Fieldtrip contributors working on supporting EGI >> data. A couple things. First of all, exactly which net do you use? If >> they are 129-channel, there is still the question of whether they are the >> Hydrocel or the older geodesic nets. Regardless, that shouldn't cause an >> error like this. Could you send me the file you are trying to process and >> the script you are using and I?ll try troubleshooting it. >> >> Joe >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >> diezmartini at gmail.com> wrote: >> >> Which nets do you use? I use EGI. I tried both the ones you mention and >> they didn't work. It was hard to find that exact one online but it was the >> only file that actually worked. >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> wrote: >> >>> Dear Ana, dear all, >>> the layout you used does not correspond to our nets. I tried the >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. >>> Please can anybody help? >>> Cheers >>> Katrin >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : >>> >>> Try this one >>>> I use >>>> >>>> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>>> katrinheimann at gmail.com> wrote: >>>> >>>>> Dear all, my problems seem neverending. This time however i really need >>>>> help. >>>>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>>>> preprocessing, channelreplacement, ica, componentrejection, final >>>>> artifactdetection, timelock of the single subject data. However, when I >>>>> wanna compute the grandaverage of the single subjects I get the following >>>>> error message: >>>>> >>>>> computing average of avg over 19 subjects >>>>> Warning: discarding electrode information because it cannot be averaged >>>>> > In ft_timelockgrandaverage at 249 >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>>>> additional allocation of an estimated 3 MB >>>>> computing average of avg over 2 subjects >>>>> Warning: discarding electrode information because it cannot be averaged >>>>> > In ft_timelockgrandaverage at 249 >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>>>> additional allocation of an estimated 0 MB >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >>>>> additional allocation of an estimated 0 MB >>>>> the call to "ft_topoplotER" took 0 seconds and required the additional >>>>> allocation of an estimated 0 MB >>>>> >>>>> Furthermore in the plot of the significant clusters, the channelnames >>>>> are mixed up (do not correspond to my net) >>>>> >>>>> >>>>> I guess that there is a problem with the layout I use. >>>>> Here the code that I use >>>>> >>>>> %For generating the layout (also in the single subjects): >>>>> >>>>> cfg = []; >>>>> >>>>> cfg.channel = obs_data.label; >>>>> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>>>> >>>>> cfg.feedback = 'yes'; >>>>> >>>>> lay = ft_prepare_layout(cfg); >>>>> >>>>> >>>>> cfg_neighb = []; >>>>> >>>>> cfg_neighb.feedback = 'yes'; >>>>> >>>>> cfg_neighb.method = 'triangulation'; >>>>> >>>>> cfg_neighb.layout = lay; >>>>> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>>>> >>>>> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>>>> >>>>> >>>>> %For computing the grand average >>>>> >>>>> cfg = []; >>>>> >>>>> cfg.channel = 'all'; >>>>> >>>>> cfg.latency = 'all'; >>>>> >>>>> cfg.parameter = 'avg'; >>>>> >>>>> cfg.keepindividual = 'no' >>>>> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>>>> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>>>> >>>>> % "{:}" means to use data from all elements of the variable >>>>> >>>>> >>>>> For plotting the significant clusters >>>>> >>>>> cfg = []; >>>>> >>>>> cfg.style = 'blank'; >>>>> >>>>> cfg.layout = lay; >>>>> >>>>> cfg.channellabels = 'yes'; >>>>> >>>>> cfg.highlight = 'labels'; >>>>> >>>>> cfg.highlightchannel = find(stat.mask); >>>>> >>>>> cfg.comment = 'no'; >>>>> >>>>> figure; ft_topoplotER(cfg, GA_90) >>>>> >>>>> title('Nonparametric: significant with cluster multiple comparison >>>>> correction') >>>>> >>>>> >>>>> Do you have ANY idea to this? I am really completely helpless.... >>>>> >>>>> thanks and best >>>>> >>>>> Katrin >>>>> >>>>> _______________________________________________ >>>>> 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 >>> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -------------------------------------------------------------------------------- >> >> Joseph Dien, PhD >> Research Associate >> Cognitive Neurology >> The Johns Hopkins University School of Medicine >> >> Lab E-mail: jdien1 at jhmi.edu >> Private E-mail: jdien07 at mac.com >> Office Phone: 410-614-3115 >> Cell Phone: 202-297-8117 >> Fax: 410-955-0188 >> http://joedien.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: > > > ------------------------------ > > Message: 3 > Date: Mon, 08 Sep 2014 21:55:44 -0400 > From: Joseph Dien > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> > Content-Type: text/plain; charset="windows-1252" > > yes, please do send me the data. > > Thanks! > > Joe > > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann wrote: > >> Dear Joseph, thanks so much, I really appreciate your help. I was >> also wandering, if maybe there is another bug in my code. >> Our nets are 128 channels, Hydrocel, but as a colleague of me >> adviced me to do so, I also tried the 129 layout. >> My code you find below (without selection of bad channels etc.) >> If you need also the data of two subjects to have a look, let me know!!! >> Best and thanks really! >> Katrin >> >> >> >> subject=input('Which subject do you want to analyse? ','s'); >> >> name = strcat(subject,'.raw'); >> >> subjectnumber=input('Which is the subjectnumber?', 's'); >> >> sb=subjectnumber >> >> %subjectnumber = strcat(subjectnumber, '.txt') >> >> %% >> >> >> >> cfg = []; >> >> cfg.dataset = name; >> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> >> cfg.trialdef.eventtype = 'trigger'; >> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus trigger >> >> cfg.trialdef.prestim = 0.234; % in seconds >> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> observation, but maybe we need less) >> >> cfg = ft_definetrial(cfg); >> >> >> >> cfg.trl([1:7],:) = []; >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> (because recorded with 500 hz)in >> >> %structure trial >> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >> >> >> >> %change timeline to make the cut the zeropoint >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> >> >> >> >> >> %% preprocess data >> >> cfg.channel = 'all'; >> >> cfg.preproc.detrend = 'yes'; >> >> cfg.preproc.demean = 'yes'; >> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already filtered >> >> %(0.1-45) and bad channels have to be replaced!!!! >> >> %cfg.preproc.bpfreq = [6 32]; >> >> % >> >> % >> >> obs_data = ft_preprocessing(cfg); >> >> % >> >> save (strcat(sb,'obs_data') , 'obs_data') >> >> >> >> %% determining channel neighbours (necessary for Artifact detection) >> >> cfg = []; >> >> cfg.channel = obs_data.label; >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.feedback = 'yes'; >> >> lay = ft_prepare_layout(cfg); >> >> >> cfg_neighb = []; >> >> cfg_neighb.feedback = 'yes'; >> >> >> >> cfg_neighb.method = 'triangulation'; >> >> cfg_neighb.layout = 'GSN128.sfp'; >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >> >> >> >> %% Artifacts - to detect bad channels - is not saved!!! >> >> >> >> >> >> cfg.method = 'summary'; >> >> cfg.latency=[0 1]; >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >> >> >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.latency=[0 1]; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs_data); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >> >> >> >> >> >> %% Preparing neighbours for channel repair - but bad channel info in!!! >> >> >> >> % cfg_neighb = []; >> >> % cfg_neighb.feedback = 'yes'; >> >> % cfg_neighb.method = 'triangulation'; >> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> % Interpolate and put into new data structure >> >> cfg = []; >> >> cfg.badchannel = {}; >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.method = 'nearest'; >> >> cfg.neighbours = neighbours; >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> >> % Check reconstruction >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> % dat1=obs_data; >> >> % dat2=obs_data_channelrepaired; >> >> % >> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> >> % y=dat2.trial{1}(62,:); >> >> % plot(x);hold on;plot(y,'r'); >> >> % >> >> % x=dat1.trial{1}(72,:); >> >> % y=dat2.trial{1}(75,:); >> >> % figure; >> >> % plot(x);hold on;plot(y,'r') >> >> % >> >> % x=dat1.trial{1}(75,:); >> >> % y=dat2.trial{1}(75,:); >> >> % figure; >> >> % plot(x);hold on;plot(y,'r') >> >> %% artifact rejection/trial inspection - throw out electrode jumps etc. >> >> >> >> >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> according to channels interpolated %% 128-number of interp. channels) >> >> >> cfg = []; >> >> cfg.channel = {'all'}; >> >> cfg.numcomponent = 128 >> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >> >> save (strcat(sb,'comp_all') , 'comp') >> >> >> >> %% >> >> cfg = []; >> >> cfg.viewmode = 'component'; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='some'; >> >> cfg.layout = 'GSN128.sfp'; >> >> ft_databrowser(cfg,comp); >> >> >> >> %% poweranalysis components >> >> cfg = []; >> >> cfg.output = 'pow'; >> >> cfg.channel = 'all';%compute the power spectrum in all ICs >> >> cfg.method = 'mtmfft'; >> >> cfg.taper = 'hanning'; >> >> cfg.foi = 0:0.2:50; >> >> obs_freq = ft_freqanalysis(cfg, comp); >> >> >> >> %And you can plot the spectra: >> >> >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> nsubplots = 16; >> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> decimals, type doc subplot >> >> >> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >> >> tot = Nfigs*nsubplots; >> >> >> >> rptvect = 1:size(comp.topo,1); >> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> >> >> >> for r=1:size(rptvect,1); >> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> 1]);%full screen >> >> k=0; >> >> for j=1:size(rptvect,2); >> >> if~(rptvect(r,j)==0); >> >> k=k+1; >> >> cfg=[]; >> >> cfg.channel = rptvect(r,j); >> >> cfg.ylim =[0 500] >> >> cfg.xlim =[0 50] >> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> >> end >> >> end >> >> end >> >> >> >> %For the IC topos you'll follow the same logic as above but with: >> >> >> >> figure >> >> cfg = []; >> >> cfg.component = [1:20]; % specify the component(s) that >> should be plotted >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.comment = 'no'; >> >> ft_topoplotIC(cfg, comp) >> >> >> >> figure >> >> cfg = []; >> >> cfg.component = [21:40]; % specify the component(s) that >> should be plotted >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.comment = 'no'; >> >> ft_topoplotIC(cfg, comp) >> >> >> >> figure >> >> cfg = []; >> >> cfg.component = [41:60]; % specify the component(s) that >> should be plotted >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.comment = 'no'; >> >> ft_topoplotIC(cfg, comp) >> >> >> >> figure >> >> cfg = []; >> >> cfg.component = [61:80]; % specify the component(s) that >> should be plotted >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.comment = 'no'; >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> >> >> >> >> %% Seperate observation conditions >> >> >> >> name1= strcat(num2str(sb),'_90.xls'); >> >> list1=xlsread (name1) >> >> >> >> name2= strcat(num2str(sb),'_180.xls'); >> >> list2=xlsread (name2) >> >> >> % >> >> >> >> cfg = [] >> >> cfg.trials = [list1] >> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> cfg = [] >> >> cfg.trials = [list2] >> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> %%PIPELINE FOR obs90 >> >> >> >> %% Decompose original data according to the components found before >> >> load (strcat(sb,'comp_all')) >> >> >> >> cfg = []; >> >> cfg.numcomponent = 128; >> >> cfg.unmixing = comp.unmixing; >> >> cfg.topolabel = comp.topolabel; >> >> >> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >> >> >> >> >> >> %% Reject component >> >> cfg = []; >> >> cfg.component = []; >> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); >> >> >> >> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> >> >> >> >> >> >> >> %% Artifacts - final detection >> >> >> >> >> >> cfg.method = 'summary'; >> >> cfg.latency=[0 1]; >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> >> >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.latency=[0 1]; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> >> >> >> >> >> % Save clean data >> >> >> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> >> >> >> >> >> %% Rereferencing data >> >> cfg = []; >> >> >> >> cfg.channel = 'all'; >> >> cfg.preproc.reref = 'yes'; >> >> cfg.preproc.refchannel = 'all'; >> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> >> >> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> >> %% Snap out smaller pieces (the third second) >> >> >> >> cfg = [] >> >> cfg.toilim = [0 1] >> >> >> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> >> >> >> %% TIMELOCK ERP >> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> >> >> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> >> >> >> %% plot it >> >> cfg = []; >> >> cfg.layout = lay ; >> >> cfg.interactive = 'yes'; >> >> ft_multiplotER(cfg, obs90_data_ERP) >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% PIPELINE FOR obs180 >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> load (strcat(sb,'comp_all')) >> >> >> >> cfg = []; >> >> cfg.numcomponent = 128 >> >> cfg.unmixing = comp.unmixing; >> >> cfg.topolabel = comp.topolabel; >> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >> >> >> >> >> >> %% Reject component >> >> cfg = []; >> >> cfg.component = []; >> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, obs180_data); >> >> >> >> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> >> >> >> >> >> >> >> %% Artifacts final 180 >> >> >> >> >> >> cfg.method = 'summary'; >> >> cfg.latency=[0 1]; >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> >> >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.latency=[0 1]; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> >> >> >> >> >> % Save clean data >> >> >> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> >> >> >> >> >> %% Rereferencing data >> >> cfg = []; >> >> cfg.channel = 'all'; >> >> cfg.preproc.reref = 'yes'; >> >> cfg.preproc.refchannel = 'all'; >> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> >> >> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> >> %% Snap out smaller pieces (the third second) >> >> >> >> cfg = [] >> >> cfg.toilim = [0 1] >> >> >> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> >> >> >> %% TIMELOCK ERP >> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> >> >> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> >> >> >> %% plot 180 ERP >> >> >> >> cfg = []; >> >> cfg.layout = lay ; >> >> cfg.interactive = 'yes'; >> >> ft_multiplotER(cfg, obs180_data_ERP) >> >> >> >> %% plot both ERPs >> >> >> >> cfg = []; >> >> cfg.layout = lay ; >> >> cfg.interactive = 'yes'; >> >> cfg.showlabels = 'yes'; >> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> >> >> >> %% plot difference wave >> >> >> >> difference = obs180_data_ERP; % copy one of >> the structures >> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >> compute the difference ERP >> >> >> cfg = []; >> >> cfg.layout = lay; >> >> cfg.interactive = 'yes'; >> >> ft_multiplotER(cfg, difference) >> >> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> Hi, >> I?m one of the main Fieldtrip contributors working on supporting >> EGI data. A couple things. First of all, exactly which net do >> you use? If they are 129-channel, there is still the question of >> whether they are the Hydrocel or the older geodesic nets. >> Regardless, that shouldn't cause an error like this. Could you >> send me the file you are trying to process and the script you are >> using and I?ll try troubleshooting it. >> >> Joe >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >> wrote: >> >>> Which nets do you use? I use EGI. I tried both the ones you >>> mention and they didn't work. It was hard to find that exact one >>> online but it was the only file that actually worked. >>> >>> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> wrote: >>> Dear Ana, dear all, >>> the layout you used does not correspond to our nets. I tried the >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> work. Please can anybody help? >>> Cheers >>> Katrin >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : >>> >>> Try this one I use >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >>> wrote: >>> Dear all, my problems seem neverending. This time however i really >>> need help. >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> preprocessing, channelreplacement, ica, componentrejection, final >>> artifactdetection, timelock of the single subject data. However, >>> when I wanna compute the grandaverage of the single subjects I get >>> the following error message: >>> >>> computing average of avg over 19 subjects >>> Warning: discarding electrode information because it cannot be averaged >>> > In ft_timelockgrandaverage at 249 >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> the additional allocation of an estimated 3 MB >>> computing average of avg over 2 subjects >>> Warning: discarding electrode information because it cannot be averaged >>> > In ft_timelockgrandaverage at 249 >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> the additional allocation of an estimated 0 MB >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> additional allocation of an estimated 0 MB >>> the call to "ft_topoplotER" took 0 seconds and required the >>> additional allocation of an estimated 0 MB >>> >>> Furthermore in the plot of the significant clusters, the >>> channelnames are mixed up (do not correspond to my net) >>> >>> >>> I guess that there is a problem with the layout I use. >>> Here the code that I use >>> >>> %For generating the layout (also in the single subjects): >>> cfg = []; >>> >>> cfg.channel = obs_data.label; >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> cfg.feedback = 'yes'; >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> cfg_neighb = []; >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> cfg_neighb.layout = lay; >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> >>> %For computing the grand average >>> >>> cfg = []; >>> >>> cfg.channel = 'all'; >>> >>> cfg.latency = 'all'; >>> >>> cfg.parameter = 'avg'; >>> >>> cfg.keepindividual = 'no' >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> For plotting the significant clusters >>> >>> cfg = []; >>> >>> cfg.style = 'blank'; >>> >>> cfg.layout = lay; >>> >>> cfg.channellabels = 'yes'; >>> >>> cfg.highlight = 'labels'; >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> cfg.comment = 'no'; >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> correction') >>> >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> thanks and best >>> >>> Katrin >>> >>> >>> _______________________________________________ >>> 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 >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -------------------------------------------------------------------------------- >> >> Joseph Dien, PhD >> Research Associate >> Cognitive Neurology >> The Johns Hopkins University School of Medicine >> >> Lab E-mail: jdien1 at jhmi.edu >> Private E-mail: jdien07 at mac.com >> Office Phone: 410-614-3115 >> Cell Phone: 202-297-8117 >> Fax: 410-955-0188 >> http://joedien.com >> >> >> _______________________________________________ >> 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 > > -------------------------------------------------------------------------------- > > Joseph Dien, PhD > Research Associate > Cognitive Neurology > The Johns Hopkins University School of Medicine > > Lab E-mail: jdien1 at jhmi.edu > Private E-mail: jdien07 at mac.com > Office Phone: 410-614-3115 > Cell Phone: 202-297-8117 > Fax: 410-955-0188 > http://joedien.com > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 4 > Date: Tue, 9 Sep 2014 06:37:13 +0000 > From: "Caspar, Emilie" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > bad > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Ashley, > > Maybe the mistake is you did not integrate in your script the > command to save the rejection. Normally, with the following command, > you will see in the Matlab Window that artifacts are correctly > rejected after the "quit" button. > > clean_data = ft_rejectvisual(cfg, interpoldata); > cfg.artfctdef.reject = 'complete'; > cfg.artfctdef.feedback = 'yes'; > cleandata = ft_rejectartifact(cfg,clean_data); > > Emilie > > > > > > Le 3 sept. 2014 ? 11:58, Ashley Greene > > a ?crit : > > Hello, > > I have used the rejectvisual function in attempt to remove bad > trials, but after marking them and pressing the quit button, > although the command window states that the selected trials have > been removed, there is no obvious change in the data; all of the > trials are still intact. Have I overlooked something? > > Thanks, > > Ashley > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 5 > Date: Tue, 09 Sep 2014 14:16:20 +0200 > From: Patricia Wollstadt > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] TRENTOOL pipeline help > Message-ID: <540EEF94.9080601 at gmx.de> > Content-Type: text/plain; charset="windows-1252" > > Hello Max, > > I added a few comments to the questions regarding individual parameters > below. To address the general problem of TRENTOOL telling you, that > there are not enough sample points in your data: From what I can see in > your script, you probably don't have enough data points in each time > series to robustly estimate TE. You analyze 800 ms of data sampled at > 300 Hz, which gives you 240 samples per time series. Can you maybe avoid > downsampling to 300 Hz and downsample to 600 Hz instead? Or could you > analyze a longer time window of interest? > Note that you also 'lose' data to embedding and the interaction delay: > The first point that can be used for TE estimation is at max. embedding > length + max. interaction delay in samples. For example: max. embedding > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max > interaction delay of 30 ms = 9 samples. In this example, you would be > left with 240 - 29 samples for TE estimation per trial. There is also > the possibility to estimate time resolved TE/TE for shorter time windows > of interest (see section 4.4 in the manual); however, this method > requires the use of a GPU for TE estimation. > > I would further recommend to use the new pipeline for group statistics > described in the manual in section 4.5 (the function 'TEgroup_calculate' > is deprecated). The new pipeline allows you to reconstruct the > interaction delay and uses the following functions (see also comments in > the script): > > TEgroup_prepare -> prepares all data sets (all subjects/all > conditions) for group analysis (this means finding common embedding > parameters such that estimates are not biased between groups) > InteractionDelayReconstruction_calculate -> estimates TE for > individual data sets and all assumed interaction delays u > InteractionDelayReconstruction_analyze -> reconstructs the > interaction delay by selecting the u that maximizes TE for each channel > TEgroup_stats -> calculate group statistics using a permutation test > > I can send you an example script for group TE analysis using this > pipeline to get you started. I hope this helps you to get the group > analysis running. Just write again if you're having trouble setting up > the pipeline or something is not clear about the parameters/my comments. > > Best, > Patricia > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: >> Hi fieldtrippers, >> >> I know trentool is not produced by the Donders Institute, so I'm not >> 100% sure if it is appropriate to ask questions about it here, but to >> the best of my knowledge they do not have a mailing list and I saw a >> few trentool questions in the archives, so I'm going to assume it's ok... >> >> In any case, below is my current pipeline (slightly modified for >> comprehensibility): >> >> (notes in bold are comments/questions made in this email, not present >> in the pipeline. Sorry in advance for the long post! Any help would be >> greatly appreciated as I'm a bit over my head on this but I think I'm >> close!) >> >> ***** >> >> % Prepare group TE data >> >> cfgP = []; >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> cfgP.TEcalctype = 'VW_ds'; >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> *I'm trying to find the transfer entropy between the left and right >> auditory cortices in my experiment. The input is virtual sensor data >> that was produced using SAM in fieldtrip on real MEG data. * >> >> % specify u to be scanned >> >> cfgP.predicttime_u = 30; >> cfgP.toi = [-0.4 0.4]; >> >> *For clarification, the predicttime_u is in seconds but the toi is in >> milliseconds. If I understand correctly, the predicttime_u must fit >> within the toi, but beyond that are there any benefits to it being >> earlier or later?* PW: The predictiontime_u is in milliseconds and the >> toi is in seconds. The prediction time is the assumed interaction >> delay between your two sources and should fit within your toi. In >> general it is preferable to use the method for interaction delay >> reconstruction for TE estimation, because it allows you to reconstruct >> the actual delay between your source and target times series. A >> non-optimal u/interaction delay may cause an underestimation of TE, so >> it is recommended to use the pipeline for interaction delay >> reconstruction whenever estimating TE for unknown delays. >> If you use the methods for interaction delay reconstruction >> 'predicttime_u' is replaced by >> cfgTEP.predicttimemin_u % minimum u to be scanned >> cfgTEP.predicttimemax_u % maximum u to be scanned >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> A large range for u values to be scanned increases computing time a >> lot, so it is best to limit the u range to values that are >> physiologically plausible. >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> cfgP.maxlag = 150; >> cfgP.actthrvalue = 7.5; >> cfgP.minnrtrials = 5; >> >> *My understanding is maxlag should be 1/2 the sampling rate, so since >> the data are downsampled to 300hz, it should be 150. I know that the >> sample rate and filters are used to determine the actthrvalue, but I >> don't actually know the calculation. 7.5 was a rough guess just to >> test the pipeline. I'm also uncertain of what minnrtrials should be.* >> PW: You can set the actthrvalue based on the filtering you did prior >> to TE analysis. If you for example highpass filtered at 10 Hz, you >> shouldn't find an ACT higher than 30 samples, because you filtered out >> any components of the signal slower than 10 Hz/30 samples (given your >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >> would be 30. >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials is >> needed to realize the permutation test for estimated TE values). >> >> % Optimization >> >> cfgP.optimizemethod = 'ragwitz'; >> cfgP.ragdim = 4:8; >> cfgP.ragtaurange = [0.2 0.4]; >> cfgP.ragtausteps = 15; >> cfgP.repPred = 100; >> * >> * >> *I am completely at a loss for this. I've done some reading into >> transfer entropy, mutual information, etc., cited in trentool, but I'm >> yet to understand how exactly this optimization works and what the >> configuration should be, given my data and experimental intentions.* >> PW: The Ragwitz criterion tries to find optimal embedding parameters >> dim and tau for the data. To do that, the method iteratively takes all >> possible combinations of dim and tau values that are provided in >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well these >> combinations embed the data. To test an embedding, the method builds >> the embedding vectors from the data; it then tests for each point how >> well the next point in time can be predicted from the reference >> point's nearest neighbours. So for each embedded point, the method >> searches for the nearest neighbours and calculates the average of >> those nearest neighbours. The difference between the >> averaged/predicted point and the actual next point is the error of the >> local predictor. The Ragwitz criterion will then return the parameter >> combination for which this error over all points is minimal. >> The parameters set the following: 'ragdim' are dimensions to be tested >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >> together with 'ragtausteps' specifies the tau values to be tested >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, that >> the values here are factors that are later multiplied with the ACT to >> obtain the actual tau. 'repPred' is the number of points that will be >> used for the local prediction, i.e. the Ragwitz criterion will test >> the local prediction and calculate the error for the first 100 points >> in your time series. The two parameters 'flagNei' ans 'sizeNei' below >> specify the type of neighbour search conducted by the Ragwitz >> criterion: 'flagNei' tells the method to either conduct a kNN or range >> search; 'sizeNei' specifies the number of neighbours or the radius to >> be searched by a range search. >> >> >> % Kernel-based TE estimation >> >> cfgP.flagNei = 'Mass'; >> cfgP.sizeNei = 4; % Default >> >> cfgP.ensemblemethod = 'no'; >> cfgP.outputpath = *OUTPUT PATH*; >> >> if ~exist(*Path for TEprepare data object*) >> load VSdat; >> TE_Wrd = {}; >> for i = 1:nConds >> for j = 1:Nsub >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> end >> end >> clear VSdat; >> save('TE_Wrd', 'TE_Wrd'); >> end >> * >> * >> *The configuration and virtual sensor data, organized in a 3 x 15 cell >> of structures (condition by subject) are the input. The TEprepare >> substructure is added to each individual condition x subject .mat >> files' data structure which are stored on disk independently.* >> >> % Use object_to_mat_conversion.m to replace individual condition x >> subject virtual sensor data >> % .mat files with their TE_Wrd equivalent >> * >> * >> *I'm using a separate script to make some manipulations to the objects >> from disk; this will all eventually be integrated into the main >> pipeline*.*TRENTOOL seems to handle data output very differently from >> fieldtrip and I've had trouble thinking through the most logical way >> to handle the data so it's a bit haphazard right now.* >> >> load cond080sub01.mat >> >> cfgG = []; >> cfgG.dim = cond080sub01.TEprepare.optdim; >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> if isfield(cond080sub01, 'TEprepare') >> TEgroup_prepare(cfgG, fileCell); >> else >> error('Need to run TEprepare before TEgroup_prepare'); >> end >> * >> * >> *For clarification, fileCell is a cell with the name of each condition >> x subject .mat file, which as I said before is collectively the same >> as the 3 x 15 VSdat structure (condition x subject).* >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> % object_to_mat_conversion.m >> >> % TE Group Calculate >> >> load cond080sub01.mat >> if isfield(cond080sub01, 'TEgroupprepare') >> for i = 1:length(fileCell) >> TEgroup_calculate(fileCell{i}); >> end >> else >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> end >> * >> * >> *At this step I get the following error: >> >> Error using transferentropy (line 337) >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in TEgroup_calculate (line 133) >> [TEresult] = transferentropy(cfg,data);* >> >> % TE Group Stats >> >> cfgGSTAT = []; >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> cfgGSTAT.uvar = 1; >> cfgGSTAT.ivar = 2; >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> *Given the error above, I am yet to get to this step, but it does not >> seem fundamentally different from normal fieldtrip stats.* >> >> ***** >> >> In case my notes were not clear or you skipped to the bottom, *my >> primary concern is whether the error I'm getting in TEgroup_calculate >> is a pipeline issue* (I noticed the example pipeline in trentool, the >> manual, and published methods articles all seem to have slightly or >> significantly different pipeline compositions), *or if the error is* >> due to ACT, ragwitz optimization, or some other faulty >> parameterization *on my part due to a lack of understanding of how >> transfer entropy works on a more theoretical/mathematical level*. If >> the latter is the case, is there any relatively straightforward way to >> conceptualize this, or is this something where I'm just going to have >> to keep reading and rereading until it eventually makes sense? I've >> already done quite a bit of that and it hasn't pierced my thick skull >> yet but I'm sure it will eventually! >> >> Thank you so much, >> >> Max Cantor >> >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> >> _______________________________________________ >> 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: > > > ------------------------------ > > Message: 6 > Date: Tue, 9 Sep 2014 15:21:20 +0200 > From: Holger Krause > To: FieldTrip discussion list > Subject: [FieldTrip] Latest FT version on ftp-server is from three > days ago > Message-ID: <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> > Content-Type: text/plain; charset="us-ascii" > > Dear developers, > > Could you please check the process for creation/publication of zip-files on > the FTP server? The latest file I can find there is fieldtrip-20140906.zip. > > Thanks in advance, > > Holger > > > ------------------------------ > > Message: 7 > Date: Tue, 9 Sep 2014 09:19:55 -0400 > From: Max Cantor > To: FieldTrip discussion list > Subject: Re: [FieldTrip] TRENTOOL pipeline help > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > This is immensely helpful, thank you. I was very confused about why some > versions of the pipeline I saw were using group calculate and others were > using interaction delay reconstruction and what that meant, and I think I > have a more clear idea of what the different steps of the pipeline are > doing. There are still a few things I'm a bit confused about though in > terms of the pipeline. For instance, whether or not I need to do TEprepare > before group prepare, and if I need to do graph analysis (which I'm not > sure I fully understand but also haven't looked deeply into) before group > stats. > > If you don't mind me taking you up on your offer, I think seeing your > example script might help clarify some of these issues. > > Thank you! > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > Patricia.Wollstadt at gmx.de> wrote: > >> Hello Max, >> >> I added a few comments to the questions regarding individual parameters >> below. To address the general problem of TRENTOOL telling you, that there >> are not enough sample points in your data: From what I can see in your >> script, you probably don't have enough data points in each time series to >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, which >> gives you 240 samples per time series. Can you maybe avoid downsampling to >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a longer time >> window of interest? >> Note that you also 'lose' data to embedding and the interaction delay: The >> first point that can be used for TE estimation is at max. embedding length >> + max. interaction delay in samples. For example: max. embedding length = >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max interaction >> delay of 30 ms = 9 samples. In this example, you would be left with 240 - >> 29 samples for TE estimation per trial. There is also the possibility to >> estimate time resolved TE/TE for shorter time windows of interest (see >> section 4.4 in the manual); however, this method requires the use of a GPU >> for TE estimation. >> >> I would further recommend to use the new pipeline for group statistics >> described in the manual in section 4.5 (the function 'TEgroup_calculate' is >> deprecated). The new pipeline allows you to reconstruct the interaction >> delay and uses the following functions (see also comments in the script): >> >> TEgroup_prepare -> prepares all data sets (all subjects/all conditions) >> for group analysis (this means finding common embedding parameters such >> that estimates are not biased between groups) >> InteractionDelayReconstruction_calculate -> estimates TE for >> individual data sets and all assumed interaction delays u >> InteractionDelayReconstruction_analyze -> reconstructs the >> interaction delay by selecting the u that maximizes TE for each channel >> TEgroup_stats -> calculate group statistics using a permutation test >> >> I can send you an example script for group TE analysis using this pipeline >> to get you started. I hope this helps you to get the group analysis >> running. Just write again if you're having trouble setting up the pipeline >> or something is not clear about the parameters/my comments. >> >> Best, >> Patricia >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> I know trentool is not produced by the Donders Institute, so I'm not 100% >> sure if it is appropriate to ask questions about it here, but to the best >> of my knowledge they do not have a mailing list and I saw a few trentool >> questions in the archives, so I'm going to assume it's ok... >> >> In any case, below is my current pipeline (slightly modified for >> comprehensibility): >> >> (notes in bold are comments/questions made in this email, not present in >> the pipeline. Sorry in advance for the long post! Any help would be greatly >> appreciated as I'm a bit over my head on this but I think I'm close!) >> >> ***** >> >> % Prepare group TE data >> >> cfgP = []; >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> cfgP.TEcalctype = 'VW_ds'; >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> *I'm trying to find the transfer entropy between the left and right >> auditory cortices in my experiment. The input is virtual sensor data that >> was produced using SAM in fieldtrip on real MEG data. * >> >> % specify u to be scanned >> >> cfgP.predicttime_u = 30; >> cfgP.toi = [-0.4 0.4]; >> >> *For clarification, the predicttime_u is in seconds but the toi is in >> milliseconds. If I understand correctly, the predicttime_u must fit within >> the toi, but beyond that are there any benefits to it being earlier or >> later?* PW: The predictiontime_u is in milliseconds and the toi is in >> seconds. The prediction time is the assumed interaction delay between your >> two sources and should fit within your toi. In general it is preferable to >> use the method for interaction delay reconstruction for TE estimation, >> because it allows you to reconstruct the actual delay between your source >> and target times series. A non-optimal u/interaction delay may cause an >> underestimation of TE, so it is recommended to use the pipeline for >> interaction delay reconstruction whenever estimating TE for unknown delays. >> If you use the methods for interaction delay reconstruction >> 'predicttime_u' is replaced by >> cfgTEP.predicttimemin_u % minimum u to be scanned >> cfgTEP.predicttimemax_u % maximum u to be scanned >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> A large range for u values to be scanned increases computing time a lot, >> so it is best to limit the u range to values that are physiologically >> plausible. >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> cfgP.maxlag = 150; >> cfgP.actthrvalue = 7.5; >> cfgP.minnrtrials = 5; >> >> *My understanding is maxlag should be 1/2 the sampling rate, so since >> the data are downsampled to 300hz, it should be 150. I know that the sample >> rate and filters are used to determine the actthrvalue, but I don't >> actually know the calculation. 7.5 was a rough guess just to test the >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: You can >> set the actthrvalue based on the filtering you did prior to TE analysis. If >> you for example highpass filtered at 10 Hz, you shouldn't find an ACT >> higher than 30 samples, because you filtered out any components of the >> signal slower than 10 Hz/30 samples (given your sampling frequency of 300 >> Hz). So in this scenario the actthrvalue would be 30. >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials is >> needed to realize the permutation test for estimated TE values). >> >> >> % Optimization >> >> cfgP.optimizemethod = 'ragwitz'; >> cfgP.ragdim = 4:8; >> cfgP.ragtaurange = [0.2 0.4]; >> cfgP.ragtausteps = 15; >> cfgP.repPred = 100; >> >> *I am completely at a loss for this. I've done some reading into >> transfer entropy, mutual information, etc., cited in trentool, but I'm yet >> to understand how exactly this optimization works and what the >> configuration should be, given my data and experimental intentions.* PW: >> The Ragwitz criterion tries to find optimal embedding parameters dim and >> tau for the data. To do that, the method iteratively takes all possible >> combinations of dim and tau values that are provided in cfgP.ragdim and >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations embed >> the data. To test an embedding, the method builds the embedding vectors >> from the data; it then tests for each point how well the next point in time >> can be predicted from the reference point's nearest neighbours. So for each >> embedded point, the method searches for the nearest neighbours and >> calculates the average of those nearest neighbours. The difference between >> the averaged/predicted point and the actual next point is the error of the >> local predictor. The Ragwitz criterion will then return the parameter >> combination for which this error over all points is minimal. >> The parameters set the following: 'ragdim' are dimensions to be tested by >> the method (I would reccomend to start with 2:10), 'ragtaurange' together >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL will >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values here are >> factors that are later multiplied with the ACT to obtain the actual tau. >> 'repPred' is the number of points that will be used for the local >> prediction, i.e. the Ragwitz criterion will test the local prediction and >> calculate the error for the first 100 points in your time series. The two >> parameters 'flagNei' ans 'sizeNei' below specify the type of neighbour >> search conducted by the Ragwitz criterion: 'flagNei' tells the method to >> either conduct a kNN or range search; 'sizeNei' specifies the number of >> neighbours or the radius to be searched by a range search. >> >> >> % Kernel-based TE estimation >> >> cfgP.flagNei = 'Mass'; >> cfgP.sizeNei = 4; % Default >> >> cfgP.ensemblemethod = 'no'; >> cfgP.outputpath = *OUTPUT PATH*; >> >> if ~exist(*Path for TEprepare data object*) >> load VSdat; >> TE_Wrd = {}; >> for i = 1:nConds >> for j = 1:Nsub >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> end >> end >> clear VSdat; >> save('TE_Wrd', 'TE_Wrd'); >> end >> >> *The configuration and virtual sensor data, organized in a 3 x 15 cell >> of structures (condition by subject) are the input. The TEprepare >> substructure is added to each individual condition x subject .mat files' >> data structure which are stored on disk independently.* >> >> % Use object_to_mat_conversion.m to replace individual condition x subject >> virtual sensor data >> % .mat files with their TE_Wrd equivalent >> >> *I'm using a separate script to make some manipulations to the objects >> from disk; this will all eventually be integrated into the main pipeline*.* >> TRENTOOL seems to handle data output very differently from fieldtrip and >> I've had trouble thinking through the most logical way to handle the data >> so it's a bit haphazard right now.* >> >> load cond080sub01.mat >> >> cfgG = []; >> cfgG.dim = cond080sub01.TEprepare.optdim; >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> if isfield(cond080sub01, 'TEprepare') >> TEgroup_prepare(cfgG, fileCell); >> else >> error('Need to run TEprepare before TEgroup_prepare'); >> end >> >> *For clarification, fileCell is a cell with the name of each condition x >> subject .mat file, which as I said before is collectively the same as the 3 >> x 15 VSdat structure (condition x subject).* >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> % object_to_mat_conversion.m >> >> % TE Group Calculate >> >> load cond080sub01.mat >> if isfield(cond080sub01, 'TEgroupprepare') >> for i = 1:length(fileCell) >> TEgroup_calculate(fileCell{i}); >> end >> else >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> end >> >> >> >> >> >> >> >> *At this step I get the following error: Error using transferentropy (line >> 337) \nTRENTOOL ERROR: not enough data points left after embedding Error in >> TEgroup_calculate (line 133) [TEresult] = transferentropy(cfg,data);* >> >> % TE Group Stats >> >> cfgGSTAT = []; >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> cfgGSTAT.uvar = 1; >> cfgGSTAT.ivar = 2; >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> *Given the error above, I am yet to get to this step, but it does not >> seem fundamentally different from normal fieldtrip stats.* >> >> ***** >> >> In case my notes were not clear or you skipped to the bottom, *my >> primary concern is whether the error I'm getting in TEgroup_calculate is a >> pipeline issue* (I noticed the example pipeline in trentool, the manual, >> and published methods articles all seem to have slightly or significantly >> different pipeline compositions), *or if the error is* due to ACT, >> ragwitz optimization, or some other faulty parameterization *on my part >> due to a lack of understanding of how transfer entropy works on a more >> theoretical/mathematical level*. If the latter is the case, is there any >> relatively straightforward way to conceptualize this, or is this something >> where I'm just going to have to keep reading and rereading until it >> eventually makes sense? I've already done quite a bit of that and it hasn't >> pierced my thick skull yet but I'm sure it will eventually! >> >> Thank you so much, >> >> Max Cantor >> >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> >> _______________________________________________ >> fieldtrip mailing >> listfieldtrip at donders.ru.nlhttp://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 >> > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > -------------- 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 46, Issue 3 > **************************************** > Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From clara.scholl at gmail.com Wed Sep 10 16:56:38 2014 From: clara.scholl at gmail.com (Clara A. Scholl) Date: Wed, 10 Sep 2014 10:56:38 -0400 Subject: [FieldTrip] data.sampleinfo when preprocessing was completed in EEGLAB In-Reply-To: References: Message-ID: Dear Eelke, Thank you! Just to clarify: when I use ft_mvaranalysis to perform multivariate autoregressive modeling on time series data over multiple trials, the relative temporal adjacency of each trial (assumed to be consecutive segments, when this is not the case) has no impact on the resulting autoregressive coefficients and the covariance of the residuals? Respectfully, Clara On Wed, Sep 10, 2014 at 4:49 AM, Eelke Spaak wrote: > Dear Clara, > > 1) Some FT functions require a sampleinfo for their inner workings, so > they reconstruct it in a simple way if it is not present. You can > safely ignore this warning if you are not doing anything with sample > indices yourself. Specifically, the FT artifact and event functions > use sample indices (i.e. return segments of artifacts/events in terms > of samples relative to the original recording), if you are not using > these you are probably safe. > > 2) Not me ;) > > Best, > Eelke > > On 9 September 2014 21:25, Clara A. Scholl wrote: > > Dear FieldTrip Community, > > > > I did preprocessing in EEGLAB and imported into FieldTrip using > > eeglab2fieldtrip (from EEGLAB version 13.3.2b). The resulting FieldTrip > > data structures do not have the data field "sampleinfo" to specify the > > position of each trial relative to the actual recording. As a result of > > this, I get the warning "reconstructing sampleinfo by assuming that the > > trials are consecutive segments of a continuous recording" when calling > the > > functions ft_timelockanalysis and ft_mvaranalysis. > > > > My questions are twofold: > > > > 1) when can I ignore this warning? > > 2) has anyone imported the sampleinfo into FieldTrip from an EEGLAB EEG > > structure? Any guidance on the best way to do this? > > > > Thanks immensely for feedback! > > Respectfully, > > Clara > > > > _______________________________________________ > > 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 eelke.spaak at donders.ru.nl Thu Sep 11 09:55:25 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 11 Sep 2014 09:55:25 +0200 Subject: [FieldTrip] data.sampleinfo when preprocessing was completed in EEGLAB In-Reply-To: References: Message-ID: Correct :) On 10 September 2014 16:56, Clara A. Scholl wrote: > Dear Eelke, > > Thank you! Just to clarify: when I use ft_mvaranalysis to perform > multivariate autoregressive modeling on time series data over multiple > trials, the relative temporal adjacency of each trial (assumed to be > consecutive segments, when this is not the case) has no impact on the > resulting autoregressive coefficients and the covariance of the residuals? > > Respectfully, > Clara > > > On Wed, Sep 10, 2014 at 4:49 AM, Eelke Spaak > wrote: >> >> Dear Clara, >> >> 1) Some FT functions require a sampleinfo for their inner workings, so >> they reconstruct it in a simple way if it is not present. You can >> safely ignore this warning if you are not doing anything with sample >> indices yourself. Specifically, the FT artifact and event functions >> use sample indices (i.e. return segments of artifacts/events in terms >> of samples relative to the original recording), if you are not using >> these you are probably safe. >> >> 2) Not me ;) >> >> Best, >> Eelke >> >> On 9 September 2014 21:25, Clara A. Scholl wrote: >> > Dear FieldTrip Community, >> > >> > I did preprocessing in EEGLAB and imported into FieldTrip using >> > eeglab2fieldtrip (from EEGLAB version 13.3.2b). The resulting FieldTrip >> > data structures do not have the data field "sampleinfo" to specify the >> > position of each trial relative to the actual recording. As a result of >> > this, I get the warning "reconstructing sampleinfo by assuming that the >> > trials are consecutive segments of a continuous recording" when calling >> > the >> > functions ft_timelockanalysis and ft_mvaranalysis. >> > >> > My questions are twofold: >> > >> > 1) when can I ignore this warning? >> > 2) has anyone imported the sampleinfo into FieldTrip from an EEGLAB EEG >> > structure? Any guidance on the best way to do this? >> > >> > Thanks immensely for feedback! >> > Respectfully, >> > Clara >> > >> > _______________________________________________ >> > 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 luke.bloy at gmail.com Thu Sep 11 18:30:57 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Thu, 11 Sep 2014 12:30:57 -0400 Subject: [FieldTrip] topoplot_common Message-ID: Is there a reason that topoplot_common doesn't support 'raw' datatypes. I have been using ft_topoplotER to plot topos at particular time windows in continuous raw datasets. This recently broke after an update. the error happens in ft_datatype_comp trying to convert my 'raw' to a 'comp' datatype. If i add 'raw' to the list of supported datatypes, https://github.com/fieldtrip/fieldtrip/blob/master/private/topoplot_common.m#L74 , everything seems to work fine? Thanks Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From agreene24 at gmail.com Fri Sep 12 14:39:43 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Fri, 12 Sep 2014 21:39:43 +0900 Subject: [FieldTrip] ft_rejectvisual: removing trials marked as bad In-Reply-To: <3C365782-4B07-4EFE-A921-99489BDD5DA6@live.ucl.ac.uk> References: <3C365782-4B07-4EFE-A921-99489BDD5DA6@live.ucl.ac.uk> Message-ID: Hi Emilie, Thanks!! I, of course, completely overlooked that. Ashley On Tue, Sep 9, 2014 at 3:37 PM, Caspar, Emilie wrote: > Hi Ashley, > > Maybe the mistake is you did not integrate in your script the command to > save the rejection. Normally, with the following command, you will see in > the Matlab Window that artifacts are correctly rejected after the "quit" > button. > > clean_data = ft_rejectvisual(cfg, interpoldata); > cfg.artfctdef.reject = 'complete'; > cfg.artfctdef.feedback = 'yes'; > cleandata = ft_rejectartifact(cfg,clean_data); > > Emilie > > > > > > Le 3 sept. 2014 à 11:58, Ashley Greene a écrit : > > Hello, > > I have used the rejectvisual function in attempt to remove bad trials, > but after marking them and pressing the quit button, although the command > window states that the selected trials have been removed, there is no > obvious change in the data; all of the trials are still intact. Have I > overlooked something? > > Thanks, > > Ashley > _______________________________________________ > 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 tobiastrame at uni-muenster.de Fri Sep 12 18:23:17 2014 From: tobiastrame at uni-muenster.de (Tobias Trame) Date: Fri, 12 Sep 2014 18:23:17 +0200 (CEST) Subject: [FieldTrip] Read only EEG data from combined MEG/EEG ctf file Message-ID: Hi everybody! I'm trying to read only the EEG data from a combined MEG/EEG ctf file in order to create leadfields later on, but the function "ft_read_sens" just returns the gradiometer information in a 'grad' field. It searches for an 'elec'-field in the header of the data which is not present. Is there a configuration to get the EEG-elecrodes by using "ft_read_sens"? My first attempt was to write the EEG-Information from the header by hand using the following code: hdr = ft_read_header('subject.ds', 'headerformat', 'ctf_ds'); elec.elecpos = [hdr.orig.eeg.pos]'; elec.chanpos = [hdr.orig.eeg.pos]'; elec.label = {hdr.orig.eeg.name}'; elec.type = 'eeg'; elec.unit = 'cm'; But now I get a similar problem if I want to create leadfields from timelock data. After doing the timelock analysis using timelock_data = ft_timelockanalysis(cfg, mydata); the structure timelock_data contains just a 'grad' and no 'elec' field so that ft_prepare_leadfield(cfg, timelock_data) always ignores the EEG-elecrodes and tries to use the gradiometes - even if I put the electrodes defined above into cfg.elec. Thanks for any suggestions! Tobias From j.herring at fcdonders.ru.nl Mon Sep 15 12:01:02 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Mon, 15 Sep 2014 12:01:02 +0200 (CEST) Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' In-Reply-To: <20140910140714.9n2t9bxs008o400c@imap.uni-ulm.de> Message-ID: <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> Dear Barbara, The error seems to be related to a bug that pops up now and then (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a corrupt installation of fieldtrip and/or the need to update fieldtrip. Could you please try downloading the most recent version of fieldtrip and see if the problem persists? For an example of what can be expected from this function see: Esser SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. Best, Jim ----- Oorspronkelijk bericht ----- > Van: "barbara schorr" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 10 september 2014 14:07:14 > Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' > Dear fieldtripers. > > as mentioned in the subject line I would like to anaylse my timelocked > ERP Data with the function ft_globalmeanfield. > > I get the Error: Undefined function or variable 'abort' > Error in ft_globalmeanfield (line84) > if abort > > in the function it says: > > %the abort variable is set to true or false in ft_preamble_inti > if abort > % do not continue function execution in case the outputfile is > present and the user indicated to keep it > return > end > > > I don't understand what this means. I would really appreciate your > help to get this running. > > Also, what is the result when I run this function on my data? (This > method was proposed from a reviewer. I never used it before, so I > don't exactly know what it does and what the result will look like). > > Thank you very much in advance! > > Best, > > Barbara Schorr > > > > > Zitat von 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: Question regarding nonparametric testing for coherence > > differences (Eric Maris) > > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) > > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) > > 4. Re: ft_rejectvisual: removing trials marked as bad > > (Caspar, Emilie) > > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) > > 6. Latest FT version on ftp-server is from three days ago > > (Holger Krause) > > 7. Re: TRENTOOL pipeline help (Max Cantor) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) > > From: "Eric Maris" > > To: , "'FieldTrip discussion list'" > > > > Subject: Re: [FieldTrip] Question regarding nonparametric testing > > for > > coherence differences > > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> > > Content-Type: text/plain; charset="utf-8" > > > > Dear Hwee Ling, > > > > > > > > In the paper you refer to (Maris et al, JNM, 2007), I did not > > perform a > > cluster-based permutation test at the level of the channel pairs. > > Instead, > > all coherences mentioned in the paper are coherence between a single > > EMG > > channel (2 electrodes mounted on the forearm) and all MEG > > electrodes. Thus, > > there are as many EMG-MEG coherences as there are MEG channels (275 > > in our > > lab), and the clustering of these coherences involves the same > > neighbourhood > > structure as the clustering of channel-specific statistics on power > > or > > evoked response. The analysis you propose involves clustering in a > > much more > > complex space, namely the formed by all (MEG,MEG) channel pairs > > (275*275=75625 pairs). In the early days of cluster-based > > permutation > > statistics, I have worked on this problem but did not pursue it > > because the > > resulting clusters are very hard to interpret. > > > > > > > > Best, > > > > > > > > Eric Maris > > > > > > > > > > > > Dear all and Prof Maris, > > > > I'm re-posting this question again, as I didn't get any replies > > previously. > > > > I?m interested to investigate if there are any differences in phase > > synchronization in resting state data at timepoint 2 versus > > timepoint 1. The > > EEG data was collected using 64 EEG channels, resting state, eyes > > opened and > > eyes closed. I?ve arbitrarily segmented the resting state data into > > epochs > > of 2s each, and the epochs with artifacts are excluded completely > > from > > further analyses. I then performed mtmfft to get the fourier > > representation > > of the data, extracted the coherence, and compared the coherence > > difference > > of timepoint 2 versus timepoint 1 of all channels paired with all > > other > > channels. > > > > I figured that if I extract the connectivity analyses without > > specifying the > > channelcmb, I get a 'chan_chan_freq' dimord variable that would > > allow me to > > perform cluster-based statistical analyses. I get an output with > > ?chan_chan? > > dimord variable. However, I was not 100% sure that this is correct, > > hence, I?ve > > inserted my code (see below). It?ll be great if you could tell me if > > what I?m > > doing makes any sense at all. Also, I don?t know how I can plot the > > results > > to see if it make any sense at all. > > > > Also, I checked the values obtained from when I specified > > "cfg.channelcmb" > > and when I did not specify "cfg.channelcmb", I noticed that the > > values were > > somehow different. I would assume that the values to be similar, > > although > > I'm not sure why they would have differences in the values obtained > > from > > specifying "cfg.channelcmb". > > > > This is my code that I've used thus far: > > > > for sub = 1:5 > > > > cfg = []; > > > > cfg.output = 'fourier'; > > > > cfg.channel = {'all'}; > > > > cfg.method = 'mtmfft'; > > > > cfg.keeptrials = 'yes'; > > > > cfg.tapsmofrq = 5; > > > > cfg.foilim = [0 100]; > > > > cfg.taper = 'dpss'; > > > > % find the index for the c200 condition > > > > pre_c200_idx = find(data5.trialinfo == 201); > > > > cfg.trials = pre_c200_idx; > > > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > > > post_c200_idx = find(data5.trialinfo == 200); > > > > cfg.trials = post_c200_idx; > > > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > > > > > cfg = []; > > > > cfg.keeptrials = 'no'; > > > > cfg.channel = {'all'}; > > > > cfg.removemean = 'yes'; > > > > cfg.method = 'coh'; > > > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_pre_c200); > > > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_post_c200); > > > > end > > > > > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); > > > > cfg_neighb.method = 'template'; > > > > cfg_neighb.layout = lay; > > > > cfg_neighb.channel = 'all'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, > > sub_HLF_pre_c200coh{1}); > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.neighbours = neighbours; > > > > cfg.channel = 'all'; > > > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > > > cfg.latency = 'all'; > > > > cfg.avgovertime = 'no'; > > > > cfg.avgoverchan = 'no'; > > > > cfg.parameter = 'cohspctrm'; > > > > cfg.method = 'montecarlo'; > > > > cfg.statistic = 'depsamplesT'; > > > > cfg.correctm = 'cluster'; > > > > cfg.tail = 0; > > > > % cfg.clustertail = 0; > > > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 > > frequency > > bands. > > > > cfg.numrandomization = 10000; > > > > cfg.ivar = 2; > > > > cfg.uvar = 1; > > > > > > > > % design matrices > > > > clear design; > > > > design(1,:) = [1:5, 1:5]; > > > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > > > cfg.design = design; > > > > % for theta band > > > > cfg.avgoverfreq = 'yes'; > > > > cfg.frequency = [4 8]; % I also performed the statistics for delta > > (2-4), > > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma > > (30-40), > > and gamma (40-100). > > > > [diffc200_theta_stat] = ft_freqstatistics(cfg, > > sub_HLF_post_c200coh{:}, > > sub_HLF_pre_c200coh{:}); > > > > > > > > When I tried to plot the results, I used this code: > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.layout = 'lay'; > > > > cfg.zlim = [-1 1]; > > > > cfg.alpha = 0.05; > > > > cfg.refchannel = 'all'; > > > > ft_clusterplot(cfg, diffc200_theta_stat); > > > > However, I was not sure how I could plot the results. I get an error > > message > > from Fieldtrip when using ft_clusterplot: > > > > Error using topoplot_common (line 366) > > > > no reference channel is specified > > > > Error in ft_topoplotTFR (line 192) > > > > [cfg] = topoplot_common(cfg, varargin{:}); > > > > Error in ft_clusterplot (line 372) > > > > ft_topoplotTFR(cfgtopo, stat); > > > > > > > > According to your paper in 2007, the topoplot of the results were > > masked by > > the spatio-spectral pattern of the significant clusters. I don't > > know how to > > do this, and I would really appreciate if you can show me how to > > make such a > > plot. > > > > Thank you very much. > > > > Kind regards, > > > > Hweeling > > > > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 2 > > Date: Mon, 8 Sep 2014 21:38:01 +0200 > > From: KatrinH Heimann > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > Dear Joseph, thanks so much, I really appreciate your help. I was > > also > > wandering, if maybe there is another bug in my code. > > Our nets are 128 channels, Hydrocel, but as a colleague of me > > adviced me to > > do so, I also tried the 129 layout. > > My code you find below (without selection of bad channels etc.) > > If you need also the data of two subjects to have a look, let me > > know!!! > > Best and thanks really! > > Katrin > > > > > > subject=input('Which subject do you want to analyse? ','s'); > > > > name = strcat(subject,'.raw'); > > > > subjectnumber=input('Which is the subjectnumber?', 's'); > > > > sb=subjectnumber > > > > %subjectnumber = strcat(subjectnumber, '.txt') > > > > %% > > > > > > cfg = []; > > > > cfg.dataset = name; > > > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > > > cfg.trialdef.eventtype = 'trigger'; > > > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > > trigger > > > > cfg.trialdef.prestim = 0.234; % in seconds > > > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > > observation, but maybe we need less) > > > > cfg = ft_definetrial(cfg); > > > > > > cfg.trl([1:7],:) = []; > > > > > > %change timeline according to constant offset of 16 ms = 8 samples > > (because > > recorded with 500 hz)in > > > > %structure trial > > > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > > > > %change timeline to make the cut the zeropoint > > > > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > > > > > %% preprocess data > > > > cfg.channel = 'all'; > > > > cfg.preproc.detrend = 'yes'; > > > > cfg.preproc.demean = 'yes'; > > > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > > filtered > > > > %(0.1-45) and bad channels have to be replaced!!!! > > > > %cfg.preproc.bpfreq = [6 32]; > > > > % > > > > % > > > > obs_data = ft_preprocessing(cfg); > > > > % > > > > save (strcat(sb,'obs_data') , 'obs_data') > > > > > > %% determining channel neighbours (necessary for Artifact detection) > > > > cfg = []; > > > > cfg.channel = obs_data.label; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.feedback = 'yes'; > > > > lay = ft_prepare_layout(cfg); > > > > > > > > cfg_neighb = []; > > > > cfg_neighb.feedback = 'yes'; > > > > > > cfg_neighb.method = 'triangulation'; > > > > cfg_neighb.layout = 'GSN128.sfp'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > > > > > %% Preparing neighbours for channel repair - but bad channel info > > in!!! > > > > > > % cfg_neighb = []; > > > > % cfg_neighb.feedback = 'yes'; > > > > % cfg_neighb.method = 'triangulation'; > > > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > % Interpolate and put into new data structure > > > > cfg = []; > > > > cfg.badchannel = {}; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.method = 'nearest'; > > > > cfg.neighbours = neighbours; > > > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > > > > % Check reconstruction > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > % dat1=obs_data; > > > > % dat2=obs_data_channelrepaired; > > > > % > > > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > > > % y=dat2.trial{1}(62,:); > > > > % plot(x);hold on;plot(y,'r'); > > > > % > > > > % x=dat1.trial{1}(72,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > % > > > > % x=dat1.trial{1}(75,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > %% artifact rejection/trial inspection - throw out electrode jumps > > etc. > > > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > > according to > > channels interpolated %% 128-number of interp. channels) > > > > > > > > cfg = []; > > > > cfg.channel = {'all'}; > > > > cfg.numcomponent = 128 > > > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > > > save (strcat(sb,'comp_all') , 'comp') > > > > > > %% > > > > cfg = []; > > > > cfg.viewmode = 'component'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='some'; > > > > cfg.layout = 'GSN128.sfp'; > > > > ft_databrowser(cfg,comp); > > > > > > %% poweranalysis components > > > > cfg = []; > > > > cfg.output = 'pow'; > > > > cfg.channel = 'all';%compute the power spectrum in all ICs > > > > cfg.method = 'mtmfft'; > > > > cfg.taper = 'hanning'; > > > > cfg.foi = 0:0.2:50; > > > > obs_freq = ft_freqanalysis(cfg, comp); > > > > > > %And you can plot the spectra: > > > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > nsubplots = 16; > > > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > > decimals, type > > doc subplot > > > > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > > > tot = Nfigs*nsubplots; > > > > > > rptvect = 1:size(comp.topo,1); > > > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > > > > for r=1:size(rptvect,1); > > > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 > > 1]);%full > > screen > > > > k=0; > > > > for j=1:size(rptvect,2); > > > > if~(rptvect(r,j)==0); > > > > k=k+1; > > > > cfg=[]; > > > > cfg.channel = rptvect(r,j); > > > > cfg.ylim =[0 500] > > > > cfg.xlim =[0 50] > > > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > > > end > > > > end > > > > end > > > > > > %For the IC topos you'll follow the same logic as above but with: > > > > > > figure > > > > cfg = []; > > > > cfg.component = [1:20]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [21:40]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [41:60]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [61:80]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > > > > > > > > > %% Seperate observation conditions > > > > > > name1= strcat(num2str(sb),'_90.xls'); > > > > list1=xlsread (name1) > > > > > > > > > > > > name2= strcat(num2str(sb),'_180.xls'); > > > > list2=xlsread (name2) > > > > > > > > % > > > > > > cfg = [] > > > > cfg.trials = [list1] > > > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > cfg = [] > > > > cfg.trials = [list2] > > > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > %%PIPELINE FOR obs90 > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128; > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > > obs90_data); > > > > > > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > > > > > > %% Artifacts - final detection > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > > > > %% plot it > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > > > > > > > > > %% PIPELINE FOR obs180 > > > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128 > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > > obs180_data); > > > > > > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > > > > > > %% Artifacts final 180 > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > > > > %% plot 180 ERP > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs180_data_ERP) > > > > > > %% plot both ERPs > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > cfg.showlabels = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > > > > %% plot difference wave > > > > > > difference = obs180_data_ERP; % copy one of the > > structures > > > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute > > the > > difference ERP > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, difference) > > > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > > > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI > >> data. A couple things. First of all, exactly which net do you use? > >> If > >> they are 129-channel, there is still the question of whether they > >> are the > >> Hydrocel or the older geodesic nets. Regardless, that shouldn't > >> cause an > >> error like this. Could you send me the file you are trying to > >> process and > >> the script you are using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < > >> diezmartini at gmail.com> wrote: > >> > >> Which nets do you use? I use EGI. I tried both the ones you mention > >> and > >> they didn't work. It was hard to find that exact one online but it > >> was the > >> only file that actually worked. > >> > >> > >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >> > >> wrote: > >> > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. > >>> Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one > >>> > >>>> I use > >>>> > >>>> > >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < > >>>> katrinheimann at gmail.com> wrote: > >>>> > >>>>> Dear all, my problems seem neverending. This time however i > >>>>> really need > >>>>> help. > >>>>> I implemented a pipeline for ERPs. All works now, > >>>>> trialdefinition, > >>>>> preprocessing, channelreplacement, ica, componentrejection, > >>>>> final > >>>>> artifactdetection, timelock of the single subject data. However, > >>>>> when I > >>>>> wanna compute the grandaverage of the single subjects I get the > >>>>> following > >>>>> error message: > >>>>> > >>>>> computing average of avg over 19 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 3 MB > >>>>> computing average of avg over 2 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_prepare_layout" took 0 seconds and required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_topoplotER" took 0 seconds and required the > >>>>> additional > >>>>> allocation of an estimated 0 MB > >>>>> > >>>>> Furthermore in the plot of the significant clusters, the > >>>>> channelnames > >>>>> are mixed up (do not correspond to my net) > >>>>> > >>>>> > >>>>> I guess that there is a problem with the layout I use. > >>>>> Here the code that I use > >>>>> > >>>>> %For generating the layout (also in the single subjects): > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = obs_data.label; > >>>>> > >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>>>> > >>>>> cfg.feedback = 'yes'; > >>>>> > >>>>> lay = ft_prepare_layout(cfg); > >>>>> > >>>>> > >>>>> cfg_neighb = []; > >>>>> > >>>>> cfg_neighb.feedback = 'yes'; > >>>>> > >>>>> cfg_neighb.method = 'triangulation'; > >>>>> > >>>>> cfg_neighb.layout = lay; > >>>>> > >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>>>> > >>>>> > >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>>>> > >>>>> > >>>>> %For computing the grand average > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = 'all'; > >>>>> > >>>>> cfg.latency = 'all'; > >>>>> > >>>>> cfg.parameter = 'avg'; > >>>>> > >>>>> cfg.keepindividual = 'no' > >>>>> > >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>>>> > >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>>>> > >>>>> % "{:}" means to use data from all elements of the variable > >>>>> > >>>>> > >>>>> For plotting the significant clusters > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.style = 'blank'; > >>>>> > >>>>> cfg.layout = lay; > >>>>> > >>>>> cfg.channellabels = 'yes'; > >>>>> > >>>>> cfg.highlight = 'labels'; > >>>>> > >>>>> cfg.highlightchannel = find(stat.mask); > >>>>> > >>>>> cfg.comment = 'no'; > >>>>> > >>>>> figure; ft_topoplotER(cfg, GA_90) > >>>>> > >>>>> title('Nonparametric: significant with cluster multiple > >>>>> comparison > >>>>> correction') > >>>>> > >>>>> > >>>>> Do you have ANY idea to this? I am really completely > >>>>> helpless.... > >>>>> > >>>>> thanks and best > >>>>> > >>>>> Katrin > >>>>> > >>>>> _______________________________________________ > >>>>> 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 > >>> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> > >> -------------------------------------------------------------------------------- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.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: > > > > > > ------------------------------ > > > > Message: 3 > > Date: Mon, 08 Sep 2014 21:55:44 -0400 > > From: Joseph Dien > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> > > Content-Type: text/plain; charset="windows-1252" > > > > yes, please do send me the data. > > > > Thanks! > > > > Joe > > > > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann > > wrote: > > > >> Dear Joseph, thanks so much, I really appreciate your help. I was > >> also wandering, if maybe there is another bug in my code. > >> Our nets are 128 channels, Hydrocel, but as a colleague of me > >> adviced me to do so, I also tried the 129 layout. > >> My code you find below (without selection of bad channels etc.) > >> If you need also the data of two subjects to have a look, let me > >> know!!! > >> Best and thanks really! > >> Katrin > >> > >> > >> > >> subject=input('Which subject do you want to analyse? ','s'); > >> > >> name = strcat(subject,'.raw'); > >> > >> subjectnumber=input('Which is the subjectnumber?', 's'); > >> > >> sb=subjectnumber > >> > >> %subjectnumber = strcat(subjectnumber, '.txt') > >> > >> %% > >> > >> > >> > >> cfg = []; > >> > >> cfg.dataset = name; > >> > >> cfg.trialfun = 'ft_trialfun_general'; % this is the default > >> > >> cfg.trialdef.eventtype = 'trigger'; > >> > >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > >> trigger > >> > >> cfg.trialdef.prestim = 0.234; % in seconds > >> > >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > >> observation, but maybe we need less) > >> > >> cfg = ft_definetrial(cfg); > >> > >> > >> > >> cfg.trl([1:7],:) = []; > >> > >> > >> > >> %change timeline according to constant offset of 16 ms = 8 samples > >> (because recorded with 500 hz)in > >> > >> %structure trial > >> > >> cfg.trl(:,3)=cfg.trl(:,3)-8 > >> > >> > >> > >> %change timeline to make the cut the zeropoint > >> > >> > >> > >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; > >> > >> > >> > >> > >> > >> %% preprocess data > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.detrend = 'yes'; > >> > >> cfg.preproc.demean = 'yes'; > >> > >> cfg.preproc.baselinewindow = [-2.1 -2.0] > >> > >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > >> filtered > >> > >> %(0.1-45) and bad channels have to be replaced!!!! > >> > >> %cfg.preproc.bpfreq = [6 32]; > >> > >> % > >> > >> % > >> > >> obs_data = ft_preprocessing(cfg); > >> > >> % > >> > >> save (strcat(sb,'obs_data') , 'obs_data') > >> > >> > >> > >> %% determining channel neighbours (necessary for Artifact > >> detection) > >> > >> cfg = []; > >> > >> cfg.channel = obs_data.label; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.feedback = 'yes'; > >> > >> lay = ft_prepare_layout(cfg); > >> > >> > >> cfg_neighb = []; > >> > >> cfg_neighb.feedback = 'yes'; > >> > >> > >> > >> cfg_neighb.method = 'triangulation'; > >> > >> cfg_neighb.layout = 'GSN128.sfp'; > >> > >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> obs_data.elec = ft_read_sens('GSN128.sfp'); > >> > >> > >> > >> %% Artifacts - to detect bad channels - is not saved!!! > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs_data_try = ft_rejectvisual(cfg, obs_data); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_try = ft_rejectartifact (cfg,obs_data); > >> > >> > >> > >> > >> > >> %% Preparing neighbours for channel repair - but bad channel info > >> in!!! > >> > >> > >> > >> % cfg_neighb = []; > >> > >> % cfg_neighb.feedback = 'yes'; > >> > >> % cfg_neighb.method = 'triangulation'; > >> > >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > >> > >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> % Interpolate and put into new data structure > >> > >> cfg = []; > >> > >> cfg.badchannel = {}; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.method = 'nearest'; > >> > >> cfg.neighbours = neighbours; > >> > >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >> > >> > >> > >> % Check reconstruction > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> % dat1=obs_data; > >> > >> % dat2=obs_data_channelrepaired; > >> > >> % > >> > >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > >> > >> % y=dat2.trial{1}(62,:); > >> > >> % plot(x);hold on;plot(y,'r'); > >> > >> % > >> > >> % x=dat1.trial{1}(72,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> % > >> > >> % x=dat1.trial{1}(75,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> %% artifact rejection/trial inspection - throw out electrode jumps > >> etc. > >> > >> > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > >> according to channels interpolated %% 128-number of interp. > >> channels) > >> > >> > >> cfg = []; > >> > >> cfg.channel = {'all'}; > >> > >> cfg.numcomponent = 128 > >> > >> comp = ft_componentanalysis(cfg,obs_data_clean1); > >> > >> save (strcat(sb,'comp_all') , 'comp') > >> > >> > >> > >> %% > >> > >> cfg = []; > >> > >> cfg.viewmode = 'component'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='some'; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> ft_databrowser(cfg,comp); > >> > >> > >> > >> %% poweranalysis components > >> > >> cfg = []; > >> > >> cfg.output = 'pow'; > >> > >> cfg.channel = 'all';%compute the power spectrum in all ICs > >> > >> cfg.method = 'mtmfft'; > >> > >> cfg.taper = 'hanning'; > >> > >> cfg.foi = 0:0.2:50; > >> > >> obs_freq = ft_freqanalysis(cfg, comp); > >> > >> > >> > >> %And you can plot the spectra: > >> > >> > >> > >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > >> > >> nsubplots = 16; > >> > >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > >> decimals, type doc subplot > >> > >> > >> > >> Nfigs = ceil(size(comp.topo,1)/nsubplots); > >> > >> tot = Nfigs*nsubplots; > >> > >> > >> > >> rptvect = 1:size(comp.topo,1); > >> > >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > >> > >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; > >> > >> > >> > >> for r=1:size(rptvect,1); > >> > >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 > >> 1]);%full screen > >> > >> k=0; > >> > >> for j=1:size(rptvect,2); > >> > >> if~(rptvect(r,j)==0); > >> > >> k=k+1; > >> > >> cfg=[]; > >> > >> cfg.channel = rptvect(r,j); > >> > >> cfg.ylim =[0 500] > >> > >> cfg.xlim =[0 50] > >> > >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > >> > >> end > >> > >> end > >> > >> end > >> > >> > >> > >> %For the IC topos you'll follow the same logic as above but with: > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [1:20]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [21:40]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [41:60]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [61:80]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% Seperate observation conditions > >> > >> > >> > >> name1= strcat(num2str(sb),'_90.xls'); > >> > >> list1=xlsread (name1) > >> > >> > >> > >> name2= strcat(num2str(sb),'_180.xls'); > >> > >> list2=xlsread (name2) > >> > >> > >> % > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list1] > >> > >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list2] > >> > >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> %%PIPELINE FOR obs90 > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128; > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> > >> > >> comp_1 = ft_componentanalysis(cfg, obs90_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > >> obs90_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts - final detection > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs90_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > >> > >> > >> > >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > >> > >> > >> > >> %% plot it > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% PIPELINE FOR obs180 > >> > >> > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128 > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> comp_2 = ft_componentanalysis(cfg, obs180_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > >> obs180_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts final 180 > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs180_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > >> > >> > >> > >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > >> > >> > >> > >> %% plot 180 ERP > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs180_data_ERP) > >> > >> > >> > >> %% plot both ERPs > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> cfg.showlabels = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > >> > >> > >> > >> %% plot difference wave > >> > >> > >> > >> difference = obs180_data_ERP; % copy one of > >> the structures > >> > >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % > >> compute the difference ERP > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, difference) > >> > >> > >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI data. A couple things. First of all, exactly which net do > >> you use? If they are 129-channel, there is still the question of > >> whether they are the Hydrocel or the older geodesic nets. > >> Regardless, that shouldn't cause an error like this. Could you > >> send me the file you are trying to process and the script you are > >> using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini > >> wrote: > >> > >>> Which nets do you use? I use EGI. I tried both the ones you > >>> mention and they didn't work. It was hard to find that exact one > >>> online but it was the only file that actually worked. > >>> > >>> > >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >>> wrote: > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one I use > >>> > >>> > >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > >>> wrote: > >>> Dear all, my problems seem neverending. This time however i really > >>> need help. > >>> I implemented a pipeline for ERPs. All works now, trialdefinition, > >>> preprocessing, channelreplacement, ica, componentrejection, final > >>> artifactdetection, timelock of the single subject data. However, > >>> when I wanna compute the grandaverage of the single subjects I get > >>> the following error message: > >>> > >>> computing average of avg over 19 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 3 MB > >>> computing average of avg over 2 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 0 MB > >>> the call to "ft_prepare_layout" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> the call to "ft_topoplotER" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> > >>> Furthermore in the plot of the significant clusters, the > >>> channelnames are mixed up (do not correspond to my net) > >>> > >>> > >>> I guess that there is a problem with the layout I use. > >>> Here the code that I use > >>> > >>> %For generating the layout (also in the single subjects): > >>> cfg = []; > >>> > >>> cfg.channel = obs_data.label; > >>> > >>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>> > >>> cfg.feedback = 'yes'; > >>> > >>> lay = ft_prepare_layout(cfg); > >>> > >>> > >>> cfg_neighb = []; > >>> > >>> cfg_neighb.feedback = 'yes'; > >>> > >>> cfg_neighb.method = 'triangulation'; > >>> > >>> cfg_neighb.layout = lay; > >>> > >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>> > >>> > >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>> > >>> > >>> > >>> %For computing the grand average > >>> > >>> cfg = []; > >>> > >>> cfg.channel = 'all'; > >>> > >>> cfg.latency = 'all'; > >>> > >>> cfg.parameter = 'avg'; > >>> > >>> cfg.keepindividual = 'no' > >>> > >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>> > >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>> > >>> % "{:}" means to use data from all elements of the variable > >>> > >>> > >>> For plotting the significant clusters > >>> > >>> cfg = []; > >>> > >>> cfg.style = 'blank'; > >>> > >>> cfg.layout = lay; > >>> > >>> cfg.channellabels = 'yes'; > >>> > >>> cfg.highlight = 'labels'; > >>> > >>> cfg.highlightchannel = find(stat.mask); > >>> > >>> cfg.comment = 'no'; > >>> > >>> figure; ft_topoplotER(cfg, GA_90) > >>> > >>> title('Nonparametric: significant with cluster multiple comparison > >>> correction') > >>> > >>> > >>> > >>> Do you have ANY idea to this? I am really completely helpless.... > >>> > >>> thanks and best > >>> > >>> Katrin > >>> > >>> > >>> _______________________________________________ > >>> 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 > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> -------------------------------------------------------------------------------- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.com > >> > >> > >> _______________________________________________ > >> 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 > > > > -------------------------------------------------------------------------------- > > > > Joseph Dien, PhD > > Research Associate > > Cognitive Neurology > > The Johns Hopkins University School of Medicine > > > > Lab E-mail: jdien1 at jhmi.edu > > Private E-mail: jdien07 at mac.com > > Office Phone: 410-614-3115 > > Cell Phone: 202-297-8117 > > Fax: 410-955-0188 > > http://joedien.com > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 4 > > Date: Tue, 9 Sep 2014 06:37:13 +0000 > > From: "Caspar, Emilie" > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > > bad > > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi Ashley, > > > > Maybe the mistake is you did not integrate in your script the > > command to save the rejection. Normally, with the following command, > > you will see in the Matlab Window that artifacts are correctly > > rejected after the "quit" button. > > > > clean_data = ft_rejectvisual(cfg, interpoldata); > > cfg.artfctdef.reject = 'complete'; > > cfg.artfctdef.feedback = 'yes'; > > cleandata = ft_rejectartifact(cfg,clean_data); > > > > Emilie > > > > > > > > > > > > Le 3 sept. 2014 ? 11:58, Ashley Greene > > > a ?crit : > > > > Hello, > > > > I have used the rejectvisual function in attempt to remove bad > > trials, but after marking them and pressing the quit button, > > although the command window states that the selected trials have > > been removed, there is no obvious change in the data; all of the > > trials are still intact. Have I overlooked something? > > > > Thanks, > > > > Ashley > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 5 > > Date: Tue, 09 Sep 2014 14:16:20 +0200 > > From: Patricia Wollstadt > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: <540EEF94.9080601 at gmx.de> > > Content-Type: text/plain; charset="windows-1252" > > > > Hello Max, > > > > I added a few comments to the questions regarding individual > > parameters > > below. To address the general problem of TRENTOOL telling you, that > > there are not enough sample points in your data: From what I can see > > in > > your script, you probably don't have enough data points in each time > > series to robustly estimate TE. You analyze 800 ms of data sampled > > at > > 300 Hz, which gives you 240 samples per time series. Can you maybe > > avoid > > downsampling to 300 Hz and downsample to 600 Hz instead? Or could > > you > > analyze a longer time window of interest? > > Note that you also 'lose' data to embedding and the interaction > > delay: > > The first point that can be used for TE estimation is at max. > > embedding > > length + max. interaction delay in samples. For example: max. > > embedding > > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the > > max > > interaction delay of 30 ms = 9 samples. In this example, you would > > be > > left with 240 - 29 samples for TE estimation per trial. There is > > also > > the possibility to estimate time resolved TE/TE for shorter time > > windows > > of interest (see section 4.4 in the manual); however, this method > > requires the use of a GPU for TE estimation. > > > > I would further recommend to use the new pipeline for group > > statistics > > described in the manual in section 4.5 (the function > > 'TEgroup_calculate' > > is deprecated). The new pipeline allows you to reconstruct the > > interaction delay and uses the following functions (see also > > comments in > > the script): > > > > TEgroup_prepare -> prepares all data sets (all subjects/all > > conditions) for group analysis (this means finding common embedding > > parameters such that estimates are not biased between groups) > > InteractionDelayReconstruction_calculate -> estimates TE for > > individual data sets and all assumed interaction delays u > > InteractionDelayReconstruction_analyze -> reconstructs the > > interaction delay by selecting the u that maximizes TE for each > > channel > > TEgroup_stats -> calculate group statistics using a permutation test > > > > I can send you an example script for group TE analysis using this > > pipeline to get you started. I hope this helps you to get the group > > analysis running. Just write again if you're having trouble setting > > up > > the pipeline or something is not clear about the parameters/my > > comments. > > > > Best, > > Patricia > > > > > > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not > >> 100% sure if it is appropriate to ask questions about it here, but > >> to > >> the best of my knowledge they do not have a mailing list and I saw > >> a > >> few trentool questions in the archives, so I'm going to assume it's > >> ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present > >> in the pipeline. Sorry in advance for the long post! Any help would > >> be > >> greatly appreciated as I'm a bit over my head on this but I think > >> I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data > >> that was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi is > >> in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within the toi, but beyond that are there any benefits to it being > >> earlier or later?* PW: The predictiontime_u is in milliseconds and > >> the > >> toi is in seconds. The prediction time is the assumed interaction > >> delay between your two sources and should fit within your toi. In > >> general it is preferable to use the method for interaction delay > >> reconstruction for TE estimation, because it allows you to > >> reconstruct > >> the actual delay between your source and target times series. A > >> non-optimal u/interaction delay may cause an underestimation of TE, > >> so > >> it is recommended to use the pipeline for interaction delay > >> reconstruction whenever estimating TE for unknown delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, so it is best to limit the u range to values that are > >> physiologically plausible. > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the > >> sample rate and filters are used to determine the actthrvalue, but > >> I > >> don't actually know the calculation. 7.5 was a rough guess just to > >> test the pipeline. I'm also uncertain of what minnrtrials should > >> be.* > >> PW: You can set the actthrvalue based on the filtering you did > >> prior > >> to TE analysis. If you for example highpass filtered at 10 Hz, you > >> shouldn't find an ACT higher than 30 samples, because you filtered > >> out > >> any components of the signal slower than 10 Hz/30 samples (given > >> your > >> sampling frequency of 300 Hz). So in this scenario the actthrvalue > >> would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> * > >> * > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm > >> yet to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* > >> PW: The Ragwitz criterion tries to find optimal embedding > >> parameters > >> dim and tau for the data. To do that, the method iteratively takes > >> all > >> possible combinations of dim and tau values that are provided in > >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well > >> these > >> combinations embed the data. To test an embedding, the method > >> builds > >> the embedding vectors from the data; it then tests for each point > >> how > >> well the next point in time can be predicted from the reference > >> point's nearest neighbours. So for each embedded point, the method > >> searches for the nearest neighbours and calculates the average of > >> those nearest neighbours. The difference between the > >> averaged/predicted point and the actual next point is the error of > >> the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested > >> by the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together with 'ragtausteps' specifies the tau values to be tested > >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, > >> that > >> the values here are factors that are later multiplied with the ACT > >> to > >> obtain the actual tau. 'repPred' is the number of points that will > >> be > >> used for the local prediction, i.e. the Ragwitz criterion will test > >> the local prediction and calculate the error for the first 100 > >> points > >> in your time series. The two parameters 'flagNei' ans 'sizeNei' > >> below > >> specify the type of neighbour search conducted by the Ragwitz > >> criterion: 'flagNei' tells the method to either conduct a kNN or > >> range > >> search; 'sizeNei' specifies the number of neighbours or the radius > >> to > >> be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> * > >> * > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> * > >> * > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.*TRENTOOL seems to handle data output very differently > >> from > >> fieldtrip and I've had trouble thinking through the most logical > >> way > >> to handle the data so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> * > >> * > >> *For clarification, fileCell is a cell with the name of each > >> condition > >> x subject .mat file, which as I said before is collectively the > >> same > >> as the 3 x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> * > >> * > >> *At this step I get the following error: > >> > >> Error using transferentropy (line 337) > >> \nTRENTOOL ERROR: not enough data points left after embedding > >> > >> Error in TEgroup_calculate (line 133) > >> [TEresult] = transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate > >> is a pipeline issue* (I noticed the example pipeline in trentool, > >> the > >> manual, and published methods articles all seem to have slightly or > >> significantly different pipeline compositions), *or if the error > >> is* > >> due to ACT, ragwitz optimization, or some other faulty > >> parameterization *on my part due to a lack of understanding of how > >> transfer entropy works on a more theoretical/mathematical level*. > >> If > >> the latter is the case, is there any relatively straightforward way > >> to > >> conceptualize this, or is this something where I'm just going to > >> have > >> to keep reading and rereading until it eventually makes sense? I've > >> already done quite a bit of that and it hasn't pierced my thick > >> skull > >> yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> 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: > > > > > > ------------------------------ > > > > Message: 6 > > Date: Tue, 9 Sep 2014 15:21:20 +0200 > > From: Holger Krause > > To: FieldTrip discussion list > > Subject: [FieldTrip] Latest FT version on ftp-server is from three > > days ago > > Message-ID: > > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> > > Content-Type: text/plain; charset="us-ascii" > > > > Dear developers, > > > > Could you please check the process for creation/publication of > > zip-files on > > the FTP server? The latest file I can find there is > > fieldtrip-20140906.zip. > > > > Thanks in advance, > > > > Holger > > > > > > ------------------------------ > > > > Message: 7 > > Date: Tue, 9 Sep 2014 09:19:55 -0400 > > From: Max Cantor > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > This is immensely helpful, thank you. I was very confused about why > > some > > versions of the pipeline I saw were using group calculate and others > > were > > using interaction delay reconstruction and what that meant, and I > > think I > > have a more clear idea of what the different steps of the pipeline > > are > > doing. There are still a few things I'm a bit confused about though > > in > > terms of the pipeline. For instance, whether or not I need to do > > TEprepare > > before group prepare, and if I need to do graph analysis (which I'm > > not > > sure I fully understand but also haven't looked deeply into) before > > group > > stats. > > > > If you don't mind me taking you up on your offer, I think seeing > > your > > example script might help clarify some of these issues. > > > > Thank you! > > > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > > Patricia.Wollstadt at gmx.de> wrote: > > > >> Hello Max, > >> > >> I added a few comments to the questions regarding individual > >> parameters > >> below. To address the general problem of TRENTOOL telling you, that > >> there > >> are not enough sample points in your data: From what I can see in > >> your > >> script, you probably don't have enough data points in each time > >> series to > >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, > >> which > >> gives you 240 samples per time series. Can you maybe avoid > >> downsampling to > >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a > >> longer time > >> window of interest? > >> Note that you also 'lose' data to embedding and the interaction > >> delay: The > >> first point that can be used for TE estimation is at max. embedding > >> length > >> + max. interaction delay in samples. For example: max. embedding > >> length = > >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max > >> interaction > >> delay of 30 ms = 9 samples. In this example, you would be left with > >> 240 - > >> 29 samples for TE estimation per trial. There is also the > >> possibility to > >> estimate time resolved TE/TE for shorter time windows of interest > >> (see > >> section 4.4 in the manual); however, this method requires the use > >> of a GPU > >> for TE estimation. > >> > >> I would further recommend to use the new pipeline for group > >> statistics > >> described in the manual in section 4.5 (the function > >> 'TEgroup_calculate' is > >> deprecated). The new pipeline allows you to reconstruct the > >> interaction > >> delay and uses the following functions (see also comments in the > >> script): > >> > >> TEgroup_prepare -> prepares all data sets (all subjects/all > >> conditions) > >> for group analysis (this means finding common embedding parameters > >> such > >> that estimates are not biased between groups) > >> InteractionDelayReconstruction_calculate -> estimates TE for > >> individual data sets and all assumed interaction delays u > >> InteractionDelayReconstruction_analyze -> reconstructs the > >> interaction delay by selecting the u that maximizes TE for each > >> channel > >> TEgroup_stats -> calculate group statistics using a permutation > >> test > >> > >> I can send you an example script for group TE analysis using this > >> pipeline > >> to get you started. I hope this helps you to get the group analysis > >> running. Just write again if you're having trouble setting up the > >> pipeline > >> or something is not clear about the parameters/my comments. > >> > >> Best, > >> Patricia > >> > >> > >> > >> > >> On 09/04/2014 08:30 PM, Max Cantor wrote: > >> > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not 100% > >> sure if it is appropriate to ask questions about it here, but to > >> the best > >> of my knowledge they do not have a mailing list and I saw a few > >> trentool > >> questions in the archives, so I'm going to assume it's ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present in > >> the pipeline. Sorry in advance for the long post! Any help would be > >> greatly > >> appreciated as I'm a bit over my head on this but I think I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data that > >> was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi > >> is in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within > >> the toi, but beyond that are there any benefits to it being earlier > >> or > >> later?* PW: The predictiontime_u is in milliseconds and the toi is > >> in > >> seconds. The prediction time is the assumed interaction delay > >> between your > >> two sources and should fit within your toi. In general it is > >> preferable to > >> use the method for interaction delay reconstruction for TE > >> estimation, > >> because it allows you to reconstruct the actual delay between your > >> source > >> and target times series. A non-optimal u/interaction delay may > >> cause an > >> underestimation of TE, so it is recommended to use the pipeline for > >> interaction delay reconstruction whenever estimating TE for unknown > >> delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, > >> so it is best to limit the u range to values that are > >> physiologically > >> plausible. > >> > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the sample > >> rate and filters are used to determine the actthrvalue, but I don't > >> actually know the calculation. 7.5 was a rough guess just to test > >> the > >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: > >> You can > >> set the actthrvalue based on the filtering you did prior to TE > >> analysis. If > >> you for example highpass filtered at 10 Hz, you shouldn't find an > >> ACT > >> higher than 30 samples, because you filtered out any components of > >> the > >> signal slower than 10 Hz/30 samples (given your sampling frequency > >> of 300 > >> Hz). So in this scenario the actthrvalue would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm yet > >> to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* PW: > >> The Ragwitz criterion tries to find optimal embedding parameters > >> dim and > >> tau for the data. To do that, the method iteratively takes all > >> possible > >> combinations of dim and tau values that are provided in cfgP.ragdim > >> and > >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations > >> embed > >> the data. To test an embedding, the method builds the embedding > >> vectors > >> from the data; it then tests for each point how well the next point > >> in time > >> can be predicted from the reference point's nearest neighbours. So > >> for each > >> embedded point, the method searches for the nearest neighbours and > >> calculates the average of those nearest neighbours. The difference > >> between > >> the averaged/predicted point and the actual next point is the error > >> of the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested by > >> the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together > >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL > >> will > >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values > >> here are > >> factors that are later multiplied with the ACT to obtain the actual > >> tau. > >> 'repPred' is the number of points that will be used for the local > >> prediction, i.e. the Ragwitz criterion will test the local > >> prediction and > >> calculate the error for the first 100 points in your time series. > >> The two > >> parameters 'flagNei' ans 'sizeNei' below specify the type of > >> neighbour > >> search conducted by the Ragwitz criterion: 'flagNei' tells the > >> method to > >> either conduct a kNN or range search; 'sizeNei' specifies the > >> number of > >> neighbours or the radius to be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' > >> data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject > >> virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.* > >> TRENTOOL seems to handle data output very differently from > >> fieldtrip and > >> I've had trouble thinking through the most logical way to handle > >> the data > >> so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> > >> *For clarification, fileCell is a cell with the name of each > >> condition x > >> subject .mat file, which as I said before is collectively the same > >> as the 3 > >> x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> > >> > >> > >> > >> > >> > >> > >> *At this step I get the following error: Error using > >> transferentropy (line > >> 337) \nTRENTOOL ERROR: not enough data points left after embedding > >> Error in > >> TEgroup_calculate (line 133) [TEresult] = > >> transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate is a > >> pipeline issue* (I noticed the example pipeline in trentool, the > >> manual, > >> and published methods articles all seem to have slightly or > >> significantly > >> different pipeline compositions), *or if the error is* due to ACT, > >> ragwitz optimization, or some other faulty parameterization *on my > >> part > >> due to a lack of understanding of how transfer entropy works on a > >> more > >> theoretical/mathematical level*. If the latter is the case, is > >> there any > >> relatively straightforward way to conceptualize this, or is this > >> something > >> where I'm just going to have to keep reading and rereading until it > >> eventually makes sense? I've already done quite a bit of that and > >> it hasn't > >> pierced my thick skull yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> fieldtrip mailing > >> listfieldtrip at donders.ru.nlhttp://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 > >> > > > > > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > -------------- 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 46, Issue 3 > > **************************************** > > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen From f.roux at bcbl.eu Mon Sep 15 12:09:24 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Mon, 15 Sep 2014 12:09:24 +0200 (CEST) Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs In-Reply-To: <81946224.3066122.1410775297001.JavaMail.root@bcbl.eu> Message-ID: <867006743.3066178.1410775764568.JavaMail.root@bcbl.eu> Dear all, my question relates to the computation of combined planar gradients using the ft_combineplanar function. Our data has been recorded with an Elekta Neuromag 306 channel system, and I would like to know if it is "safe" to compute combined gradients before calling ft_freqstatistics, if the input data contains single trial TFRs. The reason why I am asking is because in the documentation of the function it says % Use as % [data] = ft_combineplanar(cfg, data) % where data contains an averaged planar gradient (either ERF or TFR). However, the following tutorial suggests that this can be safely applied if the input data contains TFRs which have been computed with the cfg.keeptrials = 'yes' option: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq I am bit confused as both information (the fieldtrip documentation and the tutorial) seem to contradict each other. The 2 options that are see are: 1) compute TFRs with cfg.keeptrials = 'yes', then call ft_frestatistics, then call ft_combineplanar by using the output of ft_freqstatistics as input for the ft_combineplanar function. 2) compute TFRs with cfg.keeptrials = 'yes', then call ft_combineplanar, then call ft_freqstatistics Could anyone with experience on this issue please let me know what the best way to proceed would be? Fred --------------------------------------------------------------------------- From gamaliel.ghu at gmail.com Mon Sep 15 18:12:38 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Mon, 15 Sep 2014 13:12:38 -0300 Subject: [FieldTrip] dipole simulation on head model Message-ID: hi all I hope you can help my problem. I have generated a model of head fieldtrip, and now I need to simulate sources at different positions within the crust generated. I followed the tutorial head model generation for EEG. However I have not found information on how to simulate a source. Any help would be welcome. Thank you greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Mon Sep 15 18:38:26 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 15 Sep 2014 18:38:26 +0200 Subject: [FieldTrip] dipole simulation on head model In-Reply-To: References: Message-ID: <6677301D-D72C-4C12-BC84-779D5E4DF8F3@uni-konstanz.de> Dear Gamaliel, you might try something like this: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit good luck tzvetan Am 15.09.2014 um 18:12 schrieb gamaliel huerta urrea : > hi all > > I hope you can help my problem. > > I have generated a model of head fieldtrip, and now I need to simulate sources at different positions within the crust generated. I followed the tutorial head model generation for EEG. However I have not found information on how to simulate a source. Any help would be welcome. > > Thank you > greetings > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 jingfan.jf at gmail.com Mon Sep 15 19:40:41 2014 From: jingfan.jf at gmail.com (Jing Fan) Date: Mon, 15 Sep 2014 12:40:41 -0500 Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' In-Reply-To: <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> References: <20140910140714.9n2t9bxs008o400c@imap.uni-ulm.de> <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> Message-ID: <000001cfd10c$2b7786a0$826693e0$@gmail.com> Hi Jim, I download the latest .zip file from FTP. I received the same error message when calling function ft_definetrial(cfg). It seems to me that ft_preamble init command will go to script ft_preamble.m instead of ft_preamble_init.m. Any help to resolve this issue will be appreciated. Best, Jing -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) Sent: Monday, September 15, 2014 5:01 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' Dear Barbara, The error seems to be related to a bug that pops up now and then (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a corrupt installation of fieldtrip and/or the need to update fieldtrip. Could you please try downloading the most recent version of fieldtrip and see if the problem persists? For an example of what can be expected from this function see: Esser SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. Best, Jim ----- Oorspronkelijk bericht ----- > Van: "barbara schorr" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 10 september 2014 14:07:14 > Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' > Dear fieldtripers. > > as mentioned in the subject line I would like to anaylse my timelocked > ERP Data with the function ft_globalmeanfield. > > I get the Error: Undefined function or variable 'abort' > Error in ft_globalmeanfield (line84) > if abort > > in the function it says: > > %the abort variable is set to true or false in ft_preamble_inti > if abort > % do not continue function execution in case the outputfile is > present and the user indicated to keep it > return > end > > > I don't understand what this means. I would really appreciate your > help to get this running. > > Also, what is the result when I run this function on my data? (This > method was proposed from a reviewer. I never used it before, so I > don't exactly know what it does and what the result will look like). > > Thank you very much in advance! > > Best, > > Barbara Schorr > > > > > Zitat von 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: Question regarding nonparametric testing for coherence > > differences (Eric Maris) > > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) > > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) > > 4. Re: ft_rejectvisual: removing trials marked as bad > > (Caspar, Emilie) > > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) > > 6. Latest FT version on ftp-server is from three days ago > > (Holger Krause) > > 7. Re: TRENTOOL pipeline help (Max Cantor) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) > > From: "Eric Maris" > > To: , "'FieldTrip discussion list'" > > > > Subject: Re: [FieldTrip] Question regarding nonparametric testing > > for > > coherence differences > > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> > > Content-Type: text/plain; charset="utf-8" > > > > Dear Hwee Ling, > > > > > > > > In the paper you refer to (Maris et al, JNM, 2007), I did not > > perform a > > cluster-based permutation test at the level of the channel pairs. > > Instead, > > all coherences mentioned in the paper are coherence between a single > > EMG > > channel (2 electrodes mounted on the forearm) and all MEG > > electrodes. Thus, > > there are as many EMG-MEG coherences as there are MEG channels (275 > > in our > > lab), and the clustering of these coherences involves the same > > neighbourhood > > structure as the clustering of channel-specific statistics on power > > or > > evoked response. The analysis you propose involves clustering in a > > much more > > complex space, namely the formed by all (MEG,MEG) channel pairs > > (275*275=75625 pairs). In the early days of cluster-based > > permutation > > statistics, I have worked on this problem but did not pursue it > > because the > > resulting clusters are very hard to interpret. > > > > > > > > Best, > > > > > > > > Eric Maris > > > > > > > > > > > > Dear all and Prof Maris, > > > > I'm re-posting this question again, as I didn't get any replies > > previously. > > > > I?m interested to investigate if there are any differences in phase > > synchronization in resting state data at timepoint 2 versus > > timepoint 1. The > > EEG data was collected using 64 EEG channels, resting state, eyes > > opened and > > eyes closed. I?ve arbitrarily segmented the resting state data into > > epochs > > of 2s each, and the epochs with artifacts are excluded completely > > from > > further analyses. I then performed mtmfft to get the fourier > > representation > > of the data, extracted the coherence, and compared the coherence > > difference > > of timepoint 2 versus timepoint 1 of all channels paired with all > > other > > channels. > > > > I figured that if I extract the connectivity analyses without > > specifying the > > channelcmb, I get a 'chan_chan_freq' dimord variable that would > > allow me to > > perform cluster-based statistical analyses. I get an output with > > ?chan_chan? > > dimord variable. However, I was not 100% sure that this is correct, > > hence, I?ve > > inserted my code (see below). It?ll be great if you could tell me if > > what I?m > > doing makes any sense at all. Also, I don?t know how I can plot the > > results > > to see if it make any sense at all. > > > > Also, I checked the values obtained from when I specified > > "cfg.channelcmb" > > and when I did not specify "cfg.channelcmb", I noticed that the > > values were > > somehow different. I would assume that the values to be similar, > > although > > I'm not sure why they would have differences in the values obtained > > from > > specifying "cfg.channelcmb". > > > > This is my code that I've used thus far: > > > > for sub = 1:5 > > > > cfg = []; > > > > cfg.output = 'fourier'; > > > > cfg.channel = {'all'}; > > > > cfg.method = 'mtmfft'; > > > > cfg.keeptrials = 'yes'; > > > > cfg.tapsmofrq = 5; > > > > cfg.foilim = [0 100]; > > > > cfg.taper = 'dpss'; > > > > % find the index for the c200 condition > > > > pre_c200_idx = find(data5.trialinfo == 201); > > > > cfg.trials = pre_c200_idx; > > > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > > > post_c200_idx = find(data5.trialinfo == 200); > > > > cfg.trials = post_c200_idx; > > > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > > > > > cfg = []; > > > > cfg.keeptrials = 'no'; > > > > cfg.channel = {'all'}; > > > > cfg.removemean = 'yes'; > > > > cfg.method = 'coh'; > > > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_pre_c200); > > > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_post_c200); > > > > end > > > > > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat '); > > > > cfg_neighb.method = 'template'; > > > > cfg_neighb.layout = lay; > > > > cfg_neighb.channel = 'all'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, > > sub_HLF_pre_c200coh{1}); > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.neighbours = neighbours; > > > > cfg.channel = 'all'; > > > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > > > cfg.latency = 'all'; > > > > cfg.avgovertime = 'no'; > > > > cfg.avgoverchan = 'no'; > > > > cfg.parameter = 'cohspctrm'; > > > > cfg.method = 'montecarlo'; > > > > cfg.statistic = 'depsamplesT'; > > > > cfg.correctm = 'cluster'; > > > > cfg.tail = 0; > > > > % cfg.clustertail = 0; > > > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 > > frequency > > bands. > > > > cfg.numrandomization = 10000; > > > > cfg.ivar = 2; > > > > cfg.uvar = 1; > > > > > > > > % design matrices > > > > clear design; > > > > design(1,:) = [1:5, 1:5]; > > > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > > > cfg.design = design; > > > > % for theta band > > > > cfg.avgoverfreq = 'yes'; > > > > cfg.frequency = [4 8]; % I also performed the statistics for delta > > (2-4), > > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma > > (30-40), > > and gamma (40-100). > > > > [diffc200_theta_stat] = ft_freqstatistics(cfg, > > sub_HLF_post_c200coh{:}, > > sub_HLF_pre_c200coh{:}); > > > > > > > > When I tried to plot the results, I used this code: > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.layout = 'lay'; > > > > cfg.zlim = [-1 1]; > > > > cfg.alpha = 0.05; > > > > cfg.refchannel = 'all'; > > > > ft_clusterplot(cfg, diffc200_theta_stat); > > > > However, I was not sure how I could plot the results. I get an error > > message > > from Fieldtrip when using ft_clusterplot: > > > > Error using topoplot_common (line 366) > > > > no reference channel is specified > > > > Error in ft_topoplotTFR (line 192) > > > > [cfg] = topoplot_common(cfg, varargin{:}); > > > > Error in ft_clusterplot (line 372) > > > > ft_topoplotTFR(cfgtopo, stat); > > > > > > > > According to your paper in 2007, the topoplot of the results were > > masked by > > the spatio-spectral pattern of the significant clusters. I don't > > know how to > > do this, and I would really appreciate if you can show me how to > > make such a > > plot. > > > > Thank you very much. > > > > Kind regards, > > > > Hweeling > > > > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 2 > > Date: Mon, 8 Sep 2014 21:38:01 +0200 > > From: KatrinH Heimann > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > Dear Joseph, thanks so much, I really appreciate your help. I was > > also > > wandering, if maybe there is another bug in my code. > > Our nets are 128 channels, Hydrocel, but as a colleague of me > > adviced me to > > do so, I also tried the 129 layout. > > My code you find below (without selection of bad channels etc.) > > If you need also the data of two subjects to have a look, let me > > know!!! > > Best and thanks really! > > Katrin > > > > > > subject=input('Which subject do you want to analyse? ','s'); > > > > name = strcat(subject,'.raw'); > > > > subjectnumber=input('Which is the subjectnumber?', 's'); > > > > sb=subjectnumber > > > > %subjectnumber = strcat(subjectnumber, '.txt') > > > > %% > > > > > > cfg = []; > > > > cfg.dataset = name; > > > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > > > cfg.trialdef.eventtype = 'trigger'; > > > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > > trigger > > > > cfg.trialdef.prestim = 0.234; % in seconds > > > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > > observation, but maybe we need less) > > > > cfg = ft_definetrial(cfg); > > > > > > cfg.trl([1:7],:) = []; > > > > > > %change timeline according to constant offset of 16 ms = 8 samples > > (because > > recorded with 500 hz)in > > > > %structure trial > > > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > > > > %change timeline to make the cut the zeropoint > > > > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > > > > > %% preprocess data > > > > cfg.channel = 'all'; > > > > cfg.preproc.detrend = 'yes'; > > > > cfg.preproc.demean = 'yes'; > > > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > > filtered > > > > %(0.1-45) and bad channels have to be replaced!!!! > > > > %cfg.preproc.bpfreq = [6 32]; > > > > % > > > > % > > > > obs_data = ft_preprocessing(cfg); > > > > % > > > > save (strcat(sb,'obs_data') , 'obs_data') > > > > > > %% determining channel neighbours (necessary for Artifact detection) > > > > cfg = []; > > > > cfg.channel = obs_data.label; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.feedback = 'yes'; > > > > lay = ft_prepare_layout(cfg); > > > > > > > > cfg_neighb = []; > > > > cfg_neighb.feedback = 'yes'; > > > > > > cfg_neighb.method = 'triangulation'; > > > > cfg_neighb.layout = 'GSN128.sfp'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > > > > > %% Preparing neighbours for channel repair - but bad channel info > > in!!! > > > > > > % cfg_neighb = []; > > > > % cfg_neighb.feedback = 'yes'; > > > > % cfg_neighb.method = 'triangulation'; > > > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > % Interpolate and put into new data structure > > > > cfg = []; > > > > cfg.badchannel = {}; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.method = 'nearest'; > > > > cfg.neighbours = neighbours; > > > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > > > > % Check reconstruction > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > % dat1=obs_data; > > > > % dat2=obs_data_channelrepaired; > > > > % > > > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > > > % y=dat2.trial{1}(62,:); > > > > % plot(x);hold on;plot(y,'r'); > > > > % > > > > % x=dat1.trial{1}(72,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > % > > > > % x=dat1.trial{1}(75,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > %% artifact rejection/trial inspection - throw out electrode jumps > > etc. > > > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > > according to > > channels interpolated %% 128-number of interp. channels) > > > > > > > > cfg = []; > > > > cfg.channel = {'all'}; > > > > cfg.numcomponent = 128 > > > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > > > save (strcat(sb,'comp_all') , 'comp') > > > > > > %% > > > > cfg = []; > > > > cfg.viewmode = 'component'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='some'; > > > > cfg.layout = 'GSN128.sfp'; > > > > ft_databrowser(cfg,comp); > > > > > > %% poweranalysis components > > > > cfg = []; > > > > cfg.output = 'pow'; > > > > cfg.channel = 'all';%compute the power spectrum in all ICs > > > > cfg.method = 'mtmfft'; > > > > cfg.taper = 'hanning'; > > > > cfg.foi = 0:0.2:50; > > > > obs_freq = ft_freqanalysis(cfg, comp); > > > > > > %And you can plot the spectra: > > > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > nsubplots = 16; > > > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > > decimals, type > > doc subplot > > > > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > > > tot = Nfigs*nsubplots; > > > > > > rptvect = 1:size(comp.topo,1); > > > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > > > > for r=1:size(rptvect,1); > > > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 > > 1]);%full > > screen > > > > k=0; > > > > for j=1:size(rptvect,2); > > > > if~(rptvect(r,j)==0); > > > > k=k+1; > > > > cfg=[]; > > > > cfg.channel = rptvect(r,j); > > > > cfg.ylim =[0 500] > > > > cfg.xlim =[0 50] > > > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > > > end > > > > end > > > > end > > > > > > %For the IC topos you'll follow the same logic as above but with: > > > > > > figure > > > > cfg = []; > > > > cfg.component = [1:20]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [21:40]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [41:60]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [61:80]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > > > > > > > > > %% Seperate observation conditions > > > > > > name1= strcat(num2str(sb),'_90.xls'); > > > > list1=xlsread (name1) > > > > > > > > > > > > name2= strcat(num2str(sb),'_180.xls'); > > > > list2=xlsread (name2) > > > > > > > > % > > > > > > cfg = [] > > > > cfg.trials = [list1] > > > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > cfg = [] > > > > cfg.trials = [list2] > > > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > %%PIPELINE FOR obs90 > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128; > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > > obs90_data); > > > > > > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > > > > > > %% Artifacts - final detection > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > > > > %% plot it > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > > > > > > > > > %% PIPELINE FOR obs180 > > > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128 > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > > obs180_data); > > > > > > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > > > > > > %% Artifacts final 180 > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > > > > %% plot 180 ERP > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs180_data_ERP) > > > > > > %% plot both ERPs > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > cfg.showlabels = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > > > > %% plot difference wave > > > > > > difference = obs180_data_ERP; % copy one of the > > structures > > > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute > > the > > difference ERP > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, difference) > > > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > > > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI > >> data. A couple things. First of all, exactly which net do you use? > >> If > >> they are 129-channel, there is still the question of whether they > >> are the > >> Hydrocel or the older geodesic nets. Regardless, that shouldn't > >> cause an > >> error like this. Could you send me the file you are trying to > >> process and > >> the script you are using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < > >> diezmartini at gmail.com> wrote: > >> > >> Which nets do you use? I use EGI. I tried both the ones you mention > >> and > >> they didn't work. It was hard to find that exact one online but it > >> was the > >> only file that actually worked. > >> > >> > >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >> > >> wrote: > >> > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. > >>> Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one > >>> > >>>> I use > >>>> > >>>> > >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < > >>>> katrinheimann at gmail.com> wrote: > >>>> > >>>>> Dear all, my problems seem neverending. This time however i > >>>>> really need > >>>>> help. > >>>>> I implemented a pipeline for ERPs. All works now, > >>>>> trialdefinition, > >>>>> preprocessing, channelreplacement, ica, componentrejection, > >>>>> final > >>>>> artifactdetection, timelock of the single subject data. However, > >>>>> when I > >>>>> wanna compute the grandaverage of the single subjects I get the > >>>>> following > >>>>> error message: > >>>>> > >>>>> computing average of avg over 19 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 3 MB > >>>>> computing average of avg over 2 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_prepare_layout" took 0 seconds and required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_topoplotER" took 0 seconds and required the > >>>>> additional > >>>>> allocation of an estimated 0 MB > >>>>> > >>>>> Furthermore in the plot of the significant clusters, the > >>>>> channelnames > >>>>> are mixed up (do not correspond to my net) > >>>>> > >>>>> > >>>>> I guess that there is a problem with the layout I use. > >>>>> Here the code that I use > >>>>> > >>>>> %For generating the layout (also in the single subjects): > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = obs_data.label; > >>>>> > >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>>>> > >>>>> cfg.feedback = 'yes'; > >>>>> > >>>>> lay = ft_prepare_layout(cfg); > >>>>> > >>>>> > >>>>> cfg_neighb = []; > >>>>> > >>>>> cfg_neighb.feedback = 'yes'; > >>>>> > >>>>> cfg_neighb.method = 'triangulation'; > >>>>> > >>>>> cfg_neighb.layout = lay; > >>>>> > >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>>>> > >>>>> > >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>>>> > >>>>> > >>>>> %For computing the grand average > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = 'all'; > >>>>> > >>>>> cfg.latency = 'all'; > >>>>> > >>>>> cfg.parameter = 'avg'; > >>>>> > >>>>> cfg.keepindividual = 'no' > >>>>> > >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>>>> > >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>>>> > >>>>> % "{:}" means to use data from all elements of the variable > >>>>> > >>>>> > >>>>> For plotting the significant clusters > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.style = 'blank'; > >>>>> > >>>>> cfg.layout = lay; > >>>>> > >>>>> cfg.channellabels = 'yes'; > >>>>> > >>>>> cfg.highlight = 'labels'; > >>>>> > >>>>> cfg.highlightchannel = find(stat.mask); > >>>>> > >>>>> cfg.comment = 'no'; > >>>>> > >>>>> figure; ft_topoplotER(cfg, GA_90) > >>>>> > >>>>> title('Nonparametric: significant with cluster multiple > >>>>> comparison > >>>>> correction') > >>>>> > >>>>> > >>>>> Do you have ANY idea to this? I am really completely > >>>>> helpless.... > >>>>> > >>>>> thanks and best > >>>>> > >>>>> Katrin > >>>>> > >>>>> _______________________________________________ > >>>>> 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 > >>> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> > >> ---------------------------------------------------------------------------- ---- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.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: > > > > > > ------------------------------ > > > > Message: 3 > > Date: Mon, 08 Sep 2014 21:55:44 -0400 > > From: Joseph Dien > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> > > Content-Type: text/plain; charset="windows-1252" > > > > yes, please do send me the data. > > > > Thanks! > > > > Joe > > > > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann > > wrote: > > > >> Dear Joseph, thanks so much, I really appreciate your help. I was > >> also wandering, if maybe there is another bug in my code. > >> Our nets are 128 channels, Hydrocel, but as a colleague of me > >> adviced me to do so, I also tried the 129 layout. > >> My code you find below (without selection of bad channels etc.) > >> If you need also the data of two subjects to have a look, let me > >> know!!! > >> Best and thanks really! > >> Katrin > >> > >> > >> > >> subject=input('Which subject do you want to analyse? ','s'); > >> > >> name = strcat(subject,'.raw'); > >> > >> subjectnumber=input('Which is the subjectnumber?', 's'); > >> > >> sb=subjectnumber > >> > >> %subjectnumber = strcat(subjectnumber, '.txt') > >> > >> %% > >> > >> > >> > >> cfg = []; > >> > >> cfg.dataset = name; > >> > >> cfg.trialfun = 'ft_trialfun_general'; % this is the default > >> > >> cfg.trialdef.eventtype = 'trigger'; > >> > >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > >> trigger > >> > >> cfg.trialdef.prestim = 0.234; % in seconds > >> > >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > >> observation, but maybe we need less) > >> > >> cfg = ft_definetrial(cfg); > >> > >> > >> > >> cfg.trl([1:7],:) = []; > >> > >> > >> > >> %change timeline according to constant offset of 16 ms = 8 samples > >> (because recorded with 500 hz)in > >> > >> %structure trial > >> > >> cfg.trl(:,3)=cfg.trl(:,3)-8 > >> > >> > >> > >> %change timeline to make the cut the zeropoint > >> > >> > >> > >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; > >> > >> > >> > >> > >> > >> %% preprocess data > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.detrend = 'yes'; > >> > >> cfg.preproc.demean = 'yes'; > >> > >> cfg.preproc.baselinewindow = [-2.1 -2.0] > >> > >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > >> filtered > >> > >> %(0.1-45) and bad channels have to be replaced!!!! > >> > >> %cfg.preproc.bpfreq = [6 32]; > >> > >> % > >> > >> % > >> > >> obs_data = ft_preprocessing(cfg); > >> > >> % > >> > >> save (strcat(sb,'obs_data') , 'obs_data') > >> > >> > >> > >> %% determining channel neighbours (necessary for Artifact > >> detection) > >> > >> cfg = []; > >> > >> cfg.channel = obs_data.label; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.feedback = 'yes'; > >> > >> lay = ft_prepare_layout(cfg); > >> > >> > >> cfg_neighb = []; > >> > >> cfg_neighb.feedback = 'yes'; > >> > >> > >> > >> cfg_neighb.method = 'triangulation'; > >> > >> cfg_neighb.layout = 'GSN128.sfp'; > >> > >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> obs_data.elec = ft_read_sens('GSN128.sfp'); > >> > >> > >> > >> %% Artifacts - to detect bad channels - is not saved!!! > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs_data_try = ft_rejectvisual(cfg, obs_data); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_try = ft_rejectartifact (cfg,obs_data); > >> > >> > >> > >> > >> > >> %% Preparing neighbours for channel repair - but bad channel info > >> in!!! > >> > >> > >> > >> % cfg_neighb = []; > >> > >> % cfg_neighb.feedback = 'yes'; > >> > >> % cfg_neighb.method = 'triangulation'; > >> > >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > >> > >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> % Interpolate and put into new data structure > >> > >> cfg = []; > >> > >> cfg.badchannel = {}; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.method = 'nearest'; > >> > >> cfg.neighbours = neighbours; > >> > >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >> > >> > >> > >> % Check reconstruction > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> % dat1=obs_data; > >> > >> % dat2=obs_data_channelrepaired; > >> > >> % > >> > >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > >> > >> % y=dat2.trial{1}(62,:); > >> > >> % plot(x);hold on;plot(y,'r'); > >> > >> % > >> > >> % x=dat1.trial{1}(72,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> % > >> > >> % x=dat1.trial{1}(75,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> %% artifact rejection/trial inspection - throw out electrode jumps > >> etc. > >> > >> > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > >> according to channels interpolated %% 128-number of interp. > >> channels) > >> > >> > >> cfg = []; > >> > >> cfg.channel = {'all'}; > >> > >> cfg.numcomponent = 128 > >> > >> comp = ft_componentanalysis(cfg,obs_data_clean1); > >> > >> save (strcat(sb,'comp_all') , 'comp') > >> > >> > >> > >> %% > >> > >> cfg = []; > >> > >> cfg.viewmode = 'component'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='some'; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> ft_databrowser(cfg,comp); > >> > >> > >> > >> %% poweranalysis components > >> > >> cfg = []; > >> > >> cfg.output = 'pow'; > >> > >> cfg.channel = 'all';%compute the power spectrum in all ICs > >> > >> cfg.method = 'mtmfft'; > >> > >> cfg.taper = 'hanning'; > >> > >> cfg.foi = 0:0.2:50; > >> > >> obs_freq = ft_freqanalysis(cfg, comp); > >> > >> > >> > >> %And you can plot the spectra: > >> > >> > >> > >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > >> > >> nsubplots = 16; > >> > >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > >> decimals, type doc subplot > >> > >> > >> > >> Nfigs = ceil(size(comp.topo,1)/nsubplots); > >> > >> tot = Nfigs*nsubplots; > >> > >> > >> > >> rptvect = 1:size(comp.topo,1); > >> > >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > >> > >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; > >> > >> > >> > >> for r=1:size(rptvect,1); > >> > >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 > >> 1]);%full screen > >> > >> k=0; > >> > >> for j=1:size(rptvect,2); > >> > >> if~(rptvect(r,j)==0); > >> > >> k=k+1; > >> > >> cfg=[]; > >> > >> cfg.channel = rptvect(r,j); > >> > >> cfg.ylim =[0 500] > >> > >> cfg.xlim =[0 50] > >> > >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > >> > >> end > >> > >> end > >> > >> end > >> > >> > >> > >> %For the IC topos you'll follow the same logic as above but with: > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [1:20]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [21:40]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [41:60]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [61:80]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% Seperate observation conditions > >> > >> > >> > >> name1= strcat(num2str(sb),'_90.xls'); > >> > >> list1=xlsread (name1) > >> > >> > >> > >> name2= strcat(num2str(sb),'_180.xls'); > >> > >> list2=xlsread (name2) > >> > >> > >> % > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list1] > >> > >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list2] > >> > >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> %%PIPELINE FOR obs90 > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128; > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> > >> > >> comp_1 = ft_componentanalysis(cfg, obs90_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > >> obs90_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts - final detection > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs90_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > >> > >> > >> > >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > >> > >> > >> > >> %% plot it > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% PIPELINE FOR obs180 > >> > >> > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128 > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> comp_2 = ft_componentanalysis(cfg, obs180_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > >> obs180_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts final 180 > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs180_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > >> > >> > >> > >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > >> > >> > >> > >> %% plot 180 ERP > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs180_data_ERP) > >> > >> > >> > >> %% plot both ERPs > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> cfg.showlabels = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > >> > >> > >> > >> %% plot difference wave > >> > >> > >> > >> difference = obs180_data_ERP; % copy one of > >> the structures > >> > >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % > >> compute the difference ERP > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, difference) > >> > >> > >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI data. A couple things. First of all, exactly which net do > >> you use? If they are 129-channel, there is still the question of > >> whether they are the Hydrocel or the older geodesic nets. > >> Regardless, that shouldn't cause an error like this. Could you > >> send me the file you are trying to process and the script you are > >> using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini > >> wrote: > >> > >>> Which nets do you use? I use EGI. I tried both the ones you > >>> mention and they didn't work. It was hard to find that exact one > >>> online but it was the only file that actually worked. > >>> > >>> > >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >>> wrote: > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one I use > >>> > >>> > >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > >>> wrote: > >>> Dear all, my problems seem neverending. This time however i really > >>> need help. > >>> I implemented a pipeline for ERPs. All works now, trialdefinition, > >>> preprocessing, channelreplacement, ica, componentrejection, final > >>> artifactdetection, timelock of the single subject data. However, > >>> when I wanna compute the grandaverage of the single subjects I get > >>> the following error message: > >>> > >>> computing average of avg over 19 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 3 MB > >>> computing average of avg over 2 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 0 MB > >>> the call to "ft_prepare_layout" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> the call to "ft_topoplotER" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> > >>> Furthermore in the plot of the significant clusters, the > >>> channelnames are mixed up (do not correspond to my net) > >>> > >>> > >>> I guess that there is a problem with the layout I use. > >>> Here the code that I use > >>> > >>> %For generating the layout (also in the single subjects): > >>> cfg = []; > >>> > >>> cfg.channel = obs_data.label; > >>> > >>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>> > >>> cfg.feedback = 'yes'; > >>> > >>> lay = ft_prepare_layout(cfg); > >>> > >>> > >>> cfg_neighb = []; > >>> > >>> cfg_neighb.feedback = 'yes'; > >>> > >>> cfg_neighb.method = 'triangulation'; > >>> > >>> cfg_neighb.layout = lay; > >>> > >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>> > >>> > >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>> > >>> > >>> > >>> %For computing the grand average > >>> > >>> cfg = []; > >>> > >>> cfg.channel = 'all'; > >>> > >>> cfg.latency = 'all'; > >>> > >>> cfg.parameter = 'avg'; > >>> > >>> cfg.keepindividual = 'no' > >>> > >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>> > >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>> > >>> % "{:}" means to use data from all elements of the variable > >>> > >>> > >>> For plotting the significant clusters > >>> > >>> cfg = []; > >>> > >>> cfg.style = 'blank'; > >>> > >>> cfg.layout = lay; > >>> > >>> cfg.channellabels = 'yes'; > >>> > >>> cfg.highlight = 'labels'; > >>> > >>> cfg.highlightchannel = find(stat.mask); > >>> > >>> cfg.comment = 'no'; > >>> > >>> figure; ft_topoplotER(cfg, GA_90) > >>> > >>> title('Nonparametric: significant with cluster multiple comparison > >>> correction') > >>> > >>> > >>> > >>> Do you have ANY idea to this? I am really completely helpless.... > >>> > >>> thanks and best > >>> > >>> Katrin > >>> > >>> > >>> _______________________________________________ > >>> 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 > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> ---------------------------------------------------------------------------- ---- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.com > >> > >> > >> _______________________________________________ > >> 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 > > > > ---------------------------------------------------------------------------- ---- > > > > Joseph Dien, PhD > > Research Associate > > Cognitive Neurology > > The Johns Hopkins University School of Medicine > > > > Lab E-mail: jdien1 at jhmi.edu > > Private E-mail: jdien07 at mac.com > > Office Phone: 410-614-3115 > > Cell Phone: 202-297-8117 > > Fax: 410-955-0188 > > http://joedien.com > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 4 > > Date: Tue, 9 Sep 2014 06:37:13 +0000 > > From: "Caspar, Emilie" > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > > bad > > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi Ashley, > > > > Maybe the mistake is you did not integrate in your script the > > command to save the rejection. Normally, with the following command, > > you will see in the Matlab Window that artifacts are correctly > > rejected after the "quit" button. > > > > clean_data = ft_rejectvisual(cfg, interpoldata); > > cfg.artfctdef.reject = 'complete'; > > cfg.artfctdef.feedback = 'yes'; > > cleandata = ft_rejectartifact(cfg,clean_data); > > > > Emilie > > > > > > > > > > > > Le 3 sept. 2014 ? 11:58, Ashley Greene > > > a ?crit : > > > > Hello, > > > > I have used the rejectvisual function in attempt to remove bad > > trials, but after marking them and pressing the quit button, > > although the command window states that the selected trials have > > been removed, there is no obvious change in the data; all of the > > trials are still intact. Have I overlooked something? > > > > Thanks, > > > > Ashley > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 5 > > Date: Tue, 09 Sep 2014 14:16:20 +0200 > > From: Patricia Wollstadt > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: <540EEF94.9080601 at gmx.de> > > Content-Type: text/plain; charset="windows-1252" > > > > Hello Max, > > > > I added a few comments to the questions regarding individual > > parameters > > below. To address the general problem of TRENTOOL telling you, that > > there are not enough sample points in your data: From what I can see > > in > > your script, you probably don't have enough data points in each time > > series to robustly estimate TE. You analyze 800 ms of data sampled > > at > > 300 Hz, which gives you 240 samples per time series. Can you maybe > > avoid > > downsampling to 300 Hz and downsample to 600 Hz instead? Or could > > you > > analyze a longer time window of interest? > > Note that you also 'lose' data to embedding and the interaction > > delay: > > The first point that can be used for TE estimation is at max. > > embedding > > length + max. interaction delay in samples. For example: max. > > embedding > > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the > > max > > interaction delay of 30 ms = 9 samples. In this example, you would > > be > > left with 240 - 29 samples for TE estimation per trial. There is > > also > > the possibility to estimate time resolved TE/TE for shorter time > > windows > > of interest (see section 4.4 in the manual); however, this method > > requires the use of a GPU for TE estimation. > > > > I would further recommend to use the new pipeline for group > > statistics > > described in the manual in section 4.5 (the function > > 'TEgroup_calculate' > > is deprecated). The new pipeline allows you to reconstruct the > > interaction delay and uses the following functions (see also > > comments in > > the script): > > > > TEgroup_prepare -> prepares all data sets (all subjects/all > > conditions) for group analysis (this means finding common embedding > > parameters such that estimates are not biased between groups) > > InteractionDelayReconstruction_calculate -> estimates TE for > > individual data sets and all assumed interaction delays u > > InteractionDelayReconstruction_analyze -> reconstructs the > > interaction delay by selecting the u that maximizes TE for each > > channel > > TEgroup_stats -> calculate group statistics using a permutation test > > > > I can send you an example script for group TE analysis using this > > pipeline to get you started. I hope this helps you to get the group > > analysis running. Just write again if you're having trouble setting > > up > > the pipeline or something is not clear about the parameters/my > > comments. > > > > Best, > > Patricia > > > > > > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not > >> 100% sure if it is appropriate to ask questions about it here, but > >> to > >> the best of my knowledge they do not have a mailing list and I saw > >> a > >> few trentool questions in the archives, so I'm going to assume it's > >> ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present > >> in the pipeline. Sorry in advance for the long post! Any help would > >> be > >> greatly appreciated as I'm a bit over my head on this but I think > >> I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data > >> that was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi is > >> in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within the toi, but beyond that are there any benefits to it being > >> earlier or later?* PW: The predictiontime_u is in milliseconds and > >> the > >> toi is in seconds. The prediction time is the assumed interaction > >> delay between your two sources and should fit within your toi. In > >> general it is preferable to use the method for interaction delay > >> reconstruction for TE estimation, because it allows you to > >> reconstruct > >> the actual delay between your source and target times series. A > >> non-optimal u/interaction delay may cause an underestimation of TE, > >> so > >> it is recommended to use the pipeline for interaction delay > >> reconstruction whenever estimating TE for unknown delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, so it is best to limit the u range to values that are > >> physiologically plausible. > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the > >> sample rate and filters are used to determine the actthrvalue, but > >> I > >> don't actually know the calculation. 7.5 was a rough guess just to > >> test the pipeline. I'm also uncertain of what minnrtrials should > >> be.* > >> PW: You can set the actthrvalue based on the filtering you did > >> prior > >> to TE analysis. If you for example highpass filtered at 10 Hz, you > >> shouldn't find an ACT higher than 30 samples, because you filtered > >> out > >> any components of the signal slower than 10 Hz/30 samples (given > >> your > >> sampling frequency of 300 Hz). So in this scenario the actthrvalue > >> would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> * > >> * > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm > >> yet to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* > >> PW: The Ragwitz criterion tries to find optimal embedding > >> parameters > >> dim and tau for the data. To do that, the method iteratively takes > >> all > >> possible combinations of dim and tau values that are provided in > >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well > >> these > >> combinations embed the data. To test an embedding, the method > >> builds > >> the embedding vectors from the data; it then tests for each point > >> how > >> well the next point in time can be predicted from the reference > >> point's nearest neighbours. So for each embedded point, the method > >> searches for the nearest neighbours and calculates the average of > >> those nearest neighbours. The difference between the > >> averaged/predicted point and the actual next point is the error of > >> the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested > >> by the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together with 'ragtausteps' specifies the tau values to be tested > >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, > >> that > >> the values here are factors that are later multiplied with the ACT > >> to > >> obtain the actual tau. 'repPred' is the number of points that will > >> be > >> used for the local prediction, i.e. the Ragwitz criterion will test > >> the local prediction and calculate the error for the first 100 > >> points > >> in your time series. The two parameters 'flagNei' ans 'sizeNei' > >> below > >> specify the type of neighbour search conducted by the Ragwitz > >> criterion: 'flagNei' tells the method to either conduct a kNN or > >> range > >> search; 'sizeNei' specifies the number of neighbours or the radius > >> to > >> be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> * > >> * > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> * > >> * > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.*TRENTOOL seems to handle data output very differently > >> from > >> fieldtrip and I've had trouble thinking through the most logical > >> way > >> to handle the data so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> * > >> * > >> *For clarification, fileCell is a cell with the name of each > >> condition > >> x subject .mat file, which as I said before is collectively the > >> same > >> as the 3 x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> * > >> * > >> *At this step I get the following error: > >> > >> Error using transferentropy (line 337) > >> \nTRENTOOL ERROR: not enough data points left after embedding > >> > >> Error in TEgroup_calculate (line 133) > >> [TEresult] = transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate > >> is a pipeline issue* (I noticed the example pipeline in trentool, > >> the > >> manual, and published methods articles all seem to have slightly or > >> significantly different pipeline compositions), *or if the error > >> is* > >> due to ACT, ragwitz optimization, or some other faulty > >> parameterization *on my part due to a lack of understanding of how > >> transfer entropy works on a more theoretical/mathematical level*. > >> If > >> the latter is the case, is there any relatively straightforward way > >> to > >> conceptualize this, or is this something where I'm just going to > >> have > >> to keep reading and rereading until it eventually makes sense? I've > >> already done quite a bit of that and it hasn't pierced my thick > >> skull > >> yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> 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: > > > > > > ------------------------------ > > > > Message: 6 > > Date: Tue, 9 Sep 2014 15:21:20 +0200 > > From: Holger Krause > > To: FieldTrip discussion list > > Subject: [FieldTrip] Latest FT version on ftp-server is from three > > days ago > > Message-ID: > > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> > > Content-Type: text/plain; charset="us-ascii" > > > > Dear developers, > > > > Could you please check the process for creation/publication of > > zip-files on > > the FTP server? The latest file I can find there is > > fieldtrip-20140906.zip. > > > > Thanks in advance, > > > > Holger > > > > > > ------------------------------ > > > > Message: 7 > > Date: Tue, 9 Sep 2014 09:19:55 -0400 > > From: Max Cantor > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > This is immensely helpful, thank you. I was very confused about why > > some > > versions of the pipeline I saw were using group calculate and others > > were > > using interaction delay reconstruction and what that meant, and I > > think I > > have a more clear idea of what the different steps of the pipeline > > are > > doing. There are still a few things I'm a bit confused about though > > in > > terms of the pipeline. For instance, whether or not I need to do > > TEprepare > > before group prepare, and if I need to do graph analysis (which I'm > > not > > sure I fully understand but also haven't looked deeply into) before > > group > > stats. > > > > If you don't mind me taking you up on your offer, I think seeing > > your > > example script might help clarify some of these issues. > > > > Thank you! > > > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > > Patricia.Wollstadt at gmx.de> wrote: > > > >> Hello Max, > >> > >> I added a few comments to the questions regarding individual > >> parameters > >> below. To address the general problem of TRENTOOL telling you, that > >> there > >> are not enough sample points in your data: From what I can see in > >> your > >> script, you probably don't have enough data points in each time > >> series to > >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, > >> which > >> gives you 240 samples per time series. Can you maybe avoid > >> downsampling to > >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a > >> longer time > >> window of interest? > >> Note that you also 'lose' data to embedding and the interaction > >> delay: The > >> first point that can be used for TE estimation is at max. embedding > >> length > >> + max. interaction delay in samples. For example: max. embedding > >> length = > >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max > >> interaction > >> delay of 30 ms = 9 samples. In this example, you would be left with > >> 240 - > >> 29 samples for TE estimation per trial. There is also the > >> possibility to > >> estimate time resolved TE/TE for shorter time windows of interest > >> (see > >> section 4.4 in the manual); however, this method requires the use > >> of a GPU > >> for TE estimation. > >> > >> I would further recommend to use the new pipeline for group > >> statistics > >> described in the manual in section 4.5 (the function > >> 'TEgroup_calculate' is > >> deprecated). The new pipeline allows you to reconstruct the > >> interaction > >> delay and uses the following functions (see also comments in the > >> script): > >> > >> TEgroup_prepare -> prepares all data sets (all subjects/all > >> conditions) > >> for group analysis (this means finding common embedding parameters > >> such > >> that estimates are not biased between groups) > >> InteractionDelayReconstruction_calculate -> estimates TE for > >> individual data sets and all assumed interaction delays u > >> InteractionDelayReconstruction_analyze -> reconstructs the > >> interaction delay by selecting the u that maximizes TE for each > >> channel > >> TEgroup_stats -> calculate group statistics using a permutation > >> test > >> > >> I can send you an example script for group TE analysis using this > >> pipeline > >> to get you started. I hope this helps you to get the group analysis > >> running. Just write again if you're having trouble setting up the > >> pipeline > >> or something is not clear about the parameters/my comments. > >> > >> Best, > >> Patricia > >> > >> > >> > >> > >> On 09/04/2014 08:30 PM, Max Cantor wrote: > >> > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not 100% > >> sure if it is appropriate to ask questions about it here, but to > >> the best > >> of my knowledge they do not have a mailing list and I saw a few > >> trentool > >> questions in the archives, so I'm going to assume it's ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present in > >> the pipeline. Sorry in advance for the long post! Any help would be > >> greatly > >> appreciated as I'm a bit over my head on this but I think I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data that > >> was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi > >> is in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within > >> the toi, but beyond that are there any benefits to it being earlier > >> or > >> later?* PW: The predictiontime_u is in milliseconds and the toi is > >> in > >> seconds. The prediction time is the assumed interaction delay > >> between your > >> two sources and should fit within your toi. In general it is > >> preferable to > >> use the method for interaction delay reconstruction for TE > >> estimation, > >> because it allows you to reconstruct the actual delay between your > >> source > >> and target times series. A non-optimal u/interaction delay may > >> cause an > >> underestimation of TE, so it is recommended to use the pipeline for > >> interaction delay reconstruction whenever estimating TE for unknown > >> delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, > >> so it is best to limit the u range to values that are > >> physiologically > >> plausible. > >> > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the sample > >> rate and filters are used to determine the actthrvalue, but I don't > >> actually know the calculation. 7.5 was a rough guess just to test > >> the > >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: > >> You can > >> set the actthrvalue based on the filtering you did prior to TE > >> analysis. If > >> you for example highpass filtered at 10 Hz, you shouldn't find an > >> ACT > >> higher than 30 samples, because you filtered out any components of > >> the > >> signal slower than 10 Hz/30 samples (given your sampling frequency > >> of 300 > >> Hz). So in this scenario the actthrvalue would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm yet > >> to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* PW: > >> The Ragwitz criterion tries to find optimal embedding parameters > >> dim and > >> tau for the data. To do that, the method iteratively takes all > >> possible > >> combinations of dim and tau values that are provided in cfgP.ragdim > >> and > >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations > >> embed > >> the data. To test an embedding, the method builds the embedding > >> vectors > >> from the data; it then tests for each point how well the next point > >> in time > >> can be predicted from the reference point's nearest neighbours. So > >> for each > >> embedded point, the method searches for the nearest neighbours and > >> calculates the average of those nearest neighbours. The difference > >> between > >> the averaged/predicted point and the actual next point is the error > >> of the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested by > >> the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together > >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL > >> will > >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values > >> here are > >> factors that are later multiplied with the ACT to obtain the actual > >> tau. > >> 'repPred' is the number of points that will be used for the local > >> prediction, i.e. the Ragwitz criterion will test the local > >> prediction and > >> calculate the error for the first 100 points in your time series. > >> The two > >> parameters 'flagNei' ans 'sizeNei' below specify the type of > >> neighbour > >> search conducted by the Ragwitz criterion: 'flagNei' tells the > >> method to > >> either conduct a kNN or range search; 'sizeNei' specifies the > >> number of > >> neighbours or the radius to be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' > >> data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject > >> virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.* > >> TRENTOOL seems to handle data output very differently from > >> fieldtrip and > >> I've had trouble thinking through the most logical way to handle > >> the data > >> so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> > >> *For clarification, fileCell is a cell with the name of each > >> condition x > >> subject .mat file, which as I said before is collectively the same > >> as the 3 > >> x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> > >> > >> > >> > >> > >> > >> > >> *At this step I get the following error: Error using > >> transferentropy (line > >> 337) \nTRENTOOL ERROR: not enough data points left after embedding > >> Error in > >> TEgroup_calculate (line 133) [TEresult] = > >> transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate is a > >> pipeline issue* (I noticed the example pipeline in trentool, the > >> manual, > >> and published methods articles all seem to have slightly or > >> significantly > >> different pipeline compositions), *or if the error is* due to ACT, > >> ragwitz optimization, or some other faulty parameterization *on my > >> part > >> due to a lack of understanding of how transfer entropy works on a > >> more > >> theoretical/mathematical level*. If the latter is the case, is > >> there any > >> relatively straightforward way to conceptualize this, or is this > >> something > >> where I'm just going to have to keep reading and rereading until it > >> eventually makes sense? I've already done quite a bit of that and > >> it hasn't > >> pierced my thick skull yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> fieldtrip mailing > >> listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie ldtrip > >> > >> > >> -- > >> ------------------------------------------------------------ > >> > >> 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 > >> > > > > > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > -------------- 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 46, Issue 3 > > **************************************** > > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jingfan.jf at gmail.com Mon Sep 15 19:53:19 2014 From: jingfan.jf at gmail.com (Jing Fan) Date: Mon, 15 Sep 2014 12:53:19 -0500 Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' In-Reply-To: <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> References: <20140910140714.9n2t9bxs008o400c@imap.uni-ulm.de> <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> Message-ID: <000301cfd10d$ef53cba0$cdfb62e0$@gmail.com> Hi Barbara and Jim, I added path your/path/to/fieldtrip/utilities and now it worked. Hope it helps solve the problem. Best, Jing -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) Sent: Monday, September 15, 2014 5:01 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' Dear Barbara, The error seems to be related to a bug that pops up now and then (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a corrupt installation of fieldtrip and/or the need to update fieldtrip. Could you please try downloading the most recent version of fieldtrip and see if the problem persists? For an example of what can be expected from this function see: Esser SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. Best, Jim ----- Oorspronkelijk bericht ----- > Van: "barbara schorr" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 10 september 2014 14:07:14 > Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' > Dear fieldtripers. > > as mentioned in the subject line I would like to anaylse my timelocked > ERP Data with the function ft_globalmeanfield. > > I get the Error: Undefined function or variable 'abort' > Error in ft_globalmeanfield (line84) > if abort > > in the function it says: > > %the abort variable is set to true or false in ft_preamble_inti > if abort > % do not continue function execution in case the outputfile is > present and the user indicated to keep it > return > end > > > I don't understand what this means. I would really appreciate your > help to get this running. > > Also, what is the result when I run this function on my data? (This > method was proposed from a reviewer. I never used it before, so I > don't exactly know what it does and what the result will look like). > > Thank you very much in advance! > > Best, > > Barbara Schorr > > > > > Zitat von 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: Question regarding nonparametric testing for coherence > > differences (Eric Maris) > > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) > > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) > > 4. Re: ft_rejectvisual: removing trials marked as bad > > (Caspar, Emilie) > > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) > > 6. Latest FT version on ftp-server is from three days ago > > (Holger Krause) > > 7. Re: TRENTOOL pipeline help (Max Cantor) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) > > From: "Eric Maris" > > To: , "'FieldTrip discussion list'" > > > > Subject: Re: [FieldTrip] Question regarding nonparametric testing > > for > > coherence differences > > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> > > Content-Type: text/plain; charset="utf-8" > > > > Dear Hwee Ling, > > > > > > > > In the paper you refer to (Maris et al, JNM, 2007), I did not > > perform a > > cluster-based permutation test at the level of the channel pairs. > > Instead, > > all coherences mentioned in the paper are coherence between a single > > EMG > > channel (2 electrodes mounted on the forearm) and all MEG > > electrodes. Thus, > > there are as many EMG-MEG coherences as there are MEG channels (275 > > in our > > lab), and the clustering of these coherences involves the same > > neighbourhood > > structure as the clustering of channel-specific statistics on power > > or > > evoked response. The analysis you propose involves clustering in a > > much more > > complex space, namely the formed by all (MEG,MEG) channel pairs > > (275*275=75625 pairs). In the early days of cluster-based > > permutation > > statistics, I have worked on this problem but did not pursue it > > because the > > resulting clusters are very hard to interpret. > > > > > > > > Best, > > > > > > > > Eric Maris > > > > > > > > > > > > Dear all and Prof Maris, > > > > I'm re-posting this question again, as I didn't get any replies > > previously. > > > > I?m interested to investigate if there are any differences in phase > > synchronization in resting state data at timepoint 2 versus > > timepoint 1. The > > EEG data was collected using 64 EEG channels, resting state, eyes > > opened and > > eyes closed. I?ve arbitrarily segmented the resting state data into > > epochs > > of 2s each, and the epochs with artifacts are excluded completely > > from > > further analyses. I then performed mtmfft to get the fourier > > representation > > of the data, extracted the coherence, and compared the coherence > > difference > > of timepoint 2 versus timepoint 1 of all channels paired with all > > other > > channels. > > > > I figured that if I extract the connectivity analyses without > > specifying the > > channelcmb, I get a 'chan_chan_freq' dimord variable that would > > allow me to > > perform cluster-based statistical analyses. I get an output with > > ?chan_chan? > > dimord variable. However, I was not 100% sure that this is correct, > > hence, I?ve > > inserted my code (see below). It?ll be great if you could tell me if > > what I?m > > doing makes any sense at all. Also, I don?t know how I can plot the > > results > > to see if it make any sense at all. > > > > Also, I checked the values obtained from when I specified > > "cfg.channelcmb" > > and when I did not specify "cfg.channelcmb", I noticed that the > > values were > > somehow different. I would assume that the values to be similar, > > although > > I'm not sure why they would have differences in the values obtained > > from > > specifying "cfg.channelcmb". > > > > This is my code that I've used thus far: > > > > for sub = 1:5 > > > > cfg = []; > > > > cfg.output = 'fourier'; > > > > cfg.channel = {'all'}; > > > > cfg.method = 'mtmfft'; > > > > cfg.keeptrials = 'yes'; > > > > cfg.tapsmofrq = 5; > > > > cfg.foilim = [0 100]; > > > > cfg.taper = 'dpss'; > > > > % find the index for the c200 condition > > > > pre_c200_idx = find(data5.trialinfo == 201); > > > > cfg.trials = pre_c200_idx; > > > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > > > post_c200_idx = find(data5.trialinfo == 200); > > > > cfg.trials = post_c200_idx; > > > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > > > > > cfg = []; > > > > cfg.keeptrials = 'no'; > > > > cfg.channel = {'all'}; > > > > cfg.removemean = 'yes'; > > > > cfg.method = 'coh'; > > > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_pre_c200); > > > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_post_c200); > > > > end > > > > > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat '); > > > > cfg_neighb.method = 'template'; > > > > cfg_neighb.layout = lay; > > > > cfg_neighb.channel = 'all'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, > > sub_HLF_pre_c200coh{1}); > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.neighbours = neighbours; > > > > cfg.channel = 'all'; > > > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > > > cfg.latency = 'all'; > > > > cfg.avgovertime = 'no'; > > > > cfg.avgoverchan = 'no'; > > > > cfg.parameter = 'cohspctrm'; > > > > cfg.method = 'montecarlo'; > > > > cfg.statistic = 'depsamplesT'; > > > > cfg.correctm = 'cluster'; > > > > cfg.tail = 0; > > > > % cfg.clustertail = 0; > > > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 > > frequency > > bands. > > > > cfg.numrandomization = 10000; > > > > cfg.ivar = 2; > > > > cfg.uvar = 1; > > > > > > > > % design matrices > > > > clear design; > > > > design(1,:) = [1:5, 1:5]; > > > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > > > cfg.design = design; > > > > % for theta band > > > > cfg.avgoverfreq = 'yes'; > > > > cfg.frequency = [4 8]; % I also performed the statistics for delta > > (2-4), > > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma > > (30-40), > > and gamma (40-100). > > > > [diffc200_theta_stat] = ft_freqstatistics(cfg, > > sub_HLF_post_c200coh{:}, > > sub_HLF_pre_c200coh{:}); > > > > > > > > When I tried to plot the results, I used this code: > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.layout = 'lay'; > > > > cfg.zlim = [-1 1]; > > > > cfg.alpha = 0.05; > > > > cfg.refchannel = 'all'; > > > > ft_clusterplot(cfg, diffc200_theta_stat); > > > > However, I was not sure how I could plot the results. I get an error > > message > > from Fieldtrip when using ft_clusterplot: > > > > Error using topoplot_common (line 366) > > > > no reference channel is specified > > > > Error in ft_topoplotTFR (line 192) > > > > [cfg] = topoplot_common(cfg, varargin{:}); > > > > Error in ft_clusterplot (line 372) > > > > ft_topoplotTFR(cfgtopo, stat); > > > > > > > > According to your paper in 2007, the topoplot of the results were > > masked by > > the spatio-spectral pattern of the significant clusters. I don't > > know how to > > do this, and I would really appreciate if you can show me how to > > make such a > > plot. > > > > Thank you very much. > > > > Kind regards, > > > > Hweeling > > > > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 2 > > Date: Mon, 8 Sep 2014 21:38:01 +0200 > > From: KatrinH Heimann > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > Dear Joseph, thanks so much, I really appreciate your help. I was > > also > > wandering, if maybe there is another bug in my code. > > Our nets are 128 channels, Hydrocel, but as a colleague of me > > adviced me to > > do so, I also tried the 129 layout. > > My code you find below (without selection of bad channels etc.) > > If you need also the data of two subjects to have a look, let me > > know!!! > > Best and thanks really! > > Katrin > > > > > > subject=input('Which subject do you want to analyse? ','s'); > > > > name = strcat(subject,'.raw'); > > > > subjectnumber=input('Which is the subjectnumber?', 's'); > > > > sb=subjectnumber > > > > %subjectnumber = strcat(subjectnumber, '.txt') > > > > %% > > > > > > cfg = []; > > > > cfg.dataset = name; > > > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > > > cfg.trialdef.eventtype = 'trigger'; > > > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > > trigger > > > > cfg.trialdef.prestim = 0.234; % in seconds > > > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > > observation, but maybe we need less) > > > > cfg = ft_definetrial(cfg); > > > > > > cfg.trl([1:7],:) = []; > > > > > > %change timeline according to constant offset of 16 ms = 8 samples > > (because > > recorded with 500 hz)in > > > > %structure trial > > > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > > > > %change timeline to make the cut the zeropoint > > > > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > > > > > %% preprocess data > > > > cfg.channel = 'all'; > > > > cfg.preproc.detrend = 'yes'; > > > > cfg.preproc.demean = 'yes'; > > > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > > filtered > > > > %(0.1-45) and bad channels have to be replaced!!!! > > > > %cfg.preproc.bpfreq = [6 32]; > > > > % > > > > % > > > > obs_data = ft_preprocessing(cfg); > > > > % > > > > save (strcat(sb,'obs_data') , 'obs_data') > > > > > > %% determining channel neighbours (necessary for Artifact detection) > > > > cfg = []; > > > > cfg.channel = obs_data.label; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.feedback = 'yes'; > > > > lay = ft_prepare_layout(cfg); > > > > > > > > cfg_neighb = []; > > > > cfg_neighb.feedback = 'yes'; > > > > > > cfg_neighb.method = 'triangulation'; > > > > cfg_neighb.layout = 'GSN128.sfp'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > > > > > %% Preparing neighbours for channel repair - but bad channel info > > in!!! > > > > > > % cfg_neighb = []; > > > > % cfg_neighb.feedback = 'yes'; > > > > % cfg_neighb.method = 'triangulation'; > > > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > % Interpolate and put into new data structure > > > > cfg = []; > > > > cfg.badchannel = {}; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.method = 'nearest'; > > > > cfg.neighbours = neighbours; > > > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > > > > % Check reconstruction > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > % dat1=obs_data; > > > > % dat2=obs_data_channelrepaired; > > > > % > > > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > > > % y=dat2.trial{1}(62,:); > > > > % plot(x);hold on;plot(y,'r'); > > > > % > > > > % x=dat1.trial{1}(72,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > % > > > > % x=dat1.trial{1}(75,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > %% artifact rejection/trial inspection - throw out electrode jumps > > etc. > > > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > > according to > > channels interpolated %% 128-number of interp. channels) > > > > > > > > cfg = []; > > > > cfg.channel = {'all'}; > > > > cfg.numcomponent = 128 > > > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > > > save (strcat(sb,'comp_all') , 'comp') > > > > > > %% > > > > cfg = []; > > > > cfg.viewmode = 'component'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='some'; > > > > cfg.layout = 'GSN128.sfp'; > > > > ft_databrowser(cfg,comp); > > > > > > %% poweranalysis components > > > > cfg = []; > > > > cfg.output = 'pow'; > > > > cfg.channel = 'all';%compute the power spectrum in all ICs > > > > cfg.method = 'mtmfft'; > > > > cfg.taper = 'hanning'; > > > > cfg.foi = 0:0.2:50; > > > > obs_freq = ft_freqanalysis(cfg, comp); > > > > > > %And you can plot the spectra: > > > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > nsubplots = 16; > > > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > > decimals, type > > doc subplot > > > > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > > > tot = Nfigs*nsubplots; > > > > > > rptvect = 1:size(comp.topo,1); > > > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > > > > for r=1:size(rptvect,1); > > > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 > > 1]);%full > > screen > > > > k=0; > > > > for j=1:size(rptvect,2); > > > > if~(rptvect(r,j)==0); > > > > k=k+1; > > > > cfg=[]; > > > > cfg.channel = rptvect(r,j); > > > > cfg.ylim =[0 500] > > > > cfg.xlim =[0 50] > > > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > > > end > > > > end > > > > end > > > > > > %For the IC topos you'll follow the same logic as above but with: > > > > > > figure > > > > cfg = []; > > > > cfg.component = [1:20]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [21:40]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [41:60]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [61:80]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > > > > > > > > > %% Seperate observation conditions > > > > > > name1= strcat(num2str(sb),'_90.xls'); > > > > list1=xlsread (name1) > > > > > > > > > > > > name2= strcat(num2str(sb),'_180.xls'); > > > > list2=xlsread (name2) > > > > > > > > % > > > > > > cfg = [] > > > > cfg.trials = [list1] > > > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > cfg = [] > > > > cfg.trials = [list2] > > > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > %%PIPELINE FOR obs90 > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128; > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > > obs90_data); > > > > > > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > > > > > > %% Artifacts - final detection > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > > > > %% plot it > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > > > > > > > > > %% PIPELINE FOR obs180 > > > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128 > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > > obs180_data); > > > > > > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > > > > > > %% Artifacts final 180 > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > > > > %% plot 180 ERP > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs180_data_ERP) > > > > > > %% plot both ERPs > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > cfg.showlabels = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > > > > %% plot difference wave > > > > > > difference = obs180_data_ERP; % copy one of the > > structures > > > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute > > the > > difference ERP > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, difference) > > > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > > > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI > >> data. A couple things. First of all, exactly which net do you use? > >> If > >> they are 129-channel, there is still the question of whether they > >> are the > >> Hydrocel or the older geodesic nets. Regardless, that shouldn't > >> cause an > >> error like this. Could you send me the file you are trying to > >> process and > >> the script you are using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < > >> diezmartini at gmail.com> wrote: > >> > >> Which nets do you use? I use EGI. I tried both the ones you mention > >> and > >> they didn't work. It was hard to find that exact one online but it > >> was the > >> only file that actually worked. > >> > >> > >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >> > >> wrote: > >> > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. > >>> Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one > >>> > >>>> I use > >>>> > >>>> > >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < > >>>> katrinheimann at gmail.com> wrote: > >>>> > >>>>> Dear all, my problems seem neverending. This time however i > >>>>> really need > >>>>> help. > >>>>> I implemented a pipeline for ERPs. All works now, > >>>>> trialdefinition, > >>>>> preprocessing, channelreplacement, ica, componentrejection, > >>>>> final > >>>>> artifactdetection, timelock of the single subject data. However, > >>>>> when I > >>>>> wanna compute the grandaverage of the single subjects I get the > >>>>> following > >>>>> error message: > >>>>> > >>>>> computing average of avg over 19 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 3 MB > >>>>> computing average of avg over 2 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_prepare_layout" took 0 seconds and required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_topoplotER" took 0 seconds and required the > >>>>> additional > >>>>> allocation of an estimated 0 MB > >>>>> > >>>>> Furthermore in the plot of the significant clusters, the > >>>>> channelnames > >>>>> are mixed up (do not correspond to my net) > >>>>> > >>>>> > >>>>> I guess that there is a problem with the layout I use. > >>>>> Here the code that I use > >>>>> > >>>>> %For generating the layout (also in the single subjects): > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = obs_data.label; > >>>>> > >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>>>> > >>>>> cfg.feedback = 'yes'; > >>>>> > >>>>> lay = ft_prepare_layout(cfg); > >>>>> > >>>>> > >>>>> cfg_neighb = []; > >>>>> > >>>>> cfg_neighb.feedback = 'yes'; > >>>>> > >>>>> cfg_neighb.method = 'triangulation'; > >>>>> > >>>>> cfg_neighb.layout = lay; > >>>>> > >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>>>> > >>>>> > >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>>>> > >>>>> > >>>>> %For computing the grand average > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = 'all'; > >>>>> > >>>>> cfg.latency = 'all'; > >>>>> > >>>>> cfg.parameter = 'avg'; > >>>>> > >>>>> cfg.keepindividual = 'no' > >>>>> > >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>>>> > >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>>>> > >>>>> % "{:}" means to use data from all elements of the variable > >>>>> > >>>>> > >>>>> For plotting the significant clusters > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.style = 'blank'; > >>>>> > >>>>> cfg.layout = lay; > >>>>> > >>>>> cfg.channellabels = 'yes'; > >>>>> > >>>>> cfg.highlight = 'labels'; > >>>>> > >>>>> cfg.highlightchannel = find(stat.mask); > >>>>> > >>>>> cfg.comment = 'no'; > >>>>> > >>>>> figure; ft_topoplotER(cfg, GA_90) > >>>>> > >>>>> title('Nonparametric: significant with cluster multiple > >>>>> comparison > >>>>> correction') > >>>>> > >>>>> > >>>>> Do you have ANY idea to this? I am really completely > >>>>> helpless.... > >>>>> > >>>>> thanks and best > >>>>> > >>>>> Katrin > >>>>> > >>>>> _______________________________________________ > >>>>> 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 > >>> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> > >> ---------------------------------------------------------------------------- ---- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.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: > > > > > > ------------------------------ > > > > Message: 3 > > Date: Mon, 08 Sep 2014 21:55:44 -0400 > > From: Joseph Dien > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> > > Content-Type: text/plain; charset="windows-1252" > > > > yes, please do send me the data. > > > > Thanks! > > > > Joe > > > > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann > > wrote: > > > >> Dear Joseph, thanks so much, I really appreciate your help. I was > >> also wandering, if maybe there is another bug in my code. > >> Our nets are 128 channels, Hydrocel, but as a colleague of me > >> adviced me to do so, I also tried the 129 layout. > >> My code you find below (without selection of bad channels etc.) > >> If you need also the data of two subjects to have a look, let me > >> know!!! > >> Best and thanks really! > >> Katrin > >> > >> > >> > >> subject=input('Which subject do you want to analyse? ','s'); > >> > >> name = strcat(subject,'.raw'); > >> > >> subjectnumber=input('Which is the subjectnumber?', 's'); > >> > >> sb=subjectnumber > >> > >> %subjectnumber = strcat(subjectnumber, '.txt') > >> > >> %% > >> > >> > >> > >> cfg = []; > >> > >> cfg.dataset = name; > >> > >> cfg.trialfun = 'ft_trialfun_general'; % this is the default > >> > >> cfg.trialdef.eventtype = 'trigger'; > >> > >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > >> trigger > >> > >> cfg.trialdef.prestim = 0.234; % in seconds > >> > >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > >> observation, but maybe we need less) > >> > >> cfg = ft_definetrial(cfg); > >> > >> > >> > >> cfg.trl([1:7],:) = []; > >> > >> > >> > >> %change timeline according to constant offset of 16 ms = 8 samples > >> (because recorded with 500 hz)in > >> > >> %structure trial > >> > >> cfg.trl(:,3)=cfg.trl(:,3)-8 > >> > >> > >> > >> %change timeline to make the cut the zeropoint > >> > >> > >> > >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; > >> > >> > >> > >> > >> > >> %% preprocess data > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.detrend = 'yes'; > >> > >> cfg.preproc.demean = 'yes'; > >> > >> cfg.preproc.baselinewindow = [-2.1 -2.0] > >> > >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > >> filtered > >> > >> %(0.1-45) and bad channels have to be replaced!!!! > >> > >> %cfg.preproc.bpfreq = [6 32]; > >> > >> % > >> > >> % > >> > >> obs_data = ft_preprocessing(cfg); > >> > >> % > >> > >> save (strcat(sb,'obs_data') , 'obs_data') > >> > >> > >> > >> %% determining channel neighbours (necessary for Artifact > >> detection) > >> > >> cfg = []; > >> > >> cfg.channel = obs_data.label; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.feedback = 'yes'; > >> > >> lay = ft_prepare_layout(cfg); > >> > >> > >> cfg_neighb = []; > >> > >> cfg_neighb.feedback = 'yes'; > >> > >> > >> > >> cfg_neighb.method = 'triangulation'; > >> > >> cfg_neighb.layout = 'GSN128.sfp'; > >> > >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> obs_data.elec = ft_read_sens('GSN128.sfp'); > >> > >> > >> > >> %% Artifacts - to detect bad channels - is not saved!!! > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs_data_try = ft_rejectvisual(cfg, obs_data); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_try = ft_rejectartifact (cfg,obs_data); > >> > >> > >> > >> > >> > >> %% Preparing neighbours for channel repair - but bad channel info > >> in!!! > >> > >> > >> > >> % cfg_neighb = []; > >> > >> % cfg_neighb.feedback = 'yes'; > >> > >> % cfg_neighb.method = 'triangulation'; > >> > >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > >> > >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> % Interpolate and put into new data structure > >> > >> cfg = []; > >> > >> cfg.badchannel = {}; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.method = 'nearest'; > >> > >> cfg.neighbours = neighbours; > >> > >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >> > >> > >> > >> % Check reconstruction > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> % dat1=obs_data; > >> > >> % dat2=obs_data_channelrepaired; > >> > >> % > >> > >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > >> > >> % y=dat2.trial{1}(62,:); > >> > >> % plot(x);hold on;plot(y,'r'); > >> > >> % > >> > >> % x=dat1.trial{1}(72,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> % > >> > >> % x=dat1.trial{1}(75,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> %% artifact rejection/trial inspection - throw out electrode jumps > >> etc. > >> > >> > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > >> according to channels interpolated %% 128-number of interp. > >> channels) > >> > >> > >> cfg = []; > >> > >> cfg.channel = {'all'}; > >> > >> cfg.numcomponent = 128 > >> > >> comp = ft_componentanalysis(cfg,obs_data_clean1); > >> > >> save (strcat(sb,'comp_all') , 'comp') > >> > >> > >> > >> %% > >> > >> cfg = []; > >> > >> cfg.viewmode = 'component'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='some'; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> ft_databrowser(cfg,comp); > >> > >> > >> > >> %% poweranalysis components > >> > >> cfg = []; > >> > >> cfg.output = 'pow'; > >> > >> cfg.channel = 'all';%compute the power spectrum in all ICs > >> > >> cfg.method = 'mtmfft'; > >> > >> cfg.taper = 'hanning'; > >> > >> cfg.foi = 0:0.2:50; > >> > >> obs_freq = ft_freqanalysis(cfg, comp); > >> > >> > >> > >> %And you can plot the spectra: > >> > >> > >> > >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > >> > >> nsubplots = 16; > >> > >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > >> decimals, type doc subplot > >> > >> > >> > >> Nfigs = ceil(size(comp.topo,1)/nsubplots); > >> > >> tot = Nfigs*nsubplots; > >> > >> > >> > >> rptvect = 1:size(comp.topo,1); > >> > >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > >> > >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; > >> > >> > >> > >> for r=1:size(rptvect,1); > >> > >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 > >> 1]);%full screen > >> > >> k=0; > >> > >> for j=1:size(rptvect,2); > >> > >> if~(rptvect(r,j)==0); > >> > >> k=k+1; > >> > >> cfg=[]; > >> > >> cfg.channel = rptvect(r,j); > >> > >> cfg.ylim =[0 500] > >> > >> cfg.xlim =[0 50] > >> > >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > >> > >> end > >> > >> end > >> > >> end > >> > >> > >> > >> %For the IC topos you'll follow the same logic as above but with: > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [1:20]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [21:40]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [41:60]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [61:80]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% Seperate observation conditions > >> > >> > >> > >> name1= strcat(num2str(sb),'_90.xls'); > >> > >> list1=xlsread (name1) > >> > >> > >> > >> name2= strcat(num2str(sb),'_180.xls'); > >> > >> list2=xlsread (name2) > >> > >> > >> % > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list1] > >> > >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list2] > >> > >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> %%PIPELINE FOR obs90 > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128; > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> > >> > >> comp_1 = ft_componentanalysis(cfg, obs90_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > >> obs90_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts - final detection > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs90_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > >> > >> > >> > >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > >> > >> > >> > >> %% plot it > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% PIPELINE FOR obs180 > >> > >> > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128 > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> comp_2 = ft_componentanalysis(cfg, obs180_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > >> obs180_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts final 180 > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs180_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > >> > >> > >> > >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > >> > >> > >> > >> %% plot 180 ERP > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs180_data_ERP) > >> > >> > >> > >> %% plot both ERPs > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> cfg.showlabels = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > >> > >> > >> > >> %% plot difference wave > >> > >> > >> > >> difference = obs180_data_ERP; % copy one of > >> the structures > >> > >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % > >> compute the difference ERP > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, difference) > >> > >> > >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI data. A couple things. First of all, exactly which net do > >> you use? If they are 129-channel, there is still the question of > >> whether they are the Hydrocel or the older geodesic nets. > >> Regardless, that shouldn't cause an error like this. Could you > >> send me the file you are trying to process and the script you are > >> using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini > >> wrote: > >> > >>> Which nets do you use? I use EGI. I tried both the ones you > >>> mention and they didn't work. It was hard to find that exact one > >>> online but it was the only file that actually worked. > >>> > >>> > >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >>> wrote: > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one I use > >>> > >>> > >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > >>> wrote: > >>> Dear all, my problems seem neverending. This time however i really > >>> need help. > >>> I implemented a pipeline for ERPs. All works now, trialdefinition, > >>> preprocessing, channelreplacement, ica, componentrejection, final > >>> artifactdetection, timelock of the single subject data. However, > >>> when I wanna compute the grandaverage of the single subjects I get > >>> the following error message: > >>> > >>> computing average of avg over 19 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 3 MB > >>> computing average of avg over 2 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 0 MB > >>> the call to "ft_prepare_layout" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> the call to "ft_topoplotER" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> > >>> Furthermore in the plot of the significant clusters, the > >>> channelnames are mixed up (do not correspond to my net) > >>> > >>> > >>> I guess that there is a problem with the layout I use. > >>> Here the code that I use > >>> > >>> %For generating the layout (also in the single subjects): > >>> cfg = []; > >>> > >>> cfg.channel = obs_data.label; > >>> > >>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>> > >>> cfg.feedback = 'yes'; > >>> > >>> lay = ft_prepare_layout(cfg); > >>> > >>> > >>> cfg_neighb = []; > >>> > >>> cfg_neighb.feedback = 'yes'; > >>> > >>> cfg_neighb.method = 'triangulation'; > >>> > >>> cfg_neighb.layout = lay; > >>> > >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>> > >>> > >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>> > >>> > >>> > >>> %For computing the grand average > >>> > >>> cfg = []; > >>> > >>> cfg.channel = 'all'; > >>> > >>> cfg.latency = 'all'; > >>> > >>> cfg.parameter = 'avg'; > >>> > >>> cfg.keepindividual = 'no' > >>> > >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>> > >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>> > >>> % "{:}" means to use data from all elements of the variable > >>> > >>> > >>> For plotting the significant clusters > >>> > >>> cfg = []; > >>> > >>> cfg.style = 'blank'; > >>> > >>> cfg.layout = lay; > >>> > >>> cfg.channellabels = 'yes'; > >>> > >>> cfg.highlight = 'labels'; > >>> > >>> cfg.highlightchannel = find(stat.mask); > >>> > >>> cfg.comment = 'no'; > >>> > >>> figure; ft_topoplotER(cfg, GA_90) > >>> > >>> title('Nonparametric: significant with cluster multiple comparison > >>> correction') > >>> > >>> > >>> > >>> Do you have ANY idea to this? I am really completely helpless.... > >>> > >>> thanks and best > >>> > >>> Katrin > >>> > >>> > >>> _______________________________________________ > >>> 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 > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> ---------------------------------------------------------------------------- ---- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.com > >> > >> > >> _______________________________________________ > >> 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 > > > > ---------------------------------------------------------------------------- ---- > > > > Joseph Dien, PhD > > Research Associate > > Cognitive Neurology > > The Johns Hopkins University School of Medicine > > > > Lab E-mail: jdien1 at jhmi.edu > > Private E-mail: jdien07 at mac.com > > Office Phone: 410-614-3115 > > Cell Phone: 202-297-8117 > > Fax: 410-955-0188 > > http://joedien.com > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 4 > > Date: Tue, 9 Sep 2014 06:37:13 +0000 > > From: "Caspar, Emilie" > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > > bad > > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi Ashley, > > > > Maybe the mistake is you did not integrate in your script the > > command to save the rejection. Normally, with the following command, > > you will see in the Matlab Window that artifacts are correctly > > rejected after the "quit" button. > > > > clean_data = ft_rejectvisual(cfg, interpoldata); > > cfg.artfctdef.reject = 'complete'; > > cfg.artfctdef.feedback = 'yes'; > > cleandata = ft_rejectartifact(cfg,clean_data); > > > > Emilie > > > > > > > > > > > > Le 3 sept. 2014 ? 11:58, Ashley Greene > > > a ?crit : > > > > Hello, > > > > I have used the rejectvisual function in attempt to remove bad > > trials, but after marking them and pressing the quit button, > > although the command window states that the selected trials have > > been removed, there is no obvious change in the data; all of the > > trials are still intact. Have I overlooked something? > > > > Thanks, > > > > Ashley > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 5 > > Date: Tue, 09 Sep 2014 14:16:20 +0200 > > From: Patricia Wollstadt > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: <540EEF94.9080601 at gmx.de> > > Content-Type: text/plain; charset="windows-1252" > > > > Hello Max, > > > > I added a few comments to the questions regarding individual > > parameters > > below. To address the general problem of TRENTOOL telling you, that > > there are not enough sample points in your data: From what I can see > > in > > your script, you probably don't have enough data points in each time > > series to robustly estimate TE. You analyze 800 ms of data sampled > > at > > 300 Hz, which gives you 240 samples per time series. Can you maybe > > avoid > > downsampling to 300 Hz and downsample to 600 Hz instead? Or could > > you > > analyze a longer time window of interest? > > Note that you also 'lose' data to embedding and the interaction > > delay: > > The first point that can be used for TE estimation is at max. > > embedding > > length + max. interaction delay in samples. For example: max. > > embedding > > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the > > max > > interaction delay of 30 ms = 9 samples. In this example, you would > > be > > left with 240 - 29 samples for TE estimation per trial. There is > > also > > the possibility to estimate time resolved TE/TE for shorter time > > windows > > of interest (see section 4.4 in the manual); however, this method > > requires the use of a GPU for TE estimation. > > > > I would further recommend to use the new pipeline for group > > statistics > > described in the manual in section 4.5 (the function > > 'TEgroup_calculate' > > is deprecated). The new pipeline allows you to reconstruct the > > interaction delay and uses the following functions (see also > > comments in > > the script): > > > > TEgroup_prepare -> prepares all data sets (all subjects/all > > conditions) for group analysis (this means finding common embedding > > parameters such that estimates are not biased between groups) > > InteractionDelayReconstruction_calculate -> estimates TE for > > individual data sets and all assumed interaction delays u > > InteractionDelayReconstruction_analyze -> reconstructs the > > interaction delay by selecting the u that maximizes TE for each > > channel > > TEgroup_stats -> calculate group statistics using a permutation test > > > > I can send you an example script for group TE analysis using this > > pipeline to get you started. I hope this helps you to get the group > > analysis running. Just write again if you're having trouble setting > > up > > the pipeline or something is not clear about the parameters/my > > comments. > > > > Best, > > Patricia > > > > > > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not > >> 100% sure if it is appropriate to ask questions about it here, but > >> to > >> the best of my knowledge they do not have a mailing list and I saw > >> a > >> few trentool questions in the archives, so I'm going to assume it's > >> ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present > >> in the pipeline. Sorry in advance for the long post! Any help would > >> be > >> greatly appreciated as I'm a bit over my head on this but I think > >> I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data > >> that was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi is > >> in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within the toi, but beyond that are there any benefits to it being > >> earlier or later?* PW: The predictiontime_u is in milliseconds and > >> the > >> toi is in seconds. The prediction time is the assumed interaction > >> delay between your two sources and should fit within your toi. In > >> general it is preferable to use the method for interaction delay > >> reconstruction for TE estimation, because it allows you to > >> reconstruct > >> the actual delay between your source and target times series. A > >> non-optimal u/interaction delay may cause an underestimation of TE, > >> so > >> it is recommended to use the pipeline for interaction delay > >> reconstruction whenever estimating TE for unknown delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, so it is best to limit the u range to values that are > >> physiologically plausible. > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the > >> sample rate and filters are used to determine the actthrvalue, but > >> I > >> don't actually know the calculation. 7.5 was a rough guess just to > >> test the pipeline. I'm also uncertain of what minnrtrials should > >> be.* > >> PW: You can set the actthrvalue based on the filtering you did > >> prior > >> to TE analysis. If you for example highpass filtered at 10 Hz, you > >> shouldn't find an ACT higher than 30 samples, because you filtered > >> out > >> any components of the signal slower than 10 Hz/30 samples (given > >> your > >> sampling frequency of 300 Hz). So in this scenario the actthrvalue > >> would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> * > >> * > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm > >> yet to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* > >> PW: The Ragwitz criterion tries to find optimal embedding > >> parameters > >> dim and tau for the data. To do that, the method iteratively takes > >> all > >> possible combinations of dim and tau values that are provided in > >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well > >> these > >> combinations embed the data. To test an embedding, the method > >> builds > >> the embedding vectors from the data; it then tests for each point > >> how > >> well the next point in time can be predicted from the reference > >> point's nearest neighbours. So for each embedded point, the method > >> searches for the nearest neighbours and calculates the average of > >> those nearest neighbours. The difference between the > >> averaged/predicted point and the actual next point is the error of > >> the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested > >> by the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together with 'ragtausteps' specifies the tau values to be tested > >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, > >> that > >> the values here are factors that are later multiplied with the ACT > >> to > >> obtain the actual tau. 'repPred' is the number of points that will > >> be > >> used for the local prediction, i.e. the Ragwitz criterion will test > >> the local prediction and calculate the error for the first 100 > >> points > >> in your time series. The two parameters 'flagNei' ans 'sizeNei' > >> below > >> specify the type of neighbour search conducted by the Ragwitz > >> criterion: 'flagNei' tells the method to either conduct a kNN or > >> range > >> search; 'sizeNei' specifies the number of neighbours or the radius > >> to > >> be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> * > >> * > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> * > >> * > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.*TRENTOOL seems to handle data output very differently > >> from > >> fieldtrip and I've had trouble thinking through the most logical > >> way > >> to handle the data so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> * > >> * > >> *For clarification, fileCell is a cell with the name of each > >> condition > >> x subject .mat file, which as I said before is collectively the > >> same > >> as the 3 x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> * > >> * > >> *At this step I get the following error: > >> > >> Error using transferentropy (line 337) > >> \nTRENTOOL ERROR: not enough data points left after embedding > >> > >> Error in TEgroup_calculate (line 133) > >> [TEresult] = transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate > >> is a pipeline issue* (I noticed the example pipeline in trentool, > >> the > >> manual, and published methods articles all seem to have slightly or > >> significantly different pipeline compositions), *or if the error > >> is* > >> due to ACT, ragwitz optimization, or some other faulty > >> parameterization *on my part due to a lack of understanding of how > >> transfer entropy works on a more theoretical/mathematical level*. > >> If > >> the latter is the case, is there any relatively straightforward way > >> to > >> conceptualize this, or is this something where I'm just going to > >> have > >> to keep reading and rereading until it eventually makes sense? I've > >> already done quite a bit of that and it hasn't pierced my thick > >> skull > >> yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> 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: > > > > > > ------------------------------ > > > > Message: 6 > > Date: Tue, 9 Sep 2014 15:21:20 +0200 > > From: Holger Krause > > To: FieldTrip discussion list > > Subject: [FieldTrip] Latest FT version on ftp-server is from three > > days ago > > Message-ID: > > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> > > Content-Type: text/plain; charset="us-ascii" > > > > Dear developers, > > > > Could you please check the process for creation/publication of > > zip-files on > > the FTP server? The latest file I can find there is > > fieldtrip-20140906.zip. > > > > Thanks in advance, > > > > Holger > > > > > > ------------------------------ > > > > Message: 7 > > Date: Tue, 9 Sep 2014 09:19:55 -0400 > > From: Max Cantor > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > This is immensely helpful, thank you. I was very confused about why > > some > > versions of the pipeline I saw were using group calculate and others > > were > > using interaction delay reconstruction and what that meant, and I > > think I > > have a more clear idea of what the different steps of the pipeline > > are > > doing. There are still a few things I'm a bit confused about though > > in > > terms of the pipeline. For instance, whether or not I need to do > > TEprepare > > before group prepare, and if I need to do graph analysis (which I'm > > not > > sure I fully understand but also haven't looked deeply into) before > > group > > stats. > > > > If you don't mind me taking you up on your offer, I think seeing > > your > > example script might help clarify some of these issues. > > > > Thank you! > > > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > > Patricia.Wollstadt at gmx.de> wrote: > > > >> Hello Max, > >> > >> I added a few comments to the questions regarding individual > >> parameters > >> below. To address the general problem of TRENTOOL telling you, that > >> there > >> are not enough sample points in your data: From what I can see in > >> your > >> script, you probably don't have enough data points in each time > >> series to > >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, > >> which > >> gives you 240 samples per time series. Can you maybe avoid > >> downsampling to > >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a > >> longer time > >> window of interest? > >> Note that you also 'lose' data to embedding and the interaction > >> delay: The > >> first point that can be used for TE estimation is at max. embedding > >> length > >> + max. interaction delay in samples. For example: max. embedding > >> length = > >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max > >> interaction > >> delay of 30 ms = 9 samples. In this example, you would be left with > >> 240 - > >> 29 samples for TE estimation per trial. There is also the > >> possibility to > >> estimate time resolved TE/TE for shorter time windows of interest > >> (see > >> section 4.4 in the manual); however, this method requires the use > >> of a GPU > >> for TE estimation. > >> > >> I would further recommend to use the new pipeline for group > >> statistics > >> described in the manual in section 4.5 (the function > >> 'TEgroup_calculate' is > >> deprecated). The new pipeline allows you to reconstruct the > >> interaction > >> delay and uses the following functions (see also comments in the > >> script): > >> > >> TEgroup_prepare -> prepares all data sets (all subjects/all > >> conditions) > >> for group analysis (this means finding common embedding parameters > >> such > >> that estimates are not biased between groups) > >> InteractionDelayReconstruction_calculate -> estimates TE for > >> individual data sets and all assumed interaction delays u > >> InteractionDelayReconstruction_analyze -> reconstructs the > >> interaction delay by selecting the u that maximizes TE for each > >> channel > >> TEgroup_stats -> calculate group statistics using a permutation > >> test > >> > >> I can send you an example script for group TE analysis using this > >> pipeline > >> to get you started. I hope this helps you to get the group analysis > >> running. Just write again if you're having trouble setting up the > >> pipeline > >> or something is not clear about the parameters/my comments. > >> > >> Best, > >> Patricia > >> > >> > >> > >> > >> On 09/04/2014 08:30 PM, Max Cantor wrote: > >> > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not 100% > >> sure if it is appropriate to ask questions about it here, but to > >> the best > >> of my knowledge they do not have a mailing list and I saw a few > >> trentool > >> questions in the archives, so I'm going to assume it's ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present in > >> the pipeline. Sorry in advance for the long post! Any help would be > >> greatly > >> appreciated as I'm a bit over my head on this but I think I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data that > >> was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi > >> is in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within > >> the toi, but beyond that are there any benefits to it being earlier > >> or > >> later?* PW: The predictiontime_u is in milliseconds and the toi is > >> in > >> seconds. The prediction time is the assumed interaction delay > >> between your > >> two sources and should fit within your toi. In general it is > >> preferable to > >> use the method for interaction delay reconstruction for TE > >> estimation, > >> because it allows you to reconstruct the actual delay between your > >> source > >> and target times series. A non-optimal u/interaction delay may > >> cause an > >> underestimation of TE, so it is recommended to use the pipeline for > >> interaction delay reconstruction whenever estimating TE for unknown > >> delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, > >> so it is best to limit the u range to values that are > >> physiologically > >> plausible. > >> > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the sample > >> rate and filters are used to determine the actthrvalue, but I don't > >> actually know the calculation. 7.5 was a rough guess just to test > >> the > >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: > >> You can > >> set the actthrvalue based on the filtering you did prior to TE > >> analysis. If > >> you for example highpass filtered at 10 Hz, you shouldn't find an > >> ACT > >> higher than 30 samples, because you filtered out any components of > >> the > >> signal slower than 10 Hz/30 samples (given your sampling frequency > >> of 300 > >> Hz). So in this scenario the actthrvalue would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm yet > >> to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* PW: > >> The Ragwitz criterion tries to find optimal embedding parameters > >> dim and > >> tau for the data. To do that, the method iteratively takes all > >> possible > >> combinations of dim and tau values that are provided in cfgP.ragdim > >> and > >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations > >> embed > >> the data. To test an embedding, the method builds the embedding > >> vectors > >> from the data; it then tests for each point how well the next point > >> in time > >> can be predicted from the reference point's nearest neighbours. So > >> for each > >> embedded point, the method searches for the nearest neighbours and > >> calculates the average of those nearest neighbours. The difference > >> between > >> the averaged/predicted point and the actual next point is the error > >> of the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested by > >> the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together > >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL > >> will > >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values > >> here are > >> factors that are later multiplied with the ACT to obtain the actual > >> tau. > >> 'repPred' is the number of points that will be used for the local > >> prediction, i.e. the Ragwitz criterion will test the local > >> prediction and > >> calculate the error for the first 100 points in your time series. > >> The two > >> parameters 'flagNei' ans 'sizeNei' below specify the type of > >> neighbour > >> search conducted by the Ragwitz criterion: 'flagNei' tells the > >> method to > >> either conduct a kNN or range search; 'sizeNei' specifies the > >> number of > >> neighbours or the radius to be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' > >> data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject > >> virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.* > >> TRENTOOL seems to handle data output very differently from > >> fieldtrip and > >> I've had trouble thinking through the most logical way to handle > >> the data > >> so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> > >> *For clarification, fileCell is a cell with the name of each > >> condition x > >> subject .mat file, which as I said before is collectively the same > >> as the 3 > >> x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> > >> > >> > >> > >> > >> > >> > >> *At this step I get the following error: Error using > >> transferentropy (line > >> 337) \nTRENTOOL ERROR: not enough data points left after embedding > >> Error in > >> TEgroup_calculate (line 133) [TEresult] = > >> transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate is a > >> pipeline issue* (I noticed the example pipeline in trentool, the > >> manual, > >> and published methods articles all seem to have slightly or > >> significantly > >> different pipeline compositions), *or if the error is* due to ACT, > >> ragwitz optimization, or some other faulty parameterization *on my > >> part > >> due to a lack of understanding of how transfer entropy works on a > >> more > >> theoretical/mathematical level*. If the latter is the case, is > >> there any > >> relatively straightforward way to conceptualize this, or is this > >> something > >> where I'm just going to have to keep reading and rereading until it > >> eventually makes sense? I've already done quite a bit of that and > >> it hasn't > >> pierced my thick skull yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> fieldtrip mailing > >> listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie ldtrip > >> > >> > >> -- > >> ------------------------------------------------------------ > >> > >> 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 > >> > > > > > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > -------------- 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 46, Issue 3 > > **************************************** > > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gamaliel.ghu at gmail.com Tue Sep 16 06:49:37 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Tue, 16 Sep 2014 01:49:37 -0300 Subject: [FieldTrip] dipole simulation on head model Message-ID: Hi all I followed the tips above to simulate a dipole source on my own head model generated from MRIs. However, using information from: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit I could not simulate anything. Only one image is blank. The code I am using is as follows: cfg = []; cfg.vol = vol; % See above cfg.elec = elec; % See above cfg.dip.pos = [0 0 0]; cfg.dip.mom = [2 2 2]; % Note, it Should be transposed cfg.dip.frequency = 10; cfg.ntrials = 10; cfg.triallength = 1; % seconds cfg.fsample = 25; % Hz raw1 = ft_dipolesimulation (cfg); ft_timelockanalysis avg1 = ([], raw1); plot (avg1.time, avg1.avg); % Plot the timecourse where: vol = ft_prepare_headmodel volumes generated from the segmentation of my resonances. and ft_read_sens elec = ('standard_1020.elc'); to run the script the result is a blank image. and Matlab tells me the following: using headmodel specified in the configuration using electrodes specified in the configuration Determining source compartment (1) projecting electrodes on skin surface electrode and system combine combining transfer matrix computing simulated data computing simulated trial data for 10 RMS value of simulated data is NaN the call to "ft_dipolesimulation" took 4 seconds the input is raw Data with 97 channels and 10 trials Warning: the data does not Contain a definition trial > In utilities \ private \ warning_once at 158 In utilities \ private \ fixsampleinfo at 66 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 Warning: sampleinfo by reconstructing Assuming That the trials are consecutive segments of a continuous recording > In utilities \ private \ warning_once at 158 In utilities \ private \ fixsampleinfo at 79 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 averaging trials trial averaging 10 of 10 the call to "ft_timelockanalysis" took 1 seconds I hope you can help greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Tue Sep 16 08:07:19 2014 From: a.stolk8 at gmail.com (a.stolk) Date: Tue, 16 Sep 2014 08:07:19 +0200 Subject: [FieldTrip] dipole simulation on head model Message-ID: Hi Gamaliel, can you try avg = ft_timelockanalysis([], raw1);  Instead of ft_timelockanalysis avg1 = ([], raw1);  Hope this helps, arjen -------- Oorspronkelijk bericht -------- Van: gamaliel huerta urrea Datum: Aan: fieldtrip at science.ru.nl Onderwerp: [FieldTrip] dipole simulation on head model Hi all I followed the tips above to simulate a dipole source on my own head model generated from MRIs. However, using information from:  http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit I could not simulate anything. Only one image is blank. The code I am using is as follows:  cfg = [];  cfg.vol = vol; % See above  cfg.elec = elec; % See above  cfg.dip.pos = [0 0 0];  cfg.dip.mom = [2 2 2]; % Note, it Should be transposed  cfg.dip.frequency = 10;  cfg.ntrials = 10;  cfg.triallength = 1; % seconds  cfg.fsample = 25; % Hz  raw1 = ft_dipolesimulation (cfg);  ft_timelockanalysis avg1 = ([], raw1);  plot (avg1.time, avg1.avg); % Plot the timecourse  where:  vol = ft_prepare_headmodel volumes generated from the segmentation of my resonances.  and  ft_read_sens elec = ('standard_1020.elc');  to run the script the result is a blank image.  and Matlab tells me the following:  using headmodel specified in the configuration  using electrodes specified in the configuration  Determining source compartment (1)  projecting electrodes on skin surface  electrode and system combine combining transfer matrix  computing simulated data  computing simulated trial data for 10  RMS value of simulated data is NaN  the call to "ft_dipolesimulation" took 4 seconds  the input is raw Data with 97 channels and 10 trials  Warning: the data does not Contain a definition trial  > In utilities \ private \ warning_once at 158     In utilities \ private \ fixsampleinfo at 66     In ft_datatype_raw at 157     In ft_checkdata at 224     In ft_timelockanalysis at 105     In codgen at 50  Warning: sampleinfo by reconstructing Assuming That the trials are consecutive segments of  a continuous recording  > In utilities \ private \ warning_once at 158     In utilities \ private \ fixsampleinfo at 79     In ft_datatype_raw at 157     In ft_checkdata at 224     In ft_timelockanalysis at 105     In codgen at 50  averaging trials  trial averaging 10 of 10  the call to "ft_timelockanalysis" took 1 seconds  I hope you can help  greetings -- Gamaliel Huerta Ingeniería Civil Biomédica Universidad de Valparaíso -------------- next part -------------- An HTML attachment was scrubbed... URL: From Holger.Krause at med.uni-duesseldorf.de Tue Sep 16 11:35:30 2014 From: Holger.Krause at med.uni-duesseldorf.de (Holger Krause) Date: Tue, 16 Sep 2014 11:35:30 +0200 Subject: [FieldTrip] Latest FT version on ftp-server is from three days ago In-Reply-To: <201409091521.22589.Holger.Krause@med.uni-duesseldorf.de> Message-ID: <201409161135.32594.Holger.Krause@med.uni-duesseldorf.de> Hi! Again, same situation as last week :-( The latest file I can find on the FTP server is fieldtrip-20140913.zip. Thanks for taking care of this issue, 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 r.oostenveld at donders.ru.nl Tue Sep 16 12:15:11 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 16 Sep 2014 12:15:11 +0200 Subject: [FieldTrip] Latest FT version on ftp-server is from three days ago In-Reply-To: <201409161135.32594.Holger.Krause@med.uni-duesseldorf.de> References: <201409161135.32594.Holger.Krause@med.uni-duesseldorf.de> Message-ID: <4C0CDFB7-782E-49C1-9659-B85ABB918486@donders.ru.nl> Hi Holger, Thanks for notifying. We had a server crash a few days ago. One of the consequences seems to have been that the automatic svn update script blocked. I did a cleanup and the automatic releases on the ftp should start coming again. Note that alternative ways to access the code are explained on http://fieldtrip.fcdonders.nl/faq/i_would_like_an_automatic_daily_updated_version_of_the_code_can_i_get_access_to_the_cvs_or_snv_server best regards, Robert On 16 Sep 2014, at 11:35, Holger Krause wrote: > Hi! > > Again, same situation as last week :-( The latest file I can find on the FTP > server is fieldtrip-20140913.zip. > > Thanks for taking care of this issue, > > 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 gauthierb.ens at gmail.com Tue Sep 16 14:27:15 2014 From: gauthierb.ens at gmail.com (Baptiste Gauthier) Date: Tue, 16 Sep 2014 14:27:15 +0200 Subject: [FieldTrip] difference in raw time sample values for .fif files read by fieldtrip vs mne-python Message-ID: Dear fieldtrippers, I recently observed that reading a raw neuromag .fif file with fieldtrip and mne-python (with default settings for both) give exactly the same events separated by the same time (which is good!) but with a different time offset: the zero-point definition for the recording differ between the two softwares. I hypothesize that this difference comes from the convention adopted: fieldtrip would use the "record raw" trigger as a zero-point and mne the "start" trigger that occur earlier (i.e. you can follow the signal but it will be not saved in the file), but I'm not perfectly sure. As someone already observed this difference? It's harmless because it doesn't affect relative timing of the event but become problematic to transfer recoded events trl from fieldtrip to mne-python with a time-sample matching strategy. Best, Baptiste -- Baptiste Gauthier Postdoctoral Research Fellow INSERM-CEA Cognitive Neuroimaging unit CEA/SAC/DSV/DRM/Neurospin center Bât 145, Point Courier 156 F-91191 Gif-sur-Yvette Cedex FRANCE -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.gerhold at gmail.com Tue Sep 16 17:03:33 2014 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Tue, 16 Sep 2014 17:03:33 +0200 Subject: [FieldTrip] ft_connectivityanalysis vs MATLAB Message-ID: Hi, I've compared the non-parametric calculation of the coherence spectrum using ft_connectivityanalysis to mscohere (MATLAB). The FT function provides inflated coherence values in comparison to the MATLAB function. I've also referenced this to a implementation of the original calculation which equates to the MATLAB output. Any advice would be appreciated. Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.gerhold at gmail.com Tue Sep 16 17:16:00 2014 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Tue, 16 Sep 2014 17:16:00 +0200 Subject: [FieldTrip] ft_connectivity_pdc Message-ID: When computing pdc in FT, line 67 of ft_connectivity_pdc appears to invert the spectral transfer func. When inverting I received the following error: Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 6.358859e-18. Will this impact on the final spectrum calculated by the method. If so, is there a possible workaround/solution? Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From gamaliel.ghu at gmail.com Tue Sep 16 19:20:36 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Tue, 16 Sep 2014 14:20:36 -0300 Subject: [FieldTrip] dipole simulation on head model Message-ID: Hi all I followed the tips above to simulate a dipole source on my own head model generated from MRIs. However, using information from: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit I could not simulate anything. Only one image is blank. The code I am using is as follows: cfg = []; cfg.vol = vol; % See above cfg.elec = elec; % See above cfg.dip.pos = [0 0 0]; cfg.dip.mom = [2 2 2]; % Note, it Should be transposed cfg.dip.frequency = 10; cfg.ntrials = 10; cfg.triallength = 1; % seconds cfg.fsample = 25; % Hz raw1 = ft_dipolesimulation (cfg); avg1 = ft_timelockanalysis([], raw1); plot (avg1.time, avg1.avg); % Plot the timecourse where: vol = ft_prepare_headmodel volumes generated from the segmentation of my resonances. and ft_read_sens elec = ('standard_1020.elc'); to run the script the result is a blank image. and Matlab tells me the following: using headmodel specified in the configuration using electrodes specified in the configuration Determining source compartment (1) projecting electrodes on skin surface electrode and system combine combining transfer matrix computing simulated data computing simulated trial data for 10 RMS value of simulated data is NaN the call to "ft_dipolesimulation" took 4 seconds the input is raw Data with 97 channels and 10 trials Warning: the data does not Contain a definition trial >* In utilities \ private \ warning_once at 158 * In utilities \ private \ fixsampleinfo at 66 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 Warning: sampleinfo by reconstructing Assuming That the trials are consecutive segments of a continuous recording >* In utilities \ private \ warning_once at 158 * In utilities \ private \ fixsampleinfo at 79 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 averaging trials trial averaging 10 of 10 the call to "ft_timelockanalysis" took 1 seconds I hope you can help greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.lalancette at sickkids.ca Tue Sep 16 20:42:21 2014 From: marc.lalancette at sickkids.ca (Marc Lalancette) Date: Tue, 16 Sep 2014 18:42:21 +0000 Subject: [FieldTrip] MEG lead field units Message-ID: <2A2B6A5B8C4C174CBCCE0B45E548DEB229FBB67F@SKMBXX01.sickkids.ca> Hello Fieldtrippies, Regarding a question I asked some months ago about the physical units of the lead field in Fieldtrip, I wanted to share the fact that I was wrong, and that it might be good to either document this in the code and possibly to add a factor. When using 'cm' units, the lead field is in Wb/cm^2/(A*m) = 1e4 T/Am = 1e2 T/(A*cm). I started to realize my original assumption was wrong while working on my Biomag poster since I was getting very low SNR values (around 1) for typical source and system parameters. So I looked closer at the single sphere code and my own old spherical forward solution code, and here is where the extra factor comes in: Skipping to the last step, my formula is: B = UnitConversion * (1e-7) * ( (QxrQ/F - (QxrQ * rv') * GradF/F^2) * SensorOrient' ); The second factor is the constant mu0/(4*pi) = 10^-7 Wb/Am. Assuming a source (Q) in units of Am and distances in cm, the complicated bit has units of Am*cm/cm^3. Thus without the first factor, B would have units of Wb/cm^2 = 1e4 T, and so I was using UnitConversion = 1e4 in my code, to get B in Tesla. If we don't put in a specific source amplitude (as in Fieldtrip), and still using UnitConversion, then B would be in T/(Am). I guess units can be different than 'cm' though, so the factor would have to take that into account. Note that the single shell forward solution gives the same units as single sphere and would need the same factor. I haven't looked at other forward methods. I also haven't verified if this is correctly dealt with when obtaining reconstructed source amplitudes, say with a beamformer. Cheers, Marc Lalancette Lab Research Project Manager The Hospital for Sick Children, Toronto, Canada ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. -------------- next part -------------- An HTML attachment was scrubbed... URL: From barbara.schorr at uni-ulm.de Wed Sep 17 11:22:19 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Wed, 17 Sep 2014 11:22:19 +0200 Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable In-Reply-To: References: Message-ID: <20140917112219.crkxv6dgoo0skccc@imap.uni-ulm.de> Dear Jim, I now downloaded the newest fieldtrip version but I still get the same error messag. Is there anything else I need to know? Thanks a lot! Best, Barbara Zitat von 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: ft_rejectvisual: removing trials marked as bad (Ashley Greene) > 2. Read only EEG data from combined MEG/EEG ctf file (Tobias Trame) > 3. Re: ft_globalmeanfield : Undefined function of variable > 'abort' (Herring, J.D. (Jim)) > 4. using ft_megplanar with sinle-trial TFRs (Fr?d?ric Roux) > 5. dipole simulation on head model (gamaliel huerta urrea) > 6. Re: dipole simulation on head model (Tzvetan Popov) > 7. Re: ft_globalmeanfield : Undefined function of variable > 'abort' (Jing Fan) > 8. Re: ft_globalmeanfield : Undefined function of variable > 'abort' (Jing Fan) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 12 Sep 2014 21:39:43 +0900 > From: Ashley Greene > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > bad > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi Emilie, > > Thanks!! I, of course, completely overlooked that. > > Ashley > > On Tue, Sep 9, 2014 at 3:37 PM, Caspar, Emilie wrote: > >> Hi Ashley, >> >> Maybe the mistake is you did not integrate in your script the command to >> save the rejection. Normally, with the following command, you will see in >> the Matlab Window that artifacts are correctly rejected after the "quit" >> button. >> >> clean_data = ft_rejectvisual(cfg, interpoldata); >> cfg.artfctdef.reject = 'complete'; >> cfg.artfctdef.feedback = 'yes'; >> cleandata = ft_rejectartifact(cfg,clean_data); >> >> Emilie >> >> >> >> >> >> Le 3 sept. 2014 ? 11:58, Ashley Greene a ?crit : >> >> Hello, >> >> I have used the rejectvisual function in attempt to remove bad trials, >> but after marking them and pressing the quit button, although the command >> window states that the selected trials have been removed, there is no >> obvious change in the data; all of the trials are still intact. Have I >> overlooked something? >> >> Thanks, >> >> Ashley >> _______________________________________________ >> 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: > > > ------------------------------ > > Message: 2 > Date: Fri, 12 Sep 2014 18:23:17 +0200 (CEST) > From: Tobias Trame > To: > Subject: [FieldTrip] Read only EEG data from combined MEG/EEG ctf file > Message-ID: > > > Content-Type: text/plain; charset=us-ascii > > Hi everybody! > > I'm trying to read only the EEG data from a combined MEG/EEG ctf > file in order > to create leadfields later on, but the function "ft_read_sens" just returns > the gradiometer information in a 'grad' field. It searches for an > 'elec'-field > in the header of the data which is not present. Is there a configuration to > get the EEG-elecrodes by using "ft_read_sens"? > > My first attempt was to write the EEG-Information from the header by hand > using the following code: > > hdr = ft_read_header('subject.ds', 'headerformat', 'ctf_ds'); > elec.elecpos = [hdr.orig.eeg.pos]'; > elec.chanpos = [hdr.orig.eeg.pos]'; > elec.label = {hdr.orig.eeg.name}'; > elec.type = 'eeg'; > elec.unit = 'cm'; > > But now I get a similar problem if I want to create leadfields from timelock > data. After doing the timelock analysis using > > timelock_data = ft_timelockanalysis(cfg, mydata); > > the structure timelock_data contains just a 'grad' and no 'elec' > field so that > ft_prepare_leadfield(cfg, timelock_data) always ignores the EEG-elecrodes and > tries to use the gradiometes - even if I put the electrodes defined > above into > cfg.elec. > > Thanks for any suggestions! > > Tobias > > > ------------------------------ > > Message: 3 > Date: Mon, 15 Sep 2014 12:01:02 +0200 (CEST) > From: "Herring, J.D. (Jim)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of > variable 'abort' > Message-ID: > <2103383764.4690548.1410775262514.JavaMail.root at draco.zimbra.ru.nl> > Content-Type: text/plain; charset=utf-8 > > Dear Barbara, > > The error seems to be related to a bug that pops up now and then > (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be > due to a corrupt installation of fieldtrip and/or the need to update > fieldtrip. > > Could you please try downloading the most recent version of > fieldtrip and see if the problem persists? > > For an example of what can be expected from this function see: Esser > SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A > direct demonstration of cortical LTP in humans: a combined TMS/EEG > study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. > PubMed PMID: 16464689. > > Best, > > Jim > > > ----- Oorspronkelijk bericht ----- >> Van: "barbara schorr" >> Aan: fieldtrip at science.ru.nl >> Verzonden: Woensdag 10 september 2014 14:07:14 >> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of >> variable 'abort' >> Dear fieldtripers. >> >> as mentioned in the subject line I would like to anaylse my timelocked >> ERP Data with the function ft_globalmeanfield. >> >> I get the Error: Undefined function or variable 'abort' >> Error in ft_globalmeanfield (line84) >> if abort >> >> in the function it says: >> >> %the abort variable is set to true or false in ft_preamble_inti >> if abort >> % do not continue function execution in case the outputfile is >> present and the user indicated to keep it >> return >> end >> >> >> I don't understand what this means. I would really appreciate your >> help to get this running. >> >> Also, what is the result when I run this function on my data? (This >> method was proposed from a reviewer. I never used it before, so I >> don't exactly know what it does and what the result will look like). >> >> Thank you very much in advance! >> >> Best, >> >> Barbara Schorr >> >> >> >> >> Zitat von 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: Question regarding nonparametric testing for coherence >> > differences (Eric Maris) >> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >> > 4. Re: ft_rejectvisual: removing trials marked as bad >> > (Caspar, Emilie) >> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >> > 6. Latest FT version on ftp-server is from three days ago >> > (Holger Krause) >> > 7. Re: TRENTOOL pipeline help (Max Cantor) >> > >> > >> > ---------------------------------------------------------------------- >> > >> > Message: 1 >> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >> > From: "Eric Maris" >> > To: , "'FieldTrip discussion list'" >> > >> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >> > for >> > coherence differences >> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Hwee Ling, >> > >> > >> > >> > In the paper you refer to (Maris et al, JNM, 2007), I did not >> > perform a >> > cluster-based permutation test at the level of the channel pairs. >> > Instead, >> > all coherences mentioned in the paper are coherence between a single >> > EMG >> > channel (2 electrodes mounted on the forearm) and all MEG >> > electrodes. Thus, >> > there are as many EMG-MEG coherences as there are MEG channels (275 >> > in our >> > lab), and the clustering of these coherences involves the same >> > neighbourhood >> > structure as the clustering of channel-specific statistics on power >> > or >> > evoked response. The analysis you propose involves clustering in a >> > much more >> > complex space, namely the formed by all (MEG,MEG) channel pairs >> > (275*275=75625 pairs). In the early days of cluster-based >> > permutation >> > statistics, I have worked on this problem but did not pursue it >> > because the >> > resulting clusters are very hard to interpret. >> > >> > >> > >> > Best, >> > >> > >> > >> > Eric Maris >> > >> > >> > >> > >> > >> > Dear all and Prof Maris, >> > >> > I'm re-posting this question again, as I didn't get any replies >> > previously. >> > >> > I?m interested to investigate if there are any differences in phase >> > synchronization in resting state data at timepoint 2 versus >> > timepoint 1. The >> > EEG data was collected using 64 EEG channels, resting state, eyes >> > opened and >> > eyes closed. I?ve arbitrarily segmented the resting state data into >> > epochs >> > of 2s each, and the epochs with artifacts are excluded completely >> > from >> > further analyses. I then performed mtmfft to get the fourier >> > representation >> > of the data, extracted the coherence, and compared the coherence >> > difference >> > of timepoint 2 versus timepoint 1 of all channels paired with all >> > other >> > channels. >> > >> > I figured that if I extract the connectivity analyses without >> > specifying the >> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >> > allow me to >> > perform cluster-based statistical analyses. I get an output with >> > ?chan_chan? >> > dimord variable. However, I was not 100% sure that this is correct, >> > hence, I?ve >> > inserted my code (see below). It?ll be great if you could tell me if >> > what I?m >> > doing makes any sense at all. Also, I don?t know how I can plot the >> > results >> > to see if it make any sense at all. >> > >> > Also, I checked the values obtained from when I specified >> > "cfg.channelcmb" >> > and when I did not specify "cfg.channelcmb", I noticed that the >> > values were >> > somehow different. I would assume that the values to be similar, >> > although >> > I'm not sure why they would have differences in the values obtained >> > from >> > specifying "cfg.channelcmb". >> > >> > This is my code that I've used thus far: >> > >> > for sub = 1:5 >> > >> > cfg = []; >> > >> > cfg.output = 'fourier'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.keeptrials = 'yes'; >> > >> > cfg.tapsmofrq = 5; >> > >> > cfg.foilim = [0 100]; >> > >> > cfg.taper = 'dpss'; >> > >> > % find the index for the c200 condition >> > >> > pre_c200_idx = find(data5.trialinfo == 201); >> > >> > cfg.trials = pre_c200_idx; >> > >> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >> > >> > post_c200_idx = find(data5.trialinfo == 200); >> > >> > cfg.trials = post_c200_idx; >> > >> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >> > >> > >> > >> > cfg = []; >> > >> > cfg.keeptrials = 'no'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.removemean = 'yes'; >> > >> > cfg.method = 'coh'; >> > >> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_pre_c200); >> > >> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_post_c200); >> > >> > end >> > >> > >> > >> > >> load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); >> > >> > cfg_neighb.method = 'template'; >> > >> > cfg_neighb.layout = lay; >> > >> > cfg_neighb.channel = 'all'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, >> > sub_HLF_pre_c200coh{1}); >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.neighbours = neighbours; >> > >> > cfg.channel = 'all'; >> > >> > cfg.channelcmb = {cfg.channel, cfg.channel}; >> > >> > cfg.latency = 'all'; >> > >> > cfg.avgovertime = 'no'; >> > >> > cfg.avgoverchan = 'no'; >> > >> > cfg.parameter = 'cohspctrm'; >> > >> > cfg.method = 'montecarlo'; >> > >> > cfg.statistic = 'depsamplesT'; >> > >> > cfg.correctm = 'cluster'; >> > >> > cfg.tail = 0; >> > >> > % cfg.clustertail = 0; >> > >> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >> > frequency >> > bands. >> > >> > cfg.numrandomization = 10000; >> > >> > cfg.ivar = 2; >> > >> > cfg.uvar = 1; >> > >> > >> > >> > % design matrices >> > >> > clear design; >> > >> > design(1,:) = [1:5, 1:5]; >> > >> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >> > >> > cfg.design = design; >> > >> > % for theta band >> > >> > cfg.avgoverfreq = 'yes'; >> > >> > cfg.frequency = [4 8]; % I also performed the statistics for delta >> > (2-4), >> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >> > (30-40), >> > and gamma (40-100). >> > >> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >> > sub_HLF_post_c200coh{:}, >> > sub_HLF_pre_c200coh{:}); >> > >> > >> > >> > When I tried to plot the results, I used this code: >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.layout = 'lay'; >> > >> > cfg.zlim = [-1 1]; >> > >> > cfg.alpha = 0.05; >> > >> > cfg.refchannel = 'all'; >> > >> > ft_clusterplot(cfg, diffc200_theta_stat); >> > >> > However, I was not sure how I could plot the results. I get an error >> > message >> > from Fieldtrip when using ft_clusterplot: >> > >> > Error using topoplot_common (line 366) >> > >> > no reference channel is specified >> > >> > Error in ft_topoplotTFR (line 192) >> > >> > [cfg] = topoplot_common(cfg, varargin{:}); >> > >> > Error in ft_clusterplot (line 372) >> > >> > ft_topoplotTFR(cfgtopo, stat); >> > >> > >> > >> > According to your paper in 2007, the topoplot of the results were >> > masked by >> > the spatio-spectral pattern of the significant clusters. I don't >> > know how to >> > do this, and I would really appreciate if you can show me how to >> > make such a >> > plot. >> > >> > Thank you very much. >> > >> > Kind regards, >> > >> > Hweeling >> > >> > >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > >> >> > >> > ------------------------------ >> > >> > Message: 2 >> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >> > From: KatrinH Heimann >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Joseph, thanks so much, I really appreciate your help. I was >> > also >> > wandering, if maybe there is another bug in my code. >> > Our nets are 128 channels, Hydrocel, but as a colleague of me >> > adviced me to >> > do so, I also tried the 129 layout. >> > My code you find below (without selection of bad channels etc.) >> > If you need also the data of two subjects to have a look, let me >> > know!!! >> > Best and thanks really! >> > Katrin >> > >> > >> > subject=input('Which subject do you want to analyse? ','s'); >> > >> > name = strcat(subject,'.raw'); >> > >> > subjectnumber=input('Which is the subjectnumber?', 's'); >> > >> > sb=subjectnumber >> > >> > %subjectnumber = strcat(subjectnumber, '.txt') >> > >> > %% >> > >> > >> > cfg = []; >> > >> > cfg.dataset = name; >> > >> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >> > >> > cfg.trialdef.eventtype = 'trigger'; >> > >> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> > trigger >> > >> > cfg.trialdef.prestim = 0.234; % in seconds >> > >> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> > observation, but maybe we need less) >> > >> > cfg = ft_definetrial(cfg); >> > >> > >> > cfg.trl([1:7],:) = []; >> > >> > >> > %change timeline according to constant offset of 16 ms = 8 samples >> > (because >> > recorded with 500 hz)in >> > >> > %structure trial >> > >> > cfg.trl(:,3)=cfg.trl(:,3)-8 >> > >> > >> > %change timeline to make the cut the zeropoint >> > >> > >> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> > >> > >> > >> > %% preprocess data >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.detrend = 'yes'; >> > >> > cfg.preproc.demean = 'yes'; >> > >> > cfg.preproc.baselinewindow = [-2.1 -2.0] >> > >> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> > filtered >> > >> > %(0.1-45) and bad channels have to be replaced!!!! >> > >> > %cfg.preproc.bpfreq = [6 32]; >> > >> > % >> > >> > % >> > >> > obs_data = ft_preprocessing(cfg); >> > >> > % >> > >> > save (strcat(sb,'obs_data') , 'obs_data') >> > >> > >> > %% determining channel neighbours (necessary for Artifact detection) >> > >> > cfg = []; >> > >> > cfg.channel = obs_data.label; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.feedback = 'yes'; >> > >> > lay = ft_prepare_layout(cfg); >> > >> > >> > >> > cfg_neighb = []; >> > >> > cfg_neighb.feedback = 'yes'; >> > >> > >> > cfg_neighb.method = 'triangulation'; >> > >> > cfg_neighb.layout = 'GSN128.sfp'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > obs_data.elec = ft_read_sens('GSN128.sfp'); >> > >> > >> > %% Artifacts - to detect bad channels - is not saved!!! >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs_data_try = ft_rejectvisual(cfg, obs_data); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_try = ft_rejectartifact (cfg,obs_data); >> > >> > >> > >> > %% Preparing neighbours for channel repair - but bad channel info >> > in!!! >> > >> > >> > % cfg_neighb = []; >> > >> > % cfg_neighb.feedback = 'yes'; >> > >> > % cfg_neighb.method = 'triangulation'; >> > >> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> > >> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > % Interpolate and put into new data structure >> > >> > cfg = []; >> > >> > cfg.badchannel = {}; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.method = 'nearest'; >> > >> > cfg.neighbours = neighbours; >> > >> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> > >> > >> > % Check reconstruction >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > % dat1=obs_data; >> > >> > % dat2=obs_data_channelrepaired; >> > >> > % >> > >> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> > >> > % y=dat2.trial{1}(62,:); >> > >> > % plot(x);hold on;plot(y,'r'); >> > >> > % >> > >> > % x=dat1.trial{1}(72,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > % >> > >> > % x=dat1.trial{1}(75,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > %% artifact rejection/trial inspection - throw out electrode jumps >> > etc. >> > >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> > according to >> > channels interpolated %% 128-number of interp. channels) >> > >> > >> > >> > cfg = []; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.numcomponent = 128 >> > >> > comp = ft_componentanalysis(cfg,obs_data_clean1); >> > >> > save (strcat(sb,'comp_all') , 'comp') >> > >> > >> > %% >> > >> > cfg = []; >> > >> > cfg.viewmode = 'component'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='some'; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > ft_databrowser(cfg,comp); >> > >> > >> > %% poweranalysis components >> > >> > cfg = []; >> > >> > cfg.output = 'pow'; >> > >> > cfg.channel = 'all';%compute the power spectrum in all ICs >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.taper = 'hanning'; >> > >> > cfg.foi = 0:0.2:50; >> > >> > obs_freq = ft_freqanalysis(cfg, comp); >> > >> > >> > %And you can plot the spectra: >> > >> > >> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> > >> > nsubplots = 16; >> > >> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> > decimals, type >> > doc subplot >> > >> > >> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >> > >> > tot = Nfigs*nsubplots; >> > >> > >> > rptvect = 1:size(comp.topo,1); >> > >> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> > >> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> > >> > >> > for r=1:size(rptvect,1); >> > >> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> > 1]);%full >> > screen >> > >> > k=0; >> > >> > for j=1:size(rptvect,2); >> > >> > if~(rptvect(r,j)==0); >> > >> > k=k+1; >> > >> > cfg=[]; >> > >> > cfg.channel = rptvect(r,j); >> > >> > cfg.ylim =[0 500] >> > >> > cfg.xlim =[0 50] >> > >> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> > >> > end >> > >> > end >> > >> > end >> > >> > >> > %For the IC topos you'll follow the same logic as above but with: >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [1:20]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [21:40]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [41:60]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [61:80]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > >> > >> > >> > >> > %% Seperate observation conditions >> > >> > >> > name1= strcat(num2str(sb),'_90.xls'); >> > >> > list1=xlsread (name1) >> > >> > >> > >> > >> > >> > name2= strcat(num2str(sb),'_180.xls'); >> > >> > list2=xlsread (name2) >> > >> > >> > >> > % >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list1] >> > >> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list2] >> > >> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > %%PIPELINE FOR obs90 >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128; >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > >> > comp_1 = ft_componentanalysis(cfg, obs90_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> > obs90_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts - final detection >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs90_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> > >> > >> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> > >> > >> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> > >> > >> > %% plot it >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP) >> > >> > >> > >> > >> > >> > >> > >> > %% PIPELINE FOR obs180 >> > >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128 >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > comp_2 = ft_componentanalysis(cfg, obs180_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> > obs180_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts final 180 >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs180_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> > >> > >> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> > >> > >> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> > >> > >> > %% plot 180 ERP >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs180_data_ERP) >> > >> > >> > %% plot both ERPs >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > cfg.showlabels = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> > >> > >> > %% plot difference wave >> > >> > >> > difference = obs180_data_ERP; % copy one of the >> > structures >> > >> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >> > the >> > difference ERP >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, difference) >> > >> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> > >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI >> >> data. A couple things. First of all, exactly which net do you use? >> >> If >> >> they are 129-channel, there is still the question of whether they >> >> are the >> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >> >> cause an >> >> error like this. Could you send me the file you are trying to >> >> process and >> >> the script you are using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >> >> diezmartini at gmail.com> wrote: >> >> >> >> Which nets do you use? I use EGI. I tried both the ones you mention >> >> and >> >> they didn't work. It was hard to find that exact one online but it >> >> was the >> >> only file that actually worked. >> >> >> >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >> >> >> wrote: >> >> >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. >> >>> Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one >> >>> >> >>>> I use >> >>>> >> >>>> >> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >> >>>> katrinheimann at gmail.com> wrote: >> >>>> >> >>>>> Dear all, my problems seem neverending. This time however i >> >>>>> really need >> >>>>> help. >> >>>>> I implemented a pipeline for ERPs. All works now, >> >>>>> trialdefinition, >> >>>>> preprocessing, channelreplacement, ica, componentrejection, >> >>>>> final >> >>>>> artifactdetection, timelock of the single subject data. However, >> >>>>> when I >> >>>>> wanna compute the grandaverage of the single subjects I get the >> >>>>> following >> >>>>> error message: >> >>>>> >> >>>>> computing average of avg over 19 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 3 MB >> >>>>> computing average of avg over 2 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >> >>>>> additional >> >>>>> allocation of an estimated 0 MB >> >>>>> >> >>>>> Furthermore in the plot of the significant clusters, the >> >>>>> channelnames >> >>>>> are mixed up (do not correspond to my net) >> >>>>> >> >>>>> >> >>>>> I guess that there is a problem with the layout I use. >> >>>>> Here the code that I use >> >>>>> >> >>>>> %For generating the layout (also in the single subjects): >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = obs_data.label; >> >>>>> >> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>>> >> >>>>> cfg.feedback = 'yes'; >> >>>>> >> >>>>> lay = ft_prepare_layout(cfg); >> >>>>> >> >>>>> >> >>>>> cfg_neighb = []; >> >>>>> >> >>>>> cfg_neighb.feedback = 'yes'; >> >>>>> >> >>>>> cfg_neighb.method = 'triangulation'; >> >>>>> >> >>>>> cfg_neighb.layout = lay; >> >>>>> >> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>>> >> >>>>> >> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>>>> >> >>>>> >> >>>>> %For computing the grand average >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = 'all'; >> >>>>> >> >>>>> cfg.latency = 'all'; >> >>>>> >> >>>>> cfg.parameter = 'avg'; >> >>>>> >> >>>>> cfg.keepindividual = 'no' >> >>>>> >> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>>>> >> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>>>> >> >>>>> % "{:}" means to use data from all elements of the variable >> >>>>> >> >>>>> >> >>>>> For plotting the significant clusters >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.style = 'blank'; >> >>>>> >> >>>>> cfg.layout = lay; >> >>>>> >> >>>>> cfg.channellabels = 'yes'; >> >>>>> >> >>>>> cfg.highlight = 'labels'; >> >>>>> >> >>>>> cfg.highlightchannel = find(stat.mask); >> >>>>> >> >>>>> cfg.comment = 'no'; >> >>>>> >> >>>>> figure; ft_topoplotER(cfg, GA_90) >> >>>>> >> >>>>> title('Nonparametric: significant with cluster multiple >> >>>>> comparison >> >>>>> correction') >> >>>>> >> >>>>> >> >>>>> Do you have ANY idea to this? I am really completely >> >>>>> helpless.... >> >>>>> >> >>>>> thanks and best >> >>>>> >> >>>>> Katrin >> >>>>> >> >>>>> _______________________________________________ >> >>>>> 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 >> >>> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> >> >> >> -------------------------------------------------------------------------------- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.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: >> > >> >> > >> > ------------------------------ >> > >> > Message: 3 >> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >> > From: Joseph Dien >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > yes, please do send me the data. >> > >> > Thanks! >> > >> > Joe >> > >> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >> > wrote: >> > >> >> Dear Joseph, thanks so much, I really appreciate your help. I was >> >> also wandering, if maybe there is another bug in my code. >> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >> >> adviced me to do so, I also tried the 129 layout. >> >> My code you find below (without selection of bad channels etc.) >> >> If you need also the data of two subjects to have a look, let me >> >> know!!! >> >> Best and thanks really! >> >> Katrin >> >> >> >> >> >> >> >> subject=input('Which subject do you want to analyse? ','s'); >> >> >> >> name = strcat(subject,'.raw'); >> >> >> >> subjectnumber=input('Which is the subjectnumber?', 's'); >> >> >> >> sb=subjectnumber >> >> >> >> %subjectnumber = strcat(subjectnumber, '.txt') >> >> >> >> %% >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.dataset = name; >> >> >> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> >> >> >> cfg.trialdef.eventtype = 'trigger'; >> >> >> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> >> trigger >> >> >> >> cfg.trialdef.prestim = 0.234; % in seconds >> >> >> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> >> observation, but maybe we need less) >> >> >> >> cfg = ft_definetrial(cfg); >> >> >> >> >> >> >> >> cfg.trl([1:7],:) = []; >> >> >> >> >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> >> (because recorded with 500 hz)in >> >> >> >> %structure trial >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >> >> >> >> >> >> >> >> %change timeline to make the cut the zeropoint >> >> >> >> >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> >> >> >> >> >> >> >> >> >> >> >> %% preprocess data >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.detrend = 'yes'; >> >> >> >> cfg.preproc.demean = 'yes'; >> >> >> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >> >> >> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> >> filtered >> >> >> >> %(0.1-45) and bad channels have to be replaced!!!! >> >> >> >> %cfg.preproc.bpfreq = [6 32]; >> >> >> >> % >> >> >> >> % >> >> >> >> obs_data = ft_preprocessing(cfg); >> >> >> >> % >> >> >> >> save (strcat(sb,'obs_data') , 'obs_data') >> >> >> >> >> >> >> >> %% determining channel neighbours (necessary for Artifact >> >> detection) >> >> >> >> cfg = []; >> >> >> >> cfg.channel = obs_data.label; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.feedback = 'yes'; >> >> >> >> lay = ft_prepare_layout(cfg); >> >> >> >> >> >> cfg_neighb = []; >> >> >> >> cfg_neighb.feedback = 'yes'; >> >> >> >> >> >> >> >> cfg_neighb.method = 'triangulation'; >> >> >> >> cfg_neighb.layout = 'GSN128.sfp'; >> >> >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >> >> >> >> >> >> >> >> %% Artifacts - to detect bad channels - is not saved!!! >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Preparing neighbours for channel repair - but bad channel info >> >> in!!! >> >> >> >> >> >> >> >> % cfg_neighb = []; >> >> >> >> % cfg_neighb.feedback = 'yes'; >> >> >> >> % cfg_neighb.method = 'triangulation'; >> >> >> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> >> >> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> % Interpolate and put into new data structure >> >> >> >> cfg = []; >> >> >> >> cfg.badchannel = {}; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.method = 'nearest'; >> >> >> >> cfg.neighbours = neighbours; >> >> >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> >> >> >> >> >> % Check reconstruction >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> % dat1=obs_data; >> >> >> >> % dat2=obs_data_channelrepaired; >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> >> >> >> % y=dat2.trial{1}(62,:); >> >> >> >> % plot(x);hold on;plot(y,'r'); >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(72,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(75,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> %% artifact rejection/trial inspection - throw out electrode jumps >> >> etc. >> >> >> >> >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> >> according to channels interpolated %% 128-number of interp. >> >> channels) >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.channel = {'all'}; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >> >> >> >> save (strcat(sb,'comp_all') , 'comp') >> >> >> >> >> >> >> >> %% >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'component'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='some'; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> ft_databrowser(cfg,comp); >> >> >> >> >> >> >> >> %% poweranalysis components >> >> >> >> cfg = []; >> >> >> >> cfg.output = 'pow'; >> >> >> >> cfg.channel = 'all';%compute the power spectrum in all ICs >> >> >> >> cfg.method = 'mtmfft'; >> >> >> >> cfg.taper = 'hanning'; >> >> >> >> cfg.foi = 0:0.2:50; >> >> >> >> obs_freq = ft_freqanalysis(cfg, comp); >> >> >> >> >> >> >> >> %And you can plot the spectra: >> >> >> >> >> >> >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> >> >> nsubplots = 16; >> >> >> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> >> decimals, type doc subplot >> >> >> >> >> >> >> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >> >> >> >> tot = Nfigs*nsubplots; >> >> >> >> >> >> >> >> rptvect = 1:size(comp.topo,1); >> >> >> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> >> >> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> >> >> >> >> >> >> >> for r=1:size(rptvect,1); >> >> >> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> >> 1]);%full screen >> >> >> >> k=0; >> >> >> >> for j=1:size(rptvect,2); >> >> >> >> if~(rptvect(r,j)==0); >> >> >> >> k=k+1; >> >> >> >> cfg=[]; >> >> >> >> cfg.channel = rptvect(r,j); >> >> >> >> cfg.ylim =[0 500] >> >> >> >> cfg.xlim =[0 50] >> >> >> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> >> >> >> end >> >> >> >> end >> >> >> >> end >> >> >> >> >> >> >> >> %For the IC topos you'll follow the same logic as above but with: >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [1:20]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [21:40]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [41:60]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [61:80]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Seperate observation conditions >> >> >> >> >> >> >> >> name1= strcat(num2str(sb),'_90.xls'); >> >> >> >> list1=xlsread (name1) >> >> >> >> >> >> >> >> name2= strcat(num2str(sb),'_180.xls'); >> >> >> >> list2=xlsread (name2) >> >> >> >> >> >> % >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list1] >> >> >> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list2] >> >> >> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> %%PIPELINE FOR obs90 >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128; >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> >> >> >> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> >> obs90_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts - final detection >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> >> >> >> >> >> >> >> %% plot it >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% PIPELINE FOR obs180 >> >> >> >> >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> >> obs180_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts final 180 >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> >> >> >> >> >> >> >> %% plot 180 ERP >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot both ERPs >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> cfg.showlabels = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot difference wave >> >> >> >> >> >> >> >> difference = obs180_data_ERP; % copy one of >> >> the structures >> >> >> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >> >> compute the difference ERP >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, difference) >> >> >> >> >> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI data. A couple things. First of all, exactly which net do >> >> you use? If they are 129-channel, there is still the question of >> >> whether they are the Hydrocel or the older geodesic nets. >> >> Regardless, that shouldn't cause an error like this. Could you >> >> send me the file you are trying to process and the script you are >> >> using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >> >> wrote: >> >> >> >>> Which nets do you use? I use EGI. I tried both the ones you >> >>> mention and they didn't work. It was hard to find that exact one >> >>> online but it was the only file that actually worked. >> >>> >> >>> >> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one I use >> >>> >> >>> >> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear all, my problems seem neverending. This time however i really >> >>> need help. >> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >> >>> preprocessing, channelreplacement, ica, componentrejection, final >> >>> artifactdetection, timelock of the single subject data. However, >> >>> when I wanna compute the grandaverage of the single subjects I get >> >>> the following error message: >> >>> >> >>> computing average of avg over 19 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 3 MB >> >>> computing average of avg over 2 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 0 MB >> >>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> the call to "ft_topoplotER" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> >> >>> Furthermore in the plot of the significant clusters, the >> >>> channelnames are mixed up (do not correspond to my net) >> >>> >> >>> >> >>> I guess that there is a problem with the layout I use. >> >>> Here the code that I use >> >>> >> >>> %For generating the layout (also in the single subjects): >> >>> cfg = []; >> >>> >> >>> cfg.channel = obs_data.label; >> >>> >> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>> >> >>> cfg.feedback = 'yes'; >> >>> >> >>> lay = ft_prepare_layout(cfg); >> >>> >> >>> >> >>> cfg_neighb = []; >> >>> >> >>> cfg_neighb.feedback = 'yes'; >> >>> >> >>> cfg_neighb.method = 'triangulation'; >> >>> >> >>> cfg_neighb.layout = lay; >> >>> >> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>> >> >>> >> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>> >> >>> >> >>> >> >>> %For computing the grand average >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.channel = 'all'; >> >>> >> >>> cfg.latency = 'all'; >> >>> >> >>> cfg.parameter = 'avg'; >> >>> >> >>> cfg.keepindividual = 'no' >> >>> >> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>> >> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>> >> >>> % "{:}" means to use data from all elements of the variable >> >>> >> >>> >> >>> For plotting the significant clusters >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.style = 'blank'; >> >>> >> >>> cfg.layout = lay; >> >>> >> >>> cfg.channellabels = 'yes'; >> >>> >> >>> cfg.highlight = 'labels'; >> >>> >> >>> cfg.highlightchannel = find(stat.mask); >> >>> >> >>> cfg.comment = 'no'; >> >>> >> >>> figure; ft_topoplotER(cfg, GA_90) >> >>> >> >>> title('Nonparametric: significant with cluster multiple comparison >> >>> correction') >> >>> >> >>> >> >>> >> >>> Do you have ANY idea to this? I am really completely helpless.... >> >>> >> >>> thanks and best >> >>> >> >>> Katrin >> >>> >> >>> >> >>> _______________________________________________ >> >>> 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 >> >>> >> >>> _______________________________________________ >> >>> fieldtrip mailing list >> >>> fieldtrip at donders.ru.nl >> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> -------------------------------------------------------------------------------- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.com >> >> >> >> >> >> _______________________________________________ >> >> 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 >> > >> > >> -------------------------------------------------------------------------------- >> > >> > Joseph Dien, PhD >> > Research Associate >> > Cognitive Neurology >> > The Johns Hopkins University School of Medicine >> > >> > Lab E-mail: jdien1 at jhmi.edu >> > Private E-mail: jdien07 at mac.com >> > Office Phone: 410-614-3115 >> > Cell Phone: 202-297-8117 >> > Fax: 410-955-0188 >> > http://joedien.com >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > >> >> > >> > ------------------------------ >> > >> > Message: 4 >> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >> > From: "Caspar, Emilie" >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >> > bad >> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >> > Content-Type: text/plain; charset="iso-8859-1" >> > >> > Hi Ashley, >> > >> > Maybe the mistake is you did not integrate in your script the >> > command to save the rejection. Normally, with the following command, >> > you will see in the Matlab Window that artifacts are correctly >> > rejected after the "quit" button. >> > >> > clean_data = ft_rejectvisual(cfg, interpoldata); >> > cfg.artfctdef.reject = 'complete'; >> > cfg.artfctdef.feedback = 'yes'; >> > cleandata = ft_rejectartifact(cfg,clean_data); >> > >> > Emilie >> > >> > >> > >> > >> > >> > Le 3 sept. 2014 ? 11:58, Ashley Greene >> > > a ?crit : >> > >> > Hello, >> > >> > I have used the rejectvisual function in attempt to remove bad >> > trials, but after marking them and pressing the quit button, >> > although the command window states that the selected trials have >> > been removed, there is no obvious change in the data; all of the >> > trials are still intact. Have I overlooked something? >> > >> > Thanks, >> > >> > Ashley >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > >> >> > >> > ------------------------------ >> > >> > Message: 5 >> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >> > From: Patricia Wollstadt >> > To: fieldtrip at science.ru.nl >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: <540EEF94.9080601 at gmx.de> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > Hello Max, >> > >> > I added a few comments to the questions regarding individual >> > parameters >> > below. To address the general problem of TRENTOOL telling you, that >> > there are not enough sample points in your data: From what I can see >> > in >> > your script, you probably don't have enough data points in each time >> > series to robustly estimate TE. You analyze 800 ms of data sampled >> > at >> > 300 Hz, which gives you 240 samples per time series. Can you maybe >> > avoid >> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >> > you >> > analyze a longer time window of interest? >> > Note that you also 'lose' data to embedding and the interaction >> > delay: >> > The first point that can be used for TE estimation is at max. >> > embedding >> > length + max. interaction delay in samples. For example: max. >> > embedding >> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >> > max >> > interaction delay of 30 ms = 9 samples. In this example, you would >> > be >> > left with 240 - 29 samples for TE estimation per trial. There is >> > also >> > the possibility to estimate time resolved TE/TE for shorter time >> > windows >> > of interest (see section 4.4 in the manual); however, this method >> > requires the use of a GPU for TE estimation. >> > >> > I would further recommend to use the new pipeline for group >> > statistics >> > described in the manual in section 4.5 (the function >> > 'TEgroup_calculate' >> > is deprecated). The new pipeline allows you to reconstruct the >> > interaction delay and uses the following functions (see also >> > comments in >> > the script): >> > >> > TEgroup_prepare -> prepares all data sets (all subjects/all >> > conditions) for group analysis (this means finding common embedding >> > parameters such that estimates are not biased between groups) >> > InteractionDelayReconstruction_calculate -> estimates TE for >> > individual data sets and all assumed interaction delays u >> > InteractionDelayReconstruction_analyze -> reconstructs the >> > interaction delay by selecting the u that maximizes TE for each >> > channel >> > TEgroup_stats -> calculate group statistics using a permutation test >> > >> > I can send you an example script for group TE analysis using this >> > pipeline to get you started. I hope this helps you to get the group >> > analysis running. Just write again if you're having trouble setting >> > up >> > the pipeline or something is not clear about the parameters/my >> > comments. >> > >> > Best, >> > Patricia >> > >> > >> > >> > >> > On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not >> >> 100% sure if it is appropriate to ask questions about it here, but >> >> to >> >> the best of my knowledge they do not have a mailing list and I saw >> >> a >> >> few trentool questions in the archives, so I'm going to assume it's >> >> ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present >> >> in the pipeline. Sorry in advance for the long post! Any help would >> >> be >> >> greatly appreciated as I'm a bit over my head on this but I think >> >> I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data >> >> that was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi is >> >> in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within the toi, but beyond that are there any benefits to it being >> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >> >> the >> >> toi is in seconds. The prediction time is the assumed interaction >> >> delay between your two sources and should fit within your toi. In >> >> general it is preferable to use the method for interaction delay >> >> reconstruction for TE estimation, because it allows you to >> >> reconstruct >> >> the actual delay between your source and target times series. A >> >> non-optimal u/interaction delay may cause an underestimation of TE, >> >> so >> >> it is recommended to use the pipeline for interaction delay >> >> reconstruction whenever estimating TE for unknown delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, so it is best to limit the u range to values that are >> >> physiologically plausible. >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the >> >> sample rate and filters are used to determine the actthrvalue, but >> >> I >> >> don't actually know the calculation. 7.5 was a rough guess just to >> >> test the pipeline. I'm also uncertain of what minnrtrials should >> >> be.* >> >> PW: You can set the actthrvalue based on the filtering you did >> >> prior >> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >> >> shouldn't find an ACT higher than 30 samples, because you filtered >> >> out >> >> any components of the signal slower than 10 Hz/30 samples (given >> >> your >> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >> >> would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> * >> >> * >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm >> >> yet to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* >> >> PW: The Ragwitz criterion tries to find optimal embedding >> >> parameters >> >> dim and tau for the data. To do that, the method iteratively takes >> >> all >> >> possible combinations of dim and tau values that are provided in >> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >> >> these >> >> combinations embed the data. To test an embedding, the method >> >> builds >> >> the embedding vectors from the data; it then tests for each point >> >> how >> >> well the next point in time can be predicted from the reference >> >> point's nearest neighbours. So for each embedded point, the method >> >> searches for the nearest neighbours and calculates the average of >> >> those nearest neighbours. The difference between the >> >> averaged/predicted point and the actual next point is the error of >> >> the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested >> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together with 'ragtausteps' specifies the tau values to be tested >> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >> >> that >> >> the values here are factors that are later multiplied with the ACT >> >> to >> >> obtain the actual tau. 'repPred' is the number of points that will >> >> be >> >> used for the local prediction, i.e. the Ragwitz criterion will test >> >> the local prediction and calculate the error for the first 100 >> >> points >> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >> >> below >> >> specify the type of neighbour search conducted by the Ragwitz >> >> criterion: 'flagNei' tells the method to either conduct a kNN or >> >> range >> >> search; 'sizeNei' specifies the number of neighbours or the radius >> >> to >> >> be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> * >> >> * >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> * >> >> * >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.*TRENTOOL seems to handle data output very differently >> >> from >> >> fieldtrip and I've had trouble thinking through the most logical >> >> way >> >> to handle the data so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> * >> >> * >> >> *For clarification, fileCell is a cell with the name of each >> >> condition >> >> x subject .mat file, which as I said before is collectively the >> >> same >> >> as the 3 x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> * >> >> * >> >> *At this step I get the following error: >> >> >> >> Error using transferentropy (line 337) >> >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> >> >> Error in TEgroup_calculate (line 133) >> >> [TEresult] = transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate >> >> is a pipeline issue* (I noticed the example pipeline in trentool, >> >> the >> >> manual, and published methods articles all seem to have slightly or >> >> significantly different pipeline compositions), *or if the error >> >> is* >> >> due to ACT, ragwitz optimization, or some other faulty >> >> parameterization *on my part due to a lack of understanding of how >> >> transfer entropy works on a more theoretical/mathematical level*. >> >> If >> >> the latter is the case, is there any relatively straightforward way >> >> to >> >> conceptualize this, or is this something where I'm just going to >> >> have >> >> to keep reading and rereading until it eventually makes sense? I've >> >> already done quite a bit of that and it hasn't pierced my thick >> >> skull >> >> yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> 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: >> > >> >> > >> > ------------------------------ >> > >> > Message: 6 >> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >> > From: Holger Krause >> > To: FieldTrip discussion list >> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >> > days ago >> > Message-ID: >> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >> > Content-Type: text/plain; charset="us-ascii" >> > >> > Dear developers, >> > >> > Could you please check the process for creation/publication of >> > zip-files on >> > the FTP server? The latest file I can find there is >> > fieldtrip-20140906.zip. >> > >> > Thanks in advance, >> > >> > Holger >> > >> > >> > ------------------------------ >> > >> > Message: 7 >> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >> > From: Max Cantor >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > This is immensely helpful, thank you. I was very confused about why >> > some >> > versions of the pipeline I saw were using group calculate and others >> > were >> > using interaction delay reconstruction and what that meant, and I >> > think I >> > have a more clear idea of what the different steps of the pipeline >> > are >> > doing. There are still a few things I'm a bit confused about though >> > in >> > terms of the pipeline. For instance, whether or not I need to do >> > TEprepare >> > before group prepare, and if I need to do graph analysis (which I'm >> > not >> > sure I fully understand but also haven't looked deeply into) before >> > group >> > stats. >> > >> > If you don't mind me taking you up on your offer, I think seeing >> > your >> > example script might help clarify some of these issues. >> > >> > Thank you! >> > >> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >> > Patricia.Wollstadt at gmx.de> wrote: >> > >> >> Hello Max, >> >> >> >> I added a few comments to the questions regarding individual >> >> parameters >> >> below. To address the general problem of TRENTOOL telling you, that >> >> there >> >> are not enough sample points in your data: From what I can see in >> >> your >> >> script, you probably don't have enough data points in each time >> >> series to >> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >> >> which >> >> gives you 240 samples per time series. Can you maybe avoid >> >> downsampling to >> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >> >> longer time >> >> window of interest? >> >> Note that you also 'lose' data to embedding and the interaction >> >> delay: The >> >> first point that can be used for TE estimation is at max. embedding >> >> length >> >> + max. interaction delay in samples. For example: max. embedding >> >> length = >> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >> >> interaction >> >> delay of 30 ms = 9 samples. In this example, you would be left with >> >> 240 - >> >> 29 samples for TE estimation per trial. There is also the >> >> possibility to >> >> estimate time resolved TE/TE for shorter time windows of interest >> >> (see >> >> section 4.4 in the manual); however, this method requires the use >> >> of a GPU >> >> for TE estimation. >> >> >> >> I would further recommend to use the new pipeline for group >> >> statistics >> >> described in the manual in section 4.5 (the function >> >> 'TEgroup_calculate' is >> >> deprecated). The new pipeline allows you to reconstruct the >> >> interaction >> >> delay and uses the following functions (see also comments in the >> >> script): >> >> >> >> TEgroup_prepare -> prepares all data sets (all subjects/all >> >> conditions) >> >> for group analysis (this means finding common embedding parameters >> >> such >> >> that estimates are not biased between groups) >> >> InteractionDelayReconstruction_calculate -> estimates TE for >> >> individual data sets and all assumed interaction delays u >> >> InteractionDelayReconstruction_analyze -> reconstructs the >> >> interaction delay by selecting the u that maximizes TE for each >> >> channel >> >> TEgroup_stats -> calculate group statistics using a permutation >> >> test >> >> >> >> I can send you an example script for group TE analysis using this >> >> pipeline >> >> to get you started. I hope this helps you to get the group analysis >> >> running. Just write again if you're having trouble setting up the >> >> pipeline >> >> or something is not clear about the parameters/my comments. >> >> >> >> Best, >> >> Patricia >> >> >> >> >> >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not 100% >> >> sure if it is appropriate to ask questions about it here, but to >> >> the best >> >> of my knowledge they do not have a mailing list and I saw a few >> >> trentool >> >> questions in the archives, so I'm going to assume it's ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present in >> >> the pipeline. Sorry in advance for the long post! Any help would be >> >> greatly >> >> appreciated as I'm a bit over my head on this but I think I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data that >> >> was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi >> >> is in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within >> >> the toi, but beyond that are there any benefits to it being earlier >> >> or >> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >> >> in >> >> seconds. The prediction time is the assumed interaction delay >> >> between your >> >> two sources and should fit within your toi. In general it is >> >> preferable to >> >> use the method for interaction delay reconstruction for TE >> >> estimation, >> >> because it allows you to reconstruct the actual delay between your >> >> source >> >> and target times series. A non-optimal u/interaction delay may >> >> cause an >> >> underestimation of TE, so it is recommended to use the pipeline for >> >> interaction delay reconstruction whenever estimating TE for unknown >> >> delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, >> >> so it is best to limit the u range to values that are >> >> physiologically >> >> plausible. >> >> >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the sample >> >> rate and filters are used to determine the actthrvalue, but I don't >> >> actually know the calculation. 7.5 was a rough guess just to test >> >> the >> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >> >> You can >> >> set the actthrvalue based on the filtering you did prior to TE >> >> analysis. If >> >> you for example highpass filtered at 10 Hz, you shouldn't find an >> >> ACT >> >> higher than 30 samples, because you filtered out any components of >> >> the >> >> signal slower than 10 Hz/30 samples (given your sampling frequency >> >> of 300 >> >> Hz). So in this scenario the actthrvalue would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm yet >> >> to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* PW: >> >> The Ragwitz criterion tries to find optimal embedding parameters >> >> dim and >> >> tau for the data. To do that, the method iteratively takes all >> >> possible >> >> combinations of dim and tau values that are provided in cfgP.ragdim >> >> and >> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >> >> embed >> >> the data. To test an embedding, the method builds the embedding >> >> vectors >> >> from the data; it then tests for each point how well the next point >> >> in time >> >> can be predicted from the reference point's nearest neighbours. So >> >> for each >> >> embedded point, the method searches for the nearest neighbours and >> >> calculates the average of those nearest neighbours. The difference >> >> between >> >> the averaged/predicted point and the actual next point is the error >> >> of the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested by >> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together >> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >> >> will >> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >> >> here are >> >> factors that are later multiplied with the ACT to obtain the actual >> >> tau. >> >> 'repPred' is the number of points that will be used for the local >> >> prediction, i.e. the Ragwitz criterion will test the local >> >> prediction and >> >> calculate the error for the first 100 points in your time series. >> >> The two >> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >> >> neighbour >> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >> >> method to >> >> either conduct a kNN or range search; 'sizeNei' specifies the >> >> number of >> >> neighbours or the radius to be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' >> >> data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject >> >> virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.* >> >> TRENTOOL seems to handle data output very differently from >> >> fieldtrip and >> >> I've had trouble thinking through the most logical way to handle >> >> the data >> >> so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> >> >> *For clarification, fileCell is a cell with the name of each >> >> condition x >> >> subject .mat file, which as I said before is collectively the same >> >> as the 3 >> >> x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> *At this step I get the following error: Error using >> >> transferentropy (line >> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in >> >> TEgroup_calculate (line 133) [TEresult] = >> >> transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate is a >> >> pipeline issue* (I noticed the example pipeline in trentool, the >> >> manual, >> >> and published methods articles all seem to have slightly or >> >> significantly >> >> different pipeline compositions), *or if the error is* due to ACT, >> >> ragwitz optimization, or some other faulty parameterization *on my >> >> part >> >> due to a lack of understanding of how transfer entropy works on a >> >> more >> >> theoretical/mathematical level*. If the latter is the case, is >> >> there any >> >> relatively straightforward way to conceptualize this, or is this >> >> something >> >> where I'm just going to have to keep reading and rereading until it >> >> eventually makes sense? I've already done quite a bit of that and >> >> it hasn't >> >> pierced my thick skull yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing >> >> >> listfieldtrip at donders.ru.nlhttp://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 >> >> >> > >> > >> > >> > -- >> > Max Cantor >> > Lab Manager >> > Computational Neurolinguistics Lab >> > University of Michigan >> > -------------- 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 46, Issue 3 >> > **************************************** >> > >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jim Herring, MSc. > Neuronal Oscillations Group > Centre for Cognitive Neuroimaging > Donders Institute for Brain, Cognition and Behaviour > Radboud University Nijmegen > > > ------------------------------ > > Message: 4 > Date: Mon, 15 Sep 2014 12:09:24 +0200 (CEST) > From: Fr?d?ric Roux > To: FieldTrip discussion list > Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs > Message-ID: <867006743.3066178.1410775764568.JavaMail.root at bcbl.eu> > Content-Type: text/plain; charset=utf-8 > > Dear all, > > my question relates to the computation of combined planar gradients > using the ft_combineplanar function. > > Our data has been recorded with an Elekta Neuromag 306 channel system, > and I would like to know if it is "safe" to compute combined gradients > before calling ft_freqstatistics, if the input data contains single > trial TFRs. > > The reason why I am asking is because in the documentation of the > function it says > % Use as > % [data] = ft_combineplanar(cfg, data) > % where data contains an averaged planar gradient (either ERF or TFR). > > However, the following tutorial suggests that this can be safely applied if > the input data contains TFRs which have been computed with the > cfg.keeptrials = 'yes' option: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > > I am bit confused as both information (the fieldtrip documentation > and the tutorial) > seem to contradict each other. > > The 2 options that are see are: > > 1) compute TFRs with cfg.keeptrials = 'yes', then call > ft_frestatistics, then call ft_combineplanar > by using the output of ft_freqstatistics as input for the > ft_combineplanar function. > 2) compute TFRs with cfg.keeptrials = 'yes', then call > ft_combineplanar, then call ft_freqstatistics > > Could anyone with experience on this issue please let me know what > the best way > to proceed would be? > > Fred > --------------------------------------------------------------------------- > > > > > ------------------------------ > > Message: 5 > Date: Mon, 15 Sep 2014 13:12:38 -0300 > From: gamaliel huerta urrea > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] dipole simulation on head model > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > hi all > > I hope you can help my problem. > > I have generated a model of head fieldtrip, and now I need to simulate > sources at different positions within the crust generated. I followed the > tutorial head model generation for EEG. However I have not found > information on how to simulate a source. Any help would be welcome. > > Thank you > greetings > > -- > *Gamaliel Huerta* > *Ingenier?a Civil Biom?dica* > *Universidad de Valpara?so* > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 6 > Date: Mon, 15 Sep 2014 18:38:26 +0200 > From: Tzvetan Popov > To: FieldTrip discussion list > Subject: Re: [FieldTrip] dipole simulation on head model > Message-ID: <6677301D-D72C-4C12-BC84-779D5E4DF8F3 at uni-konstanz.de> > Content-Type: text/plain; charset="iso-8859-1" > > > Dear Gamaliel, > you might try something like this: > > http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit > > good luck > tzvetan > > Am 15.09.2014 um 18:12 schrieb gamaliel huerta urrea > : > >> hi all >> >> I hope you can help my problem. >> >> I have generated a model of head fieldtrip, and now I need to >> simulate sources at different positions within the crust generated. >> I followed the tutorial head model generation for EEG. However I >> have not found information on how to simulate a source. Any help >> would be welcome. >> >> Thank you >> greetings >> >> -- >> Gamaliel Huerta >> Ingenier?a Civil Biom?dica >> Universidad de Valpara?so >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 7 > Date: Mon, 15 Sep 2014 12:40:41 -0500 > From: "Jing Fan" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of > variable 'abort' > Message-ID: <000001cfd10c$2b7786a0$826693e0$@gmail.com> > Content-Type: text/plain; charset="us-ascii" > > Hi Jim, > > I download the latest .zip file from FTP. > I received the same error message when calling function ft_definetrial(cfg). > It seems to me that ft_preamble init command will go to script ft_preamble.m > instead of ft_preamble_init.m. > Any help to resolve this issue will be appreciated. > > Best, > Jing > > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) > Sent: Monday, September 15, 2014 5:01 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable > 'abort' > > Dear Barbara, > > The error seems to be related to a bug that pops up now and then > (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a > corrupt installation of fieldtrip and/or the need to update fieldtrip. > > Could you please try downloading the most recent version of fieldtrip and > see if the problem persists? > > For an example of what can be expected from this function see: Esser SK, > Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct > demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res > Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. > > Best, > > Jim > > > ----- Oorspronkelijk bericht ----- >> Van: "barbara schorr" >> Aan: fieldtrip at science.ru.nl >> Verzonden: Woensdag 10 september 2014 14:07:14 >> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable > 'abort' >> Dear fieldtripers. >> >> as mentioned in the subject line I would like to anaylse my timelocked >> ERP Data with the function ft_globalmeanfield. >> >> I get the Error: Undefined function or variable 'abort' >> Error in ft_globalmeanfield (line84) >> if abort >> >> in the function it says: >> >> %the abort variable is set to true or false in ft_preamble_inti >> if abort >> % do not continue function execution in case the outputfile is >> present and the user indicated to keep it >> return >> end >> >> >> I don't understand what this means. I would really appreciate your >> help to get this running. >> >> Also, what is the result when I run this function on my data? (This >> method was proposed from a reviewer. I never used it before, so I >> don't exactly know what it does and what the result will look like). >> >> Thank you very much in advance! >> >> Best, >> >> Barbara Schorr >> >> >> >> >> Zitat von 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: Question regarding nonparametric testing for coherence >> > differences (Eric Maris) >> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >> > 4. Re: ft_rejectvisual: removing trials marked as bad >> > (Caspar, Emilie) >> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >> > 6. Latest FT version on ftp-server is from three days ago >> > (Holger Krause) >> > 7. Re: TRENTOOL pipeline help (Max Cantor) >> > >> > >> > ---------------------------------------------------------------------- >> > >> > Message: 1 >> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >> > From: "Eric Maris" >> > To: , "'FieldTrip discussion list'" >> > >> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >> > for >> > coherence differences >> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Hwee Ling, >> > >> > >> > >> > In the paper you refer to (Maris et al, JNM, 2007), I did not >> > perform a >> > cluster-based permutation test at the level of the channel pairs. >> > Instead, >> > all coherences mentioned in the paper are coherence between a single >> > EMG >> > channel (2 electrodes mounted on the forearm) and all MEG >> > electrodes. Thus, >> > there are as many EMG-MEG coherences as there are MEG channels (275 >> > in our >> > lab), and the clustering of these coherences involves the same >> > neighbourhood >> > structure as the clustering of channel-specific statistics on power >> > or >> > evoked response. The analysis you propose involves clustering in a >> > much more >> > complex space, namely the formed by all (MEG,MEG) channel pairs >> > (275*275=75625 pairs). In the early days of cluster-based >> > permutation >> > statistics, I have worked on this problem but did not pursue it >> > because the >> > resulting clusters are very hard to interpret. >> > >> > >> > >> > Best, >> > >> > >> > >> > Eric Maris >> > >> > >> > >> > >> > >> > Dear all and Prof Maris, >> > >> > I'm re-posting this question again, as I didn't get any replies >> > previously. >> > >> > I?m interested to investigate if there are any differences in phase >> > synchronization in resting state data at timepoint 2 versus >> > timepoint 1. The >> > EEG data was collected using 64 EEG channels, resting state, eyes >> > opened and >> > eyes closed. I?ve arbitrarily segmented the resting state data into >> > epochs >> > of 2s each, and the epochs with artifacts are excluded completely >> > from >> > further analyses. I then performed mtmfft to get the fourier >> > representation >> > of the data, extracted the coherence, and compared the coherence >> > difference >> > of timepoint 2 versus timepoint 1 of all channels paired with all >> > other >> > channels. >> > >> > I figured that if I extract the connectivity analyses without >> > specifying the >> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >> > allow me to >> > perform cluster-based statistical analyses. I get an output with >> > ?chan_chan? >> > dimord variable. However, I was not 100% sure that this is correct, >> > hence, I?ve >> > inserted my code (see below). It?ll be great if you could tell me if >> > what I?m >> > doing makes any sense at all. Also, I don?t know how I can plot the >> > results >> > to see if it make any sense at all. >> > >> > Also, I checked the values obtained from when I specified >> > "cfg.channelcmb" >> > and when I did not specify "cfg.channelcmb", I noticed that the >> > values were >> > somehow different. I would assume that the values to be similar, >> > although >> > I'm not sure why they would have differences in the values obtained >> > from >> > specifying "cfg.channelcmb". >> > >> > This is my code that I've used thus far: >> > >> > for sub = 1:5 >> > >> > cfg = []; >> > >> > cfg.output = 'fourier'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.keeptrials = 'yes'; >> > >> > cfg.tapsmofrq = 5; >> > >> > cfg.foilim = [0 100]; >> > >> > cfg.taper = 'dpss'; >> > >> > % find the index for the c200 condition >> > >> > pre_c200_idx = find(data5.trialinfo == 201); >> > >> > cfg.trials = pre_c200_idx; >> > >> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >> > >> > post_c200_idx = find(data5.trialinfo == 200); >> > >> > cfg.trials = post_c200_idx; >> > >> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >> > >> > >> > >> > cfg = []; >> > >> > cfg.keeptrials = 'no'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.removemean = 'yes'; >> > >> > cfg.method = 'coh'; >> > >> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_pre_c200); >> > >> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_post_c200); >> > >> > end >> > >> > >> > >> > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat > '); >> > >> > cfg_neighb.method = 'template'; >> > >> > cfg_neighb.layout = lay; >> > >> > cfg_neighb.channel = 'all'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, >> > sub_HLF_pre_c200coh{1}); >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.neighbours = neighbours; >> > >> > cfg.channel = 'all'; >> > >> > cfg.channelcmb = {cfg.channel, cfg.channel}; >> > >> > cfg.latency = 'all'; >> > >> > cfg.avgovertime = 'no'; >> > >> > cfg.avgoverchan = 'no'; >> > >> > cfg.parameter = 'cohspctrm'; >> > >> > cfg.method = 'montecarlo'; >> > >> > cfg.statistic = 'depsamplesT'; >> > >> > cfg.correctm = 'cluster'; >> > >> > cfg.tail = 0; >> > >> > % cfg.clustertail = 0; >> > >> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >> > frequency >> > bands. >> > >> > cfg.numrandomization = 10000; >> > >> > cfg.ivar = 2; >> > >> > cfg.uvar = 1; >> > >> > >> > >> > % design matrices >> > >> > clear design; >> > >> > design(1,:) = [1:5, 1:5]; >> > >> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >> > >> > cfg.design = design; >> > >> > % for theta band >> > >> > cfg.avgoverfreq = 'yes'; >> > >> > cfg.frequency = [4 8]; % I also performed the statistics for delta >> > (2-4), >> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >> > (30-40), >> > and gamma (40-100). >> > >> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >> > sub_HLF_post_c200coh{:}, >> > sub_HLF_pre_c200coh{:}); >> > >> > >> > >> > When I tried to plot the results, I used this code: >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.layout = 'lay'; >> > >> > cfg.zlim = [-1 1]; >> > >> > cfg.alpha = 0.05; >> > >> > cfg.refchannel = 'all'; >> > >> > ft_clusterplot(cfg, diffc200_theta_stat); >> > >> > However, I was not sure how I could plot the results. I get an error >> > message >> > from Fieldtrip when using ft_clusterplot: >> > >> > Error using topoplot_common (line 366) >> > >> > no reference channel is specified >> > >> > Error in ft_topoplotTFR (line 192) >> > >> > [cfg] = topoplot_common(cfg, varargin{:}); >> > >> > Error in ft_clusterplot (line 372) >> > >> > ft_topoplotTFR(cfgtopo, stat); >> > >> > >> > >> > According to your paper in 2007, the topoplot of the results were >> > masked by >> > the spatio-spectral pattern of the significant clusters. I don't >> > know how to >> > do this, and I would really appreciate if you can show me how to >> > make such a >> > plot. >> > >> > Thank you very much. >> > >> > Kind regards, >> > >> > Hweeling >> > >> > >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 280/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 2 >> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >> > From: KatrinH Heimann >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Joseph, thanks so much, I really appreciate your help. I was >> > also >> > wandering, if maybe there is another bug in my code. >> > Our nets are 128 channels, Hydrocel, but as a colleague of me >> > adviced me to >> > do so, I also tried the 129 layout. >> > My code you find below (without selection of bad channels etc.) >> > If you need also the data of two subjects to have a look, let me >> > know!!! >> > Best and thanks really! >> > Katrin >> > >> > >> > subject=input('Which subject do you want to analyse? ','s'); >> > >> > name = strcat(subject,'.raw'); >> > >> > subjectnumber=input('Which is the subjectnumber?', 's'); >> > >> > sb=subjectnumber >> > >> > %subjectnumber = strcat(subjectnumber, '.txt') >> > >> > %% >> > >> > >> > cfg = []; >> > >> > cfg.dataset = name; >> > >> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >> > >> > cfg.trialdef.eventtype = 'trigger'; >> > >> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> > trigger >> > >> > cfg.trialdef.prestim = 0.234; % in seconds >> > >> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> > observation, but maybe we need less) >> > >> > cfg = ft_definetrial(cfg); >> > >> > >> > cfg.trl([1:7],:) = []; >> > >> > >> > %change timeline according to constant offset of 16 ms = 8 samples >> > (because >> > recorded with 500 hz)in >> > >> > %structure trial >> > >> > cfg.trl(:,3)=cfg.trl(:,3)-8 >> > >> > >> > %change timeline to make the cut the zeropoint >> > >> > >> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> > >> > >> > >> > %% preprocess data >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.detrend = 'yes'; >> > >> > cfg.preproc.demean = 'yes'; >> > >> > cfg.preproc.baselinewindow = [-2.1 -2.0] >> > >> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> > filtered >> > >> > %(0.1-45) and bad channels have to be replaced!!!! >> > >> > %cfg.preproc.bpfreq = [6 32]; >> > >> > % >> > >> > % >> > >> > obs_data = ft_preprocessing(cfg); >> > >> > % >> > >> > save (strcat(sb,'obs_data') , 'obs_data') >> > >> > >> > %% determining channel neighbours (necessary for Artifact detection) >> > >> > cfg = []; >> > >> > cfg.channel = obs_data.label; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.feedback = 'yes'; >> > >> > lay = ft_prepare_layout(cfg); >> > >> > >> > >> > cfg_neighb = []; >> > >> > cfg_neighb.feedback = 'yes'; >> > >> > >> > cfg_neighb.method = 'triangulation'; >> > >> > cfg_neighb.layout = 'GSN128.sfp'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > obs_data.elec = ft_read_sens('GSN128.sfp'); >> > >> > >> > %% Artifacts - to detect bad channels - is not saved!!! >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs_data_try = ft_rejectvisual(cfg, obs_data); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_try = ft_rejectartifact (cfg,obs_data); >> > >> > >> > >> > %% Preparing neighbours for channel repair - but bad channel info >> > in!!! >> > >> > >> > % cfg_neighb = []; >> > >> > % cfg_neighb.feedback = 'yes'; >> > >> > % cfg_neighb.method = 'triangulation'; >> > >> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> > >> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > % Interpolate and put into new data structure >> > >> > cfg = []; >> > >> > cfg.badchannel = {}; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.method = 'nearest'; >> > >> > cfg.neighbours = neighbours; >> > >> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> > >> > >> > % Check reconstruction >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > % dat1=obs_data; >> > >> > % dat2=obs_data_channelrepaired; >> > >> > % >> > >> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> > >> > % y=dat2.trial{1}(62,:); >> > >> > % plot(x);hold on;plot(y,'r'); >> > >> > % >> > >> > % x=dat1.trial{1}(72,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > % >> > >> > % x=dat1.trial{1}(75,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > %% artifact rejection/trial inspection - throw out electrode jumps >> > etc. >> > >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> > according to >> > channels interpolated %% 128-number of interp. channels) >> > >> > >> > >> > cfg = []; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.numcomponent = 128 >> > >> > comp = ft_componentanalysis(cfg,obs_data_clean1); >> > >> > save (strcat(sb,'comp_all') , 'comp') >> > >> > >> > %% >> > >> > cfg = []; >> > >> > cfg.viewmode = 'component'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='some'; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > ft_databrowser(cfg,comp); >> > >> > >> > %% poweranalysis components >> > >> > cfg = []; >> > >> > cfg.output = 'pow'; >> > >> > cfg.channel = 'all';%compute the power spectrum in all ICs >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.taper = 'hanning'; >> > >> > cfg.foi = 0:0.2:50; >> > >> > obs_freq = ft_freqanalysis(cfg, comp); >> > >> > >> > %And you can plot the spectra: >> > >> > >> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> > >> > nsubplots = 16; >> > >> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> > decimals, type >> > doc subplot >> > >> > >> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >> > >> > tot = Nfigs*nsubplots; >> > >> > >> > rptvect = 1:size(comp.topo,1); >> > >> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> > >> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> > >> > >> > for r=1:size(rptvect,1); >> > >> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> > 1]);%full >> > screen >> > >> > k=0; >> > >> > for j=1:size(rptvect,2); >> > >> > if~(rptvect(r,j)==0); >> > >> > k=k+1; >> > >> > cfg=[]; >> > >> > cfg.channel = rptvect(r,j); >> > >> > cfg.ylim =[0 500] >> > >> > cfg.xlim =[0 50] >> > >> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> > >> > end >> > >> > end >> > >> > end >> > >> > >> > %For the IC topos you'll follow the same logic as above but with: >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [1:20]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [21:40]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [41:60]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [61:80]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > >> > >> > >> > >> > %% Seperate observation conditions >> > >> > >> > name1= strcat(num2str(sb),'_90.xls'); >> > >> > list1=xlsread (name1) >> > >> > >> > >> > >> > >> > name2= strcat(num2str(sb),'_180.xls'); >> > >> > list2=xlsread (name2) >> > >> > >> > >> > % >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list1] >> > >> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list2] >> > >> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > %%PIPELINE FOR obs90 >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128; >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > >> > comp_1 = ft_componentanalysis(cfg, obs90_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> > obs90_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts - final detection >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs90_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> > >> > >> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> > >> > >> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> > >> > >> > %% plot it >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP) >> > >> > >> > >> > >> > >> > >> > >> > %% PIPELINE FOR obs180 >> > >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128 >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > comp_2 = ft_componentanalysis(cfg, obs180_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> > obs180_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts final 180 >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs180_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> > >> > >> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> > >> > >> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> > >> > >> > %% plot 180 ERP >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs180_data_ERP) >> > >> > >> > %% plot both ERPs >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > cfg.showlabels = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> > >> > >> > %% plot difference wave >> > >> > >> > difference = obs180_data_ERP; % copy one of the >> > structures >> > >> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >> > the >> > difference ERP >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, difference) >> > >> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> > >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI >> >> data. A couple things. First of all, exactly which net do you use? >> >> If >> >> they are 129-channel, there is still the question of whether they >> >> are the >> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >> >> cause an >> >> error like this. Could you send me the file you are trying to >> >> process and >> >> the script you are using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >> >> diezmartini at gmail.com> wrote: >> >> >> >> Which nets do you use? I use EGI. I tried both the ones you mention >> >> and >> >> they didn't work. It was hard to find that exact one online but it >> >> was the >> >> only file that actually worked. >> >> >> >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >> >> >> wrote: >> >> >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. >> >>> Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one >> >>> >> >>>> I use >> >>>> >> >>>> >> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >> >>>> katrinheimann at gmail.com> wrote: >> >>>> >> >>>>> Dear all, my problems seem neverending. This time however i >> >>>>> really need >> >>>>> help. >> >>>>> I implemented a pipeline for ERPs. All works now, >> >>>>> trialdefinition, >> >>>>> preprocessing, channelreplacement, ica, componentrejection, >> >>>>> final >> >>>>> artifactdetection, timelock of the single subject data. However, >> >>>>> when I >> >>>>> wanna compute the grandaverage of the single subjects I get the >> >>>>> following >> >>>>> error message: >> >>>>> >> >>>>> computing average of avg over 19 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 3 MB >> >>>>> computing average of avg over 2 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >> >>>>> additional >> >>>>> allocation of an estimated 0 MB >> >>>>> >> >>>>> Furthermore in the plot of the significant clusters, the >> >>>>> channelnames >> >>>>> are mixed up (do not correspond to my net) >> >>>>> >> >>>>> >> >>>>> I guess that there is a problem with the layout I use. >> >>>>> Here the code that I use >> >>>>> >> >>>>> %For generating the layout (also in the single subjects): >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = obs_data.label; >> >>>>> >> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>>> >> >>>>> cfg.feedback = 'yes'; >> >>>>> >> >>>>> lay = ft_prepare_layout(cfg); >> >>>>> >> >>>>> >> >>>>> cfg_neighb = []; >> >>>>> >> >>>>> cfg_neighb.feedback = 'yes'; >> >>>>> >> >>>>> cfg_neighb.method = 'triangulation'; >> >>>>> >> >>>>> cfg_neighb.layout = lay; >> >>>>> >> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>>> >> >>>>> >> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>>>> >> >>>>> >> >>>>> %For computing the grand average >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = 'all'; >> >>>>> >> >>>>> cfg.latency = 'all'; >> >>>>> >> >>>>> cfg.parameter = 'avg'; >> >>>>> >> >>>>> cfg.keepindividual = 'no' >> >>>>> >> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>>>> >> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>>>> >> >>>>> % "{:}" means to use data from all elements of the variable >> >>>>> >> >>>>> >> >>>>> For plotting the significant clusters >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.style = 'blank'; >> >>>>> >> >>>>> cfg.layout = lay; >> >>>>> >> >>>>> cfg.channellabels = 'yes'; >> >>>>> >> >>>>> cfg.highlight = 'labels'; >> >>>>> >> >>>>> cfg.highlightchannel = find(stat.mask); >> >>>>> >> >>>>> cfg.comment = 'no'; >> >>>>> >> >>>>> figure; ft_topoplotER(cfg, GA_90) >> >>>>> >> >>>>> title('Nonparametric: significant with cluster multiple >> >>>>> comparison >> >>>>> correction') >> >>>>> >> >>>>> >> >>>>> Do you have ANY idea to this? I am really completely >> >>>>> helpless.... >> >>>>> >> >>>>> thanks and best >> >>>>> >> >>>>> Katrin >> >>>>> >> >>>>> _______________________________________________ >> >>>>> 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 >> >>> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> >> >> > ---------------------------------------------------------------------------- > ---- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.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: >> > > b61/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 3 >> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >> > From: Joseph Dien >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > yes, please do send me the data. >> > >> > Thanks! >> > >> > Joe >> > >> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >> > wrote: >> > >> >> Dear Joseph, thanks so much, I really appreciate your help. I was >> >> also wandering, if maybe there is another bug in my code. >> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >> >> adviced me to do so, I also tried the 129 layout. >> >> My code you find below (without selection of bad channels etc.) >> >> If you need also the data of two subjects to have a look, let me >> >> know!!! >> >> Best and thanks really! >> >> Katrin >> >> >> >> >> >> >> >> subject=input('Which subject do you want to analyse? ','s'); >> >> >> >> name = strcat(subject,'.raw'); >> >> >> >> subjectnumber=input('Which is the subjectnumber?', 's'); >> >> >> >> sb=subjectnumber >> >> >> >> %subjectnumber = strcat(subjectnumber, '.txt') >> >> >> >> %% >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.dataset = name; >> >> >> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> >> >> >> cfg.trialdef.eventtype = 'trigger'; >> >> >> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> >> trigger >> >> >> >> cfg.trialdef.prestim = 0.234; % in seconds >> >> >> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> >> observation, but maybe we need less) >> >> >> >> cfg = ft_definetrial(cfg); >> >> >> >> >> >> >> >> cfg.trl([1:7],:) = []; >> >> >> >> >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> >> (because recorded with 500 hz)in >> >> >> >> %structure trial >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >> >> >> >> >> >> >> >> %change timeline to make the cut the zeropoint >> >> >> >> >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> >> >> >> >> >> >> >> >> >> >> >> %% preprocess data >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.detrend = 'yes'; >> >> >> >> cfg.preproc.demean = 'yes'; >> >> >> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >> >> >> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> >> filtered >> >> >> >> %(0.1-45) and bad channels have to be replaced!!!! >> >> >> >> %cfg.preproc.bpfreq = [6 32]; >> >> >> >> % >> >> >> >> % >> >> >> >> obs_data = ft_preprocessing(cfg); >> >> >> >> % >> >> >> >> save (strcat(sb,'obs_data') , 'obs_data') >> >> >> >> >> >> >> >> %% determining channel neighbours (necessary for Artifact >> >> detection) >> >> >> >> cfg = []; >> >> >> >> cfg.channel = obs_data.label; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.feedback = 'yes'; >> >> >> >> lay = ft_prepare_layout(cfg); >> >> >> >> >> >> cfg_neighb = []; >> >> >> >> cfg_neighb.feedback = 'yes'; >> >> >> >> >> >> >> >> cfg_neighb.method = 'triangulation'; >> >> >> >> cfg_neighb.layout = 'GSN128.sfp'; >> >> >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >> >> >> >> >> >> >> >> %% Artifacts - to detect bad channels - is not saved!!! >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Preparing neighbours for channel repair - but bad channel info >> >> in!!! >> >> >> >> >> >> >> >> % cfg_neighb = []; >> >> >> >> % cfg_neighb.feedback = 'yes'; >> >> >> >> % cfg_neighb.method = 'triangulation'; >> >> >> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> >> >> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> % Interpolate and put into new data structure >> >> >> >> cfg = []; >> >> >> >> cfg.badchannel = {}; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.method = 'nearest'; >> >> >> >> cfg.neighbours = neighbours; >> >> >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> >> >> >> >> >> % Check reconstruction >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> % dat1=obs_data; >> >> >> >> % dat2=obs_data_channelrepaired; >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> >> >> >> % y=dat2.trial{1}(62,:); >> >> >> >> % plot(x);hold on;plot(y,'r'); >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(72,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(75,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> %% artifact rejection/trial inspection - throw out electrode jumps >> >> etc. >> >> >> >> >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> >> according to channels interpolated %% 128-number of interp. >> >> channels) >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.channel = {'all'}; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >> >> >> >> save (strcat(sb,'comp_all') , 'comp') >> >> >> >> >> >> >> >> %% >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'component'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='some'; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> ft_databrowser(cfg,comp); >> >> >> >> >> >> >> >> %% poweranalysis components >> >> >> >> cfg = []; >> >> >> >> cfg.output = 'pow'; >> >> >> >> cfg.channel = 'all';%compute the power spectrum in all ICs >> >> >> >> cfg.method = 'mtmfft'; >> >> >> >> cfg.taper = 'hanning'; >> >> >> >> cfg.foi = 0:0.2:50; >> >> >> >> obs_freq = ft_freqanalysis(cfg, comp); >> >> >> >> >> >> >> >> %And you can plot the spectra: >> >> >> >> >> >> >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> >> >> nsubplots = 16; >> >> >> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> >> decimals, type doc subplot >> >> >> >> >> >> >> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >> >> >> >> tot = Nfigs*nsubplots; >> >> >> >> >> >> >> >> rptvect = 1:size(comp.topo,1); >> >> >> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> >> >> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> >> >> >> >> >> >> >> for r=1:size(rptvect,1); >> >> >> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> >> 1]);%full screen >> >> >> >> k=0; >> >> >> >> for j=1:size(rptvect,2); >> >> >> >> if~(rptvect(r,j)==0); >> >> >> >> k=k+1; >> >> >> >> cfg=[]; >> >> >> >> cfg.channel = rptvect(r,j); >> >> >> >> cfg.ylim =[0 500] >> >> >> >> cfg.xlim =[0 50] >> >> >> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> >> >> >> end >> >> >> >> end >> >> >> >> end >> >> >> >> >> >> >> >> %For the IC topos you'll follow the same logic as above but with: >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [1:20]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [21:40]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [41:60]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [61:80]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Seperate observation conditions >> >> >> >> >> >> >> >> name1= strcat(num2str(sb),'_90.xls'); >> >> >> >> list1=xlsread (name1) >> >> >> >> >> >> >> >> name2= strcat(num2str(sb),'_180.xls'); >> >> >> >> list2=xlsread (name2) >> >> >> >> >> >> % >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list1] >> >> >> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list2] >> >> >> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> %%PIPELINE FOR obs90 >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128; >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> >> >> >> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> >> obs90_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts - final detection >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> >> >> >> >> >> >> >> %% plot it >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% PIPELINE FOR obs180 >> >> >> >> >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> >> obs180_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts final 180 >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> >> >> >> >> >> >> >> %% plot 180 ERP >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot both ERPs >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> cfg.showlabels = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot difference wave >> >> >> >> >> >> >> >> difference = obs180_data_ERP; % copy one of >> >> the structures >> >> >> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >> >> compute the difference ERP >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, difference) >> >> >> >> >> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI data. A couple things. First of all, exactly which net do >> >> you use? If they are 129-channel, there is still the question of >> >> whether they are the Hydrocel or the older geodesic nets. >> >> Regardless, that shouldn't cause an error like this. Could you >> >> send me the file you are trying to process and the script you are >> >> using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >> >> wrote: >> >> >> >>> Which nets do you use? I use EGI. I tried both the ones you >> >>> mention and they didn't work. It was hard to find that exact one >> >>> online but it was the only file that actually worked. >> >>> >> >>> >> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one I use >> >>> >> >>> >> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear all, my problems seem neverending. This time however i really >> >>> need help. >> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >> >>> preprocessing, channelreplacement, ica, componentrejection, final >> >>> artifactdetection, timelock of the single subject data. However, >> >>> when I wanna compute the grandaverage of the single subjects I get >> >>> the following error message: >> >>> >> >>> computing average of avg over 19 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 3 MB >> >>> computing average of avg over 2 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 0 MB >> >>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> the call to "ft_topoplotER" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> >> >>> Furthermore in the plot of the significant clusters, the >> >>> channelnames are mixed up (do not correspond to my net) >> >>> >> >>> >> >>> I guess that there is a problem with the layout I use. >> >>> Here the code that I use >> >>> >> >>> %For generating the layout (also in the single subjects): >> >>> cfg = []; >> >>> >> >>> cfg.channel = obs_data.label; >> >>> >> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>> >> >>> cfg.feedback = 'yes'; >> >>> >> >>> lay = ft_prepare_layout(cfg); >> >>> >> >>> >> >>> cfg_neighb = []; >> >>> >> >>> cfg_neighb.feedback = 'yes'; >> >>> >> >>> cfg_neighb.method = 'triangulation'; >> >>> >> >>> cfg_neighb.layout = lay; >> >>> >> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>> >> >>> >> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>> >> >>> >> >>> >> >>> %For computing the grand average >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.channel = 'all'; >> >>> >> >>> cfg.latency = 'all'; >> >>> >> >>> cfg.parameter = 'avg'; >> >>> >> >>> cfg.keepindividual = 'no' >> >>> >> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>> >> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>> >> >>> % "{:}" means to use data from all elements of the variable >> >>> >> >>> >> >>> For plotting the significant clusters >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.style = 'blank'; >> >>> >> >>> cfg.layout = lay; >> >>> >> >>> cfg.channellabels = 'yes'; >> >>> >> >>> cfg.highlight = 'labels'; >> >>> >> >>> cfg.highlightchannel = find(stat.mask); >> >>> >> >>> cfg.comment = 'no'; >> >>> >> >>> figure; ft_topoplotER(cfg, GA_90) >> >>> >> >>> title('Nonparametric: significant with cluster multiple comparison >> >>> correction') >> >>> >> >>> >> >>> >> >>> Do you have ANY idea to this? I am really completely helpless.... >> >>> >> >>> thanks and best >> >>> >> >>> Katrin >> >>> >> >>> >> >>> _______________________________________________ >> >>> 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 >> >>> >> >>> _______________________________________________ >> >>> fieldtrip mailing list >> >>> fieldtrip at donders.ru.nl >> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> > ---------------------------------------------------------------------------- > ---- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.com >> >> >> >> >> >> _______________________________________________ >> >> 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 >> > >> > > ---------------------------------------------------------------------------- > ---- >> > >> > Joseph Dien, PhD >> > Research Associate >> > Cognitive Neurology >> > The Johns Hopkins University School of Medicine >> > >> > Lab E-mail: jdien1 at jhmi.edu >> > Private E-mail: jdien07 at mac.com >> > Office Phone: 410-614-3115 >> > Cell Phone: 202-297-8117 >> > Fax: 410-955-0188 >> > http://joedien.com >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > ad2/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 4 >> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >> > From: "Caspar, Emilie" >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >> > bad >> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >> > Content-Type: text/plain; charset="iso-8859-1" >> > >> > Hi Ashley, >> > >> > Maybe the mistake is you did not integrate in your script the >> > command to save the rejection. Normally, with the following command, >> > you will see in the Matlab Window that artifacts are correctly >> > rejected after the "quit" button. >> > >> > clean_data = ft_rejectvisual(cfg, interpoldata); >> > cfg.artfctdef.reject = 'complete'; >> > cfg.artfctdef.feedback = 'yes'; >> > cleandata = ft_rejectartifact(cfg,clean_data); >> > >> > Emilie >> > >> > >> > >> > >> > >> > Le 3 sept. 2014 ? 11:58, Ashley Greene >> > > a ?crit : >> > >> > Hello, >> > >> > I have used the rejectvisual function in attempt to remove bad >> > trials, but after marking them and pressing the quit button, >> > although the command window states that the selected trials have >> > been removed, there is no obvious change in the data; all of the >> > trials are still intact. Have I overlooked something? >> > >> > Thanks, >> > >> > Ashley >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 985/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 5 >> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >> > From: Patricia Wollstadt >> > To: fieldtrip at science.ru.nl >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: <540EEF94.9080601 at gmx.de> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > Hello Max, >> > >> > I added a few comments to the questions regarding individual >> > parameters >> > below. To address the general problem of TRENTOOL telling you, that >> > there are not enough sample points in your data: From what I can see >> > in >> > your script, you probably don't have enough data points in each time >> > series to robustly estimate TE. You analyze 800 ms of data sampled >> > at >> > 300 Hz, which gives you 240 samples per time series. Can you maybe >> > avoid >> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >> > you >> > analyze a longer time window of interest? >> > Note that you also 'lose' data to embedding and the interaction >> > delay: >> > The first point that can be used for TE estimation is at max. >> > embedding >> > length + max. interaction delay in samples. For example: max. >> > embedding >> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >> > max >> > interaction delay of 30 ms = 9 samples. In this example, you would >> > be >> > left with 240 - 29 samples for TE estimation per trial. There is >> > also >> > the possibility to estimate time resolved TE/TE for shorter time >> > windows >> > of interest (see section 4.4 in the manual); however, this method >> > requires the use of a GPU for TE estimation. >> > >> > I would further recommend to use the new pipeline for group >> > statistics >> > described in the manual in section 4.5 (the function >> > 'TEgroup_calculate' >> > is deprecated). The new pipeline allows you to reconstruct the >> > interaction delay and uses the following functions (see also >> > comments in >> > the script): >> > >> > TEgroup_prepare -> prepares all data sets (all subjects/all >> > conditions) for group analysis (this means finding common embedding >> > parameters such that estimates are not biased between groups) >> > InteractionDelayReconstruction_calculate -> estimates TE for >> > individual data sets and all assumed interaction delays u >> > InteractionDelayReconstruction_analyze -> reconstructs the >> > interaction delay by selecting the u that maximizes TE for each >> > channel >> > TEgroup_stats -> calculate group statistics using a permutation test >> > >> > I can send you an example script for group TE analysis using this >> > pipeline to get you started. I hope this helps you to get the group >> > analysis running. Just write again if you're having trouble setting >> > up >> > the pipeline or something is not clear about the parameters/my >> > comments. >> > >> > Best, >> > Patricia >> > >> > >> > >> > >> > On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not >> >> 100% sure if it is appropriate to ask questions about it here, but >> >> to >> >> the best of my knowledge they do not have a mailing list and I saw >> >> a >> >> few trentool questions in the archives, so I'm going to assume it's >> >> ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present >> >> in the pipeline. Sorry in advance for the long post! Any help would >> >> be >> >> greatly appreciated as I'm a bit over my head on this but I think >> >> I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data >> >> that was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi is >> >> in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within the toi, but beyond that are there any benefits to it being >> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >> >> the >> >> toi is in seconds. The prediction time is the assumed interaction >> >> delay between your two sources and should fit within your toi. In >> >> general it is preferable to use the method for interaction delay >> >> reconstruction for TE estimation, because it allows you to >> >> reconstruct >> >> the actual delay between your source and target times series. A >> >> non-optimal u/interaction delay may cause an underestimation of TE, >> >> so >> >> it is recommended to use the pipeline for interaction delay >> >> reconstruction whenever estimating TE for unknown delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, so it is best to limit the u range to values that are >> >> physiologically plausible. >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the >> >> sample rate and filters are used to determine the actthrvalue, but >> >> I >> >> don't actually know the calculation. 7.5 was a rough guess just to >> >> test the pipeline. I'm also uncertain of what minnrtrials should >> >> be.* >> >> PW: You can set the actthrvalue based on the filtering you did >> >> prior >> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >> >> shouldn't find an ACT higher than 30 samples, because you filtered >> >> out >> >> any components of the signal slower than 10 Hz/30 samples (given >> >> your >> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >> >> would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> * >> >> * >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm >> >> yet to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* >> >> PW: The Ragwitz criterion tries to find optimal embedding >> >> parameters >> >> dim and tau for the data. To do that, the method iteratively takes >> >> all >> >> possible combinations of dim and tau values that are provided in >> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >> >> these >> >> combinations embed the data. To test an embedding, the method >> >> builds >> >> the embedding vectors from the data; it then tests for each point >> >> how >> >> well the next point in time can be predicted from the reference >> >> point's nearest neighbours. So for each embedded point, the method >> >> searches for the nearest neighbours and calculates the average of >> >> those nearest neighbours. The difference between the >> >> averaged/predicted point and the actual next point is the error of >> >> the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested >> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together with 'ragtausteps' specifies the tau values to be tested >> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >> >> that >> >> the values here are factors that are later multiplied with the ACT >> >> to >> >> obtain the actual tau. 'repPred' is the number of points that will >> >> be >> >> used for the local prediction, i.e. the Ragwitz criterion will test >> >> the local prediction and calculate the error for the first 100 >> >> points >> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >> >> below >> >> specify the type of neighbour search conducted by the Ragwitz >> >> criterion: 'flagNei' tells the method to either conduct a kNN or >> >> range >> >> search; 'sizeNei' specifies the number of neighbours or the radius >> >> to >> >> be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> * >> >> * >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> * >> >> * >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.*TRENTOOL seems to handle data output very differently >> >> from >> >> fieldtrip and I've had trouble thinking through the most logical >> >> way >> >> to handle the data so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> * >> >> * >> >> *For clarification, fileCell is a cell with the name of each >> >> condition >> >> x subject .mat file, which as I said before is collectively the >> >> same >> >> as the 3 x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> * >> >> * >> >> *At this step I get the following error: >> >> >> >> Error using transferentropy (line 337) >> >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> >> >> Error in TEgroup_calculate (line 133) >> >> [TEresult] = transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate >> >> is a pipeline issue* (I noticed the example pipeline in trentool, >> >> the >> >> manual, and published methods articles all seem to have slightly or >> >> significantly different pipeline compositions), *or if the error >> >> is* >> >> due to ACT, ragwitz optimization, or some other faulty >> >> parameterization *on my part due to a lack of understanding of how >> >> transfer entropy works on a more theoretical/mathematical level*. >> >> If >> >> the latter is the case, is there any relatively straightforward way >> >> to >> >> conceptualize this, or is this something where I'm just going to >> >> have >> >> to keep reading and rereading until it eventually makes sense? I've >> >> already done quite a bit of that and it hasn't pierced my thick >> >> skull >> >> yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> 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: >> > > 97f/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 6 >> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >> > From: Holger Krause >> > To: FieldTrip discussion list >> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >> > days ago >> > Message-ID: >> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >> > Content-Type: text/plain; charset="us-ascii" >> > >> > Dear developers, >> > >> > Could you please check the process for creation/publication of >> > zip-files on >> > the FTP server? The latest file I can find there is >> > fieldtrip-20140906.zip. >> > >> > Thanks in advance, >> > >> > Holger >> > >> > >> > ------------------------------ >> > >> > Message: 7 >> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >> > From: Max Cantor >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > This is immensely helpful, thank you. I was very confused about why >> > some >> > versions of the pipeline I saw were using group calculate and others >> > were >> > using interaction delay reconstruction and what that meant, and I >> > think I >> > have a more clear idea of what the different steps of the pipeline >> > are >> > doing. There are still a few things I'm a bit confused about though >> > in >> > terms of the pipeline. For instance, whether or not I need to do >> > TEprepare >> > before group prepare, and if I need to do graph analysis (which I'm >> > not >> > sure I fully understand but also haven't looked deeply into) before >> > group >> > stats. >> > >> > If you don't mind me taking you up on your offer, I think seeing >> > your >> > example script might help clarify some of these issues. >> > >> > Thank you! >> > >> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >> > Patricia.Wollstadt at gmx.de> wrote: >> > >> >> Hello Max, >> >> >> >> I added a few comments to the questions regarding individual >> >> parameters >> >> below. To address the general problem of TRENTOOL telling you, that >> >> there >> >> are not enough sample points in your data: From what I can see in >> >> your >> >> script, you probably don't have enough data points in each time >> >> series to >> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >> >> which >> >> gives you 240 samples per time series. Can you maybe avoid >> >> downsampling to >> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >> >> longer time >> >> window of interest? >> >> Note that you also 'lose' data to embedding and the interaction >> >> delay: The >> >> first point that can be used for TE estimation is at max. embedding >> >> length >> >> + max. interaction delay in samples. For example: max. embedding >> >> length = >> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >> >> interaction >> >> delay of 30 ms = 9 samples. In this example, you would be left with >> >> 240 - >> >> 29 samples for TE estimation per trial. There is also the >> >> possibility to >> >> estimate time resolved TE/TE for shorter time windows of interest >> >> (see >> >> section 4.4 in the manual); however, this method requires the use >> >> of a GPU >> >> for TE estimation. >> >> >> >> I would further recommend to use the new pipeline for group >> >> statistics >> >> described in the manual in section 4.5 (the function >> >> 'TEgroup_calculate' is >> >> deprecated). The new pipeline allows you to reconstruct the >> >> interaction >> >> delay and uses the following functions (see also comments in the >> >> script): >> >> >> >> TEgroup_prepare -> prepares all data sets (all subjects/all >> >> conditions) >> >> for group analysis (this means finding common embedding parameters >> >> such >> >> that estimates are not biased between groups) >> >> InteractionDelayReconstruction_calculate -> estimates TE for >> >> individual data sets and all assumed interaction delays u >> >> InteractionDelayReconstruction_analyze -> reconstructs the >> >> interaction delay by selecting the u that maximizes TE for each >> >> channel >> >> TEgroup_stats -> calculate group statistics using a permutation >> >> test >> >> >> >> I can send you an example script for group TE analysis using this >> >> pipeline >> >> to get you started. I hope this helps you to get the group analysis >> >> running. Just write again if you're having trouble setting up the >> >> pipeline >> >> or something is not clear about the parameters/my comments. >> >> >> >> Best, >> >> Patricia >> >> >> >> >> >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not 100% >> >> sure if it is appropriate to ask questions about it here, but to >> >> the best >> >> of my knowledge they do not have a mailing list and I saw a few >> >> trentool >> >> questions in the archives, so I'm going to assume it's ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present in >> >> the pipeline. Sorry in advance for the long post! Any help would be >> >> greatly >> >> appreciated as I'm a bit over my head on this but I think I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data that >> >> was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi >> >> is in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within >> >> the toi, but beyond that are there any benefits to it being earlier >> >> or >> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >> >> in >> >> seconds. The prediction time is the assumed interaction delay >> >> between your >> >> two sources and should fit within your toi. In general it is >> >> preferable to >> >> use the method for interaction delay reconstruction for TE >> >> estimation, >> >> because it allows you to reconstruct the actual delay between your >> >> source >> >> and target times series. A non-optimal u/interaction delay may >> >> cause an >> >> underestimation of TE, so it is recommended to use the pipeline for >> >> interaction delay reconstruction whenever estimating TE for unknown >> >> delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, >> >> so it is best to limit the u range to values that are >> >> physiologically >> >> plausible. >> >> >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the sample >> >> rate and filters are used to determine the actthrvalue, but I don't >> >> actually know the calculation. 7.5 was a rough guess just to test >> >> the >> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >> >> You can >> >> set the actthrvalue based on the filtering you did prior to TE >> >> analysis. If >> >> you for example highpass filtered at 10 Hz, you shouldn't find an >> >> ACT >> >> higher than 30 samples, because you filtered out any components of >> >> the >> >> signal slower than 10 Hz/30 samples (given your sampling frequency >> >> of 300 >> >> Hz). So in this scenario the actthrvalue would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm yet >> >> to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* PW: >> >> The Ragwitz criterion tries to find optimal embedding parameters >> >> dim and >> >> tau for the data. To do that, the method iteratively takes all >> >> possible >> >> combinations of dim and tau values that are provided in cfgP.ragdim >> >> and >> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >> >> embed >> >> the data. To test an embedding, the method builds the embedding >> >> vectors >> >> from the data; it then tests for each point how well the next point >> >> in time >> >> can be predicted from the reference point's nearest neighbours. So >> >> for each >> >> embedded point, the method searches for the nearest neighbours and >> >> calculates the average of those nearest neighbours. The difference >> >> between >> >> the averaged/predicted point and the actual next point is the error >> >> of the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested by >> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together >> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >> >> will >> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >> >> here are >> >> factors that are later multiplied with the ACT to obtain the actual >> >> tau. >> >> 'repPred' is the number of points that will be used for the local >> >> prediction, i.e. the Ragwitz criterion will test the local >> >> prediction and >> >> calculate the error for the first 100 points in your time series. >> >> The two >> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >> >> neighbour >> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >> >> method to >> >> either conduct a kNN or range search; 'sizeNei' specifies the >> >> number of >> >> neighbours or the radius to be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' >> >> data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject >> >> virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.* >> >> TRENTOOL seems to handle data output very differently from >> >> fieldtrip and >> >> I've had trouble thinking through the most logical way to handle >> >> the data >> >> so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> >> >> *For clarification, fileCell is a cell with the name of each >> >> condition x >> >> subject .mat file, which as I said before is collectively the same >> >> as the 3 >> >> x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> *At this step I get the following error: Error using >> >> transferentropy (line >> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in >> >> TEgroup_calculate (line 133) [TEresult] = >> >> transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate is a >> >> pipeline issue* (I noticed the example pipeline in trentool, the >> >> manual, >> >> and published methods articles all seem to have slightly or >> >> significantly >> >> different pipeline compositions), *or if the error is* due to ACT, >> >> ragwitz optimization, or some other faulty parameterization *on my >> >> part >> >> due to a lack of understanding of how transfer entropy works on a >> >> more >> >> theoretical/mathematical level*. If the latter is the case, is >> >> there any >> >> relatively straightforward way to conceptualize this, or is this >> >> something >> >> where I'm just going to have to keep reading and rereading until it >> >> eventually makes sense? I've already done quite a bit of that and >> >> it hasn't >> >> pierced my thick skull yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing >> >> > listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie > ldtrip >> >> >> >> >> >> -- >> >> ------------------------------------------------------------ >> >> >> >> 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 >> >> >> > >> > >> > >> > -- >> > Max Cantor >> > Lab Manager >> > Computational Neurolinguistics Lab >> > University of Michigan >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 024/attachment.html> >> > >> > ------------------------------ >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > End of fieldtrip Digest, Vol 46, Issue 3 >> > **************************************** >> > >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jim Herring, MSc. > Neuronal Oscillations Group > Centre for Cognitive Neuroimaging > Donders Institute for Brain, Cognition and Behaviour > Radboud University Nijmegen > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > ------------------------------ > > Message: 8 > Date: Mon, 15 Sep 2014 12:53:19 -0500 > From: "Jing Fan" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of > variable 'abort' > Message-ID: <000301cfd10d$ef53cba0$cdfb62e0$@gmail.com> > Content-Type: text/plain; charset="us-ascii" > > Hi Barbara and Jim, > > I added path your/path/to/fieldtrip/utilities and now it worked. > Hope it helps solve the problem. > > Best, > Jing > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) > Sent: Monday, September 15, 2014 5:01 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable > 'abort' > > Dear Barbara, > > The error seems to be related to a bug that pops up now and then > (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a > corrupt installation of fieldtrip and/or the need to update fieldtrip. > > Could you please try downloading the most recent version of fieldtrip and > see if the problem persists? > > For an example of what can be expected from this function see: Esser SK, > Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct > demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res > Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. > > Best, > > Jim > > > ----- Oorspronkelijk bericht ----- >> Van: "barbara schorr" >> Aan: fieldtrip at science.ru.nl >> Verzonden: Woensdag 10 september 2014 14:07:14 >> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable > 'abort' >> Dear fieldtripers. >> >> as mentioned in the subject line I would like to anaylse my timelocked >> ERP Data with the function ft_globalmeanfield. >> >> I get the Error: Undefined function or variable 'abort' >> Error in ft_globalmeanfield (line84) >> if abort >> >> in the function it says: >> >> %the abort variable is set to true or false in ft_preamble_inti >> if abort >> % do not continue function execution in case the outputfile is >> present and the user indicated to keep it >> return >> end >> >> >> I don't understand what this means. I would really appreciate your >> help to get this running. >> >> Also, what is the result when I run this function on my data? (This >> method was proposed from a reviewer. I never used it before, so I >> don't exactly know what it does and what the result will look like). >> >> Thank you very much in advance! >> >> Best, >> >> Barbara Schorr >> >> >> >> >> Zitat von 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: Question regarding nonparametric testing for coherence >> > differences (Eric Maris) >> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >> > 4. Re: ft_rejectvisual: removing trials marked as bad >> > (Caspar, Emilie) >> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >> > 6. Latest FT version on ftp-server is from three days ago >> > (Holger Krause) >> > 7. Re: TRENTOOL pipeline help (Max Cantor) >> > >> > >> > ---------------------------------------------------------------------- >> > >> > Message: 1 >> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >> > From: "Eric Maris" >> > To: , "'FieldTrip discussion list'" >> > >> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >> > for >> > coherence differences >> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Hwee Ling, >> > >> > >> > >> > In the paper you refer to (Maris et al, JNM, 2007), I did not >> > perform a >> > cluster-based permutation test at the level of the channel pairs. >> > Instead, >> > all coherences mentioned in the paper are coherence between a single >> > EMG >> > channel (2 electrodes mounted on the forearm) and all MEG >> > electrodes. Thus, >> > there are as many EMG-MEG coherences as there are MEG channels (275 >> > in our >> > lab), and the clustering of these coherences involves the same >> > neighbourhood >> > structure as the clustering of channel-specific statistics on power >> > or >> > evoked response. The analysis you propose involves clustering in a >> > much more >> > complex space, namely the formed by all (MEG,MEG) channel pairs >> > (275*275=75625 pairs). In the early days of cluster-based >> > permutation >> > statistics, I have worked on this problem but did not pursue it >> > because the >> > resulting clusters are very hard to interpret. >> > >> > >> > >> > Best, >> > >> > >> > >> > Eric Maris >> > >> > >> > >> > >> > >> > Dear all and Prof Maris, >> > >> > I'm re-posting this question again, as I didn't get any replies >> > previously. >> > >> > I?m interested to investigate if there are any differences in phase >> > synchronization in resting state data at timepoint 2 versus >> > timepoint 1. The >> > EEG data was collected using 64 EEG channels, resting state, eyes >> > opened and >> > eyes closed. I?ve arbitrarily segmented the resting state data into >> > epochs >> > of 2s each, and the epochs with artifacts are excluded completely >> > from >> > further analyses. I then performed mtmfft to get the fourier >> > representation >> > of the data, extracted the coherence, and compared the coherence >> > difference >> > of timepoint 2 versus timepoint 1 of all channels paired with all >> > other >> > channels. >> > >> > I figured that if I extract the connectivity analyses without >> > specifying the >> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >> > allow me to >> > perform cluster-based statistical analyses. I get an output with >> > ?chan_chan? >> > dimord variable. However, I was not 100% sure that this is correct, >> > hence, I?ve >> > inserted my code (see below). It?ll be great if you could tell me if >> > what I?m >> > doing makes any sense at all. Also, I don?t know how I can plot the >> > results >> > to see if it make any sense at all. >> > >> > Also, I checked the values obtained from when I specified >> > "cfg.channelcmb" >> > and when I did not specify "cfg.channelcmb", I noticed that the >> > values were >> > somehow different. I would assume that the values to be similar, >> > although >> > I'm not sure why they would have differences in the values obtained >> > from >> > specifying "cfg.channelcmb". >> > >> > This is my code that I've used thus far: >> > >> > for sub = 1:5 >> > >> > cfg = []; >> > >> > cfg.output = 'fourier'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.keeptrials = 'yes'; >> > >> > cfg.tapsmofrq = 5; >> > >> > cfg.foilim = [0 100]; >> > >> > cfg.taper = 'dpss'; >> > >> > % find the index for the c200 condition >> > >> > pre_c200_idx = find(data5.trialinfo == 201); >> > >> > cfg.trials = pre_c200_idx; >> > >> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >> > >> > post_c200_idx = find(data5.trialinfo == 200); >> > >> > cfg.trials = post_c200_idx; >> > >> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >> > >> > >> > >> > cfg = []; >> > >> > cfg.keeptrials = 'no'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.removemean = 'yes'; >> > >> > cfg.method = 'coh'; >> > >> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_pre_c200); >> > >> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_post_c200); >> > >> > end >> > >> > >> > >> > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat > '); >> > >> > cfg_neighb.method = 'template'; >> > >> > cfg_neighb.layout = lay; >> > >> > cfg_neighb.channel = 'all'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, >> > sub_HLF_pre_c200coh{1}); >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.neighbours = neighbours; >> > >> > cfg.channel = 'all'; >> > >> > cfg.channelcmb = {cfg.channel, cfg.channel}; >> > >> > cfg.latency = 'all'; >> > >> > cfg.avgovertime = 'no'; >> > >> > cfg.avgoverchan = 'no'; >> > >> > cfg.parameter = 'cohspctrm'; >> > >> > cfg.method = 'montecarlo'; >> > >> > cfg.statistic = 'depsamplesT'; >> > >> > cfg.correctm = 'cluster'; >> > >> > cfg.tail = 0; >> > >> > % cfg.clustertail = 0; >> > >> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >> > frequency >> > bands. >> > >> > cfg.numrandomization = 10000; >> > >> > cfg.ivar = 2; >> > >> > cfg.uvar = 1; >> > >> > >> > >> > % design matrices >> > >> > clear design; >> > >> > design(1,:) = [1:5, 1:5]; >> > >> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >> > >> > cfg.design = design; >> > >> > % for theta band >> > >> > cfg.avgoverfreq = 'yes'; >> > >> > cfg.frequency = [4 8]; % I also performed the statistics for delta >> > (2-4), >> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >> > (30-40), >> > and gamma (40-100). >> > >> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >> > sub_HLF_post_c200coh{:}, >> > sub_HLF_pre_c200coh{:}); >> > >> > >> > >> > When I tried to plot the results, I used this code: >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.layout = 'lay'; >> > >> > cfg.zlim = [-1 1]; >> > >> > cfg.alpha = 0.05; >> > >> > cfg.refchannel = 'all'; >> > >> > ft_clusterplot(cfg, diffc200_theta_stat); >> > >> > However, I was not sure how I could plot the results. I get an error >> > message >> > from Fieldtrip when using ft_clusterplot: >> > >> > Error using topoplot_common (line 366) >> > >> > no reference channel is specified >> > >> > Error in ft_topoplotTFR (line 192) >> > >> > [cfg] = topoplot_common(cfg, varargin{:}); >> > >> > Error in ft_clusterplot (line 372) >> > >> > ft_topoplotTFR(cfgtopo, stat); >> > >> > >> > >> > According to your paper in 2007, the topoplot of the results were >> > masked by >> > the spatio-spectral pattern of the significant clusters. I don't >> > know how to >> > do this, and I would really appreciate if you can show me how to >> > make such a >> > plot. >> > >> > Thank you very much. >> > >> > Kind regards, >> > >> > Hweeling >> > >> > >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 280/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 2 >> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >> > From: KatrinH Heimann >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Joseph, thanks so much, I really appreciate your help. I was >> > also >> > wandering, if maybe there is another bug in my code. >> > Our nets are 128 channels, Hydrocel, but as a colleague of me >> > adviced me to >> > do so, I also tried the 129 layout. >> > My code you find below (without selection of bad channels etc.) >> > If you need also the data of two subjects to have a look, let me >> > know!!! >> > Best and thanks really! >> > Katrin >> > >> > >> > subject=input('Which subject do you want to analyse? ','s'); >> > >> > name = strcat(subject,'.raw'); >> > >> > subjectnumber=input('Which is the subjectnumber?', 's'); >> > >> > sb=subjectnumber >> > >> > %subjectnumber = strcat(subjectnumber, '.txt') >> > >> > %% >> > >> > >> > cfg = []; >> > >> > cfg.dataset = name; >> > >> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >> > >> > cfg.trialdef.eventtype = 'trigger'; >> > >> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> > trigger >> > >> > cfg.trialdef.prestim = 0.234; % in seconds >> > >> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> > observation, but maybe we need less) >> > >> > cfg = ft_definetrial(cfg); >> > >> > >> > cfg.trl([1:7],:) = []; >> > >> > >> > %change timeline according to constant offset of 16 ms = 8 samples >> > (because >> > recorded with 500 hz)in >> > >> > %structure trial >> > >> > cfg.trl(:,3)=cfg.trl(:,3)-8 >> > >> > >> > %change timeline to make the cut the zeropoint >> > >> > >> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> > >> > >> > >> > %% preprocess data >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.detrend = 'yes'; >> > >> > cfg.preproc.demean = 'yes'; >> > >> > cfg.preproc.baselinewindow = [-2.1 -2.0] >> > >> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> > filtered >> > >> > %(0.1-45) and bad channels have to be replaced!!!! >> > >> > %cfg.preproc.bpfreq = [6 32]; >> > >> > % >> > >> > % >> > >> > obs_data = ft_preprocessing(cfg); >> > >> > % >> > >> > save (strcat(sb,'obs_data') , 'obs_data') >> > >> > >> > %% determining channel neighbours (necessary for Artifact detection) >> > >> > cfg = []; >> > >> > cfg.channel = obs_data.label; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.feedback = 'yes'; >> > >> > lay = ft_prepare_layout(cfg); >> > >> > >> > >> > cfg_neighb = []; >> > >> > cfg_neighb.feedback = 'yes'; >> > >> > >> > cfg_neighb.method = 'triangulation'; >> > >> > cfg_neighb.layout = 'GSN128.sfp'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > obs_data.elec = ft_read_sens('GSN128.sfp'); >> > >> > >> > %% Artifacts - to detect bad channels - is not saved!!! >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs_data_try = ft_rejectvisual(cfg, obs_data); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_try = ft_rejectartifact (cfg,obs_data); >> > >> > >> > >> > %% Preparing neighbours for channel repair - but bad channel info >> > in!!! >> > >> > >> > % cfg_neighb = []; >> > >> > % cfg_neighb.feedback = 'yes'; >> > >> > % cfg_neighb.method = 'triangulation'; >> > >> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> > >> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > % Interpolate and put into new data structure >> > >> > cfg = []; >> > >> > cfg.badchannel = {}; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.method = 'nearest'; >> > >> > cfg.neighbours = neighbours; >> > >> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> > >> > >> > % Check reconstruction >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > % dat1=obs_data; >> > >> > % dat2=obs_data_channelrepaired; >> > >> > % >> > >> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> > >> > % y=dat2.trial{1}(62,:); >> > >> > % plot(x);hold on;plot(y,'r'); >> > >> > % >> > >> > % x=dat1.trial{1}(72,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > % >> > >> > % x=dat1.trial{1}(75,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > %% artifact rejection/trial inspection - throw out electrode jumps >> > etc. >> > >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> > according to >> > channels interpolated %% 128-number of interp. channels) >> > >> > >> > >> > cfg = []; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.numcomponent = 128 >> > >> > comp = ft_componentanalysis(cfg,obs_data_clean1); >> > >> > save (strcat(sb,'comp_all') , 'comp') >> > >> > >> > %% >> > >> > cfg = []; >> > >> > cfg.viewmode = 'component'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='some'; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > ft_databrowser(cfg,comp); >> > >> > >> > %% poweranalysis components >> > >> > cfg = []; >> > >> > cfg.output = 'pow'; >> > >> > cfg.channel = 'all';%compute the power spectrum in all ICs >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.taper = 'hanning'; >> > >> > cfg.foi = 0:0.2:50; >> > >> > obs_freq = ft_freqanalysis(cfg, comp); >> > >> > >> > %And you can plot the spectra: >> > >> > >> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> > >> > nsubplots = 16; >> > >> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> > decimals, type >> > doc subplot >> > >> > >> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >> > >> > tot = Nfigs*nsubplots; >> > >> > >> > rptvect = 1:size(comp.topo,1); >> > >> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> > >> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> > >> > >> > for r=1:size(rptvect,1); >> > >> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> > 1]);%full >> > screen >> > >> > k=0; >> > >> > for j=1:size(rptvect,2); >> > >> > if~(rptvect(r,j)==0); >> > >> > k=k+1; >> > >> > cfg=[]; >> > >> > cfg.channel = rptvect(r,j); >> > >> > cfg.ylim =[0 500] >> > >> > cfg.xlim =[0 50] >> > >> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> > >> > end >> > >> > end >> > >> > end >> > >> > >> > %For the IC topos you'll follow the same logic as above but with: >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [1:20]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [21:40]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [41:60]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [61:80]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > >> > >> > >> > >> > %% Seperate observation conditions >> > >> > >> > name1= strcat(num2str(sb),'_90.xls'); >> > >> > list1=xlsread (name1) >> > >> > >> > >> > >> > >> > name2= strcat(num2str(sb),'_180.xls'); >> > >> > list2=xlsread (name2) >> > >> > >> > >> > % >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list1] >> > >> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list2] >> > >> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > %%PIPELINE FOR obs90 >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128; >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > >> > comp_1 = ft_componentanalysis(cfg, obs90_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> > obs90_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts - final detection >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs90_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> > >> > >> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> > >> > >> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> > >> > >> > %% plot it >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP) >> > >> > >> > >> > >> > >> > >> > >> > %% PIPELINE FOR obs180 >> > >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128 >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > comp_2 = ft_componentanalysis(cfg, obs180_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> > obs180_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts final 180 >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs180_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> > >> > >> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> > >> > >> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> > >> > >> > %% plot 180 ERP >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs180_data_ERP) >> > >> > >> > %% plot both ERPs >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > cfg.showlabels = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> > >> > >> > %% plot difference wave >> > >> > >> > difference = obs180_data_ERP; % copy one of the >> > structures >> > >> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >> > the >> > difference ERP >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, difference) >> > >> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> > >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI >> >> data. A couple things. First of all, exactly which net do you use? >> >> If >> >> they are 129-channel, there is still the question of whether they >> >> are the >> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >> >> cause an >> >> error like this. Could you send me the file you are trying to >> >> process and >> >> the script you are using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >> >> diezmartini at gmail.com> wrote: >> >> >> >> Which nets do you use? I use EGI. I tried both the ones you mention >> >> and >> >> they didn't work. It was hard to find that exact one online but it >> >> was the >> >> only file that actually worked. >> >> >> >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >> >> >> wrote: >> >> >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. >> >>> Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one >> >>> >> >>>> I use >> >>>> >> >>>> >> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >> >>>> katrinheimann at gmail.com> wrote: >> >>>> >> >>>>> Dear all, my problems seem neverending. This time however i >> >>>>> really need >> >>>>> help. >> >>>>> I implemented a pipeline for ERPs. All works now, >> >>>>> trialdefinition, >> >>>>> preprocessing, channelreplacement, ica, componentrejection, >> >>>>> final >> >>>>> artifactdetection, timelock of the single subject data. However, >> >>>>> when I >> >>>>> wanna compute the grandaverage of the single subjects I get the >> >>>>> following >> >>>>> error message: >> >>>>> >> >>>>> computing average of avg over 19 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 3 MB >> >>>>> computing average of avg over 2 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >> >>>>> additional >> >>>>> allocation of an estimated 0 MB >> >>>>> >> >>>>> Furthermore in the plot of the significant clusters, the >> >>>>> channelnames >> >>>>> are mixed up (do not correspond to my net) >> >>>>> >> >>>>> >> >>>>> I guess that there is a problem with the layout I use. >> >>>>> Here the code that I use >> >>>>> >> >>>>> %For generating the layout (also in the single subjects): >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = obs_data.label; >> >>>>> >> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>>> >> >>>>> cfg.feedback = 'yes'; >> >>>>> >> >>>>> lay = ft_prepare_layout(cfg); >> >>>>> >> >>>>> >> >>>>> cfg_neighb = []; >> >>>>> >> >>>>> cfg_neighb.feedback = 'yes'; >> >>>>> >> >>>>> cfg_neighb.method = 'triangulation'; >> >>>>> >> >>>>> cfg_neighb.layout = lay; >> >>>>> >> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>>> >> >>>>> >> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>>>> >> >>>>> >> >>>>> %For computing the grand average >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = 'all'; >> >>>>> >> >>>>> cfg.latency = 'all'; >> >>>>> >> >>>>> cfg.parameter = 'avg'; >> >>>>> >> >>>>> cfg.keepindividual = 'no' >> >>>>> >> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>>>> >> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>>>> >> >>>>> % "{:}" means to use data from all elements of the variable >> >>>>> >> >>>>> >> >>>>> For plotting the significant clusters >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.style = 'blank'; >> >>>>> >> >>>>> cfg.layout = lay; >> >>>>> >> >>>>> cfg.channellabels = 'yes'; >> >>>>> >> >>>>> cfg.highlight = 'labels'; >> >>>>> >> >>>>> cfg.highlightchannel = find(stat.mask); >> >>>>> >> >>>>> cfg.comment = 'no'; >> >>>>> >> >>>>> figure; ft_topoplotER(cfg, GA_90) >> >>>>> >> >>>>> title('Nonparametric: significant with cluster multiple >> >>>>> comparison >> >>>>> correction') >> >>>>> >> >>>>> >> >>>>> Do you have ANY idea to this? I am really completely >> >>>>> helpless.... >> >>>>> >> >>>>> thanks and best >> >>>>> >> >>>>> Katrin >> >>>>> >> >>>>> _______________________________________________ >> >>>>> 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 >> >>> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> >> >> > ---------------------------------------------------------------------------- > ---- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.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: >> > > b61/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 3 >> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >> > From: Joseph Dien >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > yes, please do send me the data. >> > >> > Thanks! >> > >> > Joe >> > >> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >> > wrote: >> > >> >> Dear Joseph, thanks so much, I really appreciate your help. I was >> >> also wandering, if maybe there is another bug in my code. >> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >> >> adviced me to do so, I also tried the 129 layout. >> >> My code you find below (without selection of bad channels etc.) >> >> If you need also the data of two subjects to have a look, let me >> >> know!!! >> >> Best and thanks really! >> >> Katrin >> >> >> >> >> >> >> >> subject=input('Which subject do you want to analyse? ','s'); >> >> >> >> name = strcat(subject,'.raw'); >> >> >> >> subjectnumber=input('Which is the subjectnumber?', 's'); >> >> >> >> sb=subjectnumber >> >> >> >> %subjectnumber = strcat(subjectnumber, '.txt') >> >> >> >> %% >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.dataset = name; >> >> >> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> >> >> >> cfg.trialdef.eventtype = 'trigger'; >> >> >> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> >> trigger >> >> >> >> cfg.trialdef.prestim = 0.234; % in seconds >> >> >> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> >> observation, but maybe we need less) >> >> >> >> cfg = ft_definetrial(cfg); >> >> >> >> >> >> >> >> cfg.trl([1:7],:) = []; >> >> >> >> >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> >> (because recorded with 500 hz)in >> >> >> >> %structure trial >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >> >> >> >> >> >> >> >> %change timeline to make the cut the zeropoint >> >> >> >> >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> >> >> >> >> >> >> >> >> >> >> >> %% preprocess data >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.detrend = 'yes'; >> >> >> >> cfg.preproc.demean = 'yes'; >> >> >> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >> >> >> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> >> filtered >> >> >> >> %(0.1-45) and bad channels have to be replaced!!!! >> >> >> >> %cfg.preproc.bpfreq = [6 32]; >> >> >> >> % >> >> >> >> % >> >> >> >> obs_data = ft_preprocessing(cfg); >> >> >> >> % >> >> >> >> save (strcat(sb,'obs_data') , 'obs_data') >> >> >> >> >> >> >> >> %% determining channel neighbours (necessary for Artifact >> >> detection) >> >> >> >> cfg = []; >> >> >> >> cfg.channel = obs_data.label; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.feedback = 'yes'; >> >> >> >> lay = ft_prepare_layout(cfg); >> >> >> >> >> >> cfg_neighb = []; >> >> >> >> cfg_neighb.feedback = 'yes'; >> >> >> >> >> >> >> >> cfg_neighb.method = 'triangulation'; >> >> >> >> cfg_neighb.layout = 'GSN128.sfp'; >> >> >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >> >> >> >> >> >> >> >> %% Artifacts - to detect bad channels - is not saved!!! >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Preparing neighbours for channel repair - but bad channel info >> >> in!!! >> >> >> >> >> >> >> >> % cfg_neighb = []; >> >> >> >> % cfg_neighb.feedback = 'yes'; >> >> >> >> % cfg_neighb.method = 'triangulation'; >> >> >> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> >> >> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> % Interpolate and put into new data structure >> >> >> >> cfg = []; >> >> >> >> cfg.badchannel = {}; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.method = 'nearest'; >> >> >> >> cfg.neighbours = neighbours; >> >> >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> >> >> >> >> >> % Check reconstruction >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> % dat1=obs_data; >> >> >> >> % dat2=obs_data_channelrepaired; >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> >> >> >> % y=dat2.trial{1}(62,:); >> >> >> >> % plot(x);hold on;plot(y,'r'); >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(72,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(75,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> %% artifact rejection/trial inspection - throw out electrode jumps >> >> etc. >> >> >> >> >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> >> according to channels interpolated %% 128-number of interp. >> >> channels) >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.channel = {'all'}; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >> >> >> >> save (strcat(sb,'comp_all') , 'comp') >> >> >> >> >> >> >> >> %% >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'component'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='some'; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> ft_databrowser(cfg,comp); >> >> >> >> >> >> >> >> %% poweranalysis components >> >> >> >> cfg = []; >> >> >> >> cfg.output = 'pow'; >> >> >> >> cfg.channel = 'all';%compute the power spectrum in all ICs >> >> >> >> cfg.method = 'mtmfft'; >> >> >> >> cfg.taper = 'hanning'; >> >> >> >> cfg.foi = 0:0.2:50; >> >> >> >> obs_freq = ft_freqanalysis(cfg, comp); >> >> >> >> >> >> >> >> %And you can plot the spectra: >> >> >> >> >> >> >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> >> >> nsubplots = 16; >> >> >> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> >> decimals, type doc subplot >> >> >> >> >> >> >> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >> >> >> >> tot = Nfigs*nsubplots; >> >> >> >> >> >> >> >> rptvect = 1:size(comp.topo,1); >> >> >> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> >> >> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> >> >> >> >> >> >> >> for r=1:size(rptvect,1); >> >> >> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> >> 1]);%full screen >> >> >> >> k=0; >> >> >> >> for j=1:size(rptvect,2); >> >> >> >> if~(rptvect(r,j)==0); >> >> >> >> k=k+1; >> >> >> >> cfg=[]; >> >> >> >> cfg.channel = rptvect(r,j); >> >> >> >> cfg.ylim =[0 500] >> >> >> >> cfg.xlim =[0 50] >> >> >> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> >> >> >> end >> >> >> >> end >> >> >> >> end >> >> >> >> >> >> >> >> %For the IC topos you'll follow the same logic as above but with: >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [1:20]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [21:40]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [41:60]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [61:80]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Seperate observation conditions >> >> >> >> >> >> >> >> name1= strcat(num2str(sb),'_90.xls'); >> >> >> >> list1=xlsread (name1) >> >> >> >> >> >> >> >> name2= strcat(num2str(sb),'_180.xls'); >> >> >> >> list2=xlsread (name2) >> >> >> >> >> >> % >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list1] >> >> >> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list2] >> >> >> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> %%PIPELINE FOR obs90 >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128; >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> >> >> >> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> >> obs90_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts - final detection >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> >> >> >> >> >> >> >> %% plot it >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% PIPELINE FOR obs180 >> >> >> >> >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> >> obs180_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts final 180 >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> >> >> >> >> >> >> >> %% plot 180 ERP >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot both ERPs >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> cfg.showlabels = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot difference wave >> >> >> >> >> >> >> >> difference = obs180_data_ERP; % copy one of >> >> the structures >> >> >> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >> >> compute the difference ERP >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, difference) >> >> >> >> >> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI data. A couple things. First of all, exactly which net do >> >> you use? If they are 129-channel, there is still the question of >> >> whether they are the Hydrocel or the older geodesic nets. >> >> Regardless, that shouldn't cause an error like this. Could you >> >> send me the file you are trying to process and the script you are >> >> using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >> >> wrote: >> >> >> >>> Which nets do you use? I use EGI. I tried both the ones you >> >>> mention and they didn't work. It was hard to find that exact one >> >>> online but it was the only file that actually worked. >> >>> >> >>> >> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one I use >> >>> >> >>> >> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear all, my problems seem neverending. This time however i really >> >>> need help. >> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >> >>> preprocessing, channelreplacement, ica, componentrejection, final >> >>> artifactdetection, timelock of the single subject data. However, >> >>> when I wanna compute the grandaverage of the single subjects I get >> >>> the following error message: >> >>> >> >>> computing average of avg over 19 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 3 MB >> >>> computing average of avg over 2 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 0 MB >> >>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> the call to "ft_topoplotER" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> >> >>> Furthermore in the plot of the significant clusters, the >> >>> channelnames are mixed up (do not correspond to my net) >> >>> >> >>> >> >>> I guess that there is a problem with the layout I use. >> >>> Here the code that I use >> >>> >> >>> %For generating the layout (also in the single subjects): >> >>> cfg = []; >> >>> >> >>> cfg.channel = obs_data.label; >> >>> >> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>> >> >>> cfg.feedback = 'yes'; >> >>> >> >>> lay = ft_prepare_layout(cfg); >> >>> >> >>> >> >>> cfg_neighb = []; >> >>> >> >>> cfg_neighb.feedback = 'yes'; >> >>> >> >>> cfg_neighb.method = 'triangulation'; >> >>> >> >>> cfg_neighb.layout = lay; >> >>> >> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>> >> >>> >> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>> >> >>> >> >>> >> >>> %For computing the grand average >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.channel = 'all'; >> >>> >> >>> cfg.latency = 'all'; >> >>> >> >>> cfg.parameter = 'avg'; >> >>> >> >>> cfg.keepindividual = 'no' >> >>> >> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>> >> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>> >> >>> % "{:}" means to use data from all elements of the variable >> >>> >> >>> >> >>> For plotting the significant clusters >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.style = 'blank'; >> >>> >> >>> cfg.layout = lay; >> >>> >> >>> cfg.channellabels = 'yes'; >> >>> >> >>> cfg.highlight = 'labels'; >> >>> >> >>> cfg.highlightchannel = find(stat.mask); >> >>> >> >>> cfg.comment = 'no'; >> >>> >> >>> figure; ft_topoplotER(cfg, GA_90) >> >>> >> >>> title('Nonparametric: significant with cluster multiple comparison >> >>> correction') >> >>> >> >>> >> >>> >> >>> Do you have ANY idea to this? I am really completely helpless.... >> >>> >> >>> thanks and best >> >>> >> >>> Katrin >> >>> >> >>> >> >>> _______________________________________________ >> >>> 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 >> >>> >> >>> _______________________________________________ >> >>> fieldtrip mailing list >> >>> fieldtrip at donders.ru.nl >> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> > ---------------------------------------------------------------------------- > ---- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.com >> >> >> >> >> >> _______________________________________________ >> >> 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 >> > >> > > ---------------------------------------------------------------------------- > ---- >> > >> > Joseph Dien, PhD >> > Research Associate >> > Cognitive Neurology >> > The Johns Hopkins University School of Medicine >> > >> > Lab E-mail: jdien1 at jhmi.edu >> > Private E-mail: jdien07 at mac.com >> > Office Phone: 410-614-3115 >> > Cell Phone: 202-297-8117 >> > Fax: 410-955-0188 >> > http://joedien.com >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > ad2/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 4 >> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >> > From: "Caspar, Emilie" >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >> > bad >> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >> > Content-Type: text/plain; charset="iso-8859-1" >> > >> > Hi Ashley, >> > >> > Maybe the mistake is you did not integrate in your script the >> > command to save the rejection. Normally, with the following command, >> > you will see in the Matlab Window that artifacts are correctly >> > rejected after the "quit" button. >> > >> > clean_data = ft_rejectvisual(cfg, interpoldata); >> > cfg.artfctdef.reject = 'complete'; >> > cfg.artfctdef.feedback = 'yes'; >> > cleandata = ft_rejectartifact(cfg,clean_data); >> > >> > Emilie >> > >> > >> > >> > >> > >> > Le 3 sept. 2014 ? 11:58, Ashley Greene >> > > a ?crit : >> > >> > Hello, >> > >> > I have used the rejectvisual function in attempt to remove bad >> > trials, but after marking them and pressing the quit button, >> > although the command window states that the selected trials have >> > been removed, there is no obvious change in the data; all of the >> > trials are still intact. Have I overlooked something? >> > >> > Thanks, >> > >> > Ashley >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 985/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 5 >> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >> > From: Patricia Wollstadt >> > To: fieldtrip at science.ru.nl >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: <540EEF94.9080601 at gmx.de> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > Hello Max, >> > >> > I added a few comments to the questions regarding individual >> > parameters >> > below. To address the general problem of TRENTOOL telling you, that >> > there are not enough sample points in your data: From what I can see >> > in >> > your script, you probably don't have enough data points in each time >> > series to robustly estimate TE. You analyze 800 ms of data sampled >> > at >> > 300 Hz, which gives you 240 samples per time series. Can you maybe >> > avoid >> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >> > you >> > analyze a longer time window of interest? >> > Note that you also 'lose' data to embedding and the interaction >> > delay: >> > The first point that can be used for TE estimation is at max. >> > embedding >> > length + max. interaction delay in samples. For example: max. >> > embedding >> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >> > max >> > interaction delay of 30 ms = 9 samples. In this example, you would >> > be >> > left with 240 - 29 samples for TE estimation per trial. There is >> > also >> > the possibility to estimate time resolved TE/TE for shorter time >> > windows >> > of interest (see section 4.4 in the manual); however, this method >> > requires the use of a GPU for TE estimation. >> > >> > I would further recommend to use the new pipeline for group >> > statistics >> > described in the manual in section 4.5 (the function >> > 'TEgroup_calculate' >> > is deprecated). The new pipeline allows you to reconstruct the >> > interaction delay and uses the following functions (see also >> > comments in >> > the script): >> > >> > TEgroup_prepare -> prepares all data sets (all subjects/all >> > conditions) for group analysis (this means finding common embedding >> > parameters such that estimates are not biased between groups) >> > InteractionDelayReconstruction_calculate -> estimates TE for >> > individual data sets and all assumed interaction delays u >> > InteractionDelayReconstruction_analyze -> reconstructs the >> > interaction delay by selecting the u that maximizes TE for each >> > channel >> > TEgroup_stats -> calculate group statistics using a permutation test >> > >> > I can send you an example script for group TE analysis using this >> > pipeline to get you started. I hope this helps you to get the group >> > analysis running. Just write again if you're having trouble setting >> > up >> > the pipeline or something is not clear about the parameters/my >> > comments. >> > >> > Best, >> > Patricia >> > >> > >> > >> > >> > On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not >> >> 100% sure if it is appropriate to ask questions about it here, but >> >> to >> >> the best of my knowledge they do not have a mailing list and I saw >> >> a >> >> few trentool questions in the archives, so I'm going to assume it's >> >> ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present >> >> in the pipeline. Sorry in advance for the long post! Any help would >> >> be >> >> greatly appreciated as I'm a bit over my head on this but I think >> >> I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data >> >> that was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi is >> >> in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within the toi, but beyond that are there any benefits to it being >> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >> >> the >> >> toi is in seconds. The prediction time is the assumed interaction >> >> delay between your two sources and should fit within your toi. In >> >> general it is preferable to use the method for interaction delay >> >> reconstruction for TE estimation, because it allows you to >> >> reconstruct >> >> the actual delay between your source and target times series. A >> >> non-optimal u/interaction delay may cause an underestimation of TE, >> >> so >> >> it is recommended to use the pipeline for interaction delay >> >> reconstruction whenever estimating TE for unknown delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, so it is best to limit the u range to values that are >> >> physiologically plausible. >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the >> >> sample rate and filters are used to determine the actthrvalue, but >> >> I >> >> don't actually know the calculation. 7.5 was a rough guess just to >> >> test the pipeline. I'm also uncertain of what minnrtrials should >> >> be.* >> >> PW: You can set the actthrvalue based on the filtering you did >> >> prior >> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >> >> shouldn't find an ACT higher than 30 samples, because you filtered >> >> out >> >> any components of the signal slower than 10 Hz/30 samples (given >> >> your >> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >> >> would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> * >> >> * >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm >> >> yet to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* >> >> PW: The Ragwitz criterion tries to find optimal embedding >> >> parameters >> >> dim and tau for the data. To do that, the method iteratively takes >> >> all >> >> possible combinations of dim and tau values that are provided in >> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >> >> these >> >> combinations embed the data. To test an embedding, the method >> >> builds >> >> the embedding vectors from the data; it then tests for each point >> >> how >> >> well the next point in time can be predicted from the reference >> >> point's nearest neighbours. So for each embedded point, the method >> >> searches for the nearest neighbours and calculates the average of >> >> those nearest neighbours. The difference between the >> >> averaged/predicted point and the actual next point is the error of >> >> the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested >> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together with 'ragtausteps' specifies the tau values to be tested >> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >> >> that >> >> the values here are factors that are later multiplied with the ACT >> >> to >> >> obtain the actual tau. 'repPred' is the number of points that will >> >> be >> >> used for the local prediction, i.e. the Ragwitz criterion will test >> >> the local prediction and calculate the error for the first 100 >> >> points >> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >> >> below >> >> specify the type of neighbour search conducted by the Ragwitz >> >> criterion: 'flagNei' tells the method to either conduct a kNN or >> >> range >> >> search; 'sizeNei' specifies the number of neighbours or the radius >> >> to >> >> be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> * >> >> * >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> * >> >> * >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.*TRENTOOL seems to handle data output very differently >> >> from >> >> fieldtrip and I've had trouble thinking through the most logical >> >> way >> >> to handle the data so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> * >> >> * >> >> *For clarification, fileCell is a cell with the name of each >> >> condition >> >> x subject .mat file, which as I said before is collectively the >> >> same >> >> as the 3 x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> * >> >> * >> >> *At this step I get the following error: >> >> >> >> Error using transferentropy (line 337) >> >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> >> >> Error in TEgroup_calculate (line 133) >> >> [TEresult] = transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate >> >> is a pipeline issue* (I noticed the example pipeline in trentool, >> >> the >> >> manual, and published methods articles all seem to have slightly or >> >> significantly different pipeline compositions), *or if the error >> >> is* >> >> due to ACT, ragwitz optimization, or some other faulty >> >> parameterization *on my part due to a lack of understanding of how >> >> transfer entropy works on a more theoretical/mathematical level*. >> >> If >> >> the latter is the case, is there any relatively straightforward way >> >> to >> >> conceptualize this, or is this something where I'm just going to >> >> have >> >> to keep reading and rereading until it eventually makes sense? I've >> >> already done quite a bit of that and it hasn't pierced my thick >> >> skull >> >> yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> 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: >> > > 97f/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 6 >> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >> > From: Holger Krause >> > To: FieldTrip discussion list >> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >> > days ago >> > Message-ID: >> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >> > Content-Type: text/plain; charset="us-ascii" >> > >> > Dear developers, >> > >> > Could you please check the process for creation/publication of >> > zip-files on >> > the FTP server? The latest file I can find there is >> > fieldtrip-20140906.zip. >> > >> > Thanks in advance, >> > >> > Holger >> > >> > >> > ------------------------------ >> > >> > Message: 7 >> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >> > From: Max Cantor >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > This is immensely helpful, thank you. I was very confused about why >> > some >> > versions of the pipeline I saw were using group calculate and others >> > were >> > using interaction delay reconstruction and what that meant, and I >> > think I >> > have a more clear idea of what the different steps of the pipeline >> > are >> > doing. There are still a few things I'm a bit confused about though >> > in >> > terms of the pipeline. For instance, whether or not I need to do >> > TEprepare >> > before group prepare, and if I need to do graph analysis (which I'm >> > not >> > sure I fully understand but also haven't looked deeply into) before >> > group >> > stats. >> > >> > If you don't mind me taking you up on your offer, I think seeing >> > your >> > example script might help clarify some of these issues. >> > >> > Thank you! >> > >> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >> > Patricia.Wollstadt at gmx.de> wrote: >> > >> >> Hello Max, >> >> >> >> I added a few comments to the questions regarding individual >> >> parameters >> >> below. To address the general problem of TRENTOOL telling you, that >> >> there >> >> are not enough sample points in your data: From what I can see in >> >> your >> >> script, you probably don't have enough data points in each time >> >> series to >> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >> >> which >> >> gives you 240 samples per time series. Can you maybe avoid >> >> downsampling to >> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >> >> longer time >> >> window of interest? >> >> Note that you also 'lose' data to embedding and the interaction >> >> delay: The >> >> first point that can be used for TE estimation is at max. embedding >> >> length >> >> + max. interaction delay in samples. For example: max. embedding >> >> length = >> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >> >> interaction >> >> delay of 30 ms = 9 samples. In this example, you would be left with >> >> 240 - >> >> 29 samples for TE estimation per trial. There is also the >> >> possibility to >> >> estimate time resolved TE/TE for shorter time windows of interest >> >> (see >> >> section 4.4 in the manual); however, this method requires the use >> >> of a GPU >> >> for TE estimation. >> >> >> >> I would further recommend to use the new pipeline for group >> >> statistics >> >> described in the manual in section 4.5 (the function >> >> 'TEgroup_calculate' is >> >> deprecated). The new pipeline allows you to reconstruct the >> >> interaction >> >> delay and uses the following functions (see also comments in the >> >> script): >> >> >> >> TEgroup_prepare -> prepares all data sets (all subjects/all >> >> conditions) >> >> for group analysis (this means finding common embedding parameters >> >> such >> >> that estimates are not biased between groups) >> >> InteractionDelayReconstruction_calculate -> estimates TE for >> >> individual data sets and all assumed interaction delays u >> >> InteractionDelayReconstruction_analyze -> reconstructs the >> >> interaction delay by selecting the u that maximizes TE for each >> >> channel >> >> TEgroup_stats -> calculate group statistics using a permutation >> >> test >> >> >> >> I can send you an example script for group TE analysis using this >> >> pipeline >> >> to get you started. I hope this helps you to get the group analysis >> >> running. Just write again if you're having trouble setting up the >> >> pipeline >> >> or something is not clear about the parameters/my comments. >> >> >> >> Best, >> >> Patricia >> >> >> >> >> >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not 100% >> >> sure if it is appropriate to ask questions about it here, but to >> >> the best >> >> of my knowledge they do not have a mailing list and I saw a few >> >> trentool >> >> questions in the archives, so I'm going to assume it's ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present in >> >> the pipeline. Sorry in advance for the long post! Any help would be >> >> greatly >> >> appreciated as I'm a bit over my head on this but I think I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data that >> >> was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi >> >> is in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within >> >> the toi, but beyond that are there any benefits to it being earlier >> >> or >> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >> >> in >> >> seconds. The prediction time is the assumed interaction delay >> >> between your >> >> two sources and should fit within your toi. In general it is >> >> preferable to >> >> use the method for interaction delay reconstruction for TE >> >> estimation, >> >> because it allows you to reconstruct the actual delay between your >> >> source >> >> and target times series. A non-optimal u/interaction delay may >> >> cause an >> >> underestimation of TE, so it is recommended to use the pipeline for >> >> interaction delay reconstruction whenever estimating TE for unknown >> >> delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, >> >> so it is best to limit the u range to values that are >> >> physiologically >> >> plausible. >> >> >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the sample >> >> rate and filters are used to determine the actthrvalue, but I don't >> >> actually know the calculation. 7.5 was a rough guess just to test >> >> the >> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >> >> You can >> >> set the actthrvalue based on the filtering you did prior to TE >> >> analysis. If >> >> you for example highpass filtered at 10 Hz, you shouldn't find an >> >> ACT >> >> higher than 30 samples, because you filtered out any components of >> >> the >> >> signal slower than 10 Hz/30 samples (given your sampling frequency >> >> of 300 >> >> Hz). So in this scenario the actthrvalue would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm yet >> >> to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* PW: >> >> The Ragwitz criterion tries to find optimal embedding parameters >> >> dim and >> >> tau for the data. To do that, the method iteratively takes all >> >> possible >> >> combinations of dim and tau values that are provided in cfgP.ragdim >> >> and >> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >> >> embed >> >> the data. To test an embedding, the method builds the embedding >> >> vectors >> >> from the data; it then tests for each point how well the next point >> >> in time >> >> can be predicted from the reference point's nearest neighbours. So >> >> for each >> >> embedded point, the method searches for the nearest neighbours and >> >> calculates the average of those nearest neighbours. The difference >> >> between >> >> the averaged/predicted point and the actual next point is the error >> >> of the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested by >> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together >> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >> >> will >> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >> >> here are >> >> factors that are later multiplied with the ACT to obtain the actual >> >> tau. >> >> 'repPred' is the number of points that will be used for the local >> >> prediction, i.e. the Ragwitz criterion will test the local >> >> prediction and >> >> calculate the error for the first 100 points in your time series. >> >> The two >> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >> >> neighbour >> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >> >> method to >> >> either conduct a kNN or range search; 'sizeNei' specifies the >> >> number of >> >> neighbours or the radius to be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' >> >> data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject >> >> virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.* >> >> TRENTOOL seems to handle data output very differently from >> >> fieldtrip and >> >> I've had trouble thinking through the most logical way to handle >> >> the data >> >> so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> >> >> *For clarification, fileCell is a cell with the name of each >> >> condition x >> >> subject .mat file, which as I said before is collectively the same >> >> as the 3 >> >> x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> *At this step I get the following error: Error using >> >> transferentropy (line >> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in >> >> TEgroup_calculate (line 133) [TEresult] = >> >> transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate is a >> >> pipeline issue* (I noticed the example pipeline in trentool, the >> >> manual, >> >> and published methods articles all seem to have slightly or >> >> significantly >> >> different pipeline compositions), *or if the error is* due to ACT, >> >> ragwitz optimization, or some other faulty parameterization *on my >> >> part >> >> due to a lack of understanding of how transfer entropy works on a >> >> more >> >> theoretical/mathematical level*. If the latter is the case, is >> >> there any >> >> relatively straightforward way to conceptualize this, or is this >> >> something >> >> where I'm just going to have to keep reading and rereading until it >> >> eventually makes sense? I've already done quite a bit of that and >> >> it hasn't >> >> pierced my thick skull yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing >> >> > listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie > ldtrip >> >> >> >> >> >> -- >> >> ------------------------------------------------------------ >> >> >> >> 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 >> >> >> > >> > >> > >> > -- >> > Max Cantor >> > Lab Manager >> > Computational Neurolinguistics Lab >> > University of Michigan >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 024/attachment.html> >> > >> > ------------------------------ >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > End of fieldtrip Digest, Vol 46, Issue 3 >> > **************************************** >> > >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jim Herring, MSc. > Neuronal Oscillations Group > Centre for Cognitive Neuroimaging > Donders Institute for Brain, Cognition and Behaviour > Radboud University Nijmegen > _______________________________________________ > 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 > > End of fieldtrip Digest, Vol 46, Issue 5 > **************************************** > Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From barbara.schorr at uni-ulm.de Wed Sep 17 12:13:04 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Wed, 17 Sep 2014 12:13:04 +0200 Subject: [FieldTrip] ft_globalmeanfield works In-Reply-To: References: Message-ID: <20140917121304.oegwu3yyo4004s8c@imap.uni-ulm.de> Dear Jim, I found the problem. I still had an older Fieldtrip version on my computer and this interfered somehow. I deleted that version and now it works. Best, Barbara Zitat von 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. dipole simulation on head model (gamaliel huerta urrea) > 2. Re: dipole simulation on head model (a.stolk) > 3. Re: Latest FT version on ftp-server is from three days ago > (Holger Krause) > 4. Re: Latest FT version on ftp-server is from three days ago > (Robert Oostenveld) > 5. difference in raw time sample values for .fif files read by > fieldtrip vs mne-python (Baptiste Gauthier) > 6. ft_connectivityanalysis vs MATLAB (Matt Gerhold) > 7. ft_connectivity_pdc (Matt Gerhold) > 8. dipole simulation on head model (gamaliel huerta urrea) > 9. Re: MEG lead field units (Marc Lalancette) > 10. Re: ft_globalmeanfield : Undefined function of variable > (barbara.schorr at uni-ulm.de) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 16 Sep 2014 01:49:37 -0300 > From: gamaliel huerta urrea > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] dipole simulation on head model > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi all > > I followed the tips above to simulate a dipole source on my own head model > generated from MRIs. However, using information from: > > http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit > > I could not simulate anything. Only one image is blank. The code I am using > is as follows: > > cfg = []; > cfg.vol = vol; % See above > cfg.elec = elec; % See above > cfg.dip.pos = [0 0 0]; > cfg.dip.mom = [2 2 2]; % Note, it Should be transposed > cfg.dip.frequency = 10; > cfg.ntrials = 10; > cfg.triallength = 1; % seconds > cfg.fsample = 25; % Hz > raw1 = ft_dipolesimulation (cfg); > ft_timelockanalysis avg1 = ([], raw1); > plot (avg1.time, avg1.avg); % Plot the timecourse > > where: > > vol = ft_prepare_headmodel volumes generated from the segmentation of my > resonances. > > and > > ft_read_sens elec = ('standard_1020.elc'); > > to run the script the result is a blank image. > > and Matlab tells me the following: > > using headmodel specified in the configuration > using electrodes specified in the configuration > Determining source compartment (1) > projecting electrodes on skin surface > electrode and system combine combining transfer matrix > computing simulated data > computing simulated trial data for 10 > > RMS value of simulated data is NaN > the call to "ft_dipolesimulation" took 4 seconds > the input is raw Data with 97 channels and 10 trials > Warning: the data does not Contain a definition trial >> In utilities \ private \ warning_once at 158 > In utilities \ private \ fixsampleinfo at 66 > In ft_datatype_raw at 157 > In ft_checkdata at 224 > In ft_timelockanalysis at 105 > In codgen at 50 > Warning: sampleinfo by reconstructing Assuming That the trials are > consecutive segments of > a continuous recording >> In utilities \ private \ warning_once at 158 > In utilities \ private \ fixsampleinfo at 79 > In ft_datatype_raw at 157 > In ft_checkdata at 224 > In ft_timelockanalysis at 105 > In codgen at 50 > averaging trials > trial averaging 10 of 10 > > the call to "ft_timelockanalysis" took 1 seconds > > > I hope you can help > > > greetings > -- > *Gamaliel Huerta* > *Ingenier?a Civil Biom?dica* > *Universidad de Valpara?so* > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 2 > Date: Tue, 16 Sep 2014 08:07:19 +0200 > From: "a.stolk" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] dipole simulation on head model > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi Gamaliel, can you try > avg = ft_timelockanalysis([], raw1);? > Instead of > ft_timelockanalysis avg1 = ([], raw1);? > Hope this helps, arjen > > > > -------- Oorspronkelijk bericht -------- > Van: gamaliel huerta urrea > Datum: > Aan: fieldtrip at science.ru.nl > Onderwerp: [FieldTrip] dipole simulation on head model > > > Hi all > > I followed the tips above to simulate a dipole source on my own head > model generated from MRIs. However, using information from:? > > http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit > > I could not simulate anything. Only one image is blank. The code I > am using is as follows:? > > cfg = [];? > cfg.vol = vol; % See above? > cfg.elec = elec; % See above? > cfg.dip.pos = [0 0 0];? > cfg.dip.mom = [2 2 2]; % Note, it Should be transposed? > cfg.dip.frequency = 10;? > cfg.ntrials = 10;? > cfg.triallength = 1; % seconds? > cfg.fsample = 25; % Hz? > raw1 = ft_dipolesimulation (cfg);? > ft_timelockanalysis avg1 = ([], raw1);? > plot (avg1.time, avg1.avg); % Plot the timecourse? > > where:? > > vol = ft_prepare_headmodel volumes generated from the segmentation > of my resonances.? > > and? > > ft_read_sens elec = ('standard_1020.elc');? > > to run the script the result is a blank image.? > > and Matlab tells me the following:? > > using headmodel specified in the configuration? > using electrodes specified in the configuration? > Determining source compartment (1)? > projecting electrodes on skin surface? > electrode and system combine combining transfer matrix? > computing simulated data? > computing simulated trial data for 10? > > RMS value of simulated data is NaN? > the call to "ft_dipolesimulation" took 4 seconds? > the input is raw Data with 97 channels and 10 trials? > Warning: the data does not Contain a definition trial? >> In utilities \ private \ warning_once at 158? > ? ?In utilities \ private \ fixsampleinfo at 66? > ? ?In ft_datatype_raw at 157? > ? ?In ft_checkdata at 224? > ? ?In ft_timelockanalysis at 105? > ? ?In codgen at 50? > Warning: sampleinfo by reconstructing Assuming That the trials are > consecutive segments of? > a continuous recording? >> In utilities \ private \ warning_once at 158? > ? ?In utilities \ private \ fixsampleinfo at 79? > ? ?In ft_datatype_raw at 157? > ? ?In ft_checkdata at 224? > ? ?In ft_timelockanalysis at 105? > ? ?In codgen at 50? > averaging trials? > trial averaging 10 of 10? > > the call to "ft_timelockanalysis" took 1 seconds? > > > I hope you can help? > > > greetings > -- > Gamaliel Huerta > Ingenier?a Civil Biom?dica > Universidad de Valpara?so > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 3 > Date: Tue, 16 Sep 2014 11:35:30 +0200 > From: Holger Krause > To: > Subject: Re: [FieldTrip] Latest FT version on ftp-server is from three > days ago > Message-ID: <201409161135.32594.Holger.Krause at med.uni-duesseldorf.de> > Content-Type: text/plain; charset="iso-8859-15" > > Hi! > > Again, same situation as last week :-( The latest file I can find on the FTP > server is fieldtrip-20140913.zip. > > Thanks for taking care of this issue, > > 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 > > > > ------------------------------ > > Message: 4 > Date: Tue, 16 Sep 2014 12:15:11 +0200 > From: Robert Oostenveld > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Latest FT version on ftp-server is from three > days ago > Message-ID: <4C0CDFB7-782E-49C1-9659-B85ABB918486 at donders.ru.nl> > Content-Type: text/plain; charset=iso-8859-1 > > Hi Holger, > > Thanks for notifying. We had a server crash a few days ago. One of > the consequences seems to have been that the automatic svn update > script blocked. I did a cleanup and the automatic releases on the > ftp should start coming again. Note that alternative ways to access > the code are explained on > http://fieldtrip.fcdonders.nl/faq/i_would_like_an_automatic_daily_updated_version_of_the_code_can_i_get_access_to_the_cvs_or_snv_server > > best regards, > Robert > > > > On 16 Sep 2014, at 11:35, Holger Krause > wrote: > >> Hi! >> >> Again, same situation as last week :-( The latest file I can find on the FTP >> server is fieldtrip-20140913.zip. >> >> Thanks for taking care of this issue, >> >> 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 > > > > > ------------------------------ > > Message: 5 > Date: Tue, 16 Sep 2014 14:27:15 +0200 > From: Baptiste Gauthier > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] difference in raw time sample values for .fif > files read by fieldtrip vs mne-python > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Dear fieldtrippers, > > I recently observed that reading a raw neuromag .fif file with fieldtrip > and mne-python (with default settings for both) give exactly the same > events separated by the same time (which is good!) but with a different > time offset: the zero-point definition for the recording differ between the > two softwares. I hypothesize that this difference comes from the convention > adopted: fieldtrip would use the "record raw" trigger as a zero-point and > mne the "start" trigger that occur earlier (i.e. you can follow the signal > but it will be not saved in the file), but I'm not perfectly sure. > > As someone already observed this difference? > It's harmless because it doesn't affect relative timing of the event but > become problematic to transfer recoded events trl from fieldtrip to > mne-python with a time-sample matching strategy. > > Best, > > Baptiste > > -- > Baptiste Gauthier > Postdoctoral Research Fellow > > INSERM-CEA Cognitive Neuroimaging unit > CEA/SAC/DSV/DRM/Neurospin center > B?t 145, Point Courier 156 > F-91191 Gif-sur-Yvette Cedex FRANCE > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 6 > Date: Tue, 16 Sep 2014 17:03:33 +0200 > From: Matt Gerhold > To: fieldtrip at science.ru.nl, fieldtrip-request at science.ru.nl > Subject: [FieldTrip] ft_connectivityanalysis vs MATLAB > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi, > > I've compared the non-parametric calculation of the coherence spectrum > using ft_connectivityanalysis to mscohere (MATLAB). The FT function > provides inflated coherence values in comparison to the MATLAB function. > I've also referenced this to a implementation of the original calculation > which equates to the MATLAB output. Any advice would be appreciated. > > Matthew > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 7 > Date: Tue, 16 Sep 2014 17:16:00 +0200 > From: Matt Gerhold > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] ft_connectivity_pdc > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > When computing pdc in FT, line 67 of ft_connectivity_pdc appears to invert > the spectral transfer func. When inverting I received the following error: > > Warning: Matrix is close to singular or badly scaled. Results may be > inaccurate. RCOND = 6.358859e-18. > > Will this impact on the final spectrum calculated by the method. If so, is > there a possible workaround/solution? > > Matthew > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 8 > Date: Tue, 16 Sep 2014 14:20:36 -0300 > From: gamaliel huerta urrea > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] dipole simulation on head model > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi all > > I followed the tips above to simulate a dipole source on my own head > model generated from MRIs. However, using information from: > http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit > > I could not simulate anything. Only one image is blank. The code I am > using is as follows: > > cfg = []; > cfg.vol = vol; % See above > cfg.elec = elec; % See above > cfg.dip.pos = [0 0 0]; > cfg.dip.mom = [2 2 2]; % Note, it Should be transposed > cfg.dip.frequency = 10; > cfg.ntrials = 10; > cfg.triallength = 1; % seconds > cfg.fsample = 25; % Hz > raw1 = ft_dipolesimulation (cfg); > avg1 = ft_timelockanalysis([], raw1); > > plot (avg1.time, avg1.avg); % Plot the timecourse > > where: > > vol = ft_prepare_headmodel volumes generated from the segmentation of > my resonances. > > and > > ft_read_sens elec = ('standard_1020.elc'); > > to run the script the result is a blank image. > > and Matlab tells me the following: > > using headmodel specified in the configuration > using electrodes specified in the configuration > Determining source compartment (1) > projecting electrodes on skin surface > electrode and system combine combining transfer matrix > computing simulated data > computing simulated trial data for 10 > > RMS value of simulated data is NaN > the call to "ft_dipolesimulation" took 4 seconds > the input is raw Data with 97 channels and 10 trials > Warning: the data does not Contain a definition trial >> * In utilities \ private \ warning_once at 158 > * In utilities \ private \ fixsampleinfo at 66 > In ft_datatype_raw at 157 > In ft_checkdata at 224 > In ft_timelockanalysis at 105 > In codgen at 50 > Warning: sampleinfo by reconstructing Assuming That the trials are > consecutive segments of > a continuous recording >> * In utilities \ private \ warning_once at 158 > * In utilities \ private \ fixsampleinfo at 79 > In ft_datatype_raw at 157 > In ft_checkdata at 224 > In ft_timelockanalysis at 105 > In codgen at 50 > averaging trials > trial averaging 10 of 10 > > the call to "ft_timelockanalysis" took 1 seconds > > > I hope you can help > > > greetings > > -- > *Gamaliel Huerta* > *Ingenier?a Civil Biom?dica* > *Universidad de Valpara?so* > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 9 > Date: Tue, 16 Sep 2014 18:42:21 +0000 > From: Marc Lalancette > To: "fieldtrip at science.ru.nl" > Subject: Re: [FieldTrip] MEG lead field units > Message-ID: > <2A2B6A5B8C4C174CBCCE0B45E548DEB229FBB67F at SKMBXX01.sickkids.ca> > Content-Type: text/plain; charset="us-ascii" > > Hello Fieldtrippies, > > Regarding a question I asked some months ago about the physical > units of the lead field in Fieldtrip, I wanted to share the fact > that I was wrong, and that it might be good to either document this > in the code and possibly to add a factor. When using 'cm' units, > the lead field is in Wb/cm^2/(A*m) = 1e4 T/Am = 1e2 T/(A*cm). I > started to realize my original assumption was wrong while working on > my Biomag poster since I was getting very low SNR values (around 1) > for typical source and system parameters. So I looked closer at > the single sphere code and my own old spherical forward solution > code, and here is where the extra factor comes in: > > Skipping to the last step, my formula is: > B = UnitConversion * (1e-7) * ( (QxrQ/F - (QxrQ * rv') * GradF/F^2) > * SensorOrient' ); > The second factor is the constant mu0/(4*pi) = 10^-7 Wb/Am. > Assuming a source (Q) in units of Am and distances in cm, the > complicated bit has units of Am*cm/cm^3. > Thus without the first factor, B would have units of Wb/cm^2 = 1e4 > T, and so I was using UnitConversion = 1e4 in my code, to get B in > Tesla. If we don't put in a specific source amplitude (as in > Fieldtrip), and still using UnitConversion, then B would be in T/(Am). > > I guess units can be different than 'cm' though, so the factor would > have to take that into account. Note that the single shell forward > solution gives the same units as single sphere and would need the > same factor. I haven't looked at other forward methods. I also > haven't verified if this is correctly dealt with when obtaining > reconstructed source amplitudes, say with a beamformer. > > Cheers, > Marc Lalancette > Lab Research Project Manager > The Hospital for Sick Children, Toronto, Canada > > > > > ________________________________ > > This e-mail may contain confidential, personal and/or health > information(information which may be subject to legal restrictions > on use, retention and/or disclosure) for the sole use of the > intended recipient. Any review or distribution by anyone other than > the person for whom it was originally intended is strictly > prohibited. If you have received this e-mail in error, please > contact the sender and delete all copies. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 10 > Date: Wed, 17 Sep 2014 11:22:19 +0200 > From: barbara.schorr at uni-ulm.de > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of > variable > Message-ID: <20140917112219.crkxv6dgoo0skccc at imap.uni-ulm.de> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > Dear Jim, > > I now downloaded the newest fieldtrip version but I still get the same > error messag. Is there anything else I need to know? > > Thanks a lot! > > Best, > Barbara > > > Zitat von 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: ft_rejectvisual: removing trials marked as bad (Ashley Greene) >> 2. Read only EEG data from combined MEG/EEG ctf file (Tobias Trame) >> 3. Re: ft_globalmeanfield : Undefined function of variable >> 'abort' (Herring, J.D. (Jim)) >> 4. using ft_megplanar with sinle-trial TFRs (Fr?d?ric Roux) >> 5. dipole simulation on head model (gamaliel huerta urrea) >> 6. Re: dipole simulation on head model (Tzvetan Popov) >> 7. Re: ft_globalmeanfield : Undefined function of variable >> 'abort' (Jing Fan) >> 8. Re: ft_globalmeanfield : Undefined function of variable >> 'abort' (Jing Fan) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Fri, 12 Sep 2014 21:39:43 +0900 >> From: Ashley Greene >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >> bad >> Message-ID: >> >> Content-Type: text/plain; charset="utf-8" >> >> Hi Emilie, >> >> Thanks!! I, of course, completely overlooked that. >> >> Ashley >> >> On Tue, Sep 9, 2014 at 3:37 PM, Caspar, Emilie wrote: >> >>> Hi Ashley, >>> >>> Maybe the mistake is you did not integrate in your script the command to >>> save the rejection. Normally, with the following command, you will see in >>> the Matlab Window that artifacts are correctly rejected after the "quit" >>> button. >>> >>> clean_data = ft_rejectvisual(cfg, interpoldata); >>> cfg.artfctdef.reject = 'complete'; >>> cfg.artfctdef.feedback = 'yes'; >>> cleandata = ft_rejectartifact(cfg,clean_data); >>> >>> Emilie >>> >>> >>> >>> >>> >>> Le 3 sept. 2014 ? 11:58, Ashley Greene a ?crit : >>> >>> Hello, >>> >>> I have used the rejectvisual function in attempt to remove bad trials, >>> but after marking them and pressing the quit button, although the command >>> window states that the selected trials have been removed, there is no >>> obvious change in the data; all of the trials are still intact. Have I >>> overlooked something? >>> >>> Thanks, >>> >>> Ashley >>> _______________________________________________ >>> 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: >> >> >> ------------------------------ >> >> Message: 2 >> Date: Fri, 12 Sep 2014 18:23:17 +0200 (CEST) >> From: Tobias Trame >> To: >> Subject: [FieldTrip] Read only EEG data from combined MEG/EEG ctf file >> Message-ID: >> >> >> Content-Type: text/plain; charset=us-ascii >> >> Hi everybody! >> >> I'm trying to read only the EEG data from a combined MEG/EEG ctf >> file in order >> to create leadfields later on, but the function "ft_read_sens" just returns >> the gradiometer information in a 'grad' field. It searches for an >> 'elec'-field >> in the header of the data which is not present. Is there a configuration to >> get the EEG-elecrodes by using "ft_read_sens"? >> >> My first attempt was to write the EEG-Information from the header by hand >> using the following code: >> >> hdr = ft_read_header('subject.ds', 'headerformat', 'ctf_ds'); >> elec.elecpos = [hdr.orig.eeg.pos]'; >> elec.chanpos = [hdr.orig.eeg.pos]'; >> elec.label = {hdr.orig.eeg.name}'; >> elec.type = 'eeg'; >> elec.unit = 'cm'; >> >> But now I get a similar problem if I want to create leadfields from timelock >> data. After doing the timelock analysis using >> >> timelock_data = ft_timelockanalysis(cfg, mydata); >> >> the structure timelock_data contains just a 'grad' and no 'elec' >> field so that >> ft_prepare_leadfield(cfg, timelock_data) always ignores the >> EEG-elecrodes and >> tries to use the gradiometes - even if I put the electrodes defined >> above into >> cfg.elec. >> >> Thanks for any suggestions! >> >> Tobias >> >> >> ------------------------------ >> >> Message: 3 >> Date: Mon, 15 Sep 2014 12:01:02 +0200 (CEST) >> From: "Herring, J.D. (Jim)" >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of >> variable 'abort' >> Message-ID: >> <2103383764.4690548.1410775262514.JavaMail.root at draco.zimbra.ru.nl> >> Content-Type: text/plain; charset=utf-8 >> >> Dear Barbara, >> >> The error seems to be related to a bug that pops up now and then >> (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be >> due to a corrupt installation of fieldtrip and/or the need to update >> fieldtrip. >> >> Could you please try downloading the most recent version of >> fieldtrip and see if the problem persists? >> >> For an example of what can be expected from this function see: Esser >> SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A >> direct demonstration of cortical LTP in humans: a combined TMS/EEG >> study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. >> PubMed PMID: 16464689. >> >> Best, >> >> Jim >> >> >> ----- Oorspronkelijk bericht ----- >>> Van: "barbara schorr" >>> Aan: fieldtrip at science.ru.nl >>> Verzonden: Woensdag 10 september 2014 14:07:14 >>> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of >>> variable 'abort' >>> Dear fieldtripers. >>> >>> as mentioned in the subject line I would like to anaylse my timelocked >>> ERP Data with the function ft_globalmeanfield. >>> >>> I get the Error: Undefined function or variable 'abort' >>> Error in ft_globalmeanfield (line84) >>> if abort >>> >>> in the function it says: >>> >>> %the abort variable is set to true or false in ft_preamble_inti >>> if abort >>> % do not continue function execution in case the outputfile is >>> present and the user indicated to keep it >>> return >>> end >>> >>> >>> I don't understand what this means. I would really appreciate your >>> help to get this running. >>> >>> Also, what is the result when I run this function on my data? (This >>> method was proposed from a reviewer. I never used it before, so I >>> don't exactly know what it does and what the result will look like). >>> >>> Thank you very much in advance! >>> >>> Best, >>> >>> Barbara Schorr >>> >>> >>> >>> >>> Zitat von 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: Question regarding nonparametric testing for coherence >>> > differences (Eric Maris) >>> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >>> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >>> > 4. Re: ft_rejectvisual: removing trials marked as bad >>> > (Caspar, Emilie) >>> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >>> > 6. Latest FT version on ftp-server is from three days ago >>> > (Holger Krause) >>> > 7. Re: TRENTOOL pipeline help (Max Cantor) >>> > >>> > >>> > ---------------------------------------------------------------------- >>> > >>> > Message: 1 >>> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >>> > From: "Eric Maris" >>> > To: , "'FieldTrip discussion list'" >>> > >>> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >>> > for >>> > coherence differences >>> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Hwee Ling, >>> > >>> > >>> > >>> > In the paper you refer to (Maris et al, JNM, 2007), I did not >>> > perform a >>> > cluster-based permutation test at the level of the channel pairs. >>> > Instead, >>> > all coherences mentioned in the paper are coherence between a single >>> > EMG >>> > channel (2 electrodes mounted on the forearm) and all MEG >>> > electrodes. Thus, >>> > there are as many EMG-MEG coherences as there are MEG channels (275 >>> > in our >>> > lab), and the clustering of these coherences involves the same >>> > neighbourhood >>> > structure as the clustering of channel-specific statistics on power >>> > or >>> > evoked response. The analysis you propose involves clustering in a >>> > much more >>> > complex space, namely the formed by all (MEG,MEG) channel pairs >>> > (275*275=75625 pairs). In the early days of cluster-based >>> > permutation >>> > statistics, I have worked on this problem but did not pursue it >>> > because the >>> > resulting clusters are very hard to interpret. >>> > >>> > >>> > >>> > Best, >>> > >>> > >>> > >>> > Eric Maris >>> > >>> > >>> > >>> > >>> > >>> > Dear all and Prof Maris, >>> > >>> > I'm re-posting this question again, as I didn't get any replies >>> > previously. >>> > >>> > I?m interested to investigate if there are any differences in phase >>> > synchronization in resting state data at timepoint 2 versus >>> > timepoint 1. The >>> > EEG data was collected using 64 EEG channels, resting state, eyes >>> > opened and >>> > eyes closed. I?ve arbitrarily segmented the resting state data into >>> > epochs >>> > of 2s each, and the epochs with artifacts are excluded completely >>> > from >>> > further analyses. I then performed mtmfft to get the fourier >>> > representation >>> > of the data, extracted the coherence, and compared the coherence >>> > difference >>> > of timepoint 2 versus timepoint 1 of all channels paired with all >>> > other >>> > channels. >>> > >>> > I figured that if I extract the connectivity analyses without >>> > specifying the >>> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >>> > allow me to >>> > perform cluster-based statistical analyses. I get an output with >>> > ?chan_chan? >>> > dimord variable. However, I was not 100% sure that this is correct, >>> > hence, I?ve >>> > inserted my code (see below). It?ll be great if you could tell me if >>> > what I?m >>> > doing makes any sense at all. Also, I don?t know how I can plot the >>> > results >>> > to see if it make any sense at all. >>> > >>> > Also, I checked the values obtained from when I specified >>> > "cfg.channelcmb" >>> > and when I did not specify "cfg.channelcmb", I noticed that the >>> > values were >>> > somehow different. I would assume that the values to be similar, >>> > although >>> > I'm not sure why they would have differences in the values obtained >>> > from >>> > specifying "cfg.channelcmb". >>> > >>> > This is my code that I've used thus far: >>> > >>> > for sub = 1:5 >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'fourier'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.keeptrials = 'yes'; >>> > >>> > cfg.tapsmofrq = 5; >>> > >>> > cfg.foilim = [0 100]; >>> > >>> > cfg.taper = 'dpss'; >>> > >>> > % find the index for the c200 condition >>> > >>> > pre_c200_idx = find(data5.trialinfo == 201); >>> > >>> > cfg.trials = pre_c200_idx; >>> > >>> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > post_c200_idx = find(data5.trialinfo == 200); >>> > >>> > cfg.trials = post_c200_idx; >>> > >>> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.keeptrials = 'no'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.removemean = 'yes'; >>> > >>> > cfg.method = 'coh'; >>> > >>> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_pre_c200); >>> > >>> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_post_c200); >>> > >>> > end >>> > >>> > >>> > >>> > >>> load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); >>> > >>> > cfg_neighb.method = 'template'; >>> > >>> > cfg_neighb.layout = lay; >>> > >>> > cfg_neighb.channel = 'all'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, >>> > sub_HLF_pre_c200coh{1}); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.channelcmb = {cfg.channel, cfg.channel}; >>> > >>> > cfg.latency = 'all'; >>> > >>> > cfg.avgovertime = 'no'; >>> > >>> > cfg.avgoverchan = 'no'; >>> > >>> > cfg.parameter = 'cohspctrm'; >>> > >>> > cfg.method = 'montecarlo'; >>> > >>> > cfg.statistic = 'depsamplesT'; >>> > >>> > cfg.correctm = 'cluster'; >>> > >>> > cfg.tail = 0; >>> > >>> > % cfg.clustertail = 0; >>> > >>> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >>> > frequency >>> > bands. >>> > >>> > cfg.numrandomization = 10000; >>> > >>> > cfg.ivar = 2; >>> > >>> > cfg.uvar = 1; >>> > >>> > >>> > >>> > % design matrices >>> > >>> > clear design; >>> > >>> > design(1,:) = [1:5, 1:5]; >>> > >>> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >>> > >>> > cfg.design = design; >>> > >>> > % for theta band >>> > >>> > cfg.avgoverfreq = 'yes'; >>> > >>> > cfg.frequency = [4 8]; % I also performed the statistics for delta >>> > (2-4), >>> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >>> > (30-40), >>> > and gamma (40-100). >>> > >>> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >>> > sub_HLF_post_c200coh{:}, >>> > sub_HLF_pre_c200coh{:}); >>> > >>> > >>> > >>> > When I tried to plot the results, I used this code: >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.layout = 'lay'; >>> > >>> > cfg.zlim = [-1 1]; >>> > >>> > cfg.alpha = 0.05; >>> > >>> > cfg.refchannel = 'all'; >>> > >>> > ft_clusterplot(cfg, diffc200_theta_stat); >>> > >>> > However, I was not sure how I could plot the results. I get an error >>> > message >>> > from Fieldtrip when using ft_clusterplot: >>> > >>> > Error using topoplot_common (line 366) >>> > >>> > no reference channel is specified >>> > >>> > Error in ft_topoplotTFR (line 192) >>> > >>> > [cfg] = topoplot_common(cfg, varargin{:}); >>> > >>> > Error in ft_clusterplot (line 372) >>> > >>> > ft_topoplotTFR(cfgtopo, stat); >>> > >>> > >>> > >>> > According to your paper in 2007, the topoplot of the results were >>> > masked by >>> > the spatio-spectral pattern of the significant clusters. I don't >>> > know how to >>> > do this, and I would really appreciate if you can show me how to >>> > make such a >>> > plot. >>> > >>> > Thank you very much. >>> > >>> > Kind regards, >>> > >>> > Hweeling >>> > >>> > >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 2 >>> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >>> > From: KatrinH Heimann >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Joseph, thanks so much, I really appreciate your help. I was >>> > also >>> > wandering, if maybe there is another bug in my code. >>> > Our nets are 128 channels, Hydrocel, but as a colleague of me >>> > adviced me to >>> > do so, I also tried the 129 layout. >>> > My code you find below (without selection of bad channels etc.) >>> > If you need also the data of two subjects to have a look, let me >>> > know!!! >>> > Best and thanks really! >>> > Katrin >>> > >>> > >>> > subject=input('Which subject do you want to analyse? ','s'); >>> > >>> > name = strcat(subject,'.raw'); >>> > >>> > subjectnumber=input('Which is the subjectnumber?', 's'); >>> > >>> > sb=subjectnumber >>> > >>> > %subjectnumber = strcat(subjectnumber, '.txt') >>> > >>> > %% >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.dataset = name; >>> > >>> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> > >>> > cfg.trialdef.eventtype = 'trigger'; >>> > >>> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> > trigger >>> > >>> > cfg.trialdef.prestim = 0.234; % in seconds >>> > >>> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> > observation, but maybe we need less) >>> > >>> > cfg = ft_definetrial(cfg); >>> > >>> > >>> > cfg.trl([1:7],:) = []; >>> > >>> > >>> > %change timeline according to constant offset of 16 ms = 8 samples >>> > (because >>> > recorded with 500 hz)in >>> > >>> > %structure trial >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)-8 >>> > >>> > >>> > %change timeline to make the cut the zeropoint >>> > >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> > >>> > >>> > >>> > %% preprocess data >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.detrend = 'yes'; >>> > >>> > cfg.preproc.demean = 'yes'; >>> > >>> > cfg.preproc.baselinewindow = [-2.1 -2.0] >>> > >>> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> > filtered >>> > >>> > %(0.1-45) and bad channels have to be replaced!!!! >>> > >>> > %cfg.preproc.bpfreq = [6 32]; >>> > >>> > % >>> > >>> > % >>> > >>> > obs_data = ft_preprocessing(cfg); >>> > >>> > % >>> > >>> > save (strcat(sb,'obs_data') , 'obs_data') >>> > >>> > >>> > %% determining channel neighbours (necessary for Artifact detection) >>> > >>> > cfg = []; >>> > >>> > cfg.channel = obs_data.label; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.feedback = 'yes'; >>> > >>> > lay = ft_prepare_layout(cfg); >>> > >>> > >>> > >>> > cfg_neighb = []; >>> > >>> > cfg_neighb.feedback = 'yes'; >>> > >>> > >>> > cfg_neighb.method = 'triangulation'; >>> > >>> > cfg_neighb.layout = 'GSN128.sfp'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > obs_data.elec = ft_read_sens('GSN128.sfp'); >>> > >>> > >>> > %% Artifacts - to detect bad channels - is not saved!!! >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs_data_try = ft_rejectvisual(cfg, obs_data); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_try = ft_rejectartifact (cfg,obs_data); >>> > >>> > >>> > >>> > %% Preparing neighbours for channel repair - but bad channel info >>> > in!!! >>> > >>> > >>> > % cfg_neighb = []; >>> > >>> > % cfg_neighb.feedback = 'yes'; >>> > >>> > % cfg_neighb.method = 'triangulation'; >>> > >>> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> > >>> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > % Interpolate and put into new data structure >>> > >>> > cfg = []; >>> > >>> > cfg.badchannel = {}; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.method = 'nearest'; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> > >>> > >>> > % Check reconstruction >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > % dat1=obs_data; >>> > >>> > % dat2=obs_data_channelrepaired; >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> > >>> > % y=dat2.trial{1}(62,:); >>> > >>> > % plot(x);hold on;plot(y,'r'); >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(72,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(75,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > %% artifact rejection/trial inspection - throw out electrode jumps >>> > etc. >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> > according to >>> > channels interpolated %% 128-number of interp. channels) >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > comp = ft_componentanalysis(cfg,obs_data_clean1); >>> > >>> > save (strcat(sb,'comp_all') , 'comp') >>> > >>> > >>> > %% >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'component'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='some'; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > ft_databrowser(cfg,comp); >>> > >>> > >>> > %% poweranalysis components >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'pow'; >>> > >>> > cfg.channel = 'all';%compute the power spectrum in all ICs >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.taper = 'hanning'; >>> > >>> > cfg.foi = 0:0.2:50; >>> > >>> > obs_freq = ft_freqanalysis(cfg, comp); >>> > >>> > >>> > %And you can plot the spectra: >>> > >>> > >>> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> > >>> > nsubplots = 16; >>> > >>> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> > decimals, type >>> > doc subplot >>> > >>> > >>> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> > >>> > tot = Nfigs*nsubplots; >>> > >>> > >>> > rptvect = 1:size(comp.topo,1); >>> > >>> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> > >>> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> > >>> > >>> > for r=1:size(rptvect,1); >>> > >>> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> > 1]);%full >>> > screen >>> > >>> > k=0; >>> > >>> > for j=1:size(rptvect,2); >>> > >>> > if~(rptvect(r,j)==0); >>> > >>> > k=k+1; >>> > >>> > cfg=[]; >>> > >>> > cfg.channel = rptvect(r,j); >>> > >>> > cfg.ylim =[0 500] >>> > >>> > cfg.xlim =[0 50] >>> > >>> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> > >>> > end >>> > >>> > end >>> > >>> > end >>> > >>> > >>> > %For the IC topos you'll follow the same logic as above but with: >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [1:20]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [21:40]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [41:60]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [61:80]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% Seperate observation conditions >>> > >>> > >>> > name1= strcat(num2str(sb),'_90.xls'); >>> > >>> > list1=xlsread (name1) >>> > >>> > >>> > >>> > >>> > >>> > name2= strcat(num2str(sb),'_180.xls'); >>> > >>> > list2=xlsread (name2) >>> > >>> > >>> > >>> > % >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list1] >>> > >>> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list2] >>> > >>> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > %%PIPELINE FOR obs90 >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128; >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > >>> > comp_1 = ft_componentanalysis(cfg, obs90_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> > obs90_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts - final detection >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs90_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> > >>> > >>> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> > >>> > >>> > %% plot it >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP) >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% PIPELINE FOR obs180 >>> > >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > comp_2 = ft_componentanalysis(cfg, obs180_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> > obs180_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts final 180 >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs180_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> > >>> > >>> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> > >>> > >>> > %% plot 180 ERP >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs180_data_ERP) >>> > >>> > >>> > %% plot both ERPs >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > cfg.showlabels = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> > >>> > >>> > %% plot difference wave >>> > >>> > >>> > difference = obs180_data_ERP; % copy one of the >>> > structures >>> > >>> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >>> > the >>> > difference ERP >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, difference) >>> > >>> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> > >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI >>> >> data. A couple things. First of all, exactly which net do you use? >>> >> If >>> >> they are 129-channel, there is still the question of whether they >>> >> are the >>> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >>> >> cause an >>> >> error like this. Could you send me the file you are trying to >>> >> process and >>> >> the script you are using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >>> >> diezmartini at gmail.com> wrote: >>> >> >>> >> Which nets do you use? I use EGI. I tried both the ones you mention >>> >> and >>> >> they didn't work. It was hard to find that exact one online but it >>> >> was the >>> >> only file that actually worked. >>> >> >>> >> >>> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >> >>> >> wrote: >>> >> >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. >>> >>> Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one >>> >>> >>> >>>> I use >>> >>>> >>> >>>> >>> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>> >>>> katrinheimann at gmail.com> wrote: >>> >>>> >>> >>>>> Dear all, my problems seem neverending. This time however i >>> >>>>> really need >>> >>>>> help. >>> >>>>> I implemented a pipeline for ERPs. All works now, >>> >>>>> trialdefinition, >>> >>>>> preprocessing, channelreplacement, ica, componentrejection, >>> >>>>> final >>> >>>>> artifactdetection, timelock of the single subject data. However, >>> >>>>> when I >>> >>>>> wanna compute the grandaverage of the single subjects I get the >>> >>>>> following >>> >>>>> error message: >>> >>>>> >>> >>>>> computing average of avg over 19 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 3 MB >>> >>>>> computing average of avg over 2 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>>>> additional >>> >>>>> allocation of an estimated 0 MB >>> >>>>> >>> >>>>> Furthermore in the plot of the significant clusters, the >>> >>>>> channelnames >>> >>>>> are mixed up (do not correspond to my net) >>> >>>>> >>> >>>>> >>> >>>>> I guess that there is a problem with the layout I use. >>> >>>>> Here the code that I use >>> >>>>> >>> >>>>> %For generating the layout (also in the single subjects): >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = obs_data.label; >>> >>>>> >>> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>>>> >>> >>>>> cfg.feedback = 'yes'; >>> >>>>> >>> >>>>> lay = ft_prepare_layout(cfg); >>> >>>>> >>> >>>>> >>> >>>>> cfg_neighb = []; >>> >>>>> >>> >>>>> cfg_neighb.feedback = 'yes'; >>> >>>>> >>> >>>>> cfg_neighb.method = 'triangulation'; >>> >>>>> >>> >>>>> cfg_neighb.layout = lay; >>> >>>>> >>> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>>>> >>> >>>>> >>> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>>>> >>> >>>>> >>> >>>>> %For computing the grand average >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = 'all'; >>> >>>>> >>> >>>>> cfg.latency = 'all'; >>> >>>>> >>> >>>>> cfg.parameter = 'avg'; >>> >>>>> >>> >>>>> cfg.keepindividual = 'no' >>> >>>>> >>> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>>>> >>> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>>>> >>> >>>>> % "{:}" means to use data from all elements of the variable >>> >>>>> >>> >>>>> >>> >>>>> For plotting the significant clusters >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.style = 'blank'; >>> >>>>> >>> >>>>> cfg.layout = lay; >>> >>>>> >>> >>>>> cfg.channellabels = 'yes'; >>> >>>>> >>> >>>>> cfg.highlight = 'labels'; >>> >>>>> >>> >>>>> cfg.highlightchannel = find(stat.mask); >>> >>>>> >>> >>>>> cfg.comment = 'no'; >>> >>>>> >>> >>>>> figure; ft_topoplotER(cfg, GA_90) >>> >>>>> >>> >>>>> title('Nonparametric: significant with cluster multiple >>> >>>>> comparison >>> >>>>> correction') >>> >>>>> >>> >>>>> >>> >>>>> Do you have ANY idea to this? I am really completely >>> >>>>> helpless.... >>> >>>>> >>> >>>>> thanks and best >>> >>>>> >>> >>>>> Katrin >>> >>>>> >>> >>>>> _______________________________________________ >>> >>>>> 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 >>> >>> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing list >>> >> fieldtrip at donders.ru.nl >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> >> >>> >> >>> -------------------------------------------------------------------------------- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.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: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 3 >>> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >>> > From: Joseph Dien >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > yes, please do send me the data. >>> > >>> > Thanks! >>> > >>> > Joe >>> > >>> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >>> > wrote: >>> > >>> >> Dear Joseph, thanks so much, I really appreciate your help. I was >>> >> also wandering, if maybe there is another bug in my code. >>> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >>> >> adviced me to do so, I also tried the 129 layout. >>> >> My code you find below (without selection of bad channels etc.) >>> >> If you need also the data of two subjects to have a look, let me >>> >> know!!! >>> >> Best and thanks really! >>> >> Katrin >>> >> >>> >> >>> >> >>> >> subject=input('Which subject do you want to analyse? ','s'); >>> >> >>> >> name = strcat(subject,'.raw'); >>> >> >>> >> subjectnumber=input('Which is the subjectnumber?', 's'); >>> >> >>> >> sb=subjectnumber >>> >> >>> >> %subjectnumber = strcat(subjectnumber, '.txt') >>> >> >>> >> %% >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.dataset = name; >>> >> >>> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> >> >>> >> cfg.trialdef.eventtype = 'trigger'; >>> >> >>> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> >> trigger >>> >> >>> >> cfg.trialdef.prestim = 0.234; % in seconds >>> >> >>> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> >> observation, but maybe we need less) >>> >> >>> >> cfg = ft_definetrial(cfg); >>> >> >>> >> >>> >> >>> >> cfg.trl([1:7],:) = []; >>> >> >>> >> >>> >> >>> >> %change timeline according to constant offset of 16 ms = 8 samples >>> >> (because recorded with 500 hz)in >>> >> >>> >> %structure trial >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >>> >> >>> >> >>> >> >>> >> %change timeline to make the cut the zeropoint >>> >> >>> >> >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% preprocess data >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.detrend = 'yes'; >>> >> >>> >> cfg.preproc.demean = 'yes'; >>> >> >>> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >>> >> >>> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> >> filtered >>> >> >>> >> %(0.1-45) and bad channels have to be replaced!!!! >>> >> >>> >> %cfg.preproc.bpfreq = [6 32]; >>> >> >>> >> % >>> >> >>> >> % >>> >> >>> >> obs_data = ft_preprocessing(cfg); >>> >> >>> >> % >>> >> >>> >> save (strcat(sb,'obs_data') , 'obs_data') >>> >> >>> >> >>> >> >>> >> %% determining channel neighbours (necessary for Artifact >>> >> detection) >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = obs_data.label; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.feedback = 'yes'; >>> >> >>> >> lay = ft_prepare_layout(cfg); >>> >> >>> >> >>> >> cfg_neighb = []; >>> >> >>> >> cfg_neighb.feedback = 'yes'; >>> >> >>> >> >>> >> >>> >> cfg_neighb.method = 'triangulation'; >>> >> >>> >> cfg_neighb.layout = 'GSN128.sfp'; >>> >> >>> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >>> >> >>> >> >>> >> >>> >> %% Artifacts - to detect bad channels - is not saved!!! >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Preparing neighbours for channel repair - but bad channel info >>> >> in!!! >>> >> >>> >> >>> >> >>> >> % cfg_neighb = []; >>> >> >>> >> % cfg_neighb.feedback = 'yes'; >>> >> >>> >> % cfg_neighb.method = 'triangulation'; >>> >> >>> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> >> >>> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> % Interpolate and put into new data structure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.badchannel = {}; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.method = 'nearest'; >>> >> >>> >> cfg.neighbours = neighbours; >>> >> >>> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> >> >>> >> >>> >> >>> >> % Check reconstruction >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> % dat1=obs_data; >>> >> >>> >> % dat2=obs_data_channelrepaired; >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> >> >>> >> % y=dat2.trial{1}(62,:); >>> >> >>> >> % plot(x);hold on;plot(y,'r'); >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(72,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(75,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> %% artifact rejection/trial inspection - throw out electrode jumps >>> >> etc. >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> >> according to channels interpolated %% 128-number of interp. >>> >> channels) >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = {'all'}; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >>> >> >>> >> save (strcat(sb,'comp_all') , 'comp') >>> >> >>> >> >>> >> >>> >> %% >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'component'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='some'; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> ft_databrowser(cfg,comp); >>> >> >>> >> >>> >> >>> >> %% poweranalysis components >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.output = 'pow'; >>> >> >>> >> cfg.channel = 'all';%compute the power spectrum in all ICs >>> >> >>> >> cfg.method = 'mtmfft'; >>> >> >>> >> cfg.taper = 'hanning'; >>> >> >>> >> cfg.foi = 0:0.2:50; >>> >> >>> >> obs_freq = ft_freqanalysis(cfg, comp); >>> >> >>> >> >>> >> >>> >> %And you can plot the spectra: >>> >> >>> >> >>> >> >>> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> >> >>> >> nsubplots = 16; >>> >> >>> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> >> decimals, type doc subplot >>> >> >>> >> >>> >> >>> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> >> >>> >> tot = Nfigs*nsubplots; >>> >> >>> >> >>> >> >>> >> rptvect = 1:size(comp.topo,1); >>> >> >>> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> >> >>> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> >> >>> >> >>> >> >>> >> for r=1:size(rptvect,1); >>> >> >>> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> >> 1]);%full screen >>> >> >>> >> k=0; >>> >> >>> >> for j=1:size(rptvect,2); >>> >> >>> >> if~(rptvect(r,j)==0); >>> >> >>> >> k=k+1; >>> >> >>> >> cfg=[]; >>> >> >>> >> cfg.channel = rptvect(r,j); >>> >> >>> >> cfg.ylim =[0 500] >>> >> >>> >> cfg.xlim =[0 50] >>> >> >>> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> >>> >> >>> >> %For the IC topos you'll follow the same logic as above but with: >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [1:20]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [21:40]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [41:60]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [61:80]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Seperate observation conditions >>> >> >>> >> >>> >> >>> >> name1= strcat(num2str(sb),'_90.xls'); >>> >> >>> >> list1=xlsread (name1) >>> >> >>> >> >>> >> >>> >> name2= strcat(num2str(sb),'_180.xls'); >>> >> >>> >> list2=xlsread (name2) >>> >> >>> >> >>> >> % >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list1] >>> >> >>> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list2] >>> >> >>> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> %%PIPELINE FOR obs90 >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128; >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> >>> >> >>> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> >> obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts - final detection >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot it >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% PIPELINE FOR obs180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> >> obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts final 180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot 180 ERP >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot both ERPs >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> cfg.showlabels = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot difference wave >>> >> >>> >> >>> >> >>> >> difference = obs180_data_ERP; % copy one of >>> >> the structures >>> >> >>> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >>> >> compute the difference ERP >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, difference) >>> >> >>> >> >>> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI data. A couple things. First of all, exactly which net do >>> >> you use? If they are 129-channel, there is still the question of >>> >> whether they are the Hydrocel or the older geodesic nets. >>> >> Regardless, that shouldn't cause an error like this. Could you >>> >> send me the file you are trying to process and the script you are >>> >> using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >>> >> wrote: >>> >> >>> >>> Which nets do you use? I use EGI. I tried both the ones you >>> >>> mention and they didn't work. It was hard to find that exact one >>> >>> online but it was the only file that actually worked. >>> >>> >>> >>> >>> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one I use >>> >>> >>> >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear all, my problems seem neverending. This time however i really >>> >>> need help. >>> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> >>> preprocessing, channelreplacement, ica, componentrejection, final >>> >>> artifactdetection, timelock of the single subject data. However, >>> >>> when I wanna compute the grandaverage of the single subjects I get >>> >>> the following error message: >>> >>> >>> >>> computing average of avg over 19 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 3 MB >>> >>> computing average of avg over 2 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 0 MB >>> >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> >>> >>> Furthermore in the plot of the significant clusters, the >>> >>> channelnames are mixed up (do not correspond to my net) >>> >>> >>> >>> >>> >>> I guess that there is a problem with the layout I use. >>> >>> Here the code that I use >>> >>> >>> >>> %For generating the layout (also in the single subjects): >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = obs_data.label; >>> >>> >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> >>> >>> cfg.feedback = 'yes'; >>> >>> >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> >>> >>> >>> cfg_neighb = []; >>> >>> >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> >>> >>> cfg_neighb.layout = lay; >>> >>> >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> >>> >>> >>> >>> >>> %For computing the grand average >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = 'all'; >>> >>> >>> >>> cfg.latency = 'all'; >>> >>> >>> >>> cfg.parameter = 'avg'; >>> >>> >>> >>> cfg.keepindividual = 'no' >>> >>> >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> >>> >>> >>> For plotting the significant clusters >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.style = 'blank'; >>> >>> >>> >>> cfg.layout = lay; >>> >>> >>> >>> cfg.channellabels = 'yes'; >>> >>> >>> >>> cfg.highlight = 'labels'; >>> >>> >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> >>> >>> cfg.comment = 'no'; >>> >>> >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> >>> correction') >>> >>> >>> >>> >>> >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> >>> >>> thanks and best >>> >>> >>> >>> Katrin >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> 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 >>> >>> >>> >>> _______________________________________________ >>> >>> fieldtrip mailing list >>> >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> -------------------------------------------------------------------------------- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.com >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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 >>> > >>> > >>> -------------------------------------------------------------------------------- >>> > >>> > Joseph Dien, PhD >>> > Research Associate >>> > Cognitive Neurology >>> > The Johns Hopkins University School of Medicine >>> > >>> > Lab E-mail: jdien1 at jhmi.edu >>> > Private E-mail: jdien07 at mac.com >>> > Office Phone: 410-614-3115 >>> > Cell Phone: 202-297-8117 >>> > Fax: 410-955-0188 >>> > http://joedien.com >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 4 >>> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >>> > From: "Caspar, Emilie" >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >>> > bad >>> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >>> > Content-Type: text/plain; charset="iso-8859-1" >>> > >>> > Hi Ashley, >>> > >>> > Maybe the mistake is you did not integrate in your script the >>> > command to save the rejection. Normally, with the following command, >>> > you will see in the Matlab Window that artifacts are correctly >>> > rejected after the "quit" button. >>> > >>> > clean_data = ft_rejectvisual(cfg, interpoldata); >>> > cfg.artfctdef.reject = 'complete'; >>> > cfg.artfctdef.feedback = 'yes'; >>> > cleandata = ft_rejectartifact(cfg,clean_data); >>> > >>> > Emilie >>> > >>> > >>> > >>> > >>> > >>> > Le 3 sept. 2014 ? 11:58, Ashley Greene >>> > > a ?crit : >>> > >>> > Hello, >>> > >>> > I have used the rejectvisual function in attempt to remove bad >>> > trials, but after marking them and pressing the quit button, >>> > although the command window states that the selected trials have >>> > been removed, there is no obvious change in the data; all of the >>> > trials are still intact. Have I overlooked something? >>> > >>> > Thanks, >>> > >>> > Ashley >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 5 >>> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >>> > From: Patricia Wollstadt >>> > To: fieldtrip at science.ru.nl >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: <540EEF94.9080601 at gmx.de> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > Hello Max, >>> > >>> > I added a few comments to the questions regarding individual >>> > parameters >>> > below. To address the general problem of TRENTOOL telling you, that >>> > there are not enough sample points in your data: From what I can see >>> > in >>> > your script, you probably don't have enough data points in each time >>> > series to robustly estimate TE. You analyze 800 ms of data sampled >>> > at >>> > 300 Hz, which gives you 240 samples per time series. Can you maybe >>> > avoid >>> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >>> > you >>> > analyze a longer time window of interest? >>> > Note that you also 'lose' data to embedding and the interaction >>> > delay: >>> > The first point that can be used for TE estimation is at max. >>> > embedding >>> > length + max. interaction delay in samples. For example: max. >>> > embedding >>> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >>> > max >>> > interaction delay of 30 ms = 9 samples. In this example, you would >>> > be >>> > left with 240 - 29 samples for TE estimation per trial. There is >>> > also >>> > the possibility to estimate time resolved TE/TE for shorter time >>> > windows >>> > of interest (see section 4.4 in the manual); however, this method >>> > requires the use of a GPU for TE estimation. >>> > >>> > I would further recommend to use the new pipeline for group >>> > statistics >>> > described in the manual in section 4.5 (the function >>> > 'TEgroup_calculate' >>> > is deprecated). The new pipeline allows you to reconstruct the >>> > interaction delay and uses the following functions (see also >>> > comments in >>> > the script): >>> > >>> > TEgroup_prepare -> prepares all data sets (all subjects/all >>> > conditions) for group analysis (this means finding common embedding >>> > parameters such that estimates are not biased between groups) >>> > InteractionDelayReconstruction_calculate -> estimates TE for >>> > individual data sets and all assumed interaction delays u >>> > InteractionDelayReconstruction_analyze -> reconstructs the >>> > interaction delay by selecting the u that maximizes TE for each >>> > channel >>> > TEgroup_stats -> calculate group statistics using a permutation test >>> > >>> > I can send you an example script for group TE analysis using this >>> > pipeline to get you started. I hope this helps you to get the group >>> > analysis running. Just write again if you're having trouble setting >>> > up >>> > the pipeline or something is not clear about the parameters/my >>> > comments. >>> > >>> > Best, >>> > Patricia >>> > >>> > >>> > >>> > >>> > On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not >>> >> 100% sure if it is appropriate to ask questions about it here, but >>> >> to >>> >> the best of my knowledge they do not have a mailing list and I saw >>> >> a >>> >> few trentool questions in the archives, so I'm going to assume it's >>> >> ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present >>> >> in the pipeline. Sorry in advance for the long post! Any help would >>> >> be >>> >> greatly appreciated as I'm a bit over my head on this but I think >>> >> I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data >>> >> that was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi is >>> >> in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within the toi, but beyond that are there any benefits to it being >>> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >>> >> the >>> >> toi is in seconds. The prediction time is the assumed interaction >>> >> delay between your two sources and should fit within your toi. In >>> >> general it is preferable to use the method for interaction delay >>> >> reconstruction for TE estimation, because it allows you to >>> >> reconstruct >>> >> the actual delay between your source and target times series. A >>> >> non-optimal u/interaction delay may cause an underestimation of TE, >>> >> so >>> >> it is recommended to use the pipeline for interaction delay >>> >> reconstruction whenever estimating TE for unknown delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, so it is best to limit the u range to values that are >>> >> physiologically plausible. >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the >>> >> sample rate and filters are used to determine the actthrvalue, but >>> >> I >>> >> don't actually know the calculation. 7.5 was a rough guess just to >>> >> test the pipeline. I'm also uncertain of what minnrtrials should >>> >> be.* >>> >> PW: You can set the actthrvalue based on the filtering you did >>> >> prior >>> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >>> >> shouldn't find an ACT higher than 30 samples, because you filtered >>> >> out >>> >> any components of the signal slower than 10 Hz/30 samples (given >>> >> your >>> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >>> >> would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> * >>> >> * >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm >>> >> yet to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* >>> >> PW: The Ragwitz criterion tries to find optimal embedding >>> >> parameters >>> >> dim and tau for the data. To do that, the method iteratively takes >>> >> all >>> >> possible combinations of dim and tau values that are provided in >>> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >>> >> these >>> >> combinations embed the data. To test an embedding, the method >>> >> builds >>> >> the embedding vectors from the data; it then tests for each point >>> >> how >>> >> well the next point in time can be predicted from the reference >>> >> point's nearest neighbours. So for each embedded point, the method >>> >> searches for the nearest neighbours and calculates the average of >>> >> those nearest neighbours. The difference between the >>> >> averaged/predicted point and the actual next point is the error of >>> >> the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested >>> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together with 'ragtausteps' specifies the tau values to be tested >>> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >>> >> that >>> >> the values here are factors that are later multiplied with the ACT >>> >> to >>> >> obtain the actual tau. 'repPred' is the number of points that will >>> >> be >>> >> used for the local prediction, i.e. the Ragwitz criterion will test >>> >> the local prediction and calculate the error for the first 100 >>> >> points >>> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >>> >> below >>> >> specify the type of neighbour search conducted by the Ragwitz >>> >> criterion: 'flagNei' tells the method to either conduct a kNN or >>> >> range >>> >> search; 'sizeNei' specifies the number of neighbours or the radius >>> >> to >>> >> be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> * >>> >> * >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> * >>> >> * >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.*TRENTOOL seems to handle data output very differently >>> >> from >>> >> fieldtrip and I've had trouble thinking through the most logical >>> >> way >>> >> to handle the data so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> * >>> >> * >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition >>> >> x subject .mat file, which as I said before is collectively the >>> >> same >>> >> as the 3 x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> * >>> >> * >>> >> *At this step I get the following error: >>> >> >>> >> Error using transferentropy (line 337) >>> >> \nTRENTOOL ERROR: not enough data points left after embedding >>> >> >>> >> Error in TEgroup_calculate (line 133) >>> >> [TEresult] = transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate >>> >> is a pipeline issue* (I noticed the example pipeline in trentool, >>> >> the >>> >> manual, and published methods articles all seem to have slightly or >>> >> significantly different pipeline compositions), *or if the error >>> >> is* >>> >> due to ACT, ragwitz optimization, or some other faulty >>> >> parameterization *on my part due to a lack of understanding of how >>> >> transfer entropy works on a more theoretical/mathematical level*. >>> >> If >>> >> the latter is the case, is there any relatively straightforward way >>> >> to >>> >> conceptualize this, or is this something where I'm just going to >>> >> have >>> >> to keep reading and rereading until it eventually makes sense? I've >>> >> already done quite a bit of that and it hasn't pierced my thick >>> >> skull >>> >> yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 6 >>> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >>> > From: Holger Krause >>> > To: FieldTrip discussion list >>> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >>> > days ago >>> > Message-ID: >>> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >>> > Content-Type: text/plain; charset="us-ascii" >>> > >>> > Dear developers, >>> > >>> > Could you please check the process for creation/publication of >>> > zip-files on >>> > the FTP server? The latest file I can find there is >>> > fieldtrip-20140906.zip. >>> > >>> > Thanks in advance, >>> > >>> > Holger >>> > >>> > >>> > ------------------------------ >>> > >>> > Message: 7 >>> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >>> > From: Max Cantor >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > This is immensely helpful, thank you. I was very confused about why >>> > some >>> > versions of the pipeline I saw were using group calculate and others >>> > were >>> > using interaction delay reconstruction and what that meant, and I >>> > think I >>> > have a more clear idea of what the different steps of the pipeline >>> > are >>> > doing. There are still a few things I'm a bit confused about though >>> > in >>> > terms of the pipeline. For instance, whether or not I need to do >>> > TEprepare >>> > before group prepare, and if I need to do graph analysis (which I'm >>> > not >>> > sure I fully understand but also haven't looked deeply into) before >>> > group >>> > stats. >>> > >>> > If you don't mind me taking you up on your offer, I think seeing >>> > your >>> > example script might help clarify some of these issues. >>> > >>> > Thank you! >>> > >>> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >>> > Patricia.Wollstadt at gmx.de> wrote: >>> > >>> >> Hello Max, >>> >> >>> >> I added a few comments to the questions regarding individual >>> >> parameters >>> >> below. To address the general problem of TRENTOOL telling you, that >>> >> there >>> >> are not enough sample points in your data: From what I can see in >>> >> your >>> >> script, you probably don't have enough data points in each time >>> >> series to >>> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >>> >> which >>> >> gives you 240 samples per time series. Can you maybe avoid >>> >> downsampling to >>> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >>> >> longer time >>> >> window of interest? >>> >> Note that you also 'lose' data to embedding and the interaction >>> >> delay: The >>> >> first point that can be used for TE estimation is at max. embedding >>> >> length >>> >> + max. interaction delay in samples. For example: max. embedding >>> >> length = >>> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >>> >> interaction >>> >> delay of 30 ms = 9 samples. In this example, you would be left with >>> >> 240 - >>> >> 29 samples for TE estimation per trial. There is also the >>> >> possibility to >>> >> estimate time resolved TE/TE for shorter time windows of interest >>> >> (see >>> >> section 4.4 in the manual); however, this method requires the use >>> >> of a GPU >>> >> for TE estimation. >>> >> >>> >> I would further recommend to use the new pipeline for group >>> >> statistics >>> >> described in the manual in section 4.5 (the function >>> >> 'TEgroup_calculate' is >>> >> deprecated). The new pipeline allows you to reconstruct the >>> >> interaction >>> >> delay and uses the following functions (see also comments in the >>> >> script): >>> >> >>> >> TEgroup_prepare -> prepares all data sets (all subjects/all >>> >> conditions) >>> >> for group analysis (this means finding common embedding parameters >>> >> such >>> >> that estimates are not biased between groups) >>> >> InteractionDelayReconstruction_calculate -> estimates TE for >>> >> individual data sets and all assumed interaction delays u >>> >> InteractionDelayReconstruction_analyze -> reconstructs the >>> >> interaction delay by selecting the u that maximizes TE for each >>> >> channel >>> >> TEgroup_stats -> calculate group statistics using a permutation >>> >> test >>> >> >>> >> I can send you an example script for group TE analysis using this >>> >> pipeline >>> >> to get you started. I hope this helps you to get the group analysis >>> >> running. Just write again if you're having trouble setting up the >>> >> pipeline >>> >> or something is not clear about the parameters/my comments. >>> >> >>> >> Best, >>> >> Patricia >>> >> >>> >> >>> >> >>> >> >>> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not 100% >>> >> sure if it is appropriate to ask questions about it here, but to >>> >> the best >>> >> of my knowledge they do not have a mailing list and I saw a few >>> >> trentool >>> >> questions in the archives, so I'm going to assume it's ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present in >>> >> the pipeline. Sorry in advance for the long post! Any help would be >>> >> greatly >>> >> appreciated as I'm a bit over my head on this but I think I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data that >>> >> was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi >>> >> is in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within >>> >> the toi, but beyond that are there any benefits to it being earlier >>> >> or >>> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >>> >> in >>> >> seconds. The prediction time is the assumed interaction delay >>> >> between your >>> >> two sources and should fit within your toi. In general it is >>> >> preferable to >>> >> use the method for interaction delay reconstruction for TE >>> >> estimation, >>> >> because it allows you to reconstruct the actual delay between your >>> >> source >>> >> and target times series. A non-optimal u/interaction delay may >>> >> cause an >>> >> underestimation of TE, so it is recommended to use the pipeline for >>> >> interaction delay reconstruction whenever estimating TE for unknown >>> >> delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, >>> >> so it is best to limit the u range to values that are >>> >> physiologically >>> >> plausible. >>> >> >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the sample >>> >> rate and filters are used to determine the actthrvalue, but I don't >>> >> actually know the calculation. 7.5 was a rough guess just to test >>> >> the >>> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >>> >> You can >>> >> set the actthrvalue based on the filtering you did prior to TE >>> >> analysis. If >>> >> you for example highpass filtered at 10 Hz, you shouldn't find an >>> >> ACT >>> >> higher than 30 samples, because you filtered out any components of >>> >> the >>> >> signal slower than 10 Hz/30 samples (given your sampling frequency >>> >> of 300 >>> >> Hz). So in this scenario the actthrvalue would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm yet >>> >> to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* PW: >>> >> The Ragwitz criterion tries to find optimal embedding parameters >>> >> dim and >>> >> tau for the data. To do that, the method iteratively takes all >>> >> possible >>> >> combinations of dim and tau values that are provided in cfgP.ragdim >>> >> and >>> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >>> >> embed >>> >> the data. To test an embedding, the method builds the embedding >>> >> vectors >>> >> from the data; it then tests for each point how well the next point >>> >> in time >>> >> can be predicted from the reference point's nearest neighbours. So >>> >> for each >>> >> embedded point, the method searches for the nearest neighbours and >>> >> calculates the average of those nearest neighbours. The difference >>> >> between >>> >> the averaged/predicted point and the actual next point is the error >>> >> of the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested by >>> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together >>> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >>> >> will >>> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >>> >> here are >>> >> factors that are later multiplied with the ACT to obtain the actual >>> >> tau. >>> >> 'repPred' is the number of points that will be used for the local >>> >> prediction, i.e. the Ragwitz criterion will test the local >>> >> prediction and >>> >> calculate the error for the first 100 points in your time series. >>> >> The two >>> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >>> >> neighbour >>> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >>> >> method to >>> >> either conduct a kNN or range search; 'sizeNei' specifies the >>> >> number of >>> >> neighbours or the radius to be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' >>> >> data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject >>> >> virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.* >>> >> TRENTOOL seems to handle data output very differently from >>> >> fieldtrip and >>> >> I've had trouble thinking through the most logical way to handle >>> >> the data >>> >> so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition x >>> >> subject .mat file, which as I said before is collectively the same >>> >> as the 3 >>> >> x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> *At this step I get the following error: Error using >>> >> transferentropy (line >>> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >>> >> Error in >>> >> TEgroup_calculate (line 133) [TEresult] = >>> >> transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate is a >>> >> pipeline issue* (I noticed the example pipeline in trentool, the >>> >> manual, >>> >> and published methods articles all seem to have slightly or >>> >> significantly >>> >> different pipeline compositions), *or if the error is* due to ACT, >>> >> ragwitz optimization, or some other faulty parameterization *on my >>> >> part >>> >> due to a lack of understanding of how transfer entropy works on a >>> >> more >>> >> theoretical/mathematical level*. If the latter is the case, is >>> >> there any >>> >> relatively straightforward way to conceptualize this, or is this >>> >> something >>> >> where I'm just going to have to keep reading and rereading until it >>> >> eventually makes sense? I've already done quite a bit of that and >>> >> it hasn't >>> >> pierced my thick skull yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing >>> >> >>> listfieldtrip at donders.ru.nlhttp://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 >>> >> >>> > >>> > >>> > >>> > -- >>> > Max Cantor >>> > Lab Manager >>> > Computational Neurolinguistics Lab >>> > University of Michigan >>> > -------------- 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 46, Issue 3 >>> > **************************************** >>> > >>> >>> >>> >>> Barbara Schorr, MSc >>> Clinical and Biological Psychology >>> University of Ulm >>> Albert-Einstein-Allee 47 >>> 89069 Ulm >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jim Herring, MSc. >> Neuronal Oscillations Group >> Centre for Cognitive Neuroimaging >> Donders Institute for Brain, Cognition and Behaviour >> Radboud University Nijmegen >> >> >> ------------------------------ >> >> Message: 4 >> Date: Mon, 15 Sep 2014 12:09:24 +0200 (CEST) >> From: Fr?d?ric Roux >> To: FieldTrip discussion list >> Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs >> Message-ID: <867006743.3066178.1410775764568.JavaMail.root at bcbl.eu> >> Content-Type: text/plain; charset=utf-8 >> >> Dear all, >> >> my question relates to the computation of combined planar gradients >> using the ft_combineplanar function. >> >> Our data has been recorded with an Elekta Neuromag 306 channel system, >> and I would like to know if it is "safe" to compute combined gradients >> before calling ft_freqstatistics, if the input data contains single >> trial TFRs. >> >> The reason why I am asking is because in the documentation of the >> function it says >> % Use as >> % [data] = ft_combineplanar(cfg, data) >> % where data contains an averaged planar gradient (either ERF or TFR). >> >> However, the following tutorial suggests that this can be safely applied if >> the input data contains TFRs which have been computed with the >> cfg.keeptrials = 'yes' option: >> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >> >> I am bit confused as both information (the fieldtrip documentation >> and the tutorial) >> seem to contradict each other. >> >> The 2 options that are see are: >> >> 1) compute TFRs with cfg.keeptrials = 'yes', then call >> ft_frestatistics, then call ft_combineplanar >> by using the output of ft_freqstatistics as input for the >> ft_combineplanar function. >> 2) compute TFRs with cfg.keeptrials = 'yes', then call >> ft_combineplanar, then call ft_freqstatistics >> >> Could anyone with experience on this issue please let me know what >> the best way >> to proceed would be? >> >> Fred >> --------------------------------------------------------------------------- >> >> >> >> >> ------------------------------ >> >> Message: 5 >> Date: Mon, 15 Sep 2014 13:12:38 -0300 >> From: gamaliel huerta urrea >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] dipole simulation on head model >> Message-ID: >> >> Content-Type: text/plain; charset="utf-8" >> >> hi all >> >> I hope you can help my problem. >> >> I have generated a model of head fieldtrip, and now I need to simulate >> sources at different positions within the crust generated. I followed the >> tutorial head model generation for EEG. However I have not found >> information on how to simulate a source. Any help would be welcome. >> >> Thank you >> greetings >> >> -- >> *Gamaliel Huerta* >> *Ingenier?a Civil Biom?dica* >> *Universidad de Valpara?so* >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> Message: 6 >> Date: Mon, 15 Sep 2014 18:38:26 +0200 >> From: Tzvetan Popov >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] dipole simulation on head model >> Message-ID: <6677301D-D72C-4C12-BC84-779D5E4DF8F3 at uni-konstanz.de> >> Content-Type: text/plain; charset="iso-8859-1" >> >> >> Dear Gamaliel, >> you might try something like this: >> >> http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit >> >> good luck >> tzvetan >> >> Am 15.09.2014 um 18:12 schrieb gamaliel huerta urrea >> : >> >>> hi all >>> >>> I hope you can help my problem. >>> >>> I have generated a model of head fieldtrip, and now I need to >>> simulate sources at different positions within the crust generated. >>> I followed the tutorial head model generation for EEG. However I >>> have not found information on how to simulate a source. Any help >>> would be welcome. >>> >>> Thank you >>> greetings >>> >>> -- >>> Gamaliel Huerta >>> Ingenier?a Civil Biom?dica >>> Universidad de Valpara?so >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> Message: 7 >> Date: Mon, 15 Sep 2014 12:40:41 -0500 >> From: "Jing Fan" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of >> variable 'abort' >> Message-ID: <000001cfd10c$2b7786a0$826693e0$@gmail.com> >> Content-Type: text/plain; charset="us-ascii" >> >> Hi Jim, >> >> I download the latest .zip file from FTP. >> I received the same error message when calling function ft_definetrial(cfg). >> It seems to me that ft_preamble init command will go to script ft_preamble.m >> instead of ft_preamble_init.m. >> Any help to resolve this issue will be appreciated. >> >> Best, >> Jing >> >> >> >> -----Original Message----- >> From: fieldtrip-bounces at science.ru.nl >> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) >> Sent: Monday, September 15, 2014 5:01 AM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable >> 'abort' >> >> Dear Barbara, >> >> The error seems to be related to a bug that pops up now and then >> (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a >> corrupt installation of fieldtrip and/or the need to update fieldtrip. >> >> Could you please try downloading the most recent version of fieldtrip and >> see if the problem persists? >> >> For an example of what can be expected from this function see: Esser SK, >> Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct >> demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res >> Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. >> >> Best, >> >> Jim >> >> >> ----- Oorspronkelijk bericht ----- >>> Van: "barbara schorr" >>> Aan: fieldtrip at science.ru.nl >>> Verzonden: Woensdag 10 september 2014 14:07:14 >>> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable >> 'abort' >>> Dear fieldtripers. >>> >>> as mentioned in the subject line I would like to anaylse my timelocked >>> ERP Data with the function ft_globalmeanfield. >>> >>> I get the Error: Undefined function or variable 'abort' >>> Error in ft_globalmeanfield (line84) >>> if abort >>> >>> in the function it says: >>> >>> %the abort variable is set to true or false in ft_preamble_inti >>> if abort >>> % do not continue function execution in case the outputfile is >>> present and the user indicated to keep it >>> return >>> end >>> >>> >>> I don't understand what this means. I would really appreciate your >>> help to get this running. >>> >>> Also, what is the result when I run this function on my data? (This >>> method was proposed from a reviewer. I never used it before, so I >>> don't exactly know what it does and what the result will look like). >>> >>> Thank you very much in advance! >>> >>> Best, >>> >>> Barbara Schorr >>> >>> >>> >>> >>> Zitat von 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: Question regarding nonparametric testing for coherence >>> > differences (Eric Maris) >>> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >>> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >>> > 4. Re: ft_rejectvisual: removing trials marked as bad >>> > (Caspar, Emilie) >>> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >>> > 6. Latest FT version on ftp-server is from three days ago >>> > (Holger Krause) >>> > 7. Re: TRENTOOL pipeline help (Max Cantor) >>> > >>> > >>> > ---------------------------------------------------------------------- >>> > >>> > Message: 1 >>> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >>> > From: "Eric Maris" >>> > To: , "'FieldTrip discussion list'" >>> > >>> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >>> > for >>> > coherence differences >>> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Hwee Ling, >>> > >>> > >>> > >>> > In the paper you refer to (Maris et al, JNM, 2007), I did not >>> > perform a >>> > cluster-based permutation test at the level of the channel pairs. >>> > Instead, >>> > all coherences mentioned in the paper are coherence between a single >>> > EMG >>> > channel (2 electrodes mounted on the forearm) and all MEG >>> > electrodes. Thus, >>> > there are as many EMG-MEG coherences as there are MEG channels (275 >>> > in our >>> > lab), and the clustering of these coherences involves the same >>> > neighbourhood >>> > structure as the clustering of channel-specific statistics on power >>> > or >>> > evoked response. The analysis you propose involves clustering in a >>> > much more >>> > complex space, namely the formed by all (MEG,MEG) channel pairs >>> > (275*275=75625 pairs). In the early days of cluster-based >>> > permutation >>> > statistics, I have worked on this problem but did not pursue it >>> > because the >>> > resulting clusters are very hard to interpret. >>> > >>> > >>> > >>> > Best, >>> > >>> > >>> > >>> > Eric Maris >>> > >>> > >>> > >>> > >>> > >>> > Dear all and Prof Maris, >>> > >>> > I'm re-posting this question again, as I didn't get any replies >>> > previously. >>> > >>> > I?m interested to investigate if there are any differences in phase >>> > synchronization in resting state data at timepoint 2 versus >>> > timepoint 1. The >>> > EEG data was collected using 64 EEG channels, resting state, eyes >>> > opened and >>> > eyes closed. I?ve arbitrarily segmented the resting state data into >>> > epochs >>> > of 2s each, and the epochs with artifacts are excluded completely >>> > from >>> > further analyses. I then performed mtmfft to get the fourier >>> > representation >>> > of the data, extracted the coherence, and compared the coherence >>> > difference >>> > of timepoint 2 versus timepoint 1 of all channels paired with all >>> > other >>> > channels. >>> > >>> > I figured that if I extract the connectivity analyses without >>> > specifying the >>> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >>> > allow me to >>> > perform cluster-based statistical analyses. I get an output with >>> > ?chan_chan? >>> > dimord variable. However, I was not 100% sure that this is correct, >>> > hence, I?ve >>> > inserted my code (see below). It?ll be great if you could tell me if >>> > what I?m >>> > doing makes any sense at all. Also, I don?t know how I can plot the >>> > results >>> > to see if it make any sense at all. >>> > >>> > Also, I checked the values obtained from when I specified >>> > "cfg.channelcmb" >>> > and when I did not specify "cfg.channelcmb", I noticed that the >>> > values were >>> > somehow different. I would assume that the values to be similar, >>> > although >>> > I'm not sure why they would have differences in the values obtained >>> > from >>> > specifying "cfg.channelcmb". >>> > >>> > This is my code that I've used thus far: >>> > >>> > for sub = 1:5 >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'fourier'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.keeptrials = 'yes'; >>> > >>> > cfg.tapsmofrq = 5; >>> > >>> > cfg.foilim = [0 100]; >>> > >>> > cfg.taper = 'dpss'; >>> > >>> > % find the index for the c200 condition >>> > >>> > pre_c200_idx = find(data5.trialinfo == 201); >>> > >>> > cfg.trials = pre_c200_idx; >>> > >>> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > post_c200_idx = find(data5.trialinfo == 200); >>> > >>> > cfg.trials = post_c200_idx; >>> > >>> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.keeptrials = 'no'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.removemean = 'yes'; >>> > >>> > cfg.method = 'coh'; >>> > >>> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_pre_c200); >>> > >>> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_post_c200); >>> > >>> > end >>> > >>> > >>> > >>> > >> load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat >> '); >>> > >>> > cfg_neighb.method = 'template'; >>> > >>> > cfg_neighb.layout = lay; >>> > >>> > cfg_neighb.channel = 'all'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, >>> > sub_HLF_pre_c200coh{1}); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.channelcmb = {cfg.channel, cfg.channel}; >>> > >>> > cfg.latency = 'all'; >>> > >>> > cfg.avgovertime = 'no'; >>> > >>> > cfg.avgoverchan = 'no'; >>> > >>> > cfg.parameter = 'cohspctrm'; >>> > >>> > cfg.method = 'montecarlo'; >>> > >>> > cfg.statistic = 'depsamplesT'; >>> > >>> > cfg.correctm = 'cluster'; >>> > >>> > cfg.tail = 0; >>> > >>> > % cfg.clustertail = 0; >>> > >>> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >>> > frequency >>> > bands. >>> > >>> > cfg.numrandomization = 10000; >>> > >>> > cfg.ivar = 2; >>> > >>> > cfg.uvar = 1; >>> > >>> > >>> > >>> > % design matrices >>> > >>> > clear design; >>> > >>> > design(1,:) = [1:5, 1:5]; >>> > >>> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >>> > >>> > cfg.design = design; >>> > >>> > % for theta band >>> > >>> > cfg.avgoverfreq = 'yes'; >>> > >>> > cfg.frequency = [4 8]; % I also performed the statistics for delta >>> > (2-4), >>> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >>> > (30-40), >>> > and gamma (40-100). >>> > >>> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >>> > sub_HLF_post_c200coh{:}, >>> > sub_HLF_pre_c200coh{:}); >>> > >>> > >>> > >>> > When I tried to plot the results, I used this code: >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.layout = 'lay'; >>> > >>> > cfg.zlim = [-1 1]; >>> > >>> > cfg.alpha = 0.05; >>> > >>> > cfg.refchannel = 'all'; >>> > >>> > ft_clusterplot(cfg, diffc200_theta_stat); >>> > >>> > However, I was not sure how I could plot the results. I get an error >>> > message >>> > from Fieldtrip when using ft_clusterplot: >>> > >>> > Error using topoplot_common (line 366) >>> > >>> > no reference channel is specified >>> > >>> > Error in ft_topoplotTFR (line 192) >>> > >>> > [cfg] = topoplot_common(cfg, varargin{:}); >>> > >>> > Error in ft_clusterplot (line 372) >>> > >>> > ft_topoplotTFR(cfgtopo, stat); >>> > >>> > >>> > >>> > According to your paper in 2007, the topoplot of the results were >>> > masked by >>> > the spatio-spectral pattern of the significant clusters. I don't >>> > know how to >>> > do this, and I would really appreciate if you can show me how to >>> > make such a >>> > plot. >>> > >>> > Thank you very much. >>> > >>> > Kind regards, >>> > >>> > Hweeling >>> > >>> > >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 280/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 2 >>> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >>> > From: KatrinH Heimann >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Joseph, thanks so much, I really appreciate your help. I was >>> > also >>> > wandering, if maybe there is another bug in my code. >>> > Our nets are 128 channels, Hydrocel, but as a colleague of me >>> > adviced me to >>> > do so, I also tried the 129 layout. >>> > My code you find below (without selection of bad channels etc.) >>> > If you need also the data of two subjects to have a look, let me >>> > know!!! >>> > Best and thanks really! >>> > Katrin >>> > >>> > >>> > subject=input('Which subject do you want to analyse? ','s'); >>> > >>> > name = strcat(subject,'.raw'); >>> > >>> > subjectnumber=input('Which is the subjectnumber?', 's'); >>> > >>> > sb=subjectnumber >>> > >>> > %subjectnumber = strcat(subjectnumber, '.txt') >>> > >>> > %% >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.dataset = name; >>> > >>> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> > >>> > cfg.trialdef.eventtype = 'trigger'; >>> > >>> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> > trigger >>> > >>> > cfg.trialdef.prestim = 0.234; % in seconds >>> > >>> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> > observation, but maybe we need less) >>> > >>> > cfg = ft_definetrial(cfg); >>> > >>> > >>> > cfg.trl([1:7],:) = []; >>> > >>> > >>> > %change timeline according to constant offset of 16 ms = 8 samples >>> > (because >>> > recorded with 500 hz)in >>> > >>> > %structure trial >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)-8 >>> > >>> > >>> > %change timeline to make the cut the zeropoint >>> > >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> > >>> > >>> > >>> > %% preprocess data >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.detrend = 'yes'; >>> > >>> > cfg.preproc.demean = 'yes'; >>> > >>> > cfg.preproc.baselinewindow = [-2.1 -2.0] >>> > >>> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> > filtered >>> > >>> > %(0.1-45) and bad channels have to be replaced!!!! >>> > >>> > %cfg.preproc.bpfreq = [6 32]; >>> > >>> > % >>> > >>> > % >>> > >>> > obs_data = ft_preprocessing(cfg); >>> > >>> > % >>> > >>> > save (strcat(sb,'obs_data') , 'obs_data') >>> > >>> > >>> > %% determining channel neighbours (necessary for Artifact detection) >>> > >>> > cfg = []; >>> > >>> > cfg.channel = obs_data.label; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.feedback = 'yes'; >>> > >>> > lay = ft_prepare_layout(cfg); >>> > >>> > >>> > >>> > cfg_neighb = []; >>> > >>> > cfg_neighb.feedback = 'yes'; >>> > >>> > >>> > cfg_neighb.method = 'triangulation'; >>> > >>> > cfg_neighb.layout = 'GSN128.sfp'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > obs_data.elec = ft_read_sens('GSN128.sfp'); >>> > >>> > >>> > %% Artifacts - to detect bad channels - is not saved!!! >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs_data_try = ft_rejectvisual(cfg, obs_data); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_try = ft_rejectartifact (cfg,obs_data); >>> > >>> > >>> > >>> > %% Preparing neighbours for channel repair - but bad channel info >>> > in!!! >>> > >>> > >>> > % cfg_neighb = []; >>> > >>> > % cfg_neighb.feedback = 'yes'; >>> > >>> > % cfg_neighb.method = 'triangulation'; >>> > >>> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> > >>> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > % Interpolate and put into new data structure >>> > >>> > cfg = []; >>> > >>> > cfg.badchannel = {}; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.method = 'nearest'; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> > >>> > >>> > % Check reconstruction >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > % dat1=obs_data; >>> > >>> > % dat2=obs_data_channelrepaired; >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> > >>> > % y=dat2.trial{1}(62,:); >>> > >>> > % plot(x);hold on;plot(y,'r'); >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(72,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(75,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > %% artifact rejection/trial inspection - throw out electrode jumps >>> > etc. >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> > according to >>> > channels interpolated %% 128-number of interp. channels) >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > comp = ft_componentanalysis(cfg,obs_data_clean1); >>> > >>> > save (strcat(sb,'comp_all') , 'comp') >>> > >>> > >>> > %% >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'component'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='some'; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > ft_databrowser(cfg,comp); >>> > >>> > >>> > %% poweranalysis components >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'pow'; >>> > >>> > cfg.channel = 'all';%compute the power spectrum in all ICs >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.taper = 'hanning'; >>> > >>> > cfg.foi = 0:0.2:50; >>> > >>> > obs_freq = ft_freqanalysis(cfg, comp); >>> > >>> > >>> > %And you can plot the spectra: >>> > >>> > >>> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> > >>> > nsubplots = 16; >>> > >>> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> > decimals, type >>> > doc subplot >>> > >>> > >>> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> > >>> > tot = Nfigs*nsubplots; >>> > >>> > >>> > rptvect = 1:size(comp.topo,1); >>> > >>> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> > >>> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> > >>> > >>> > for r=1:size(rptvect,1); >>> > >>> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> > 1]);%full >>> > screen >>> > >>> > k=0; >>> > >>> > for j=1:size(rptvect,2); >>> > >>> > if~(rptvect(r,j)==0); >>> > >>> > k=k+1; >>> > >>> > cfg=[]; >>> > >>> > cfg.channel = rptvect(r,j); >>> > >>> > cfg.ylim =[0 500] >>> > >>> > cfg.xlim =[0 50] >>> > >>> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> > >>> > end >>> > >>> > end >>> > >>> > end >>> > >>> > >>> > %For the IC topos you'll follow the same logic as above but with: >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [1:20]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [21:40]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [41:60]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [61:80]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% Seperate observation conditions >>> > >>> > >>> > name1= strcat(num2str(sb),'_90.xls'); >>> > >>> > list1=xlsread (name1) >>> > >>> > >>> > >>> > >>> > >>> > name2= strcat(num2str(sb),'_180.xls'); >>> > >>> > list2=xlsread (name2) >>> > >>> > >>> > >>> > % >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list1] >>> > >>> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list2] >>> > >>> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > %%PIPELINE FOR obs90 >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128; >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > >>> > comp_1 = ft_componentanalysis(cfg, obs90_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> > obs90_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts - final detection >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs90_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> > >>> > >>> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> > >>> > >>> > %% plot it >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP) >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% PIPELINE FOR obs180 >>> > >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > comp_2 = ft_componentanalysis(cfg, obs180_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> > obs180_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts final 180 >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs180_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> > >>> > >>> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> > >>> > >>> > %% plot 180 ERP >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs180_data_ERP) >>> > >>> > >>> > %% plot both ERPs >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > cfg.showlabels = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> > >>> > >>> > %% plot difference wave >>> > >>> > >>> > difference = obs180_data_ERP; % copy one of the >>> > structures >>> > >>> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >>> > the >>> > difference ERP >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, difference) >>> > >>> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> > >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI >>> >> data. A couple things. First of all, exactly which net do you use? >>> >> If >>> >> they are 129-channel, there is still the question of whether they >>> >> are the >>> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >>> >> cause an >>> >> error like this. Could you send me the file you are trying to >>> >> process and >>> >> the script you are using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >>> >> diezmartini at gmail.com> wrote: >>> >> >>> >> Which nets do you use? I use EGI. I tried both the ones you mention >>> >> and >>> >> they didn't work. It was hard to find that exact one online but it >>> >> was the >>> >> only file that actually worked. >>> >> >>> >> >>> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >> >>> >> wrote: >>> >> >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. >>> >>> Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one >>> >>> >>> >>>> I use >>> >>>> >>> >>>> >>> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>> >>>> katrinheimann at gmail.com> wrote: >>> >>>> >>> >>>>> Dear all, my problems seem neverending. This time however i >>> >>>>> really need >>> >>>>> help. >>> >>>>> I implemented a pipeline for ERPs. All works now, >>> >>>>> trialdefinition, >>> >>>>> preprocessing, channelreplacement, ica, componentrejection, >>> >>>>> final >>> >>>>> artifactdetection, timelock of the single subject data. However, >>> >>>>> when I >>> >>>>> wanna compute the grandaverage of the single subjects I get the >>> >>>>> following >>> >>>>> error message: >>> >>>>> >>> >>>>> computing average of avg over 19 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 3 MB >>> >>>>> computing average of avg over 2 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>>>> additional >>> >>>>> allocation of an estimated 0 MB >>> >>>>> >>> >>>>> Furthermore in the plot of the significant clusters, the >>> >>>>> channelnames >>> >>>>> are mixed up (do not correspond to my net) >>> >>>>> >>> >>>>> >>> >>>>> I guess that there is a problem with the layout I use. >>> >>>>> Here the code that I use >>> >>>>> >>> >>>>> %For generating the layout (also in the single subjects): >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = obs_data.label; >>> >>>>> >>> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>>>> >>> >>>>> cfg.feedback = 'yes'; >>> >>>>> >>> >>>>> lay = ft_prepare_layout(cfg); >>> >>>>> >>> >>>>> >>> >>>>> cfg_neighb = []; >>> >>>>> >>> >>>>> cfg_neighb.feedback = 'yes'; >>> >>>>> >>> >>>>> cfg_neighb.method = 'triangulation'; >>> >>>>> >>> >>>>> cfg_neighb.layout = lay; >>> >>>>> >>> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>>>> >>> >>>>> >>> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>>>> >>> >>>>> >>> >>>>> %For computing the grand average >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = 'all'; >>> >>>>> >>> >>>>> cfg.latency = 'all'; >>> >>>>> >>> >>>>> cfg.parameter = 'avg'; >>> >>>>> >>> >>>>> cfg.keepindividual = 'no' >>> >>>>> >>> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>>>> >>> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>>>> >>> >>>>> % "{:}" means to use data from all elements of the variable >>> >>>>> >>> >>>>> >>> >>>>> For plotting the significant clusters >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.style = 'blank'; >>> >>>>> >>> >>>>> cfg.layout = lay; >>> >>>>> >>> >>>>> cfg.channellabels = 'yes'; >>> >>>>> >>> >>>>> cfg.highlight = 'labels'; >>> >>>>> >>> >>>>> cfg.highlightchannel = find(stat.mask); >>> >>>>> >>> >>>>> cfg.comment = 'no'; >>> >>>>> >>> >>>>> figure; ft_topoplotER(cfg, GA_90) >>> >>>>> >>> >>>>> title('Nonparametric: significant with cluster multiple >>> >>>>> comparison >>> >>>>> correction') >>> >>>>> >>> >>>>> >>> >>>>> Do you have ANY idea to this? I am really completely >>> >>>>> helpless.... >>> >>>>> >>> >>>>> thanks and best >>> >>>>> >>> >>>>> Katrin >>> >>>>> >>> >>>>> _______________________________________________ >>> >>>>> 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 >>> >>> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing list >>> >> fieldtrip at donders.ru.nl >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> >> >>> >> >> ---------------------------------------------------------------------------- >> ---- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.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: >>> > >> > b61/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 3 >>> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >>> > From: Joseph Dien >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > yes, please do send me the data. >>> > >>> > Thanks! >>> > >>> > Joe >>> > >>> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >>> > wrote: >>> > >>> >> Dear Joseph, thanks so much, I really appreciate your help. I was >>> >> also wandering, if maybe there is another bug in my code. >>> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >>> >> adviced me to do so, I also tried the 129 layout. >>> >> My code you find below (without selection of bad channels etc.) >>> >> If you need also the data of two subjects to have a look, let me >>> >> know!!! >>> >> Best and thanks really! >>> >> Katrin >>> >> >>> >> >>> >> >>> >> subject=input('Which subject do you want to analyse? ','s'); >>> >> >>> >> name = strcat(subject,'.raw'); >>> >> >>> >> subjectnumber=input('Which is the subjectnumber?', 's'); >>> >> >>> >> sb=subjectnumber >>> >> >>> >> %subjectnumber = strcat(subjectnumber, '.txt') >>> >> >>> >> %% >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.dataset = name; >>> >> >>> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> >> >>> >> cfg.trialdef.eventtype = 'trigger'; >>> >> >>> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> >> trigger >>> >> >>> >> cfg.trialdef.prestim = 0.234; % in seconds >>> >> >>> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> >> observation, but maybe we need less) >>> >> >>> >> cfg = ft_definetrial(cfg); >>> >> >>> >> >>> >> >>> >> cfg.trl([1:7],:) = []; >>> >> >>> >> >>> >> >>> >> %change timeline according to constant offset of 16 ms = 8 samples >>> >> (because recorded with 500 hz)in >>> >> >>> >> %structure trial >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >>> >> >>> >> >>> >> >>> >> %change timeline to make the cut the zeropoint >>> >> >>> >> >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% preprocess data >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.detrend = 'yes'; >>> >> >>> >> cfg.preproc.demean = 'yes'; >>> >> >>> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >>> >> >>> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> >> filtered >>> >> >>> >> %(0.1-45) and bad channels have to be replaced!!!! >>> >> >>> >> %cfg.preproc.bpfreq = [6 32]; >>> >> >>> >> % >>> >> >>> >> % >>> >> >>> >> obs_data = ft_preprocessing(cfg); >>> >> >>> >> % >>> >> >>> >> save (strcat(sb,'obs_data') , 'obs_data') >>> >> >>> >> >>> >> >>> >> %% determining channel neighbours (necessary for Artifact >>> >> detection) >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = obs_data.label; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.feedback = 'yes'; >>> >> >>> >> lay = ft_prepare_layout(cfg); >>> >> >>> >> >>> >> cfg_neighb = []; >>> >> >>> >> cfg_neighb.feedback = 'yes'; >>> >> >>> >> >>> >> >>> >> cfg_neighb.method = 'triangulation'; >>> >> >>> >> cfg_neighb.layout = 'GSN128.sfp'; >>> >> >>> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >>> >> >>> >> >>> >> >>> >> %% Artifacts - to detect bad channels - is not saved!!! >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Preparing neighbours for channel repair - but bad channel info >>> >> in!!! >>> >> >>> >> >>> >> >>> >> % cfg_neighb = []; >>> >> >>> >> % cfg_neighb.feedback = 'yes'; >>> >> >>> >> % cfg_neighb.method = 'triangulation'; >>> >> >>> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> >> >>> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> % Interpolate and put into new data structure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.badchannel = {}; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.method = 'nearest'; >>> >> >>> >> cfg.neighbours = neighbours; >>> >> >>> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> >> >>> >> >>> >> >>> >> % Check reconstruction >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> % dat1=obs_data; >>> >> >>> >> % dat2=obs_data_channelrepaired; >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> >> >>> >> % y=dat2.trial{1}(62,:); >>> >> >>> >> % plot(x);hold on;plot(y,'r'); >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(72,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(75,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> %% artifact rejection/trial inspection - throw out electrode jumps >>> >> etc. >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> >> according to channels interpolated %% 128-number of interp. >>> >> channels) >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = {'all'}; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >>> >> >>> >> save (strcat(sb,'comp_all') , 'comp') >>> >> >>> >> >>> >> >>> >> %% >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'component'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='some'; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> ft_databrowser(cfg,comp); >>> >> >>> >> >>> >> >>> >> %% poweranalysis components >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.output = 'pow'; >>> >> >>> >> cfg.channel = 'all';%compute the power spectrum in all ICs >>> >> >>> >> cfg.method = 'mtmfft'; >>> >> >>> >> cfg.taper = 'hanning'; >>> >> >>> >> cfg.foi = 0:0.2:50; >>> >> >>> >> obs_freq = ft_freqanalysis(cfg, comp); >>> >> >>> >> >>> >> >>> >> %And you can plot the spectra: >>> >> >>> >> >>> >> >>> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> >> >>> >> nsubplots = 16; >>> >> >>> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> >> decimals, type doc subplot >>> >> >>> >> >>> >> >>> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> >> >>> >> tot = Nfigs*nsubplots; >>> >> >>> >> >>> >> >>> >> rptvect = 1:size(comp.topo,1); >>> >> >>> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> >> >>> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> >> >>> >> >>> >> >>> >> for r=1:size(rptvect,1); >>> >> >>> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> >> 1]);%full screen >>> >> >>> >> k=0; >>> >> >>> >> for j=1:size(rptvect,2); >>> >> >>> >> if~(rptvect(r,j)==0); >>> >> >>> >> k=k+1; >>> >> >>> >> cfg=[]; >>> >> >>> >> cfg.channel = rptvect(r,j); >>> >> >>> >> cfg.ylim =[0 500] >>> >> >>> >> cfg.xlim =[0 50] >>> >> >>> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> >>> >> >>> >> %For the IC topos you'll follow the same logic as above but with: >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [1:20]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [21:40]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [41:60]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [61:80]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Seperate observation conditions >>> >> >>> >> >>> >> >>> >> name1= strcat(num2str(sb),'_90.xls'); >>> >> >>> >> list1=xlsread (name1) >>> >> >>> >> >>> >> >>> >> name2= strcat(num2str(sb),'_180.xls'); >>> >> >>> >> list2=xlsread (name2) >>> >> >>> >> >>> >> % >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list1] >>> >> >>> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list2] >>> >> >>> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> %%PIPELINE FOR obs90 >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128; >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> >>> >> >>> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> >> obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts - final detection >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot it >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% PIPELINE FOR obs180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> >> obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts final 180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot 180 ERP >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot both ERPs >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> cfg.showlabels = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot difference wave >>> >> >>> >> >>> >> >>> >> difference = obs180_data_ERP; % copy one of >>> >> the structures >>> >> >>> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >>> >> compute the difference ERP >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, difference) >>> >> >>> >> >>> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI data. A couple things. First of all, exactly which net do >>> >> you use? If they are 129-channel, there is still the question of >>> >> whether they are the Hydrocel or the older geodesic nets. >>> >> Regardless, that shouldn't cause an error like this. Could you >>> >> send me the file you are trying to process and the script you are >>> >> using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >>> >> wrote: >>> >> >>> >>> Which nets do you use? I use EGI. I tried both the ones you >>> >>> mention and they didn't work. It was hard to find that exact one >>> >>> online but it was the only file that actually worked. >>> >>> >>> >>> >>> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one I use >>> >>> >>> >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear all, my problems seem neverending. This time however i really >>> >>> need help. >>> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> >>> preprocessing, channelreplacement, ica, componentrejection, final >>> >>> artifactdetection, timelock of the single subject data. However, >>> >>> when I wanna compute the grandaverage of the single subjects I get >>> >>> the following error message: >>> >>> >>> >>> computing average of avg over 19 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 3 MB >>> >>> computing average of avg over 2 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 0 MB >>> >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> >>> >>> Furthermore in the plot of the significant clusters, the >>> >>> channelnames are mixed up (do not correspond to my net) >>> >>> >>> >>> >>> >>> I guess that there is a problem with the layout I use. >>> >>> Here the code that I use >>> >>> >>> >>> %For generating the layout (also in the single subjects): >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = obs_data.label; >>> >>> >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> >>> >>> cfg.feedback = 'yes'; >>> >>> >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> >>> >>> >>> cfg_neighb = []; >>> >>> >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> >>> >>> cfg_neighb.layout = lay; >>> >>> >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> >>> >>> >>> >>> >>> %For computing the grand average >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = 'all'; >>> >>> >>> >>> cfg.latency = 'all'; >>> >>> >>> >>> cfg.parameter = 'avg'; >>> >>> >>> >>> cfg.keepindividual = 'no' >>> >>> >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> >>> >>> >>> For plotting the significant clusters >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.style = 'blank'; >>> >>> >>> >>> cfg.layout = lay; >>> >>> >>> >>> cfg.channellabels = 'yes'; >>> >>> >>> >>> cfg.highlight = 'labels'; >>> >>> >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> >>> >>> cfg.comment = 'no'; >>> >>> >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> >>> correction') >>> >>> >>> >>> >>> >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> >>> >>> thanks and best >>> >>> >>> >>> Katrin >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> 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 >>> >>> >>> >>> _______________________________________________ >>> >>> fieldtrip mailing list >>> >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >> ---------------------------------------------------------------------------- >> ---- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.com >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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 >>> > >>> > >> ---------------------------------------------------------------------------- >> ---- >>> > >>> > Joseph Dien, PhD >>> > Research Associate >>> > Cognitive Neurology >>> > The Johns Hopkins University School of Medicine >>> > >>> > Lab E-mail: jdien1 at jhmi.edu >>> > Private E-mail: jdien07 at mac.com >>> > Office Phone: 410-614-3115 >>> > Cell Phone: 202-297-8117 >>> > Fax: 410-955-0188 >>> > http://joedien.com >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > ad2/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 4 >>> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >>> > From: "Caspar, Emilie" >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >>> > bad >>> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >>> > Content-Type: text/plain; charset="iso-8859-1" >>> > >>> > Hi Ashley, >>> > >>> > Maybe the mistake is you did not integrate in your script the >>> > command to save the rejection. Normally, with the following command, >>> > you will see in the Matlab Window that artifacts are correctly >>> > rejected after the "quit" button. >>> > >>> > clean_data = ft_rejectvisual(cfg, interpoldata); >>> > cfg.artfctdef.reject = 'complete'; >>> > cfg.artfctdef.feedback = 'yes'; >>> > cleandata = ft_rejectartifact(cfg,clean_data); >>> > >>> > Emilie >>> > >>> > >>> > >>> > >>> > >>> > Le 3 sept. 2014 ? 11:58, Ashley Greene >>> > > a ?crit : >>> > >>> > Hello, >>> > >>> > I have used the rejectvisual function in attempt to remove bad >>> > trials, but after marking them and pressing the quit button, >>> > although the command window states that the selected trials have >>> > been removed, there is no obvious change in the data; all of the >>> > trials are still intact. Have I overlooked something? >>> > >>> > Thanks, >>> > >>> > Ashley >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 985/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 5 >>> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >>> > From: Patricia Wollstadt >>> > To: fieldtrip at science.ru.nl >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: <540EEF94.9080601 at gmx.de> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > Hello Max, >>> > >>> > I added a few comments to the questions regarding individual >>> > parameters >>> > below. To address the general problem of TRENTOOL telling you, that >>> > there are not enough sample points in your data: From what I can see >>> > in >>> > your script, you probably don't have enough data points in each time >>> > series to robustly estimate TE. You analyze 800 ms of data sampled >>> > at >>> > 300 Hz, which gives you 240 samples per time series. Can you maybe >>> > avoid >>> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >>> > you >>> > analyze a longer time window of interest? >>> > Note that you also 'lose' data to embedding and the interaction >>> > delay: >>> > The first point that can be used for TE estimation is at max. >>> > embedding >>> > length + max. interaction delay in samples. For example: max. >>> > embedding >>> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >>> > max >>> > interaction delay of 30 ms = 9 samples. In this example, you would >>> > be >>> > left with 240 - 29 samples for TE estimation per trial. There is >>> > also >>> > the possibility to estimate time resolved TE/TE for shorter time >>> > windows >>> > of interest (see section 4.4 in the manual); however, this method >>> > requires the use of a GPU for TE estimation. >>> > >>> > I would further recommend to use the new pipeline for group >>> > statistics >>> > described in the manual in section 4.5 (the function >>> > 'TEgroup_calculate' >>> > is deprecated). The new pipeline allows you to reconstruct the >>> > interaction delay and uses the following functions (see also >>> > comments in >>> > the script): >>> > >>> > TEgroup_prepare -> prepares all data sets (all subjects/all >>> > conditions) for group analysis (this means finding common embedding >>> > parameters such that estimates are not biased between groups) >>> > InteractionDelayReconstruction_calculate -> estimates TE for >>> > individual data sets and all assumed interaction delays u >>> > InteractionDelayReconstruction_analyze -> reconstructs the >>> > interaction delay by selecting the u that maximizes TE for each >>> > channel >>> > TEgroup_stats -> calculate group statistics using a permutation test >>> > >>> > I can send you an example script for group TE analysis using this >>> > pipeline to get you started. I hope this helps you to get the group >>> > analysis running. Just write again if you're having trouble setting >>> > up >>> > the pipeline or something is not clear about the parameters/my >>> > comments. >>> > >>> > Best, >>> > Patricia >>> > >>> > >>> > >>> > >>> > On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not >>> >> 100% sure if it is appropriate to ask questions about it here, but >>> >> to >>> >> the best of my knowledge they do not have a mailing list and I saw >>> >> a >>> >> few trentool questions in the archives, so I'm going to assume it's >>> >> ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present >>> >> in the pipeline. Sorry in advance for the long post! Any help would >>> >> be >>> >> greatly appreciated as I'm a bit over my head on this but I think >>> >> I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data >>> >> that was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi is >>> >> in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within the toi, but beyond that are there any benefits to it being >>> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >>> >> the >>> >> toi is in seconds. The prediction time is the assumed interaction >>> >> delay between your two sources and should fit within your toi. In >>> >> general it is preferable to use the method for interaction delay >>> >> reconstruction for TE estimation, because it allows you to >>> >> reconstruct >>> >> the actual delay between your source and target times series. A >>> >> non-optimal u/interaction delay may cause an underestimation of TE, >>> >> so >>> >> it is recommended to use the pipeline for interaction delay >>> >> reconstruction whenever estimating TE for unknown delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, so it is best to limit the u range to values that are >>> >> physiologically plausible. >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the >>> >> sample rate and filters are used to determine the actthrvalue, but >>> >> I >>> >> don't actually know the calculation. 7.5 was a rough guess just to >>> >> test the pipeline. I'm also uncertain of what minnrtrials should >>> >> be.* >>> >> PW: You can set the actthrvalue based on the filtering you did >>> >> prior >>> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >>> >> shouldn't find an ACT higher than 30 samples, because you filtered >>> >> out >>> >> any components of the signal slower than 10 Hz/30 samples (given >>> >> your >>> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >>> >> would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> * >>> >> * >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm >>> >> yet to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* >>> >> PW: The Ragwitz criterion tries to find optimal embedding >>> >> parameters >>> >> dim and tau for the data. To do that, the method iteratively takes >>> >> all >>> >> possible combinations of dim and tau values that are provided in >>> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >>> >> these >>> >> combinations embed the data. To test an embedding, the method >>> >> builds >>> >> the embedding vectors from the data; it then tests for each point >>> >> how >>> >> well the next point in time can be predicted from the reference >>> >> point's nearest neighbours. So for each embedded point, the method >>> >> searches for the nearest neighbours and calculates the average of >>> >> those nearest neighbours. The difference between the >>> >> averaged/predicted point and the actual next point is the error of >>> >> the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested >>> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together with 'ragtausteps' specifies the tau values to be tested >>> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >>> >> that >>> >> the values here are factors that are later multiplied with the ACT >>> >> to >>> >> obtain the actual tau. 'repPred' is the number of points that will >>> >> be >>> >> used for the local prediction, i.e. the Ragwitz criterion will test >>> >> the local prediction and calculate the error for the first 100 >>> >> points >>> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >>> >> below >>> >> specify the type of neighbour search conducted by the Ragwitz >>> >> criterion: 'flagNei' tells the method to either conduct a kNN or >>> >> range >>> >> search; 'sizeNei' specifies the number of neighbours or the radius >>> >> to >>> >> be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> * >>> >> * >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> * >>> >> * >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.*TRENTOOL seems to handle data output very differently >>> >> from >>> >> fieldtrip and I've had trouble thinking through the most logical >>> >> way >>> >> to handle the data so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> * >>> >> * >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition >>> >> x subject .mat file, which as I said before is collectively the >>> >> same >>> >> as the 3 x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> * >>> >> * >>> >> *At this step I get the following error: >>> >> >>> >> Error using transferentropy (line 337) >>> >> \nTRENTOOL ERROR: not enough data points left after embedding >>> >> >>> >> Error in TEgroup_calculate (line 133) >>> >> [TEresult] = transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate >>> >> is a pipeline issue* (I noticed the example pipeline in trentool, >>> >> the >>> >> manual, and published methods articles all seem to have slightly or >>> >> significantly different pipeline compositions), *or if the error >>> >> is* >>> >> due to ACT, ragwitz optimization, or some other faulty >>> >> parameterization *on my part due to a lack of understanding of how >>> >> transfer entropy works on a more theoretical/mathematical level*. >>> >> If >>> >> the latter is the case, is there any relatively straightforward way >>> >> to >>> >> conceptualize this, or is this something where I'm just going to >>> >> have >>> >> to keep reading and rereading until it eventually makes sense? I've >>> >> already done quite a bit of that and it hasn't pierced my thick >>> >> skull >>> >> yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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: >>> > >> > 97f/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 6 >>> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >>> > From: Holger Krause >>> > To: FieldTrip discussion list >>> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >>> > days ago >>> > Message-ID: >>> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >>> > Content-Type: text/plain; charset="us-ascii" >>> > >>> > Dear developers, >>> > >>> > Could you please check the process for creation/publication of >>> > zip-files on >>> > the FTP server? The latest file I can find there is >>> > fieldtrip-20140906.zip. >>> > >>> > Thanks in advance, >>> > >>> > Holger >>> > >>> > >>> > ------------------------------ >>> > >>> > Message: 7 >>> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >>> > From: Max Cantor >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > This is immensely helpful, thank you. I was very confused about why >>> > some >>> > versions of the pipeline I saw were using group calculate and others >>> > were >>> > using interaction delay reconstruction and what that meant, and I >>> > think I >>> > have a more clear idea of what the different steps of the pipeline >>> > are >>> > doing. There are still a few things I'm a bit confused about though >>> > in >>> > terms of the pipeline. For instance, whether or not I need to do >>> > TEprepare >>> > before group prepare, and if I need to do graph analysis (which I'm >>> > not >>> > sure I fully understand but also haven't looked deeply into) before >>> > group >>> > stats. >>> > >>> > If you don't mind me taking you up on your offer, I think seeing >>> > your >>> > example script might help clarify some of these issues. >>> > >>> > Thank you! >>> > >>> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >>> > Patricia.Wollstadt at gmx.de> wrote: >>> > >>> >> Hello Max, >>> >> >>> >> I added a few comments to the questions regarding individual >>> >> parameters >>> >> below. To address the general problem of TRENTOOL telling you, that >>> >> there >>> >> are not enough sample points in your data: From what I can see in >>> >> your >>> >> script, you probably don't have enough data points in each time >>> >> series to >>> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >>> >> which >>> >> gives you 240 samples per time series. Can you maybe avoid >>> >> downsampling to >>> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >>> >> longer time >>> >> window of interest? >>> >> Note that you also 'lose' data to embedding and the interaction >>> >> delay: The >>> >> first point that can be used for TE estimation is at max. embedding >>> >> length >>> >> + max. interaction delay in samples. For example: max. embedding >>> >> length = >>> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >>> >> interaction >>> >> delay of 30 ms = 9 samples. In this example, you would be left with >>> >> 240 - >>> >> 29 samples for TE estimation per trial. There is also the >>> >> possibility to >>> >> estimate time resolved TE/TE for shorter time windows of interest >>> >> (see >>> >> section 4.4 in the manual); however, this method requires the use >>> >> of a GPU >>> >> for TE estimation. >>> >> >>> >> I would further recommend to use the new pipeline for group >>> >> statistics >>> >> described in the manual in section 4.5 (the function >>> >> 'TEgroup_calculate' is >>> >> deprecated). The new pipeline allows you to reconstruct the >>> >> interaction >>> >> delay and uses the following functions (see also comments in the >>> >> script): >>> >> >>> >> TEgroup_prepare -> prepares all data sets (all subjects/all >>> >> conditions) >>> >> for group analysis (this means finding common embedding parameters >>> >> such >>> >> that estimates are not biased between groups) >>> >> InteractionDelayReconstruction_calculate -> estimates TE for >>> >> individual data sets and all assumed interaction delays u >>> >> InteractionDelayReconstruction_analyze -> reconstructs the >>> >> interaction delay by selecting the u that maximizes TE for each >>> >> channel >>> >> TEgroup_stats -> calculate group statistics using a permutation >>> >> test >>> >> >>> >> I can send you an example script for group TE analysis using this >>> >> pipeline >>> >> to get you started. I hope this helps you to get the group analysis >>> >> running. Just write again if you're having trouble setting up the >>> >> pipeline >>> >> or something is not clear about the parameters/my comments. >>> >> >>> >> Best, >>> >> Patricia >>> >> >>> >> >>> >> >>> >> >>> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not 100% >>> >> sure if it is appropriate to ask questions about it here, but to >>> >> the best >>> >> of my knowledge they do not have a mailing list and I saw a few >>> >> trentool >>> >> questions in the archives, so I'm going to assume it's ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present in >>> >> the pipeline. Sorry in advance for the long post! Any help would be >>> >> greatly >>> >> appreciated as I'm a bit over my head on this but I think I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data that >>> >> was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi >>> >> is in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within >>> >> the toi, but beyond that are there any benefits to it being earlier >>> >> or >>> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >>> >> in >>> >> seconds. The prediction time is the assumed interaction delay >>> >> between your >>> >> two sources and should fit within your toi. In general it is >>> >> preferable to >>> >> use the method for interaction delay reconstruction for TE >>> >> estimation, >>> >> because it allows you to reconstruct the actual delay between your >>> >> source >>> >> and target times series. A non-optimal u/interaction delay may >>> >> cause an >>> >> underestimation of TE, so it is recommended to use the pipeline for >>> >> interaction delay reconstruction whenever estimating TE for unknown >>> >> delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, >>> >> so it is best to limit the u range to values that are >>> >> physiologically >>> >> plausible. >>> >> >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the sample >>> >> rate and filters are used to determine the actthrvalue, but I don't >>> >> actually know the calculation. 7.5 was a rough guess just to test >>> >> the >>> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >>> >> You can >>> >> set the actthrvalue based on the filtering you did prior to TE >>> >> analysis. If >>> >> you for example highpass filtered at 10 Hz, you shouldn't find an >>> >> ACT >>> >> higher than 30 samples, because you filtered out any components of >>> >> the >>> >> signal slower than 10 Hz/30 samples (given your sampling frequency >>> >> of 300 >>> >> Hz). So in this scenario the actthrvalue would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm yet >>> >> to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* PW: >>> >> The Ragwitz criterion tries to find optimal embedding parameters >>> >> dim and >>> >> tau for the data. To do that, the method iteratively takes all >>> >> possible >>> >> combinations of dim and tau values that are provided in cfgP.ragdim >>> >> and >>> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >>> >> embed >>> >> the data. To test an embedding, the method builds the embedding >>> >> vectors >>> >> from the data; it then tests for each point how well the next point >>> >> in time >>> >> can be predicted from the reference point's nearest neighbours. So >>> >> for each >>> >> embedded point, the method searches for the nearest neighbours and >>> >> calculates the average of those nearest neighbours. The difference >>> >> between >>> >> the averaged/predicted point and the actual next point is the error >>> >> of the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested by >>> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together >>> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >>> >> will >>> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >>> >> here are >>> >> factors that are later multiplied with the ACT to obtain the actual >>> >> tau. >>> >> 'repPred' is the number of points that will be used for the local >>> >> prediction, i.e. the Ragwitz criterion will test the local >>> >> prediction and >>> >> calculate the error for the first 100 points in your time series. >>> >> The two >>> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >>> >> neighbour >>> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >>> >> method to >>> >> either conduct a kNN or range search; 'sizeNei' specifies the >>> >> number of >>> >> neighbours or the radius to be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' >>> >> data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject >>> >> virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.* >>> >> TRENTOOL seems to handle data output very differently from >>> >> fieldtrip and >>> >> I've had trouble thinking through the most logical way to handle >>> >> the data >>> >> so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition x >>> >> subject .mat file, which as I said before is collectively the same >>> >> as the 3 >>> >> x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> *At this step I get the following error: Error using >>> >> transferentropy (line >>> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >>> >> Error in >>> >> TEgroup_calculate (line 133) [TEresult] = >>> >> transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate is a >>> >> pipeline issue* (I noticed the example pipeline in trentool, the >>> >> manual, >>> >> and published methods articles all seem to have slightly or >>> >> significantly >>> >> different pipeline compositions), *or if the error is* due to ACT, >>> >> ragwitz optimization, or some other faulty parameterization *on my >>> >> part >>> >> due to a lack of understanding of how transfer entropy works on a >>> >> more >>> >> theoretical/mathematical level*. If the latter is the case, is >>> >> there any >>> >> relatively straightforward way to conceptualize this, or is this >>> >> something >>> >> where I'm just going to have to keep reading and rereading until it >>> >> eventually makes sense? I've already done quite a bit of that and >>> >> it hasn't >>> >> pierced my thick skull yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing >>> >> >> listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie >> ldtrip >>> >> >>> >> >>> >> -- >>> >> ------------------------------------------------------------ >>> >> >>> >> 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 >>> >> >>> > >>> > >>> > >>> > -- >>> > Max Cantor >>> > Lab Manager >>> > Computational Neurolinguistics Lab >>> > University of Michigan >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 024/attachment.html> >>> > >>> > ------------------------------ >>> > >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > End of fieldtrip Digest, Vol 46, Issue 3 >>> > **************************************** >>> > >>> >>> >>> >>> Barbara Schorr, MSc >>> Clinical and Biological Psychology >>> University of Ulm >>> Albert-Einstein-Allee 47 >>> 89069 Ulm >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jim Herring, MSc. >> Neuronal Oscillations Group >> Centre for Cognitive Neuroimaging >> Donders Institute for Brain, Cognition and Behaviour >> Radboud University Nijmegen >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> ------------------------------ >> >> Message: 8 >> Date: Mon, 15 Sep 2014 12:53:19 -0500 >> From: "Jing Fan" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of >> variable 'abort' >> Message-ID: <000301cfd10d$ef53cba0$cdfb62e0$@gmail.com> >> Content-Type: text/plain; charset="us-ascii" >> >> Hi Barbara and Jim, >> >> I added path your/path/to/fieldtrip/utilities and now it worked. >> Hope it helps solve the problem. >> >> Best, >> Jing >> >> -----Original Message----- >> From: fieldtrip-bounces at science.ru.nl >> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) >> Sent: Monday, September 15, 2014 5:01 AM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable >> 'abort' >> >> Dear Barbara, >> >> The error seems to be related to a bug that pops up now and then >> (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a >> corrupt installation of fieldtrip and/or the need to update fieldtrip. >> >> Could you please try downloading the most recent version of fieldtrip and >> see if the problem persists? >> >> For an example of what can be expected from this function see: Esser SK, >> Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct >> demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res >> Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. >> >> Best, >> >> Jim >> >> >> ----- Oorspronkelijk bericht ----- >>> Van: "barbara schorr" >>> Aan: fieldtrip at science.ru.nl >>> Verzonden: Woensdag 10 september 2014 14:07:14 >>> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable >> 'abort' >>> Dear fieldtripers. >>> >>> as mentioned in the subject line I would like to anaylse my timelocked >>> ERP Data with the function ft_globalmeanfield. >>> >>> I get the Error: Undefined function or variable 'abort' >>> Error in ft_globalmeanfield (line84) >>> if abort >>> >>> in the function it says: >>> >>> %the abort variable is set to true or false in ft_preamble_inti >>> if abort >>> % do not continue function execution in case the outputfile is >>> present and the user indicated to keep it >>> return >>> end >>> >>> >>> I don't understand what this means. I would really appreciate your >>> help to get this running. >>> >>> Also, what is the result when I run this function on my data? (This >>> method was proposed from a reviewer. I never used it before, so I >>> don't exactly know what it does and what the result will look like). >>> >>> Thank you very much in advance! >>> >>> Best, >>> >>> Barbara Schorr >>> >>> >>> >>> >>> Zitat von 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: Question regarding nonparametric testing for coherence >>> > differences (Eric Maris) >>> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >>> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >>> > 4. Re: ft_rejectvisual: removing trials marked as bad >>> > (Caspar, Emilie) >>> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >>> > 6. Latest FT version on ftp-server is from three days ago >>> > (Holger Krause) >>> > 7. Re: TRENTOOL pipeline help (Max Cantor) >>> > >>> > >>> > ---------------------------------------------------------------------- >>> > >>> > Message: 1 >>> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >>> > From: "Eric Maris" >>> > To: , "'FieldTrip discussion list'" >>> > >>> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >>> > for >>> > coherence differences >>> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Hwee Ling, >>> > >>> > >>> > >>> > In the paper you refer to (Maris et al, JNM, 2007), I did not >>> > perform a >>> > cluster-based permutation test at the level of the channel pairs. >>> > Instead, >>> > all coherences mentioned in the paper are coherence between a single >>> > EMG >>> > channel (2 electrodes mounted on the forearm) and all MEG >>> > electrodes. Thus, >>> > there are as many EMG-MEG coherences as there are MEG channels (275 >>> > in our >>> > lab), and the clustering of these coherences involves the same >>> > neighbourhood >>> > structure as the clustering of channel-specific statistics on power >>> > or >>> > evoked response. The analysis you propose involves clustering in a >>> > much more >>> > complex space, namely the formed by all (MEG,MEG) channel pairs >>> > (275*275=75625 pairs). In the early days of cluster-based >>> > permutation >>> > statistics, I have worked on this problem but did not pursue it >>> > because the >>> > resulting clusters are very hard to interpret. >>> > >>> > >>> > >>> > Best, >>> > >>> > >>> > >>> > Eric Maris >>> > >>> > >>> > >>> > >>> > >>> > Dear all and Prof Maris, >>> > >>> > I'm re-posting this question again, as I didn't get any replies >>> > previously. >>> > >>> > I?m interested to investigate if there are any differences in phase >>> > synchronization in resting state data at timepoint 2 versus >>> > timepoint 1. The >>> > EEG data was collected using 64 EEG channels, resting state, eyes >>> > opened and >>> > eyes closed. I?ve arbitrarily segmented the resting state data into >>> > epochs >>> > of 2s each, and the epochs with artifacts are excluded completely >>> > from >>> > further analyses. I then performed mtmfft to get the fourier >>> > representation >>> > of the data, extracted the coherence, and compared the coherence >>> > difference >>> > of timepoint 2 versus timepoint 1 of all channels paired with all >>> > other >>> > channels. >>> > >>> > I figured that if I extract the connectivity analyses without >>> > specifying the >>> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >>> > allow me to >>> > perform cluster-based statistical analyses. I get an output with >>> > ?chan_chan? >>> > dimord variable. However, I was not 100% sure that this is correct, >>> > hence, I?ve >>> > inserted my code (see below). It?ll be great if you could tell me if >>> > what I?m >>> > doing makes any sense at all. Also, I don?t know how I can plot the >>> > results >>> > to see if it make any sense at all. >>> > >>> > Also, I checked the values obtained from when I specified >>> > "cfg.channelcmb" >>> > and when I did not specify "cfg.channelcmb", I noticed that the >>> > values were >>> > somehow different. I would assume that the values to be similar, >>> > although >>> > I'm not sure why they would have differences in the values obtained >>> > from >>> > specifying "cfg.channelcmb". >>> > >>> > This is my code that I've used thus far: >>> > >>> > for sub = 1:5 >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'fourier'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.keeptrials = 'yes'; >>> > >>> > cfg.tapsmofrq = 5; >>> > >>> > cfg.foilim = [0 100]; >>> > >>> > cfg.taper = 'dpss'; >>> > >>> > % find the index for the c200 condition >>> > >>> > pre_c200_idx = find(data5.trialinfo == 201); >>> > >>> > cfg.trials = pre_c200_idx; >>> > >>> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > post_c200_idx = find(data5.trialinfo == 200); >>> > >>> > cfg.trials = post_c200_idx; >>> > >>> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.keeptrials = 'no'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.removemean = 'yes'; >>> > >>> > cfg.method = 'coh'; >>> > >>> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_pre_c200); >>> > >>> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_post_c200); >>> > >>> > end >>> > >>> > >>> > >>> > >> load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat >> '); >>> > >>> > cfg_neighb.method = 'template'; >>> > >>> > cfg_neighb.layout = lay; >>> > >>> > cfg_neighb.channel = 'all'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, >>> > sub_HLF_pre_c200coh{1}); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.channelcmb = {cfg.channel, cfg.channel}; >>> > >>> > cfg.latency = 'all'; >>> > >>> > cfg.avgovertime = 'no'; >>> > >>> > cfg.avgoverchan = 'no'; >>> > >>> > cfg.parameter = 'cohspctrm'; >>> > >>> > cfg.method = 'montecarlo'; >>> > >>> > cfg.statistic = 'depsamplesT'; >>> > >>> > cfg.correctm = 'cluster'; >>> > >>> > cfg.tail = 0; >>> > >>> > % cfg.clustertail = 0; >>> > >>> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >>> > frequency >>> > bands. >>> > >>> > cfg.numrandomization = 10000; >>> > >>> > cfg.ivar = 2; >>> > >>> > cfg.uvar = 1; >>> > >>> > >>> > >>> > % design matrices >>> > >>> > clear design; >>> > >>> > design(1,:) = [1:5, 1:5]; >>> > >>> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >>> > >>> > cfg.design = design; >>> > >>> > % for theta band >>> > >>> > cfg.avgoverfreq = 'yes'; >>> > >>> > cfg.frequency = [4 8]; % I also performed the statistics for delta >>> > (2-4), >>> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >>> > (30-40), >>> > and gamma (40-100). >>> > >>> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >>> > sub_HLF_post_c200coh{:}, >>> > sub_HLF_pre_c200coh{:}); >>> > >>> > >>> > >>> > When I tried to plot the results, I used this code: >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.layout = 'lay'; >>> > >>> > cfg.zlim = [-1 1]; >>> > >>> > cfg.alpha = 0.05; >>> > >>> > cfg.refchannel = 'all'; >>> > >>> > ft_clusterplot(cfg, diffc200_theta_stat); >>> > >>> > However, I was not sure how I could plot the results. I get an error >>> > message >>> > from Fieldtrip when using ft_clusterplot: >>> > >>> > Error using topoplot_common (line 366) >>> > >>> > no reference channel is specified >>> > >>> > Error in ft_topoplotTFR (line 192) >>> > >>> > [cfg] = topoplot_common(cfg, varargin{:}); >>> > >>> > Error in ft_clusterplot (line 372) >>> > >>> > ft_topoplotTFR(cfgtopo, stat); >>> > >>> > >>> > >>> > According to your paper in 2007, the topoplot of the results were >>> > masked by >>> > the spatio-spectral pattern of the significant clusters. I don't >>> > know how to >>> > do this, and I would really appreciate if you can show me how to >>> > make such a >>> > plot. >>> > >>> > Thank you very much. >>> > >>> > Kind regards, >>> > >>> > Hweeling >>> > >>> > >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 280/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 2 >>> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >>> > From: KatrinH Heimann >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Joseph, thanks so much, I really appreciate your help. I was >>> > also >>> > wandering, if maybe there is another bug in my code. >>> > Our nets are 128 channels, Hydrocel, but as a colleague of me >>> > adviced me to >>> > do so, I also tried the 129 layout. >>> > My code you find below (without selection of bad channels etc.) >>> > If you need also the data of two subjects to have a look, let me >>> > know!!! >>> > Best and thanks really! >>> > Katrin >>> > >>> > >>> > subject=input('Which subject do you want to analyse? ','s'); >>> > >>> > name = strcat(subject,'.raw'); >>> > >>> > subjectnumber=input('Which is the subjectnumber?', 's'); >>> > >>> > sb=subjectnumber >>> > >>> > %subjectnumber = strcat(subjectnumber, '.txt') >>> > >>> > %% >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.dataset = name; >>> > >>> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> > >>> > cfg.trialdef.eventtype = 'trigger'; >>> > >>> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> > trigger >>> > >>> > cfg.trialdef.prestim = 0.234; % in seconds >>> > >>> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> > observation, but maybe we need less) >>> > >>> > cfg = ft_definetrial(cfg); >>> > >>> > >>> > cfg.trl([1:7],:) = []; >>> > >>> > >>> > %change timeline according to constant offset of 16 ms = 8 samples >>> > (because >>> > recorded with 500 hz)in >>> > >>> > %structure trial >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)-8 >>> > >>> > >>> > %change timeline to make the cut the zeropoint >>> > >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> > >>> > >>> > >>> > %% preprocess data >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.detrend = 'yes'; >>> > >>> > cfg.preproc.demean = 'yes'; >>> > >>> > cfg.preproc.baselinewindow = [-2.1 -2.0] >>> > >>> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> > filtered >>> > >>> > %(0.1-45) and bad channels have to be replaced!!!! >>> > >>> > %cfg.preproc.bpfreq = [6 32]; >>> > >>> > % >>> > >>> > % >>> > >>> > obs_data = ft_preprocessing(cfg); >>> > >>> > % >>> > >>> > save (strcat(sb,'obs_data') , 'obs_data') >>> > >>> > >>> > %% determining channel neighbours (necessary for Artifact detection) >>> > >>> > cfg = []; >>> > >>> > cfg.channel = obs_data.label; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.feedback = 'yes'; >>> > >>> > lay = ft_prepare_layout(cfg); >>> > >>> > >>> > >>> > cfg_neighb = []; >>> > >>> > cfg_neighb.feedback = 'yes'; >>> > >>> > >>> > cfg_neighb.method = 'triangulation'; >>> > >>> > cfg_neighb.layout = 'GSN128.sfp'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > obs_data.elec = ft_read_sens('GSN128.sfp'); >>> > >>> > >>> > %% Artifacts - to detect bad channels - is not saved!!! >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs_data_try = ft_rejectvisual(cfg, obs_data); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_try = ft_rejectartifact (cfg,obs_data); >>> > >>> > >>> > >>> > %% Preparing neighbours for channel repair - but bad channel info >>> > in!!! >>> > >>> > >>> > % cfg_neighb = []; >>> > >>> > % cfg_neighb.feedback = 'yes'; >>> > >>> > % cfg_neighb.method = 'triangulation'; >>> > >>> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> > >>> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > % Interpolate and put into new data structure >>> > >>> > cfg = []; >>> > >>> > cfg.badchannel = {}; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.method = 'nearest'; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> > >>> > >>> > % Check reconstruction >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > % dat1=obs_data; >>> > >>> > % dat2=obs_data_channelrepaired; >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> > >>> > % y=dat2.trial{1}(62,:); >>> > >>> > % plot(x);hold on;plot(y,'r'); >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(72,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(75,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > %% artifact rejection/trial inspection - throw out electrode jumps >>> > etc. >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> > according to >>> > channels interpolated %% 128-number of interp. channels) >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > comp = ft_componentanalysis(cfg,obs_data_clean1); >>> > >>> > save (strcat(sb,'comp_all') , 'comp') >>> > >>> > >>> > %% >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'component'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='some'; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > ft_databrowser(cfg,comp); >>> > >>> > >>> > %% poweranalysis components >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'pow'; >>> > >>> > cfg.channel = 'all';%compute the power spectrum in all ICs >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.taper = 'hanning'; >>> > >>> > cfg.foi = 0:0.2:50; >>> > >>> > obs_freq = ft_freqanalysis(cfg, comp); >>> > >>> > >>> > %And you can plot the spectra: >>> > >>> > >>> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> > >>> > nsubplots = 16; >>> > >>> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> > decimals, type >>> > doc subplot >>> > >>> > >>> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> > >>> > tot = Nfigs*nsubplots; >>> > >>> > >>> > rptvect = 1:size(comp.topo,1); >>> > >>> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> > >>> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> > >>> > >>> > for r=1:size(rptvect,1); >>> > >>> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> > 1]);%full >>> > screen >>> > >>> > k=0; >>> > >>> > for j=1:size(rptvect,2); >>> > >>> > if~(rptvect(r,j)==0); >>> > >>> > k=k+1; >>> > >>> > cfg=[]; >>> > >>> > cfg.channel = rptvect(r,j); >>> > >>> > cfg.ylim =[0 500] >>> > >>> > cfg.xlim =[0 50] >>> > >>> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> > >>> > end >>> > >>> > end >>> > >>> > end >>> > >>> > >>> > %For the IC topos you'll follow the same logic as above but with: >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [1:20]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [21:40]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [41:60]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [61:80]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% Seperate observation conditions >>> > >>> > >>> > name1= strcat(num2str(sb),'_90.xls'); >>> > >>> > list1=xlsread (name1) >>> > >>> > >>> > >>> > >>> > >>> > name2= strcat(num2str(sb),'_180.xls'); >>> > >>> > list2=xlsread (name2) >>> > >>> > >>> > >>> > % >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list1] >>> > >>> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list2] >>> > >>> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > %%PIPELINE FOR obs90 >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128; >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > >>> > comp_1 = ft_componentanalysis(cfg, obs90_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> > obs90_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts - final detection >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs90_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> > >>> > >>> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> > >>> > >>> > %% plot it >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP) >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% PIPELINE FOR obs180 >>> > >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > comp_2 = ft_componentanalysis(cfg, obs180_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> > obs180_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts final 180 >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs180_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> > >>> > >>> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> > >>> > >>> > %% plot 180 ERP >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs180_data_ERP) >>> > >>> > >>> > %% plot both ERPs >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > cfg.showlabels = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> > >>> > >>> > %% plot difference wave >>> > >>> > >>> > difference = obs180_data_ERP; % copy one of the >>> > structures >>> > >>> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >>> > the >>> > difference ERP >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, difference) >>> > >>> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> > >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI >>> >> data. A couple things. First of all, exactly which net do you use? >>> >> If >>> >> they are 129-channel, there is still the question of whether they >>> >> are the >>> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >>> >> cause an >>> >> error like this. Could you send me the file you are trying to >>> >> process and >>> >> the script you are using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >>> >> diezmartini at gmail.com> wrote: >>> >> >>> >> Which nets do you use? I use EGI. I tried both the ones you mention >>> >> and >>> >> they didn't work. It was hard to find that exact one online but it >>> >> was the >>> >> only file that actually worked. >>> >> >>> >> >>> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >> >>> >> wrote: >>> >> >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. >>> >>> Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one >>> >>> >>> >>>> I use >>> >>>> >>> >>>> >>> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>> >>>> katrinheimann at gmail.com> wrote: >>> >>>> >>> >>>>> Dear all, my problems seem neverending. This time however i >>> >>>>> really need >>> >>>>> help. >>> >>>>> I implemented a pipeline for ERPs. All works now, >>> >>>>> trialdefinition, >>> >>>>> preprocessing, channelreplacement, ica, componentrejection, >>> >>>>> final >>> >>>>> artifactdetection, timelock of the single subject data. However, >>> >>>>> when I >>> >>>>> wanna compute the grandaverage of the single subjects I get the >>> >>>>> following >>> >>>>> error message: >>> >>>>> >>> >>>>> computing average of avg over 19 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 3 MB >>> >>>>> computing average of avg over 2 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>>>> additional >>> >>>>> allocation of an estimated 0 MB >>> >>>>> >>> >>>>> Furthermore in the plot of the significant clusters, the >>> >>>>> channelnames >>> >>>>> are mixed up (do not correspond to my net) >>> >>>>> >>> >>>>> >>> >>>>> I guess that there is a problem with the layout I use. >>> >>>>> Here the code that I use >>> >>>>> >>> >>>>> %For generating the layout (also in the single subjects): >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = obs_data.label; >>> >>>>> >>> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>>>> >>> >>>>> cfg.feedback = 'yes'; >>> >>>>> >>> >>>>> lay = ft_prepare_layout(cfg); >>> >>>>> >>> >>>>> >>> >>>>> cfg_neighb = []; >>> >>>>> >>> >>>>> cfg_neighb.feedback = 'yes'; >>> >>>>> >>> >>>>> cfg_neighb.method = 'triangulation'; >>> >>>>> >>> >>>>> cfg_neighb.layout = lay; >>> >>>>> >>> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>>>> >>> >>>>> >>> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>>>> >>> >>>>> >>> >>>>> %For computing the grand average >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = 'all'; >>> >>>>> >>> >>>>> cfg.latency = 'all'; >>> >>>>> >>> >>>>> cfg.parameter = 'avg'; >>> >>>>> >>> >>>>> cfg.keepindividual = 'no' >>> >>>>> >>> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>>>> >>> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>>>> >>> >>>>> % "{:}" means to use data from all elements of the variable >>> >>>>> >>> >>>>> >>> >>>>> For plotting the significant clusters >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.style = 'blank'; >>> >>>>> >>> >>>>> cfg.layout = lay; >>> >>>>> >>> >>>>> cfg.channellabels = 'yes'; >>> >>>>> >>> >>>>> cfg.highlight = 'labels'; >>> >>>>> >>> >>>>> cfg.highlightchannel = find(stat.mask); >>> >>>>> >>> >>>>> cfg.comment = 'no'; >>> >>>>> >>> >>>>> figure; ft_topoplotER(cfg, GA_90) >>> >>>>> >>> >>>>> title('Nonparametric: significant with cluster multiple >>> >>>>> comparison >>> >>>>> correction') >>> >>>>> >>> >>>>> >>> >>>>> Do you have ANY idea to this? I am really completely >>> >>>>> helpless.... >>> >>>>> >>> >>>>> thanks and best >>> >>>>> >>> >>>>> Katrin >>> >>>>> >>> >>>>> _______________________________________________ >>> >>>>> 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 >>> >>> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing list >>> >> fieldtrip at donders.ru.nl >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> >> >>> >> >> ---------------------------------------------------------------------------- >> ---- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.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: >>> > >> > b61/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 3 >>> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >>> > From: Joseph Dien >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > yes, please do send me the data. >>> > >>> > Thanks! >>> > >>> > Joe >>> > >>> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >>> > wrote: >>> > >>> >> Dear Joseph, thanks so much, I really appreciate your help. I was >>> >> also wandering, if maybe there is another bug in my code. >>> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >>> >> adviced me to do so, I also tried the 129 layout. >>> >> My code you find below (without selection of bad channels etc.) >>> >> If you need also the data of two subjects to have a look, let me >>> >> know!!! >>> >> Best and thanks really! >>> >> Katrin >>> >> >>> >> >>> >> >>> >> subject=input('Which subject do you want to analyse? ','s'); >>> >> >>> >> name = strcat(subject,'.raw'); >>> >> >>> >> subjectnumber=input('Which is the subjectnumber?', 's'); >>> >> >>> >> sb=subjectnumber >>> >> >>> >> %subjectnumber = strcat(subjectnumber, '.txt') >>> >> >>> >> %% >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.dataset = name; >>> >> >>> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> >> >>> >> cfg.trialdef.eventtype = 'trigger'; >>> >> >>> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> >> trigger >>> >> >>> >> cfg.trialdef.prestim = 0.234; % in seconds >>> >> >>> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> >> observation, but maybe we need less) >>> >> >>> >> cfg = ft_definetrial(cfg); >>> >> >>> >> >>> >> >>> >> cfg.trl([1:7],:) = []; >>> >> >>> >> >>> >> >>> >> %change timeline according to constant offset of 16 ms = 8 samples >>> >> (because recorded with 500 hz)in >>> >> >>> >> %structure trial >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >>> >> >>> >> >>> >> >>> >> %change timeline to make the cut the zeropoint >>> >> >>> >> >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% preprocess data >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.detrend = 'yes'; >>> >> >>> >> cfg.preproc.demean = 'yes'; >>> >> >>> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >>> >> >>> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> >> filtered >>> >> >>> >> %(0.1-45) and bad channels have to be replaced!!!! >>> >> >>> >> %cfg.preproc.bpfreq = [6 32]; >>> >> >>> >> % >>> >> >>> >> % >>> >> >>> >> obs_data = ft_preprocessing(cfg); >>> >> >>> >> % >>> >> >>> >> save (strcat(sb,'obs_data') , 'obs_data') >>> >> >>> >> >>> >> >>> >> %% determining channel neighbours (necessary for Artifact >>> >> detection) >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = obs_data.label; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.feedback = 'yes'; >>> >> >>> >> lay = ft_prepare_layout(cfg); >>> >> >>> >> >>> >> cfg_neighb = []; >>> >> >>> >> cfg_neighb.feedback = 'yes'; >>> >> >>> >> >>> >> >>> >> cfg_neighb.method = 'triangulation'; >>> >> >>> >> cfg_neighb.layout = 'GSN128.sfp'; >>> >> >>> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >>> >> >>> >> >>> >> >>> >> %% Artifacts - to detect bad channels - is not saved!!! >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Preparing neighbours for channel repair - but bad channel info >>> >> in!!! >>> >> >>> >> >>> >> >>> >> % cfg_neighb = []; >>> >> >>> >> % cfg_neighb.feedback = 'yes'; >>> >> >>> >> % cfg_neighb.method = 'triangulation'; >>> >> >>> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> >> >>> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> % Interpolate and put into new data structure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.badchannel = {}; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.method = 'nearest'; >>> >> >>> >> cfg.neighbours = neighbours; >>> >> >>> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> >> >>> >> >>> >> >>> >> % Check reconstruction >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> % dat1=obs_data; >>> >> >>> >> % dat2=obs_data_channelrepaired; >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> >> >>> >> % y=dat2.trial{1}(62,:); >>> >> >>> >> % plot(x);hold on;plot(y,'r'); >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(72,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(75,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> %% artifact rejection/trial inspection - throw out electrode jumps >>> >> etc. >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> >> according to channels interpolated %% 128-number of interp. >>> >> channels) >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = {'all'}; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >>> >> >>> >> save (strcat(sb,'comp_all') , 'comp') >>> >> >>> >> >>> >> >>> >> %% >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'component'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='some'; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> ft_databrowser(cfg,comp); >>> >> >>> >> >>> >> >>> >> %% poweranalysis components >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.output = 'pow'; >>> >> >>> >> cfg.channel = 'all';%compute the power spectrum in all ICs >>> >> >>> >> cfg.method = 'mtmfft'; >>> >> >>> >> cfg.taper = 'hanning'; >>> >> >>> >> cfg.foi = 0:0.2:50; >>> >> >>> >> obs_freq = ft_freqanalysis(cfg, comp); >>> >> >>> >> >>> >> >>> >> %And you can plot the spectra: >>> >> >>> >> >>> >> >>> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> >> >>> >> nsubplots = 16; >>> >> >>> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> >> decimals, type doc subplot >>> >> >>> >> >>> >> >>> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> >> >>> >> tot = Nfigs*nsubplots; >>> >> >>> >> >>> >> >>> >> rptvect = 1:size(comp.topo,1); >>> >> >>> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> >> >>> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> >> >>> >> >>> >> >>> >> for r=1:size(rptvect,1); >>> >> >>> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> >> 1]);%full screen >>> >> >>> >> k=0; >>> >> >>> >> for j=1:size(rptvect,2); >>> >> >>> >> if~(rptvect(r,j)==0); >>> >> >>> >> k=k+1; >>> >> >>> >> cfg=[]; >>> >> >>> >> cfg.channel = rptvect(r,j); >>> >> >>> >> cfg.ylim =[0 500] >>> >> >>> >> cfg.xlim =[0 50] >>> >> >>> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> >>> >> >>> >> %For the IC topos you'll follow the same logic as above but with: >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [1:20]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [21:40]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [41:60]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [61:80]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Seperate observation conditions >>> >> >>> >> >>> >> >>> >> name1= strcat(num2str(sb),'_90.xls'); >>> >> >>> >> list1=xlsread (name1) >>> >> >>> >> >>> >> >>> >> name2= strcat(num2str(sb),'_180.xls'); >>> >> >>> >> list2=xlsread (name2) >>> >> >>> >> >>> >> % >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list1] >>> >> >>> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list2] >>> >> >>> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> %%PIPELINE FOR obs90 >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128; >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> >>> >> >>> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> >> obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts - final detection >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot it >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% PIPELINE FOR obs180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> >> obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts final 180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot 180 ERP >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot both ERPs >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> cfg.showlabels = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot difference wave >>> >> >>> >> >>> >> >>> >> difference = obs180_data_ERP; % copy one of >>> >> the structures >>> >> >>> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >>> >> compute the difference ERP >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, difference) >>> >> >>> >> >>> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI data. A couple things. First of all, exactly which net do >>> >> you use? If they are 129-channel, there is still the question of >>> >> whether they are the Hydrocel or the older geodesic nets. >>> >> Regardless, that shouldn't cause an error like this. Could you >>> >> send me the file you are trying to process and the script you are >>> >> using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >>> >> wrote: >>> >> >>> >>> Which nets do you use? I use EGI. I tried both the ones you >>> >>> mention and they didn't work. It was hard to find that exact one >>> >>> online but it was the only file that actually worked. >>> >>> >>> >>> >>> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one I use >>> >>> >>> >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear all, my problems seem neverending. This time however i really >>> >>> need help. >>> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> >>> preprocessing, channelreplacement, ica, componentrejection, final >>> >>> artifactdetection, timelock of the single subject data. However, >>> >>> when I wanna compute the grandaverage of the single subjects I get >>> >>> the following error message: >>> >>> >>> >>> computing average of avg over 19 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 3 MB >>> >>> computing average of avg over 2 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 0 MB >>> >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> >>> >>> Furthermore in the plot of the significant clusters, the >>> >>> channelnames are mixed up (do not correspond to my net) >>> >>> >>> >>> >>> >>> I guess that there is a problem with the layout I use. >>> >>> Here the code that I use >>> >>> >>> >>> %For generating the layout (also in the single subjects): >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = obs_data.label; >>> >>> >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> >>> >>> cfg.feedback = 'yes'; >>> >>> >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> >>> >>> >>> cfg_neighb = []; >>> >>> >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> >>> >>> cfg_neighb.layout = lay; >>> >>> >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> >>> >>> >>> >>> >>> %For computing the grand average >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = 'all'; >>> >>> >>> >>> cfg.latency = 'all'; >>> >>> >>> >>> cfg.parameter = 'avg'; >>> >>> >>> >>> cfg.keepindividual = 'no' >>> >>> >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> >>> >>> >>> For plotting the significant clusters >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.style = 'blank'; >>> >>> >>> >>> cfg.layout = lay; >>> >>> >>> >>> cfg.channellabels = 'yes'; >>> >>> >>> >>> cfg.highlight = 'labels'; >>> >>> >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> >>> >>> cfg.comment = 'no'; >>> >>> >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> >>> correction') >>> >>> >>> >>> >>> >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> >>> >>> thanks and best >>> >>> >>> >>> Katrin >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> 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 >>> >>> >>> >>> _______________________________________________ >>> >>> fieldtrip mailing list >>> >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >> ---------------------------------------------------------------------------- >> ---- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.com >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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 >>> > >>> > >> ---------------------------------------------------------------------------- >> ---- >>> > >>> > Joseph Dien, PhD >>> > Research Associate >>> > Cognitive Neurology >>> > The Johns Hopkins University School of Medicine >>> > >>> > Lab E-mail: jdien1 at jhmi.edu >>> > Private E-mail: jdien07 at mac.com >>> > Office Phone: 410-614-3115 >>> > Cell Phone: 202-297-8117 >>> > Fax: 410-955-0188 >>> > http://joedien.com >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > ad2/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 4 >>> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >>> > From: "Caspar, Emilie" >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >>> > bad >>> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >>> > Content-Type: text/plain; charset="iso-8859-1" >>> > >>> > Hi Ashley, >>> > >>> > Maybe the mistake is you did not integrate in your script the >>> > command to save the rejection. Normally, with the following command, >>> > you will see in the Matlab Window that artifacts are correctly >>> > rejected after the "quit" button. >>> > >>> > clean_data = ft_rejectvisual(cfg, interpoldata); >>> > cfg.artfctdef.reject = 'complete'; >>> > cfg.artfctdef.feedback = 'yes'; >>> > cleandata = ft_rejectartifact(cfg,clean_data); >>> > >>> > Emilie >>> > >>> > >>> > >>> > >>> > >>> > Le 3 sept. 2014 ? 11:58, Ashley Greene >>> > > a ?crit : >>> > >>> > Hello, >>> > >>> > I have used the rejectvisual function in attempt to remove bad >>> > trials, but after marking them and pressing the quit button, >>> > although the command window states that the selected trials have >>> > been removed, there is no obvious change in the data; all of the >>> > trials are still intact. Have I overlooked something? >>> > >>> > Thanks, >>> > >>> > Ashley >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 985/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 5 >>> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >>> > From: Patricia Wollstadt >>> > To: fieldtrip at science.ru.nl >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: <540EEF94.9080601 at gmx.de> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > Hello Max, >>> > >>> > I added a few comments to the questions regarding individual >>> > parameters >>> > below. To address the general problem of TRENTOOL telling you, that >>> > there are not enough sample points in your data: From what I can see >>> > in >>> > your script, you probably don't have enough data points in each time >>> > series to robustly estimate TE. You analyze 800 ms of data sampled >>> > at >>> > 300 Hz, which gives you 240 samples per time series. Can you maybe >>> > avoid >>> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >>> > you >>> > analyze a longer time window of interest? >>> > Note that you also 'lose' data to embedding and the interaction >>> > delay: >>> > The first point that can be used for TE estimation is at max. >>> > embedding >>> > length + max. interaction delay in samples. For example: max. >>> > embedding >>> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >>> > max >>> > interaction delay of 30 ms = 9 samples. In this example, you would >>> > be >>> > left with 240 - 29 samples for TE estimation per trial. There is >>> > also >>> > the possibility to estimate time resolved TE/TE for shorter time >>> > windows >>> > of interest (see section 4.4 in the manual); however, this method >>> > requires the use of a GPU for TE estimation. >>> > >>> > I would further recommend to use the new pipeline for group >>> > statistics >>> > described in the manual in section 4.5 (the function >>> > 'TEgroup_calculate' >>> > is deprecated). The new pipeline allows you to reconstruct the >>> > interaction delay and uses the following functions (see also >>> > comments in >>> > the script): >>> > >>> > TEgroup_prepare -> prepares all data sets (all subjects/all >>> > conditions) for group analysis (this means finding common embedding >>> > parameters such that estimates are not biased between groups) >>> > InteractionDelayReconstruction_calculate -> estimates TE for >>> > individual data sets and all assumed interaction delays u >>> > InteractionDelayReconstruction_analyze -> reconstructs the >>> > interaction delay by selecting the u that maximizes TE for each >>> > channel >>> > TEgroup_stats -> calculate group statistics using a permutation test >>> > >>> > I can send you an example script for group TE analysis using this >>> > pipeline to get you started. I hope this helps you to get the group >>> > analysis running. Just write again if you're having trouble setting >>> > up >>> > the pipeline or something is not clear about the parameters/my >>> > comments. >>> > >>> > Best, >>> > Patricia >>> > >>> > >>> > >>> > >>> > On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not >>> >> 100% sure if it is appropriate to ask questions about it here, but >>> >> to >>> >> the best of my knowledge they do not have a mailing list and I saw >>> >> a >>> >> few trentool questions in the archives, so I'm going to assume it's >>> >> ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present >>> >> in the pipeline. Sorry in advance for the long post! Any help would >>> >> be >>> >> greatly appreciated as I'm a bit over my head on this but I think >>> >> I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data >>> >> that was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi is >>> >> in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within the toi, but beyond that are there any benefits to it being >>> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >>> >> the >>> >> toi is in seconds. The prediction time is the assumed interaction >>> >> delay between your two sources and should fit within your toi. In >>> >> general it is preferable to use the method for interaction delay >>> >> reconstruction for TE estimation, because it allows you to >>> >> reconstruct >>> >> the actual delay between your source and target times series. A >>> >> non-optimal u/interaction delay may cause an underestimation of TE, >>> >> so >>> >> it is recommended to use the pipeline for interaction delay >>> >> reconstruction whenever estimating TE for unknown delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, so it is best to limit the u range to values that are >>> >> physiologically plausible. >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the >>> >> sample rate and filters are used to determine the actthrvalue, but >>> >> I >>> >> don't actually know the calculation. 7.5 was a rough guess just to >>> >> test the pipeline. I'm also uncertain of what minnrtrials should >>> >> be.* >>> >> PW: You can set the actthrvalue based on the filtering you did >>> >> prior >>> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >>> >> shouldn't find an ACT higher than 30 samples, because you filtered >>> >> out >>> >> any components of the signal slower than 10 Hz/30 samples (given >>> >> your >>> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >>> >> would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> * >>> >> * >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm >>> >> yet to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* >>> >> PW: The Ragwitz criterion tries to find optimal embedding >>> >> parameters >>> >> dim and tau for the data. To do that, the method iteratively takes >>> >> all >>> >> possible combinations of dim and tau values that are provided in >>> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >>> >> these >>> >> combinations embed the data. To test an embedding, the method >>> >> builds >>> >> the embedding vectors from the data; it then tests for each point >>> >> how >>> >> well the next point in time can be predicted from the reference >>> >> point's nearest neighbours. So for each embedded point, the method >>> >> searches for the nearest neighbours and calculates the average of >>> >> those nearest neighbours. The difference between the >>> >> averaged/predicted point and the actual next point is the error of >>> >> the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested >>> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together with 'ragtausteps' specifies the tau values to be tested >>> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >>> >> that >>> >> the values here are factors that are later multiplied with the ACT >>> >> to >>> >> obtain the actual tau. 'repPred' is the number of points that will >>> >> be >>> >> used for the local prediction, i.e. the Ragwitz criterion will test >>> >> the local prediction and calculate the error for the first 100 >>> >> points >>> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >>> >> below >>> >> specify the type of neighbour search conducted by the Ragwitz >>> >> criterion: 'flagNei' tells the method to either conduct a kNN or >>> >> range >>> >> search; 'sizeNei' specifies the number of neighbours or the radius >>> >> to >>> >> be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> * >>> >> * >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> * >>> >> * >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.*TRENTOOL seems to handle data output very differently >>> >> from >>> >> fieldtrip and I've had trouble thinking through the most logical >>> >> way >>> >> to handle the data so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> * >>> >> * >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition >>> >> x subject .mat file, which as I said before is collectively the >>> >> same >>> >> as the 3 x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> * >>> >> * >>> >> *At this step I get the following error: >>> >> >>> >> Error using transferentropy (line 337) >>> >> \nTRENTOOL ERROR: not enough data points left after embedding >>> >> >>> >> Error in TEgroup_calculate (line 133) >>> >> [TEresult] = transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate >>> >> is a pipeline issue* (I noticed the example pipeline in trentool, >>> >> the >>> >> manual, and published methods articles all seem to have slightly or >>> >> significantly different pipeline compositions), *or if the error >>> >> is* >>> >> due to ACT, ragwitz optimization, or some other faulty >>> >> parameterization *on my part due to a lack of understanding of how >>> >> transfer entropy works on a more theoretical/mathematical level*. >>> >> If >>> >> the latter is the case, is there any relatively straightforward way >>> >> to >>> >> conceptualize this, or is this something where I'm just going to >>> >> have >>> >> to keep reading and rereading until it eventually makes sense? I've >>> >> already done quite a bit of that and it hasn't pierced my thick >>> >> skull >>> >> yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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: >>> > >> > 97f/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 6 >>> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >>> > From: Holger Krause >>> > To: FieldTrip discussion list >>> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >>> > days ago >>> > Message-ID: >>> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >>> > Content-Type: text/plain; charset="us-ascii" >>> > >>> > Dear developers, >>> > >>> > Could you please check the process for creation/publication of >>> > zip-files on >>> > the FTP server? The latest file I can find there is >>> > fieldtrip-20140906.zip. >>> > >>> > Thanks in advance, >>> > >>> > Holger >>> > >>> > >>> > ------------------------------ >>> > >>> > Message: 7 >>> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >>> > From: Max Cantor >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > This is immensely helpful, thank you. I was very confused about why >>> > some >>> > versions of the pipeline I saw were using group calculate and others >>> > were >>> > using interaction delay reconstruction and what that meant, and I >>> > think I >>> > have a more clear idea of what the different steps of the pipeline >>> > are >>> > doing. There are still a few things I'm a bit confused about though >>> > in >>> > terms of the pipeline. For instance, whether or not I need to do >>> > TEprepare >>> > before group prepare, and if I need to do graph analysis (which I'm >>> > not >>> > sure I fully understand but also haven't looked deeply into) before >>> > group >>> > stats. >>> > >>> > If you don't mind me taking you up on your offer, I think seeing >>> > your >>> > example script might help clarify some of these issues. >>> > >>> > Thank you! >>> > >>> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >>> > Patricia.Wollstadt at gmx.de> wrote: >>> > >>> >> Hello Max, >>> >> >>> >> I added a few comments to the questions regarding individual >>> >> parameters >>> >> below. To address the general problem of TRENTOOL telling you, that >>> >> there >>> >> are not enough sample points in your data: From what I can see in >>> >> your >>> >> script, you probably don't have enough data points in each time >>> >> series to >>> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >>> >> which >>> >> gives you 240 samples per time series. Can you maybe avoid >>> >> downsampling to >>> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >>> >> longer time >>> >> window of interest? >>> >> Note that you also 'lose' data to embedding and the interaction >>> >> delay: The >>> >> first point that can be used for TE estimation is at max. embedding >>> >> length >>> >> + max. interaction delay in samples. For example: max. embedding >>> >> length = >>> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >>> >> interaction >>> >> delay of 30 ms = 9 samples. In this example, you would be left with >>> >> 240 - >>> >> 29 samples for TE estimation per trial. There is also the >>> >> possibility to >>> >> estimate time resolved TE/TE for shorter time windows of interest >>> >> (see >>> >> section 4.4 in the manual); however, this method requires the use >>> >> of a GPU >>> >> for TE estimation. >>> >> >>> >> I would further recommend to use the new pipeline for group >>> >> statistics >>> >> described in the manual in section 4.5 (the function >>> >> 'TEgroup_calculate' is >>> >> deprecated). The new pipeline allows you to reconstruct the >>> >> interaction >>> >> delay and uses the following functions (see also comments in the >>> >> script): >>> >> >>> >> TEgroup_prepare -> prepares all data sets (all subjects/all >>> >> conditions) >>> >> for group analysis (this means finding common embedding parameters >>> >> such >>> >> that estimates are not biased between groups) >>> >> InteractionDelayReconstruction_calculate -> estimates TE for >>> >> individual data sets and all assumed interaction delays u >>> >> InteractionDelayReconstruction_analyze -> reconstructs the >>> >> interaction delay by selecting the u that maximizes TE for each >>> >> channel >>> >> TEgroup_stats -> calculate group statistics using a permutation >>> >> test >>> >> >>> >> I can send you an example script for group TE analysis using this >>> >> pipeline >>> >> to get you started. I hope this helps you to get the group analysis >>> >> running. Just write again if you're having trouble setting up the >>> >> pipeline >>> >> or something is not clear about the parameters/my comments. >>> >> >>> >> Best, >>> >> Patricia >>> >> >>> >> >>> >> >>> >> >>> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not 100% >>> >> sure if it is appropriate to ask questions about it here, but to >>> >> the best >>> >> of my knowledge they do not have a mailing list and I saw a few >>> >> trentool >>> >> questions in the archives, so I'm going to assume it's ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present in >>> >> the pipeline. Sorry in advance for the long post! Any help would be >>> >> greatly >>> >> appreciated as I'm a bit over my head on this but I think I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data that >>> >> was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi >>> >> is in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within >>> >> the toi, but beyond that are there any benefits to it being earlier >>> >> or >>> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >>> >> in >>> >> seconds. The prediction time is the assumed interaction delay >>> >> between your >>> >> two sources and should fit within your toi. In general it is >>> >> preferable to >>> >> use the method for interaction delay reconstruction for TE >>> >> estimation, >>> >> because it allows you to reconstruct the actual delay between your >>> >> source >>> >> and target times series. A non-optimal u/interaction delay may >>> >> cause an >>> >> underestimation of TE, so it is recommended to use the pipeline for >>> >> interaction delay reconstruction whenever estimating TE for unknown >>> >> delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, >>> >> so it is best to limit the u range to values that are >>> >> physiologically >>> >> plausible. >>> >> >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the sample >>> >> rate and filters are used to determine the actthrvalue, but I don't >>> >> actually know the calculation. 7.5 was a rough guess just to test >>> >> the >>> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >>> >> You can >>> >> set the actthrvalue based on the filtering you did prior to TE >>> >> analysis. If >>> >> you for example highpass filtered at 10 Hz, you shouldn't find an >>> >> ACT >>> >> higher than 30 samples, because you filtered out any components of >>> >> the >>> >> signal slower than 10 Hz/30 samples (given your sampling frequency >>> >> of 300 >>> >> Hz). So in this scenario the actthrvalue would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm yet >>> >> to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* PW: >>> >> The Ragwitz criterion tries to find optimal embedding parameters >>> >> dim and >>> >> tau for the data. To do that, the method iteratively takes all >>> >> possible >>> >> combinations of dim and tau values that are provided in cfgP.ragdim >>> >> and >>> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >>> >> embed >>> >> the data. To test an embedding, the method builds the embedding >>> >> vectors >>> >> from the data; it then tests for each point how well the next point >>> >> in time >>> >> can be predicted from the reference point's nearest neighbours. So >>> >> for each >>> >> embedded point, the method searches for the nearest neighbours and >>> >> calculates the average of those nearest neighbours. The difference >>> >> between >>> >> the averaged/predicted point and the actual next point is the error >>> >> of the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested by >>> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together >>> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >>> >> will >>> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >>> >> here are >>> >> factors that are later multiplied with the ACT to obtain the actual >>> >> tau. >>> >> 'repPred' is the number of points that will be used for the local >>> >> prediction, i.e. the Ragwitz criterion will test the local >>> >> prediction and >>> >> calculate the error for the first 100 points in your time series. >>> >> The two >>> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >>> >> neighbour >>> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >>> >> method to >>> >> either conduct a kNN or range search; 'sizeNei' specifies the >>> >> number of >>> >> neighbours or the radius to be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' >>> >> data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject >>> >> virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.* >>> >> TRENTOOL seems to handle data output very differently from >>> >> fieldtrip and >>> >> I've had trouble thinking through the most logical way to handle >>> >> the data >>> >> so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition x >>> >> subject .mat file, which as I said before is collectively the same >>> >> as the 3 >>> >> x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> *At this step I get the following error: Error using >>> >> transferentropy (line >>> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >>> >> Error in >>> >> TEgroup_calculate (line 133) [TEresult] = >>> >> transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate is a >>> >> pipeline issue* (I noticed the example pipeline in trentool, the >>> >> manual, >>> >> and published methods articles all seem to have slightly or >>> >> significantly >>> >> different pipeline compositions), *or if the error is* due to ACT, >>> >> ragwitz optimization, or some other faulty parameterization *on my >>> >> part >>> >> due to a lack of understanding of how transfer entropy works on a >>> >> more >>> >> theoretical/mathematical level*. If the latter is the case, is >>> >> there any >>> >> relatively straightforward way to conceptualize this, or is this >>> >> something >>> >> where I'm just going to have to keep reading and rereading until it >>> >> eventually makes sense? I've already done quite a bit of that and >>> >> it hasn't >>> >> pierced my thick skull yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing >>> >> >> listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie >> ldtrip >>> >> >>> >> >>> >> -- >>> >> ------------------------------------------------------------ >>> >> >>> >> 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 >>> >> >>> > >>> > >>> > >>> > -- >>> > Max Cantor >>> > Lab Manager >>> > Computational Neurolinguistics Lab >>> > University of Michigan >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 024/attachment.html> >>> > >>> > ------------------------------ >>> > >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > End of fieldtrip Digest, Vol 46, Issue 3 >>> > **************************************** >>> > >>> >>> >>> >>> Barbara Schorr, MSc >>> Clinical and Biological Psychology >>> University of Ulm >>> Albert-Einstein-Allee 47 >>> 89069 Ulm >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jim Herring, MSc. >> Neuronal Oscillations Group >> Centre for Cognitive Neuroimaging >> Donders Institute for Brain, Cognition and Behaviour >> Radboud University Nijmegen >> _______________________________________________ >> 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 >> >> End of fieldtrip Digest, Vol 46, Issue 5 >> **************************************** >> > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 46, Issue 6 > **************************************** > Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From hweeling.lee at gmail.com Thu Sep 18 14:30:16 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 18 Sep 2014 14:30:16 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity Message-ID: Dear all, I've got a question regarding extracting pairwise phase consistency of individual trials for each subject. Using the connectivity analyses tutorial as a reference, I extracted the PPC using the fourier information from the mtmfft (dpss taper). Here's an example of my code: cfg = []; cfg.output = 'fourier'; cfg.channel = {'all'}; cfg.method = 'mtmfft'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 5; % find the index for the c200 condition pre_c200_idx = find(data8.trialinfo == 200); cfg.trials = pre_c200_idx; cfg.foilim = [0 100]; % either the full range of frequencies (data2.hdr.Fs/2) or up to 100 Hz cfg.taper = 'dpss'; HLF_pre_c200 = ft_freqanalysis(cfg, data8); The PPC is extracted using this code: cfg = []; cfg.trials = 'all'; cfg.keeptrials = 'yes'; cfg.channel = {'all'}; cfg.removemean = 'yes'; cfg.method = 'wppc'; cfg.channelcmb = {cfg.channel, cfg.channel}; HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); Although I've specified to keep individual trials, my output is still a 'chan_freq' dimord variable. It does not contain any individual trial PPC information. Is there a way to extract the connectivity for individual trials? Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Thu Sep 18 15:32:54 2014 From: roeysc at gmail.com (Roey Schurr) Date: Thu, 18 Sep 2014 16:32:54 +0300 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: References: Message-ID: Dear Hweeling, Unfortunately I am not yet familiar with the PPC measure, but I guess that being a pairwise phase *consistancy* measure, it is defined over a set of trials, and can not be calculated for any individual trial (like coherence, or PLV)? Just quickly reading through "The pairwise phase consistency: A bias-free measure of rhythmic neuronal synchronization" (Vinck et al., 2010), this seems to be the case. Hope this helps, roey On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee wrote: > Dear all, > > I've got a question regarding extracting pairwise phase consistency of > individual trials for each subject. > > Using the connectivity analyses tutorial as a reference, I extracted the > PPC using the fourier information from the mtmfft (dpss taper). > > Here's an example of my code: > > cfg = []; > cfg.output = 'fourier'; > cfg.channel = {'all'}; > cfg.method = 'mtmfft'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 5; > > % find the index for the c200 condition > pre_c200_idx = find(data8.trialinfo == 200); > > cfg.trials = pre_c200_idx; > cfg.foilim = [0 100]; % either the full range of frequencies > (data2.hdr.Fs/2) or up to 100 Hz > cfg.taper = 'dpss'; > HLF_pre_c200 = ft_freqanalysis(cfg, data8); > > The PPC is extracted using this code: > > cfg = []; > cfg.trials = 'all'; > cfg.keeptrials = 'yes'; > cfg.channel = {'all'}; > cfg.removemean = 'yes'; > > cfg.method = 'wppc'; > cfg.channelcmb = {cfg.channel, cfg.channel}; > > HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); > > Although I've specified to keep individual trials, my output is still a > 'chan_freq' dimord variable. It does not contain any individual trial PPC > information. Is there a way to extract the connectivity for individual > trials? > > Thanks. > > Cheers, > Hweeling > > > _______________________________________________ > 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 julian.keil at gmail.com Thu Sep 18 16:23:15 2014 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 18 Sep 2014 16:23:15 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: References: Message-ID: Dear Hweeling, if you're looking for a single trial measure of phase relationship, you might want to have a look at the attached papers. In both papers, single trial phase relationship between cortical sources is described as the phase difference subtracted from the mean phase difference (i.e. Take the phase difference between two channels, average over trials and take the difference between the single trial phase difference and the mean phase difference). I hope thais goes into the right direction of what you're asking for. Good luck. Julian Keil, J., Müller, N., Hartmann, T., & Weisz, N. (2014). Prestimulus beta power and phase synchrony influence the sound-induced flash illusion. Cerebral Cortex, 24(5), 1278–1288. doi:10.1093/cercor/bhs409 Hanslmayr, S., Aslan, A., Staudigl, T., Klimesch, W., Herrmann, C. S., & Bäuml, K.-H. (2007). Prestimulus oscillations predict visual perception performance between and within subjects. NeuroImage, 37(4), 1465–1473. doi:10.1016/j.neuroimage.2007.07.011 ******************** 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 18.09.2014 um 15:32 schrieb Roey Schurr: > Dear Hweeling, > > Unfortunately I am not yet familiar with the PPC measure, but I guess that being a pairwise phase consistancy measure, it is defined over a set of trials, and can not be calculated for any individual trial (like coherence, or PLV)? > > Just quickly reading through "The pairwise phase consistency: A bias-free measure of rhythmic neuronal synchronization" (Vinck et al., 2010), this seems to be the case. > > Hope this helps, > roey > > On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee wrote: > Dear all, > > I've got a question regarding extracting pairwise phase consistency of individual trials for each subject. > > Using the connectivity analyses tutorial as a reference, I extracted the PPC using the fourier information from the mtmfft (dpss taper). > > Here's an example of my code: > > cfg = []; > cfg.output = 'fourier'; > cfg.channel = {'all'}; > cfg.method = 'mtmfft'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 5; > > % find the index for the c200 condition > pre_c200_idx = find(data8.trialinfo == 200); > > cfg.trials = pre_c200_idx; > cfg.foilim = [0 100]; % either the full range of frequencies (data2.hdr.Fs/2) or up to 100 Hz > cfg.taper = 'dpss'; > HLF_pre_c200 = ft_freqanalysis(cfg, data8); > > The PPC is extracted using this code: > > cfg = []; > cfg.trials = 'all'; > cfg.keeptrials = 'yes'; > cfg.channel = {'all'}; > cfg.removemean = 'yes'; > > cfg.method = 'wppc'; > cfg.channelcmb = {cfg.channel, cfg.channel}; > > HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); > > Although I've specified to keep individual trials, my output is still a 'chan_freq' dimord variable. It does not contain any individual trial PPC information. Is there a way to extract the connectivity for individual trials? > > Thanks. > > Cheers, > Hweeling > > > _______________________________________________ > 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 tobias.staudigl at uni-konstanz.de Thu Sep 18 16:39:58 2014 From: tobias.staudigl at uni-konstanz.de (Tobias Staudigl) Date: Thu, 18 Sep 2014 16:39:58 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: References: Message-ID: <541AEEBE.9090503@uni-konstanz.de> Dear Hweeling, I agree with Roey that coherence/PLV cannot be calculated for individual trials. However, you could try to use the deviation (in each single trial) from the mean phase as an approximation. Good luck! Tobias Am 18.09.2014 15:32, schrieb Roey Schurr: > Dear Hweeling, > > Unfortunately I am not yet familiar with the PPC measure, but I guess > that being a pairwise phase *consistancy* measure, it is defined over > a set of trials, and can not be calculated for any individual trial > (like coherence, or PLV)? > > Just quickly reading through "The pairwise phase consistency: A > bias-free measure of rhythmic neuronal synchronization" (Vinck et al., > 2010), this seems to be the case. > > Hope this helps, > roey > > On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee > wrote: > > Dear all, > > I've got a question regarding extracting pairwise phase > consistency of individual trials for each subject. > > Using the connectivity analyses tutorial as a reference, I > extracted the PPC using the fourier information from the mtmfft > (dpss taper). > > Here's an example of my code: > > cfg = []; > cfg.output = 'fourier'; > cfg.channel = {'all'}; > cfg.method = 'mtmfft'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 5; > % find the index for the c200 condition > pre_c200_idx = find(data8.trialinfo == 200); > cfg.trials = pre_c200_idx; > cfg.foilim = [0 100]; % either the full range of > frequencies (data2.hdr.Fs/2) or up to 100 Hz > cfg.taper = 'dpss'; > HLF_pre_c200 = ft_freqanalysis(cfg, data8); > > The PPC is extracted using this code: > > cfg = []; > cfg.trials = 'all'; > cfg.keeptrials = 'yes'; > cfg.channel = {'all'}; > cfg.removemean = 'yes'; > cfg.method = 'wppc'; > cfg.channelcmb = {cfg.channel, cfg.channel}; > HLF_pre_c200wppc = ft_connectivityanalysis(cfg, > HLF_pre_c200); > > Although I've specified to keep individual trials, my output is > still a 'chan_freq' dimord variable. It does not contain any > individual trial PPC information. Is there a way to extract the > connectivity for individual trials? > > Thanks. > > Cheers, > Hweeling > > > _______________________________________________ > 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 -- Dr. Tobias Staudigl Fachbereich Psychologie - ZPR Postfach ZPR 78457 Konstanz ZPR, Haus 12 Tel.: +49 (0)7531 / 88 - 5703 -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Thu Sep 18 19:36:40 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Thu, 18 Sep 2014 19:36:40 +0200 (CEST) Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs In-Reply-To: <867006743.3066178.1410775764568.JavaMail.root@bcbl.eu> Message-ID: <533541797.8928620.1411061800427.JavaMail.root@sculptor.zimbra.ru.nl> Hi Fred, Thank you for let us know this documentation discrepancy now corrected (https://code.google.com/p/fieldtrip/source/detail?r=9813) Regarding your question, if you're computing induced TFR (power estimates for each single-trial) the cfg.combinemethod='sum' (default) method in ft_combineplanar will sum the vertical and horizontal components of each channel. As power is positive (squared), 1) and 2) options will ended up in the same result (although 2) simplifies the channel representation). Might be you already knew it but you can use fieldtrip functions to test these type of questions and figure out yourself (see tfr.png figure, second and third rows): http://fieldtrip.fcdonders.nl/example/combineplanar_pipelineorder Above I made a simulation that basically tested you question. In addition, I also simulate ERFs asking the very same question. I know you did not ask for it but as the ft_combineplanar documentation did not clarify this issue, I took the chance to test it. You'll see that with ERFs the order of the ft_combineplanar call in the pipeline matters (see erf.png figure and the wiki example url above). The reason is because ft_combineplanar ('sum' method) for raw and timelock time of data, squares the vertical and the horizontal planar components (nonlinear transformation). Then, for ERF computations, one should first compute single-trial average first and the compute the megplanar/combineplanar. This is very important because the alternative (combine planar at single trial and then average) is not an ERF: ft_combineplanar will square the signal and random noise (plus time jittered components) will be (positively) added to the grand-mean (wont be cancelled by the negative components of the signal, as ERF approach assumes). I hope it helps. best, Diego ----- Original Message ----- > From: "Frédéric Roux" > To: "FieldTrip discussion list" > Sent: Monday, 15 September, 2014 12:09:24 PM > Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs > Dear all, > > my question relates to the computation of combined planar gradients > using the ft_combineplanar function. > > Our data has been recorded with an Elekta Neuromag 306 channel system, > and I would like to know if it is "safe" to compute combined gradients > before calling ft_freqstatistics, if the input data contains single > trial TFRs. > > The reason why I am asking is because in the documentation of the > function it says > % Use as > % [data] = ft_combineplanar(cfg, data) > % where data contains an averaged planar gradient (either ERF or TFR). > > However, the following tutorial suggests that this can be safely > applied if > the input data contains TFRs which have been computed with the > cfg.keeptrials = 'yes' option: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > > I am bit confused as both information (the fieldtrip documentation and > the tutorial) > seem to contradict each other. > > The 2 options that are see are: > > 1) compute TFRs with cfg.keeptrials = 'yes', then call > ft_frestatistics, then call ft_combineplanar > by using the output of ft_freqstatistics as input for the > ft_combineplanar function. > 2) compute TFRs with cfg.keeptrials = 'yes', then call > ft_combineplanar, then call ft_freqstatistics > > Could anyone with experience on this issue please let me know what the > best way > to proceed would be? > > 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/ -------------- next part -------------- A non-text attachment was scrubbed... Name: tfr.png Type: image/png Size: 40910 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: erf.png Type: image/png Size: 65168 bytes Desc: not available URL: From v.piai.research at gmail.com Fri Sep 19 01:13:14 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 18 Sep 2014 16:13:14 -0700 Subject: [FieldTrip] weird topo: due to missing sensors? and [Reference to non-existent field 'chanori'] Message-ID: <541B670A.7070902@gmail.com> Hello FT-ers, I was wondering whether anyone has an idea of what could be going on in this topo of the group-averaged ERF (difference between 2 conditions, planar gradient). At first I thought that could be muscle activity, but that pattern seems to hold regardless of the time window I choose (and besides when I plot the EMG of some facial muscles, they don't differ from each other...). What I noted now is that different sensors were excluded for different participants around those areas so I'm suspecting that the missing sensors are causing the problem (because of the way the data is interpolated for plotting?). I tried different options in ft_topoplot but all my attempts were in vain. Next, I tried using ft_channelrepair. I assumed that the correct order of processing steps would be to repair channels first, and then calculate planar gradients after. If I follow that procedure, I get the following error when running ft_megplanar (FT version 20140518): Reference to non-existent field 'chanori'. Error in ft_megplanar (line 242) chanposnans = any(isnan(sens.chanpos(:))) || any(isnan(sens.chanori(:))); If anyone could shed some light on these issues, it would be great! Thanks a lot, Vitoria -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hjahgfhc.png Type: image/png Size: 14934 bytes Desc: not available URL: From stephen.whitmarsh at gmail.com Fri Sep 19 09:03:18 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 19 Sep 2014 09:03:18 +0200 Subject: [FieldTrip] weird topo: due to missing sensors? and [Reference to non-existent field 'chanori'] In-Reply-To: <541B670A.7070902@gmail.com> References: <541B670A.7070902@gmail.com> Message-ID: Hi Vitoria, Yes, I guess it might be the missing channels somehow. Concerning the missing chanori; I think you throw away more than just the data when you remove a channel, and when you restore it later on, things like the orientation, location etc. is not in the data anymore. I would therefor never throw away a channel, but rather fix it, to avoid these kinds of problems. Anyway, I think you can solve it by copying the .grad structure from an earier point (before having removed channels) into the data after fixing. If this doesn't solve the topo problem, have you tried dividing the difference by the sum of the conditions or otherwise normalizing the difference for each subject? E.g. (Condition A - B) / (Condition A + B). Good luck! STephen On 19 September 2014 01:13, Vitoria Piai wrote: > Hello FT-ers, > > I was wondering whether anyone has an idea of what could be going on in > this topo of the group-averaged ERF (difference between 2 conditions, > planar gradient). At first I thought that could be muscle activity, but > that pattern seems to hold regardless of the time window I choose (and > besides when I plot the EMG of some facial muscles, they don't differ from > each other...). > What I noted now is that different sensors were excluded for different > participants around those areas so I'm suspecting that the missing sensors > are causing the problem (because of the way the data is interpolated for > plotting?). > > > I tried different options in ft_topoplot but all my attempts were in vain. > Next, I tried using ft_channelrepair. I assumed that the correct order of > processing steps would be to repair channels first, and then calculate > planar gradients after. If I follow that procedure, I get the following > error when running ft_megplanar (FT version 20140518): > Reference to non-existent field 'chanori'. > > Error in ft_megplanar (line 242) > chanposnans = any(isnan(sens.chanpos(:))) || any(isnan(sens.chanori(:))); > > If anyone could shed some light on these issues, it would be great! > Thanks a lot, > Vitoria > > _______________________________________________ > 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: hjahgfhc.png Type: image/png Size: 14934 bytes Desc: not available URL: From spa268 at nyu.edu Fri Sep 19 10:59:51 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Fri, 19 Sep 2014 12:59:51 +0400 Subject: [FieldTrip] Choosing a subset of sensors with a uniform distribution over the head Message-ID: Hello, I am trying to plot a multiplot of MEG sensors over the head, but since I have over 200 sensors I don't want to plot them all (it becomes more or less illegible; see http://i.imgur.com/lT93i2T.png). What I would like to do is take half or even a third of the channels, and plot them at double or triple the size, as in http://i.imgur.com/6wcrNFS.png (which I created by just plotting the even-numbered channels). As you can see from this image, simply selecting the even-numbered channels in my array doesn't give a nice symmetrical or uniform distribution. Is there any way (for example, somehow using the neighbours structure) to decimate the channels or to otherwise choose a subset of channels that is uniformly distributed over the head? Thank you very much, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Sep 19 12:15:31 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 19 Sep 2014 12:15:31 +0200 Subject: [FieldTrip] Choosing a subset of sensors with a uniform distribution over the head In-Reply-To: References: Message-ID: <541C0243.5020001@donders.ru.nl> Hi Stephen, there is no predfine FieldTrip way for this. You could try to this via the neighbour template. If you know that the neighbours are well defined and only the nearest neighbours are defined as neighbours (the triangulation method might do that), you can loop through the neighbour definition, and throw out all neighbours of channel i from the neighbour definition, something like: > for i=1:numel(neighbs) > > % find all neighbouring channels of channel i > neighbbix = match_str(neighbs(i).neighblabel, {neighb(:).label}); > > % throw them out > neighb(neighbidx) = []; > > end what you end up with is a neighbour structure with all channels that are not adjacent to one another, i.e. a reduced number of channels. Not sure if this works, but you might give it a try. Best, Jörn On 9/19/2014 10:59 AM, Stephen Politzer-Ahles wrote: > Hello, > > I am trying to plot a multiplot of MEG sensors over the head, but > since I have over 200 sensors I don't want to plot them all (it > becomes more or less illegible; see http://i.imgur.com/lT93i2T.png). > What I would like to do is take half or even a third of the channels, > and plot them at double or triple the size, as in > http://i.imgur.com/6wcrNFS.png (which I created by just plotting the > even-numbered channels). As you can see from this image, simply > selecting the even-numbered channels in my array doesn't give a nice > symmetrical or uniform distribution. Is there any way (for example, > somehow using the neighbours structure) to decimate the channels or to > otherwise choose a subset of channels that is uniformly distributed > over the head? > > Thank you very much, > Steve > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > _______________________________________________ > 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 N.Jain at tudelft.nl Fri Sep 19 16:16:55 2014 From: N.Jain at tudelft.nl (Nishant Jain) Date: Fri, 19 Sep 2014 14:16:55 +0000 Subject: [FieldTrip] Making Layout from Digitizer file Message-ID: <664C5D9FB00A6046B7E9E6EAB9A7EBE2103DB670@SRV384.tudelft.net> Hello, I have a .res digitizer file with 3D electrode positions of a non-standard BioSemi cap. To make a layout, I thought to use ft_prepare_layout. One of the options with that function is to make a structure of the electrode positions, which is possible since I can have the 3D coordinates on MATLAB. However, there is no information on the format of the cfg structure required by this function. I tried making a cfg.elec which contains a 160x3 matrix, but it gives me errors. How can I use the 3D position data to construct a layout? Best regards, Nishant Jain PhD candidate, 4D EEG Project. TU Delft / Department of Biomechatronics & Biorobotics Mekelweg 2 2628 CD Delft E n.jain at tudelft.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Fri Sep 19 16:50:58 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Fri, 19 Sep 2014 16:50:58 +0200 Subject: [FieldTrip] Problem redefining trials with different event as zero point Message-ID: Dear Fieldtrippers, I would like to redefine my trials using another event as zero point. So I defined trials on a certain event and preprocessed them. All trials also contain another event. Now I want to redefine them using this other event as zero point and cutting 1 sec before and 1 sec after. I tried simply using the definetrial function again: cfg = [] cfg.dataset= strcat(sb,'mov_ica_cleaned.mat') cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'resp' cfg.trialdef.prestim = -1 cfg.trialdef.poststim = 1 mov_data_small = ft_definetrial(cfg) But then I get the error message Error using ft_read_header (line 1833) unsupported header format (matlab) Error in ft_trialfun_general (line 71) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); Error in ft_definetrial (line 169) [trl, event] = feval(cfg.trialfun, cfg); Somebody able to help me? Thanks and best Katrin >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Fri Sep 19 23:31:12 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Fri, 19 Sep 2014 17:31:12 -0400 Subject: [FieldTrip] Problem redefining trials with different event as zero point In-Reply-To: References: Message-ID: Hi Katrin, Perhaps you should be using the ft_redefinetrial instead. Best, Raquel On Fri, Sep 19, 2014 at 10:50 AM, KatrinH Heimann wrote: > Dear Fieldtrippers, > > I would like to redefine my trials using another event as zero point. So I > defined trials on a certain event and preprocessed them. All trials also > contain another event. Now I want to redefine them using this other event > as zero point and cutting 1 sec before and 1 sec after. > I tried simply using the definetrial function again: > > cfg = [] > > cfg.dataset= strcat(sb,'mov_ica_cleaned.mat') > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 'resp' > > cfg.trialdef.prestim = -1 > > cfg.trialdef.poststim = 1 > > > > mov_data_small = ft_definetrial(cfg) > > > > But then I get the error message > > Error using ft_read_header (line 1833) > unsupported header format (matlab) > > Error in ft_trialfun_general (line 71) > hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); > > Error in ft_definetrial (line 169) > [trl, event] = feval(cfg.trialfun, cfg); > > > Somebody able to help me? > > Thanks and best > Katrin > > >> > > _______________________________________________ > 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 gamaliel.ghu at gmail.com Sat Sep 20 07:10:14 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Sat, 20 Sep 2014 02:10:14 -0300 Subject: [FieldTrip] problem in dipole simulation Message-ID: Hi all I followed the tips above to simulate a dipole source on my own head model generated from MRIs. However, using information from:http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit I could not simulate anything. Only one image is blank. The code I am using is as follows: cfg = []; cfg.vol = vol; % See above cfg.elec = elec; % See above cfg.dip.pos = [0 0 0]; cfg.dip.mom = [2 2 2]; % Note, it Should be transposed cfg.dip.frequency = 10; cfg.ntrials = 10; cfg.triallength = 1; % seconds cfg.fsample = 25; % Hz raw1 = ft_dipolesimulation (cfg); avg1 = ft_timelockanalysis([], raw1); plot (avg1.time, avg1.avg); % Plot the timecourse where: vol = ft_prepare_headmodel volumes generated from the segmentation of my resonances. and ft_read_sens elec = ('standard_1020.elc'); to run the script the result is a blank image. and Matlab tells me the following: using headmodel specified in the configuration using electrodes specified in the configuration Determining source compartment (1) projecting electrodes on skin surface electrode and system combine combining transfer matrix computing simulated data computing simulated trial data for 10 RMS value of simulated data is NaN the call to "ft_dipolesimulation" took 4 seconds the input is raw Data with 97 channels and 10 trials Warning: the data does not Contain a definition trial >** In utilities \ private \ warning_once at 158 ** In utilities \ private \ fixsampleinfo at 66 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 Warning: sampleinfo by reconstructing Assuming That the trials are consecutive segments of a continuous recording >** In utilities \ private \ warning_once at 158 ** In utilities \ private \ fixsampleinfo at 79 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 averaging trials trial averaging 10 of 10 the call to "ft_timelockanalysis" took 1 seconds I hope you can help greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Sun Sep 21 14:19:16 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Sun, 21 Sep 2014 14:19:16 +0200 Subject: [FieldTrip] Fwd: Real-time Functional Imaging and Neurofeedback conference In-Reply-To: References: Message-ID: <29946EDE-11E8-40BA-B103-BB8B0DC02D6F@donders.ru.nl> On 21 Sep 2014, at 10:10, Blefari Maria Laura wrote: > Dear all, > > We are very glad to announce that the abstract submission for the Real-time Functional Imaging and Neurofeedback (rtFIN) conference is now open! > > The conference would be held in Gainesville (Florida, USA) during 12-13 February, 2015. > > You may find all relevant information regarding conference, registration and abstract submission here:http://reg.conferences.dce.ufl.edu/rtFIN. > > Note that the abstracts are due on or before October 17th, 2014. The format of the abstract is similar to that of the Society for Neuroscience (2300 characters). > > We are looking forward to seeing you all in Gainesville in February! > > > Best regards, your co-organizers, > > > Ranganatha Sitaram, University of Florida > Maria Laura Blefari, Swiss Federal Institute of Technology Lausanne > Sven Haller, University of Geneva > Jarrod Lewis-Peacock, University of Texas at Austin > Frank Scharnowski, University of Geneva > Luke Stoeckel, Harvard University / National Institutes of Health > James Sulzer, University of Texas at Austin > Nikolaus Weiskopf, University College London -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Mon Sep 22 10:32:07 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 22 Sep 2014 10:32:07 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: <541AEEBE.9090503@uni-konstanz.de> References: <541AEEBE.9090503@uni-konstanz.de> Message-ID: Dear Roey, Julian and Tobias, Thanks for the feedback. Given your suggestions, I now intend to try to calculate the deviation of single trials from the mean phase difference (PLV). Pardon my ignorance, however, I still experience some problems with calculating plv for single trials. Using this code to extract PLV: cfg = []; cfg.trials = 'all'; cfg.keeptrials = 'yes'; cfg.channel = {'all'}; cfg.removemean = 'yes'; cfg.method = 'plv'; cfg.channelcmb = {cfg.channel, cfg.channel}; HLF_pre_c200plv = ft_connectivityanalysis(cfg, HLF_pre_c200); Although I've specified to keep individual trials, ft_connectivityanalysis still show averaged PLV across trials for the output. Could anyone of you, or someone else, kindly highlight my mistake in my calculation? Thank you very much! Best wishes, Hweeling On 18 September 2014 16:39, Tobias Staudigl wrote: > Dear Hweeling, > > I agree with Roey that coherence/PLV cannot be calculated for individual > trials. > However, you could try to use the deviation (in each single trial) from > the mean phase as an approximation. > > Good luck! > Tobias > > > > Am 18.09.2014 15:32, schrieb Roey Schurr: > > Dear Hweeling, > > Unfortunately I am not yet familiar with the PPC measure, but I guess > that being a pairwise phase *consistancy* measure, it is defined over a > set of trials, and can not be calculated for any individual trial (like > coherence, or PLV)? > > Just quickly reading through "The pairwise phase consistency: A > bias-free measure of rhythmic neuronal synchronization" (Vinck et al., > 2010), this seems to be the case. > > Hope this helps, > roey > > On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee > wrote: > >> Dear all, >> >> I've got a question regarding extracting pairwise phase consistency of >> individual trials for each subject. >> >> Using the connectivity analyses tutorial as a reference, I extracted >> the PPC using the fourier information from the mtmfft (dpss taper). >> >> Here's an example of my code: >> >> cfg = []; >> cfg.output = 'fourier'; >> cfg.channel = {'all'}; >> cfg.method = 'mtmfft'; >> cfg.keeptrials = 'yes'; >> cfg.tapsmofrq = 5; >> >> % find the index for the c200 condition >> pre_c200_idx = find(data8.trialinfo == 200); >> >> cfg.trials = pre_c200_idx; >> cfg.foilim = [0 100]; % either the full range of frequencies >> (data2.hdr.Fs/2) or up to 100 Hz >> cfg.taper = 'dpss'; >> HLF_pre_c200 = ft_freqanalysis(cfg, data8); >> >> The PPC is extracted using this code: >> >> cfg = []; >> cfg.trials = 'all'; >> cfg.keeptrials = 'yes'; >> cfg.channel = {'all'}; >> cfg.removemean = 'yes'; >> >> cfg.method = 'wppc'; >> cfg.channelcmb = {cfg.channel, cfg.channel}; >> >> HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); >> >> Although I've specified to keep individual trials, my output is still a >> 'chan_freq' dimord variable. It does not contain any individual trial PPC >> information. Is there a way to extract the connectivity for individual >> trials? >> >> Thanks. >> >> Cheers, >> Hweeling >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Dr. Tobias Staudigl > Fachbereich Psychologie - ZPR > Postfach ZPR > 78457 Konstanz > ZPR, Haus 12 > Tel.: +49 (0)7531 / 88 - 5703 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ================================================= 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 julian.keil at gmail.com Mon Sep 22 11:09:29 2014 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 22 Sep 2014 11:09:29 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: References: <541AEEBE.9090503@uni-konstanz.de> Message-ID: <85CB4B7D-8FA5-4FE7-9DE1-CDBC5E01FA07@gmail.com> Dear Hweeling, sorry to have been so unclear. Unfortunately, you'll have to leave the prepared field trip code a bit to compute the phase deviance. What you'll want to do is: 1. Compute the Phase for all channels and trials: Do a mtmfft with ft_freqanalysis and take the angle 2. For each trial, compute the phase difference between all channels: Use the circa_dist-function from the CircStat-Toolbox (Ask Google for the link) 3. For each combination, compute the mean over trials: Use the circa_mean function from the above mentioned toolbox 4. For each combination, compute the deviance from the mean Again, circa_dist is your friend here. Again, PLV or Coherence don't work on the single trial level, thus ft_connectivityanalysis will not work for you. Good Luck, Julian Am 22.09.2014 um 10:32 schrieb Hwee Ling Lee: > Dear Roey, Julian and Tobias, > > Thanks for the feedback. > > Given your suggestions, I now intend to try to calculate the deviation of single trials from the mean phase difference (PLV). Pardon my ignorance, however, I still experience some problems with calculating plv for single trials. > > Using this code to extract PLV: > > cfg = []; > cfg.trials = 'all'; > cfg.keeptrials = 'yes'; > cfg.channel = {'all'}; > cfg.removemean = 'yes'; > cfg.method = 'plv'; > cfg.channelcmb = {cfg.channel, cfg.channel}; > HLF_pre_c200plv = ft_connectivityanalysis(cfg, HLF_pre_c200); > > Although I've specified to keep individual trials, ft_connectivityanalysis still show averaged PLV across trials for the output. Could anyone of you, or someone else, kindly highlight my mistake in my calculation? > > Thank you very much! > > Best wishes, > Hweeling > > > > On 18 September 2014 16:39, Tobias Staudigl wrote: > Dear Hweeling, > > I agree with Roey that coherence/PLV cannot be calculated for individual trials. > However, you could try to use the deviation (in each single trial) from the mean phase as an approximation. > > Good luck! > Tobias > > > > Am 18.09.2014 15:32, schrieb Roey Schurr: >> Dear Hweeling, >> >> Unfortunately I am not yet familiar with the PPC measure, but I guess that being a pairwise phase consistancy measure, it is defined over a set of trials, and can not be calculated for any individual trial (like coherence, or PLV)? >> >> Just quickly reading through "The pairwise phase consistency: A bias-free measure of rhythmic neuronal synchronization" (Vinck et al., 2010), this seems to be the case. >> >> Hope this helps, >> roey >> >> On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee wrote: >> Dear all, >> >> I've got a question regarding extracting pairwise phase consistency of individual trials for each subject. >> >> Using the connectivity analyses tutorial as a reference, I extracted the PPC using the fourier information from the mtmfft (dpss taper). >> >> Here's an example of my code: >> >> cfg = []; >> cfg.output = 'fourier'; >> cfg.channel = {'all'}; >> cfg.method = 'mtmfft'; >> cfg.keeptrials = 'yes'; >> cfg.tapsmofrq = 5; >> >> % find the index for the c200 condition >> pre_c200_idx = find(data8.trialinfo == 200); >> >> cfg.trials = pre_c200_idx; >> cfg.foilim = [0 100]; % either the full range of frequencies (data2.hdr.Fs/2) or up to 100 Hz >> cfg.taper = 'dpss'; >> HLF_pre_c200 = ft_freqanalysis(cfg, data8); >> >> The PPC is extracted using this code: >> >> cfg = []; >> cfg.trials = 'all'; >> cfg.keeptrials = 'yes'; >> cfg.channel = {'all'}; >> cfg.removemean = 'yes'; >> >> cfg.method = 'wppc'; >> cfg.channelcmb = {cfg.channel, cfg.channel}; >> >> HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); >> >> Although I've specified to keep individual trials, my output is still a 'chan_freq' dimord variable. It does not contain any individual trial PPC information. Is there a way to extract the connectivity for individual trials? >> >> Thanks. >> >> Cheers, >> Hweeling >> >> >> _______________________________________________ >> 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 > > > -- > Dr. Tobias Staudigl > Fachbereich Psychologie - ZPR > Postfach ZPR > 78457 Konstanz > ZPR, Haus 12 > Tel.: +49 (0)7531 / 88 - 5703 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > ================================================= > 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 tzvetan.popov at uni-konstanz.de Mon Sep 22 11:22:14 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 22 Sep 2014 11:22:14 +0200 Subject: [FieldTrip] Making Layout from Digitizer file In-Reply-To: <664C5D9FB00A6046B7E9E6EAB9A7EBE2103DB670@SRV384.tudelft.net> References: <664C5D9FB00A6046B7E9E6EAB9A7EBE2103DB670@SRV384.tudelft.net> Message-ID: <9E29C938-1CFC-4639-8727-085E8889D3C6@uni-konstanz.de> Hi Nishant, > However, there is no information on the format of the cfg structure required by this function. I tried making a cfg.elec which contains a 160x3 matrix, but it gives me errors. > > How can I use the 3D position data to construct a layout? could you try some of the steps explained here http://fieldtrip.fcdonders.nl/tutorial/layout It sounds like this is what you need. best tzvetan -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at psych.ru.nl Mon Sep 22 12:44:11 2014 From: s.vanpelt at psych.ru.nl (Stan van Pelt) Date: Mon, 22 Sep 2014 12:44:11 +0200 (CEST) Subject: [FieldTrip] leadfields MNI-coordinates Message-ID: <035901cfd652$2557ff20$7007fd60$@vanpelt@psych.ru.nl> Dear FieldTrippers, For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to compute leadfields at specific (MNI-)coordinates in the brain. I am trying to find out how that is most easily done using FieldTrip - The most intuitive way seems to me to warp the MNI template to the individual's brain (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_indi vidual_head_space_that_are_all_aligned_in_mni_space) , and then apply the warping parameters to the ROI's MNI-coordinates, and enter the subsequent CTF-coordinates into ft_prepare_leadfield. However, I am not sure where exactly I can find these parameters, and how to apply them. Are these the ones in [gridsrc].params (output ft_sourcemodel)? - Alternatively, should I run ft_volumenormalise to warp the brain to MNI-space, and then inversely apply the warping parameters to the ROI's MNI-coordinates? Again, where can I find the warping parameters in this case, and how should they be applied? Best, Stan - Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Centre for Cognition Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Sep 22 13:19:38 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 22 Sep 2014 13:19:38 +0200 Subject: [FieldTrip] leadfields MNI-coordinates In-Reply-To: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> References: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Hi Stan, Have a look at this recent thread on the list (4 messages, Tom and me, this is the starting message): http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008362.html I think that might help you. Groetjes, Eelke On 22 September 2014 12:44, Stan van Pelt wrote: > Dear FieldTrippers, > > > > For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to compute > leadfields at specific (MNI-)coordinates in the brain. I am trying to find > out how that is most easily done using FieldTrip > > > > - The most intuitive way seems to me to warp the MNI template to the > individual’s brain > (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) > , and then apply the warping parameters to the ROI’s MNI-coordinates, and > enter the subsequent CTF-coordinates into ft_prepare_leadfield. However, I > am not sure where exactly I can find these parameters, and how to apply > them. Are these the ones in [gridsrc].params (output ft_sourcemodel)? > > - Alternatively, should I run ft_volumenormalise to warp the brain to > MNI-space, and then inversely apply the warping parameters to the ROI’s > MNI-coordinates? Again, where can I find the warping parameters in this > case, and how should they be applied? > > > > Best, > > Stan > > > > - > Stan van Pelt, PhD > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > Montessorilaan 3, B.01.34 > 6525 HR Nijmegen, the Netherlands > tel: +31 24 3616288 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From agreene24 at gmail.com Mon Sep 22 15:27:43 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Mon, 22 Sep 2014 22:27:43 +0900 Subject: [FieldTrip] denoise_pca error Message-ID: Hello all, I hope someone will be able to help with this. I'm trying to run the denoise_pca function on data after preprocessing, but I continue to get the following error: Error using ./ Matrix dimensions must agree. Error in ft_denoise_pca (line 193) s1 = s./max(s(:)); Could it be due to the use of the default for refchannel? Forgive me for asking such simple questions, but how do I go about choosing the reference channel? Do I just choose the cleanest channel from that particular set of preprocessed data? Thanks in advance, Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gamaliel.ghu at gmail.com Mon Sep 22 16:32:21 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Mon, 22 Sep 2014 11:32:21 -0300 Subject: [FieldTrip] Questions about matrix lead field Message-ID: Hi Experts My problem is as follows: I need generate a 3D head model from a resonance, then co register this head model with 10-20 electrode system to create my lead field matrix. According to the tutorial: "Creating a volume conduction model of the head for source reconstruction of EEG-data" I have generated head model but I do not have the lead field correctly done, because I do not know that function gives me the coregistration with the electrode system and tutorial only goes to show the volume generated with the electrodes on the surface. Finally I need is to know how I can co-register my head model with my electrode system to generate my lead field matrix. I also need to know how into matrix can I simulate dipole sources for then perform analysis of source reverse. I hope you can help greetings Bless -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.braukmann at donders.ru.nl Mon Sep 22 16:43:19 2014 From: r.braukmann at donders.ru.nl (Ricarda Braukmann) Date: Mon, 22 Sep 2014 16:43:19 +0200 Subject: [FieldTrip] Reading in .bdf files Message-ID: Hi everyone, I have a question regarding reading in Biosemi .bdf files. I followed the example on the ft website to read in a .bdf file, and - although it does not give an error- , the data looks very odd. In the ft_databrowser for example the vertical scale is [ -178000 178000 ] which seems very werid to me. I tried re-referencing the data, like in the example, using channel 'EXG5', but this did not help. Is there anyone who has experience with reading in biosemi files who could give me some advice? It would also be great if someone could explain to me what these EXG channels are exactly. I have for now turned to converting the .bdf file to .edf file (using the converter from www.biosemi.com/download/ ). Then the data looks normal, but it created some other issues with my markers and I would rather not use the converted files. More than anything, I am very curious what is going on with the original file, so any help is much appreciated! Thanks in advance! Ricarda -- Ricarda Braukmann, MSc PhD student Radboud University Medical Centre & Baby Research Center Donders Institute for Brain, Cognition and Behaviour, Centre for Neuroscience & Centre for Cognition Room B.01.22 Phone: +31 (0) 24 36 12652 Email: r.braukmann at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Mon Sep 22 16:49:59 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Mon, 22 Sep 2014 16:49:59 +0200 Subject: [FieldTrip] (no subject) Message-ID: Dear all, I encounter a strange problem using ft_databrowser for artifact detection. Basically I can't see all channels anymore, because the distance between the single channels is so wide that some get out of the window. I did not have this problem before. The only thing I changed until it worked is that I added a filter (before I filtered the data in another program). Did somebody encounter this problem before? thanks and best Katrin Below my (simple) code. cfg = []; cfg.dataset = name; cfg.trialfun = 'ft_trialfun_general'; cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'stim'; cfg.trialdef.prestim = 0.216; % in seconds cfg.trialdef.poststim = 7.284; % in seconds (whole time of video observation plus resynch phase) cfg = ft_definetrial(cfg); cfg.channel = 'all'; cfg.preproc.detrend = 'yes'; cfg.preproc.demean = 'yes'; cfg.preproc.baselinewindow = [-2.1 -2.0] cfg.preproc.bpfilter = 'yes'; cfg.preproc.bpfreq = [0.1 45]; % % obs_data = ft_preprocessing(cfg); cfg = []; cfg.viewmode = 'vertical'; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs_data); obs_data_try = ft_rejectartifact (cfg,obs_data); -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at psych.ru.nl Mon Sep 22 17:12:33 2014 From: s.vanpelt at psych.ru.nl (Stan van Pelt) Date: Mon, 22 Sep 2014 17:12:33 +0200 (CEST) Subject: [FieldTrip] leadfields MNI-coordinates In-Reply-To: References: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: <03a401cfd677$a2538ab0$e6faa010$@vanpelt@psych.ru.nl> Hi Eelke, Thanks a lot, I seem to have missed that thread, very informative! However, I seem not able yet to do the inverse warping, from MNI-coordinates to CTF-coordinates. - First I do mri_realign_mni=ft_volumenormalise([],mri_realign) - This gives me the transformation/normalization parameters from ctf->mni - As an example, I apply them to a random coordinate, here [3 5 6]: mnipos=ft_warp_apply(mri_realign_mni.params,ft_warp_apply(mri_realign_mni.initial,[3 5 6]),'individual2sn') - This gives me mni-coordinates -6.0652 -21.7174 -57.2273 - But how can I do the reverse? - If I do round(ft_warp_apply(pinv(mri_realign_mni.transform),mnipos)) I don't get [3 5 6] - It seems to me I should do something like ctfpos=ft_warp_apply(pinv(mri_realign_mni.params, mnipos),mnipos,'individual2sn') or so, but I am not getting it right... Best, Stan -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Eelke Spaak Sent: maandag 22 september 2014 13:20 To: FieldTrip discussion list Subject: Re: [FieldTrip] leadfields MNI-coordinates Hi Stan, Have a look at this recent thread on the list (4 messages, Tom and me, this is the starting message): http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008362.html I think that might help you. Groetjes, Eelke On 22 September 2014 12:44, Stan van Pelt wrote: > Dear FieldTrippers, > > > > For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to > compute leadfields at specific (MNI-)coordinates in the brain. I am > trying to find out how that is most easily done using FieldTrip > > > > - The most intuitive way seems to me to warp the MNI template to the > individual’s brain > (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_ > individual_head_space_that_are_all_aligned_in_mni_space) > , and then apply the warping parameters to the ROI’s MNI-coordinates, > and enter the subsequent CTF-coordinates into ft_prepare_leadfield. > However, I am not sure where exactly I can find these parameters, and > how to apply them. Are these the ones in [gridsrc].params (output > ft_sourcemodel)? > > - Alternatively, should I run ft_volumenormalise to warp the brain to > MNI-space, and then inversely apply the warping parameters to the > ROI’s MNI-coordinates? Again, where can I find the warping parameters > in this case, and how should they be applied? > > > > Best, > > Stan > > > > - > Stan van Pelt, PhD > Donders Institute for Brain, Cognition and Behaviour Centre for > Cognition Montessorilaan 3, B.01.34 > 6525 HR Nijmegen, the Netherlands > tel: +31 24 3616288 > > > _______________________________________________ > 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 tzvetan.popov at uni-konstanz.de Mon Sep 22 17:14:32 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 22 Sep 2014 17:14:32 +0200 Subject: [FieldTrip] Questions about matrix lead field In-Reply-To: References: Message-ID: Hi Gamaliel, > Hi Experts > > My problem is as follows: > > I need generate a 3D head model from a resonance, then co register this head model with 10-20 electrode system to create my lead field matrix. this will work if you have the 3D position of the electrodes. > According to the tutorial: > > "Creating a volume conduction model of the head for source reconstruction of EEG-data" > > I have generated head model but I do not have the lead field correctly done, because I do not know that function gives me the coregistration with the electrode system and tutorial only goes to show the volume generated with the electrodes on the surface. see here how to co-register the electrodes (scroll down to the bottom of the page): http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg?s[]=coregister&s[]=electrodes please note that using the search field with search terms “coregister electrodes” leads you to this page ;-). Also check the help of the function ft_electroderealign > > Finally I need is to know how I can co-register my head model with my electrode system to generate my lead field matrix. see above > I also need to know how into matrix can I simulate dipole sources for then perform analysis of source reverse. simulating a dipole is usually done with ft_dipolesimulation. Also the first part of this recently introduced FAQ gives you an example how to do this: http://fieldtrip.fcdonders.nl/example/combineplanar_pipelineorder?s[]=planar&s[]=gradient good luck tzvetan > > I hope you can help > > > greetings > > Bless > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 gamaliel.ghu at gmail.com Mon Sep 22 21:34:03 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Mon, 22 Sep 2014 16:34:03 -0300 Subject: [FieldTrip] Questions about matrix lead field Message-ID: *According to:* *"I need generate a 3D head model from a resonance, then co register this head model with 10-20 electrode system to create my lead field matrix. *this will work if you have the 3D position of the electrodes". I have only the patient MRIs, but no 3D positions of electrodes, just know that the system used in the acquisition is the 10-20 system with a number of fixed electrodes . Can i make my matrix Leadfield electrode using a template as standard_1020.elc? Regards -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Sep 23 07:21:38 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 23 Sep 2014 07:21:38 +0200 Subject: [FieldTrip] leadfields MNI-coordinates In-Reply-To: <03a401cfd677$a2538ab0$e6faa010$@vanpelt@psych.ru.nl> References: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> <03a401cfd677$a2538ab0$e6faa010$@vanpelt@psych.ru.nl> Message-ID: Hi Stan, Part of the solution you’re looking for probably lies in the fact that both the forward and inverse warp are non-linear transformations (when the volumetric normalization is done with cfg.nonlinear = ‘yes’). In other words, the inverse warp cannot be achieved by a simple linear transformation (i.e. the (p)inv of a xxx.transform matrix). Fortunately, ft_warp_apply supports both ft_warp_apply(params, pos, ‘individual2sn’), and ft_warp_apply(params, pos, ‘sn2individual’). The latter aims to achieve the inverse warp you’re looking for. Probably you need to then also still apply the inverse of mri_realign_mni.initial. Best, JM On Sep 22, 2014, at 5:12 PM, Stan van Pelt wrote: > Hi Eelke, > > Thanks a lot, I seem to have missed that thread, very informative! > However, I seem not able yet to do the inverse warping, from MNI-coordinates > to CTF-coordinates. > > - First I do > mri_realign_mni=ft_volumenormalise([],mri_realign) > > - This gives me the transformation/normalization parameters from ctf->mni > - As an example, I apply them to a random coordinate, here [3 5 6]: > mnipos=ft_warp_apply(mri_realign_mni.params,ft_warp_apply(mri_realign_mni.initial,[3 > 5 6]),'individual2sn') > > - This gives me mni-coordinates -6.0652 -21.7174 -57.2273 > - But how can I do the reverse? > - If I do > round(ft_warp_apply(pinv(mri_realign_mni.transform),mnipos)) > I don't get [3 5 6] > > - It seems to me I should do something like > ctfpos=ft_warp_apply(pinv(mri_realign_mni.params, > mnipos),mnipos,'individual2sn') > or so, but I am not getting it right... > > Best, > Stan > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Eelke Spaak > Sent: maandag 22 september 2014 13:20 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] leadfields MNI-coordinates > > Hi Stan, > > Have a look at this recent thread on the list (4 messages, Tom and me, this > is the starting message): > http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008362.html > I think that might help you. > > Groetjes, > Eelke > > On 22 September 2014 12:44, Stan van Pelt wrote: >> Dear FieldTrippers, >> >> >> >> For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to >> compute leadfields at specific (MNI-)coordinates in the brain. I am >> trying to find out how that is most easily done using FieldTrip >> >> >> >> - The most intuitive way seems to me to warp the MNI template to the >> individual’s brain >> (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_ >> individual_head_space_that_are_all_aligned_in_mni_space) >> , and then apply the warping parameters to the ROI’s MNI-coordinates, >> and enter the subsequent CTF-coordinates into ft_prepare_leadfield. >> However, I am not sure where exactly I can find these parameters, and >> how to apply them. Are these the ones in [gridsrc].params (output >> ft_sourcemodel)? >> >> - Alternatively, should I run ft_volumenormalise to warp the brain to >> MNI-space, and then inversely apply the warping parameters to the >> ROI’s MNI-coordinates? Again, where can I find the warping parameters >> in this case, and how should they be applied? >> >> >> >> Best, >> >> Stan >> >> >> >> - >> Stan van Pelt, PhD >> Donders Institute for Brain, Cognition and Behaviour Centre for >> Cognition Montessorilaan 3, B.01.34 >> 6525 HR Nijmegen, the Netherlands >> tel: +31 24 3616288 >> >> >> _______________________________________________ >> 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 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 Tue Sep 23 07:31:14 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 23 Sep 2014 07:31:14 +0200 Subject: [FieldTrip] denoise_pca error In-Reply-To: References: Message-ID: <3A35A4D9-0586-4E5F-AD0F-D07985BEA275@donders.ru.nl> Hi Ashley, Since your e-mail did not contain any background information with respect to the acquisition system you are using, I cannot be really to-the-point in my answer. Ft_denoise_pca has been designed to operate on 1) MEG data, that 2) has been acquired on a system that has external reference channels. I don’t know what reference channel you specified, but it seems you didn’t, and the function probably indeed defaulted to a value that caused the selection to be empty or so. But again, without additional info it’s hard to tell. Best and good luck, Jan-Mathijs On Sep 22, 2014, at 3:27 PM, Ashley Greene wrote: > Hello all, > > I hope someone will be able to help with this. I'm trying to run the denoise_pca function on data after preprocessing, but I continue to get the following error: > > Error using ./ > Matrix dimensions must agree. > > Error in ft_denoise_pca (line 193) > s1 = s./max(s(:)); > > Could it be due to the use of the default for refchannel? Forgive me for asking such simple questions, but how do I go about choosing the reference channel? Do I just choose the cleanest channel from that particular set of preprocessed data? > > Thanks in advance, > > Ashley > _______________________________________________ > 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 tzvetan.popov at uni-konstanz.de Tue Sep 23 09:52:24 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Tue, 23 Sep 2014 09:52:24 +0200 Subject: [FieldTrip] Questions about matrix lead field In-Reply-To: References: Message-ID: <1A0A6C2B-E384-45DE-81D4-1D90B91C3FFD@uni-konstanz.de> Hi, > According to: > "I need generate a 3D head model from a resonance, then co register this head model with 10-20 electrode system to create my lead field matrix. > this will work if you have the 3D position of the electrodes". > > I have only the patient MRIs, but no 3D positions of electrodes, just know that the system used in the acquisition is the 10-20 system with a number of fixed electrodes . Can i make my matrix Leadfield electrode using a template as standard_1020.elc? yes, yet on the expense of accuracy. See for instance here: http://journal.frontiersin.org/Journal/10.3389/fnins.2014.00042/full best tzvetan > > Regards > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 s.vanpelt at psych.ru.nl Tue Sep 23 09:55:22 2014 From: s.vanpelt at psych.ru.nl (Stan van Pelt) Date: Tue, 23 Sep 2014 09:55:22 +0200 (CEST) Subject: [FieldTrip] leadfields MNI-coordinates In-Reply-To: References: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> <03a401cfd677$a2538ab0$e6faa010$@vanpelt@psych.ru.nl> Message-ID: <042201cfd703$bab76a90$30263fb0$@vanpelt@psych.ru.nl> Hi Jan-Mathijs, Thanks, this indeed did the trick! Ergo, forward warping of coordinates 'pos' work like this: - mri_realign_mni=ft_volumenormalise([],mri_realign) - mnipos=ft_warp_apply(mri_realign_mni.params,ft_warp_apply(mri_realign_mni. initial, pos,'individual2sn') Inverse warping returns coordinates of mnipos in subject space (ctfpos): - posback=ft_warp_apply(mri_realign_mni.params,mnipos,'sn2individual') - ctfpos= ft_warp_apply(pinv(mri_realign_mni.initial),posback) Best, Stan From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of jan-mathijs schoffelen Sent: dinsdag 23 september 2014 7:22 To: FieldTrip discussion list Subject: Re: [FieldTrip] leadfields MNI-coordinates Hi Stan, Part of the solution you're looking for probably lies in the fact that both the forward and inverse warp are non-linear transformations (when the volumetric normalization is done with cfg.nonlinear = 'yes'). In other words, the inverse warp cannot be achieved by a simple linear transformation (i.e. the (p)inv of a xxx.transform matrix). Fortunately, ft_warp_apply supports both ft_warp_apply(params, pos, 'individual2sn'), and ft_warp_apply(params, pos, 'sn2individual'). The latter aims to achieve the inverse warp you're looking for. Probably you need to then also still apply the inverse of mri_realign_mni.initial. Best, JM On Sep 22, 2014, at 5:12 PM, Stan van Pelt wrote: Hi Eelke, Thanks a lot, I seem to have missed that thread, very informative! However, I seem not able yet to do the inverse warping, from MNI-coordinates to CTF-coordinates. - First I do mri_realign_mni=ft_volumenormalise([],mri_realign) - This gives me the transformation/normalization parameters from ctf->mni - As an example, I apply them to a random coordinate, here [3 5 6]: mnipos=ft_warp_apply(mri_realign_mni.params,ft_warp_apply(mri_realign_mni. initial,[3 5 6]),'individual2sn') - This gives me mni-coordinates -6.0652 -21.7174 -57.2273 - But how can I do the reverse? - If I do round(ft_warp_apply(pinv(mri_realign_mni.transform),mnipos)) I don't get [3 5 6] - It seems to me I should do something like ctfpos=ft_warp_apply(pinv(mri_realign_mni.params, mnipos),mnipos,'individual2sn') or so, but I am not getting it right... Best, Stan -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Eelke Spaak Sent: maandag 22 september 2014 13:20 To: FieldTrip discussion list Subject: Re: [FieldTrip] leadfields MNI-coordinates Hi Stan, Have a look at this recent thread on the list (4 messages, Tom and me, this is the starting message): http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008362.html I think that might help you. Groetjes, Eelke On 22 September 2014 12:44, Stan van Pelt wrote: Dear FieldTrippers, For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to compute leadfields at specific (MNI-)coordinates in the brain. I am trying to find out how that is most easily done using FieldTrip - The most intuitive way seems to me to warp the MNI template to the individual's brain (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_ individual_head_space_that_are_all_aligned_in_mni_space) , and then apply the warping parameters to the ROI's MNI-coordinates, and enter the subsequent CTF-coordinates into ft_prepare_leadfield. However, I am not sure where exactly I can find these parameters, and how to apply them. Are these the ones in [gridsrc].params (output ft_sourcemodel)? - Alternatively, should I run ft_volumenormalise to warp the brain to MNI-space, and then inversely apply the warping parameters to the ROI's MNI-coordinates? Again, where can I find the warping parameters in this case, and how should they be applied? Best, Stan - Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Centre for Cognition Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 _______________________________________________ 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 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 agreene24 at gmail.com Tue Sep 23 10:10:10 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Tue, 23 Sep 2014 17:10:10 +0900 Subject: [FieldTrip] denoise_pca error In-Reply-To: <3A35A4D9-0586-4E5F-AD0F-D07985BEA275@donders.ru.nl> References: <3A35A4D9-0586-4E5F-AD0F-D07985BEA275@donders.ru.nl> Message-ID: Hi Jan, I've done electrophysiological research but am a beginner with MEG, and I'm using the data from the Centre for Cognitive Neuroimaging provided from and used in the fieldtrip tutorial website. Ashley On Tue, Sep 23, 2014 at 2:31 PM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Ashley, > Since your e-mail did not contain any background information with respect > to the acquisition system you are using, I cannot be really to-the-point in > my answer. > Ft_denoise_pca has been designed to operate on > 1) MEG data, that > 2) has been acquired on a system that has external reference channels. > I don’t know what reference channel you specified, but it seems you > didn’t, and the function probably indeed defaulted to a value that caused > the selection to be empty or so. But again, without additional info it’s > hard to tell. > Best and good luck, > Jan-Mathijs > > > > On Sep 22, 2014, at 3:27 PM, Ashley Greene wrote: > > Hello all, > > I hope someone will be able to help with this. I'm trying to run the > denoise_pca function on data after preprocessing, but I continue to get the > following error: > > Error using ./ > Matrix dimensions must agree. > > Error in ft_denoise_pca (line 193) > s1 = s./max(s(:)); > > Could it be due to the use of the default for refchannel? Forgive me for > asking such simple questions, but how do I go about choosing the reference > channel? Do I just choose the cleanest channel from that particular set of > preprocessed data? > > Thanks in advance, > > Ashley > _______________________________________________ > 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 bibi.raquel at gmail.com Tue Sep 23 16:33:44 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Tue, 23 Sep 2014 10:33:44 -0400 Subject: [FieldTrip] Reading in .bdf files In-Reply-To: References: Message-ID: Hi Ricarda, The Biosemi system uses CMS & DRL during acquisition as the common mode for the ground electrode. Are you re-referencing your EEG signals, before viewing them in ft_databrowser? Best, Raquel On Mon, Sep 22, 2014 at 10:43 AM, Ricarda Braukmann < r.braukmann at donders.ru.nl> wrote: > Hi everyone, > > > I have a question regarding reading in Biosemi .bdf files. > > > I followed the example on the ft website to read in a .bdf file, and - > although it does not give an error- , the data looks very odd. In the > ft_databrowser for example the vertical scale is [ -178000 178000 ] > which seems very werid to me. > > > I tried re-referencing the data, like in the example, using channel > 'EXG5', but this did not help. > > > Is there anyone who has experience with reading in biosemi files who could > give me some advice? > > It would also be great if someone could explain to me what these EXG > channels are exactly. > > > I have for now turned to converting the .bdf file to .edf file (using the > converter from www.biosemi.com/download/ > ). > Then the data looks normal, but it created some other issues with my > markers and I would rather not use the converted files. > > More than anything, I am very curious what is going on with the original > file, so any help is much appreciated! > > > Thanks in advance! > > Ricarda > > > -- > > Ricarda Braukmann, MSc > PhD student > > > Radboud University Medical Centre & Baby Research Center > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Neuroscience & Centre for Cognition > > Room B.01.22 > Phone: +31 (0) 24 36 12652 > Email: r.braukmann at donders.ru.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 recasensmarc at gmail.com Tue Sep 23 16:45:18 2014 From: recasensmarc at gmail.com (Marc Recasens) Date: Tue, 23 Sep 2014 16:45:18 +0200 Subject: [FieldTrip] PhD and Postdoctoral positions in Majorca, Spain In-Reply-To: References: Message-ID: Hola Francisco, Soy Marc Recasens, del Grup de Recerca en Neurociència Cognitiva (*Brainlab*) de la UB. Te escribo en relació a la plaza posdoctoral que se ofrece en tu laboratorio. Estoy muy interesado en buscar una plaza posdoc ya que voy a hacer la defensa de mi tesis en los próximos meses. Me gustaría que tuvierais en cuenta mi perfil para cubrir dicha plaza.Creo que podría encajar muy bien y el proyecto que describes en la oferta es muy atractivos para mi (connectivity, M/EEG, clinical population...). Adjunto CV actualizado y la *motivation letter*. En el CV incluyo los nombres y datos de contacto de tres posibles referees que pueden dar cuenta del trabajo que he realizado hasta la fecha como *PhD student*. Carles entre ellos. Estoy 100% disponible para realizar una entrevista por Skype o presencial cuando sea. Atentamente, Marc Recasens. On Sat, Aug 23, 2014 at 12:33 AM, Francisco Barcelo wrote: > One PhD and one Postdoctoral research positions are available at the > Department of Psychology (University of Balearic Islands, Spain) to join an > ongoing project on the Cognitive neuroscience of executive control aimed to > assess functional and effective connectivity (e.g., Dynamic Causal > Modeling) in M/EEG data sets from healthy controls and brain injured > patients. The project aims to develop state-of-the-art neuropsychological > tools for a more valid and cost-effective evaluation of dysexecutive > symptoms in elderly adults and patients with frontal lobe lesions (cf., > Barceló & Knight, Cereb. Cortex, 2007; Nyhus & Barceló, Brain & Cognition, > 2009). > > Successful pre/postdoctoral candidates will hold a MSc/PhD in Psychology, > Biology, Cognitive Neuroscience, Physics, or related fields, and will play > a key role in designing, conducting, analyzing and reporting M/EEG studies, > with a focus on event-related potentials, oscillatory neural activity and > synchrony. Candidates will be fluent in English (knowledge of Spanish is > not required), and will prove good interpersonal and communication skills, > including writing to a high standard. Both positions are funded by the > Spanish Government (MINECO’s grant PSI2013-44760-R), as well as other local > research agencies. > > Requirements for the PhD student position: 1) EU citizenship; 2) a Master > degree and excellent academic marks; 3) Programming skills (eg., Matlab > will be a plus); and 4) Demonstrated ability and high motivation to conduct > high-quality research publishable in quality international peer-reviewed > journals. > > Requirements for the Postdoc position: 1) Strong background publishing EEG > and/or MEG studies; 2) Advanced programming skills (eg., Matlab, C, > Python); 3) Excellent command of EEG/MEG data analysis software (EEGLAB, > SPM8, Brainstorm, etc); and 4) demonstrate creative and independent work. > > Applicants must submit an updated CV in pdf format, a letter of > motivation, and the names and emails of two referees to the grant holder: > Francisco Barceló (f.barcelo at uib.es). The PhD studentship is for 3 years, > and the postdoc position is for one year, with the possibility of renewal. > Starting date October 1st 2014, or until the positions are filled. Informal > inquires are welcomed. For more information visit: www.mcst.es, or > www.neuropsicologiaclinica.es. > > ><><><><><><><><><><><><><>< > Francisco Barceló, PhD > Full Professor of Neuropsychology > University of Illes Balears (UIB) > Ctra. Valldemossa, km 7.5 > E-07122 Palma de Mallorca - Spain > Personal: www.mcst.es > Lab: www.neuropsicologiaclinica.es > Phone: 971 172750 > Fax: 971 172309 > ><><><><><><><><><><><><><>< > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Marc Recasens Tel.: +34 639 24 15 98 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CV2014b_english.pdf Type: application/pdf Size: 39360 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MOTIVATION LETTER.pdf Type: application/pdf Size: 12745 bytes Desc: not available URL: From matt.craddock at uni-leipzig.de Tue Sep 23 17:12:14 2014 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Tue, 23 Sep 2014 16:12:14 +0100 Subject: [FieldTrip] Reading in .bdf files In-Reply-To: References: Message-ID: <54218DCE.803@uni-leipzig.de> Hi Ricarda, The EXG channels are for external electrodes - typically they are used for things like eye movements (for example we always placed EXG1-4 at points around the eyes) and additional reference points (e.g. mastoids, earlobes). You'd need to check with whoever recorded the dataset to be sure which channel is which. I have not tried to read .bdfs using fieldtrip, as i usually do a lot of pre-processing in eeglab and port over to fieldtrip later on, but subtracting the mean of each channel (DC) as well as re-referencing may help. BDFs have a very high dynamic range which can have some unfortunate side effects at times: http://sccn.ucsd.edu/pipermail/eeglablist/2008/002147.html http://sccn.ucsd.edu/pipermail/eeglablist/2008/002229.html Cheers, Matt On 22/09/2014 15:43, Ricarda Braukmann wrote: > Hi everyone, > > > I have a question regarding reading in Biosemi .bdf files. > > > I followed the example on the ft website to read in a .bdf file, and - > although it does not give an error- , the data looks very odd. In the > ft_databrowser for example the vertical scale is [ -178000178000 ] which > seems very werid to me. > > > I tried re-referencing the data, like in the example, using channel > 'EXG5', but this did not help. > > > Is there anyone who has experience with reading in biosemi files who > could give me some advice? > > It would also be great if someone could explain to me what these EXG > channels are exactly. > > > I have for now turned to converting the .bdf file to .edf file (using > the converter from www.biosemi.com/download/ > ). > Then the data looks normal, but it created some other issues with my > markers and I would rather not use the converted files. > > More than anything, I am very curious what is going on with the original > file, so any help is much appreciated! > > > Thanks in advance! > > Ricarda -- Dr. Matt Craddock From r.braukmann at donders.ru.nl Tue Sep 23 17:11:26 2014 From: r.braukmann at donders.ru.nl (Ricarda Braukmann) Date: Tue, 23 Sep 2014 17:11:26 +0200 Subject: [FieldTrip] Reading in .bdf files Message-ID: Hi Rachel, Yes, I was wondering about the re-referencing because I indeed read that this was the necessary first step for Biosemi data. What would one usually re-reference the data to? I tried re-referencing to all electrodes (since no mastoid etc. has been collected) but this did not solve the issue for the .bdf file. It works for the converted .edf file in which the data looks much better from the start but I am not sure whether everything is going correctly. The data is quite noisy and also when trying to apply a high-pass filter later Matlab gives an error of unstable poles. I am not sure whether this is due to the actual properties of my data or whether it is still related to the way I read it in, so any suggestions are very welcome! Thanks a lot! Best, Ricarda On Tue, Sep 23, 2014 at 4:33 PM, Raquel Bibi wrote: > >> Hi Ricarda, >> The Biosemi system uses CMS & DRL during acquisition as the common mode >> for the ground electrode. Are you re-referencing your EEG signals, before >> viewing them in ft_databrowser? >> >> Best, >> >> Raquel >> >> On Mon, Sep 22, 2014 at 10:43 AM, Ricarda Braukmann < >> r.braukmann at donders.ru.nl> wrote: >> >>> Hi everyone, >>> >>> >>> I have a question regarding reading in Biosemi .bdf files. >>> >>> >>> I followed the example on the ft website to read in a .bdf file, and - >>> although it does not give an error- , the data looks very odd. In the >>> ft_databrowser for example the vertical scale is [ -178000 178000 ] >>> which seems very werid to me. >>> >>> >>> I tried re-referencing the data, like in the example, using channel >>> 'EXG5', but this did not help. >>> >>> >>> Is there anyone who has experience with reading in biosemi files who >>> could give me some advice? >>> >>> It would also be great if someone could explain to me what these EXG >>> channels are exactly. >>> >>> >>> I have for now turned to converting the .bdf file to .edf file (using >>> the converter from www.biosemi.com/download/ >>> ). >>> Then the data looks normal, but it created some other issues with my >>> markers and I would rather not use the converted files. >>> >>> More than anything, I am very curious what is going on with the original >>> file, so any help is much appreciated! >>> >>> >>> Thanks in advance! >>> >>> Ricarda >>> >>> >>> -- >>> >>> Ricarda Braukmann, MSc >>> PhD student >>> >>> >>> Radboud University Medical Centre & Baby Research Center >>> >>> Donders Institute for Brain, Cognition and Behaviour, >>> Centre for Neuroscience & Centre for Cognition >>> >>> Room B.01.22 >>> Phone: +31 (0) 24 36 12652 >>> Email: r.braukmann at donders.ru.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 >> > > > > -- Ricarda Braukmann, MSc PhD student Radboud University Medical Centre & Baby Research Center Donders Institute for Brain, Cognition and Behaviour, Centre for Neuroscience & Centre for Cognition Room B.01.22 Phone: +31 (0) 24 36 12652 Email: r.braukmann at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Tue Sep 23 18:02:36 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Tue, 23 Sep 2014 12:02:36 -0400 Subject: [FieldTrip] Reading in .bdf files In-Reply-To: References: Message-ID: Hi Ricarda, Some suggestions: 1. Did you include your EXG electrodes in the re-referenced channels? Perhaps you could remove these? 2.Review and exclude bad channels before re-referencing? I used the Biosemi Viewer before analyzing the data in Fieldtrip. 3. Re-reference to a single channel, like CZ(A1). I haven't worked with bdfs in a while, I had the same problems you're describing initially with my data. Here are a few solutions I remember offhand. I was able to resolve them without converting them to .cnt. Best, Raquel On Tue, Sep 23, 2014 at 11:11 AM, Ricarda Braukmann < r.braukmann at donders.ru.nl> wrote: > Hi Rachel, > > Yes, I was wondering about the re-referencing because I indeed read that > this was the necessary first step for Biosemi data. > What would one usually re-reference the data to? > > I tried re-referencing to all electrodes (since no mastoid etc. has been > collected) but this did not solve the issue for the .bdf file. > > It works for the converted .edf file in which the data looks much better > from the start but I am not sure whether everything is going correctly. > The data is quite noisy and also when trying to apply a high-pass filter > later Matlab gives an error of unstable poles. I am not sure whether this > is due to the actual properties of my data or whether it is still related > to the way I read it in, so any suggestions are very welcome! > > Thanks a lot! > Best, > Ricarda > > > On Tue, Sep 23, 2014 at 4:33 PM, Raquel Bibi >> wrote: >> >>> Hi Ricarda, >>> The Biosemi system uses CMS & DRL during acquisition as the common mode >>> for the ground electrode. Are you re-referencing your EEG signals, before >>> viewing them in ft_databrowser? >>> >>> Best, >>> >>> Raquel >>> >>> On Mon, Sep 22, 2014 at 10:43 AM, Ricarda Braukmann < >>> r.braukmann at donders.ru.nl> wrote: >>> >>>> Hi everyone, >>>> >>>> >>>> I have a question regarding reading in Biosemi .bdf files. >>>> >>>> >>>> I followed the example on the ft website to read in a .bdf file, and - >>>> although it does not give an error- , the data looks very odd. In the >>>> ft_databrowser for example the vertical scale is [ -178000 178000 ] >>>> which seems very werid to me. >>>> >>>> >>>> I tried re-referencing the data, like in the example, using channel >>>> 'EXG5', but this did not help. >>>> >>>> >>>> Is there anyone who has experience with reading in biosemi files who >>>> could give me some advice? >>>> >>>> It would also be great if someone could explain to me what these EXG >>>> channels are exactly. >>>> >>>> >>>> I have for now turned to converting the .bdf file to .edf file (using >>>> the converter from www.biosemi.com/download/ >>>> ). >>>> Then the data looks normal, but it created some other issues with my >>>> markers and I would rather not use the converted files. >>>> >>>> More than anything, I am very curious what is going on with the >>>> original file, so any help is much appreciated! >>>> >>>> >>>> Thanks in advance! >>>> >>>> Ricarda >>>> >>>> >>>> -- >>>> >>>> Ricarda Braukmann, MSc >>>> PhD student >>>> >>>> >>>> Radboud University Medical Centre & Baby Research Center >>>> >>>> Donders Institute for Brain, Cognition and Behaviour, >>>> Centre for Neuroscience & Centre for Cognition >>>> >>>> Room B.01.22 >>>> Phone: +31 (0) 24 36 12652 >>>> Email: r.braukmann at donders.ru.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 >>> >> >> >> >> > -- > > Ricarda Braukmann, MSc > PhD student > > > Radboud University Medical Centre & Baby Research Center > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Neuroscience & Centre for Cognition > > Room B.01.22 > Phone: +31 (0) 24 36 12652 > Email: r.braukmann at donders.ru.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 gamaliel.ghu at gmail.com Tue Sep 23 18:35:01 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Tue, 23 Sep 2014 13:35:01 -0300 Subject: [FieldTrip] Questions about matriz lead field Message-ID: Hi experts I hope you can help me prior information 1) I pretend work with EEG data simulation 2) I pretend use a template of sensor same as system 10-20 3) I have the anatomy of the patient in MRIs T2 contrast for generate the volume conduction I have the volume conduction model that I performed with the tutorial: " creating a volume conduction model of the head for source-reconstruction of eeg data" Now, I need simulate a dipole source into brain generated (volume conduction model). I have sent repeated questions about how to do this and you responded me with two reference pages: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit?s[]=ft&s[]=dipolesimulation and http://fieldtrip.fcdonders.nl/example/combineplanar_pipelineorder?s%20[%20]%20=%20planar%20&%20s%20[]%20=%20gradiente Now my questions are the next: In the first case (page 1): Can i add my own volume conduction instead of the concentric spheres describes in the example? I tried this but, i have not good results In the second case (page 2): This reference page says that the script is specific to MEG, and not use a vol especific (use a concentric sphere). Can i use the sript as example for generate my personal dipole source in my volume conduction model? Sorry for my continuous questions, but i am new in this world, the final objective of this is try of generate my own sources to generate my own simulate eeg data, and next aplicate the source analysis to found the same position of the dipole best -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From dylan.delosangeles at gmail.com Wed Sep 24 02:32:41 2014 From: dylan.delosangeles at gmail.com (Dylan DeLosAngeles) Date: Wed, 24 Sep 2014 10:02:41 +0930 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design Message-ID: Hello, So far, the tutorial on "Cluster-based permutation tests on time-frequency data" has been very helpful. Out of the four combinations from the two UO-types (subjects and trials) and the two experimental designs (between- and within-UO), the tutorial covers statistics on data in two conditions in a between-trials, in a within-trials and in a within-subjects design. However, I am wondering if there is any information about the fourth type of experiment design: between-subjects. I have data for 2 groups with 12 subjects in each group. Both groups are measured during 11 conditions. Can I approach this in a similar fashion to within-subjects design (multiple subjects in multiple experimental conditions), such that my design is multiple *groups* in multiple experimental conditions. Is it a case of first averaging over all trials belonging to each of the experimental conditions for each subject (as instructed in tutorial), and then averaging over all subjects in each group? Configuration code for setting up the design currently looks like this; grp = 2; subj = 11; design = zeros(2, subj*grp); for i = 1:grp design(1,i:2:end) = i; end idx = 1; for i = 1:subj design(2,idx:idx+1) = i; idx = idx+2; end Is there anything else I need to take into consideration when doing these statistics? Thank you, Dr Dylan DeLosAngeles Research Fellow Brain Signal Laboratory Flinders University -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksenj at ohsu.edu Wed Sep 24 05:57:57 2014 From: eriksenj at ohsu.edu (K Jeffrey Eriksen) Date: Wed, 24 Sep 2014 03:57:57 +0000 Subject: [FieldTrip] FDM and FEM forward models Message-ID: I just joined this list. I am interested in accurate FDM and FEM models for EEG forward solutions, and note that both seem to be available in some form with FieldTrip. MY question is, can these accommodate custom head models based on individual MRIs and/or CTs, or do they use a generic head of some sort? Thanks, -Jeff Eriksen -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Sep 24 07:59:31 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 24 Sep 2014 07:59:31 +0200 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: Hello Dylan, You can analyse a between-subjects design exactly as you would a between-trials design (at least as far as the statistics step is concerned), in both cases the two conditions correspond to two groups of observations, and not to the same group of observations measured in two separate conditions (which would be a within-UO design). In FieldTrip, you would typically compute averages per subject, then use an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic (not depsamples). indepsamplesT only requires one row in the design matrix, indicating the condition. Note that if you have e.g. timelock structures in two (or more) cell arrays, corresponding to the conditions, you can input them into the statistics function as follows: stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); without having to call ft_timelockgrandaverage. In fact, the above is the preferred way to do statistics now. (The same holds for ft_freqstatistics.) Hope that helps, Best, Eelke On 24 September 2014 02:32, Dylan DeLosAngeles wrote: > Hello, > > So far, the tutorial on "Cluster-based permutation tests on time-frequency > data" has been very helpful. > > Out of the four combinations from the two UO-types (subjects and trials) and > the two experimental designs (between- and within-UO), the tutorial covers > statistics on data in two conditions in a between-trials, in a within-trials > and in a within-subjects design. However, I am wondering if there is any > information about the fourth type of experiment design: between-subjects. > > I have data for 2 groups with 12 subjects in each group. Both groups are > measured during 11 conditions. > Can I approach this in a similar fashion to within-subjects design (multiple > subjects in multiple experimental conditions), such that my design is > multiple groups in multiple experimental conditions. Is it a case of first > averaging over all trials belonging to each of the experimental conditions > for each subject (as instructed in tutorial), and then averaging over all > subjects in each group? > > Configuration code for setting up the design currently looks like this; > grp = 2; > subj = 11; > design = zeros(2, subj*grp); > > for i = 1:grp > design(1,i:2:end) = i; > end > > idx = 1; > for i = 1:subj > design(2,idx:idx+1) = i; > idx = idx+2; > end > > Is there anything else I need to take into consideration when doing these > statistics? > > Thank you, > Dr Dylan DeLosAngeles > Research Fellow > Brain Signal Laboratory > Flinders University > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Wed Sep 24 08:02:17 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 24 Sep 2014 08:02:17 +0200 Subject: [FieldTrip] FDM and FEM forward models In-Reply-To: References: Message-ID: Hi Jeff, All the forward modelling in FieldTrip is based on a user-specified MRI (preferably an individual one, but can be a template brain if an individual MRI is not available). You probably will want to have a look at this tutorial: http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg Best, Eelke On 24 September 2014 05:57, K Jeffrey Eriksen wrote: > I just joined this list. I am interested in accurate FDM and FEM models for > EEG forward solutions, and note that both seem to be available in some form > with FieldTrip. MY question is, can these accommodate custom head models > based on individual MRIs and/or CTs, or do they use a generic head of some > sort? > > > > Thanks, > > -Jeff Eriksen > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tzvetan.popov at uni-konstanz.de Wed Sep 24 10:58:45 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Wed, 24 Sep 2014 10:58:45 +0200 Subject: [FieldTrip] Questions about matriz lead field In-Reply-To: References: Message-ID: <83E25E9B-CF0F-41A5-B4FD-C4F45CDE7C5A@uni-konstanz.de> Allright then, > Sorry for my continuous questions, but i am new in this world, the final objective of this is try of generate my own sources to generate my own simulate eeg data, and next aplicate the source analysis to found the same position of the dipole here is what I would do using the standard head model and standard electrodes provided with fieldtrip. Just exchange the head model with your desired head model and make sure that the units match and the alignment of elec’s and vol is correct. good luck tzvetan load ('/Users/zez/Documents/matlabtools/fieldtrip-20140518/template/headmodel/standard_bem'); load ('/Users/zez/Documents/matlabtools/fieldtrip-20140518/template/headmodel/standard_mri'); elec = ft_read_sens('/Users/zez/Documents/matlabtools/fieldtrip-20140518/template/electrode/standard_1020.elc'); %% ft_plot_mesh(vol.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); hold on; ft_plot_mesh(vol.bnd(2),'edgecolor','none','facealpha',0.4); hold on; ft_plot_mesh(vol.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); hold on; ft_plot_sens(elec,'style', 'sk'); %% cfg=[]; cfg.method = 'ortho'; figure; ft_sourceplot(cfg,mri); %% cfg=[]; cfg.dip.pos = [55 -7 5];%dipole located in the right heschl gyrus cfg.dip.mom = [0 0 -1]; cfg.dip.frequency = 10; cfg.dip.phase = 2; cfg.dip.amplitude = 1; cfg.ntrials = 20; cfg.triallength = 2; cfg.fsample = 100; cfg.vol = vol; cfg.elec = elec; cfg.relnoise = 0.1; data = ft_dipolesimulation(cfg); data.elec = elec; %% cfg = []; cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 2:2:30; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = 0:0.05:2; % time window "slides" from 0 to 2 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, data); TLK = ft_timelockanalysis([],data); %% plot the simulated signal in time and time-freq space cfg = []; cfg.channel = {'FC2', 'FC4', 'FC6', 'FT8', 'C2', 'C4', 'C6', 'T8', 'T4'}; cfg.renderer = 'zbuffer'; cfg.xlim = [0.5 1.5]; figure subplot(2,2,1);ft_singleplotTFR(cfg, TFRhann); subplot(2,2,2);ft_singleplotER(cfg,TLK); cfg.channel = {'EEG'}; subplot(2,2,3);ft_topoplotTFR(cfg, TFRhann); subplot(2,2,4);ft_topoplotER(cfg,TLK); %% cfg = []; cfg.latency = [0.5 1.5]; % specify latency window cfg.numdipoles = 1; cfg.vol = vol; cfg.grid.resolution = 10; cfg.grid.unit = 'mm'; dip = ft_dipolefitting(cfg, TLK); %% plot the location of the dipole cfg = []; cfg.location = dip.dip.pos; figure; ft_sourceplot(cfg, mri) > > > best > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 spa268 at nyu.edu Wed Sep 24 11:17:53 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Wed, 24 Sep 2014 13:17:53 +0400 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design Message-ID: Hi Eelke, Thanks for this information. I just wanted to jump in and ask: what about for interactions in a mixed 2x2 design? For example, say I expect a difference between conditions A and B for group 1, but not group 2. Would the correct way to do this be to 1) make difference waves (A-B) for each participant, then 2) do a between-UO test on the difference waves using indepsamplesT? In the past I have always tested within-UO interactions using basically this method (based on http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html), but I was under the impression that this is not OK for mixed designs (from this post: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004244.html) Thanks, Steve > > ------------------------------ > > Message: 12 > Date: Wed, 24 Sep 2014 07:59:31 +0200 > From: Eelke Spaak > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > Message-ID: > < CABPNLUomYPTw6m__+Wx8jRJc8HvyU-Pqc4Q7+G7czOjD502dfA at mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > wrote: > > Hello, > > > > So far, the tutorial on "Cluster-based permutation tests on time-frequency > > data" has been very helpful. > > > > Out of the four combinations from the two UO-types (subjects and trials) and > > the two experimental designs (between- and within-UO), the tutorial covers > > statistics on data in two conditions in a between-trials, in a within-trials > > and in a within-subjects design. However, I am wondering if there is any > > information about the fourth type of experiment design: between-subjects. > > > > I have data for 2 groups with 12 subjects in each group. Both groups are > > measured during 11 conditions. > > Can I approach this in a similar fashion to within-subjects design (multiple > > subjects in multiple experimental conditions), such that my design is > > multiple groups in multiple experimental conditions. Is it a case of first > > averaging over all trials belonging to each of the experimental conditions > > for each subject (as instructed in tutorial), and then averaging over all > > subjects in each group? > > > > Configuration code for setting up the design currently looks like this; > > grp = 2; > > subj = 11; > > design = zeros(2, subj*grp); > > > > for i = 1:grp > > design(1,i:2:end) = i; > > end > > > > idx = 1; > > for i = 1:subj > > design(2,idx:idx+1) = i; > > idx = idx+2; > > end > > > > Is there anything else I need to take into consideration when doing these > > statistics? > > > > Thank you, > > Dr Dylan DeLosAngeles > > Research Fellow > > Brain Signal Laboratory > > Flinders University > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > All the forward modelling in FieldTrip is based on a user-specified > MRI (preferably an individual one, but can be a template brain if an > individual MRI is not available). You probably will want to have a > look at this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed Sep 24 17:26:28 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 24 Sep 2014 17:26:28 +0200 Subject: [FieldTrip] fieldtrip website updated Message-ID: <70EE18B4-801F-48EF-8CC3-9913B71E3FD5@donders.ru.nl> Dear all, This afternoon we have updated the software of the FieldTrip website. We encountered some compatibility issues with our own custom extensions. As a consequence, some things have changed slightly and some parts still need minor improvements. For example the search function is not yet 100% functional. If you notice something on the website that does not work as expected, please report it at http://bugzilla.fcdonders.nl/show_bug.cgi?id=2693 thanks Robert From katrinheimann at gmail.com Thu Sep 25 15:53:14 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Thu, 25 Sep 2014 15:53:14 +0200 Subject: [FieldTrip] numcomponent problem in ica Message-ID: Hey experts, I have a problem with an ICA. What I am basically doing is running an ICA on a big dataset and then removing the identified components from smaller datasets of the same subject. Due to interpolated channels I do reduce the components using numcomponent. But there seems to be a problem with this: My code is cfg = []; cfg.channel = {'all'}; cfg.numcomponent = 126 comp = ft_componentanalysis(cfg,obs_data_clean1); save (strcat(sb,'comp_all') , 'comp') and matlab writes: the input is component data with 126 components and 129 original channels detected 0 visual artifacts the input is component data with 126 components and 129 original channels processing trials just as expected! then I want to use this ica for cleaning a smaller dataset so I wrote: cfg = []; cfg.numcomponent = 126; cfg.unmixing = comp.unmixing; cfg.topolabel = comp.topolabel; comp_1 = ft_componentanalysis(cfg, obs90_data); the program again tells me: the input is raw data with 129 channels and 80 trials selecting 129 channels baseline correcting data scaling data with 1 over 126.842103 not concatenating data starting decomposition using predetermined unmixing matrix the call to "ft_componentanalysis" took 2 seconds and required the additional allocation of an estimated 574 MB then I remove the component I identified before as blinking cfg = []; cfg.component = [1]; obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') and suddenly matlab says: baseline correcting data removing 1 components keeping 128 components processing trials processing trial 80 from 80 Why does is speak of 129 (128+1) components??? My comp and comp_1 objects only have 126 components!!! Is it doing the right thing? Thanks again for your help! Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From gamaliel.ghu at gmail.com Thu Sep 25 18:23:00 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Thu, 25 Sep 2014 13:23:00 -0300 Subject: [FieldTrip] Problem with standard_1020.elc file Message-ID: Hi all I have the next problem: When I read the standard_1020.elc file of my FieldTrip documents. reading shows the following: elec = ft_read_sens('standard_1020.elc') elec = chanpos: [97x3 double] elecpos: [97x3 double] label: {97x1 cell} type: 'eeg1010' unit: 'mm' I know that the 1020 system is different system 1010, but reading the standard_1020.elc file that comes by default in my Fieldtrip folder. Apparently not contain the informations system 1020 but 1010. have you a page where you can download the correct file standard_1020.elc? Another question is: Where I can get the files that come by default in fieldtrip: standard_bem and standard_mri? My template folder fieldtrip not have them by default. greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Thu Sep 25 18:48:26 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Thu, 25 Sep 2014 18:48:26 +0200 Subject: [FieldTrip] Problem with standard_1020.elc file In-Reply-To: References: Message-ID: <8E550D9B-3433-424F-94C1-27EE95C60DFD@uni-konstanz.de> Hi, please download a recent FieldTrip version and do this on the command line: restoredefaultpath addpath /yourpath/fieldtrip ft_defaults If you follow these instructions: http://fieldtrip.fcdonders.nl/faq/should_i_add_fieldtrip_with_all_subdirectories_to_my_matlab_path?s[]=genpath everything should work for you. best tzvetan > Hi all > > I have the next problem: > > When I read the standard_1020.elc file of my FieldTrip documents. reading shows the following: > > elec = ft_read_sens('standard_1020.elc') > > elec = > > chanpos: [97x3 double] > elecpos: [97x3 double] > label: {97x1 cell} > type: 'eeg1010' > unit: 'mm' > > > I know that the 1020 system is different system 1010, but reading the standard_1020.elc file that comes by default in my Fieldtrip folder. Apparently not contain the informations system 1020 but 1010. > > have you a page where you can download the correct file standard_1020.elc? > > Another question is: > > Where I can get the files that come by default in fieldtrip: > > standard_bem and standard_mri? > > My template folder fieldtrip not have them by default. > > > greetings > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 linkgoron at gmail.com Fri Sep 26 20:24:34 2014 From: linkgoron at gmail.com (Nitzan Uziely) Date: Fri, 26 Sep 2014 21:24:34 +0300 Subject: [FieldTrip] Fwd: Using Akaike Information Criterion for order selection with ft_mvaranalysis In-Reply-To: References: Message-ID: Hi, My name is Nitzan Uziely, and I'm a student (under-grad) at the Hebrew University of Jerusalem. I'm using fieldtrip to process EEG signals at our lab, and I'm trying to run a PDC analysis on my data. I took the data, calculated the inverse-solution and segmented it into virtual channels using the AAL atlas. I'm trying to to calculate the correct order for the ft_mvaranalysis function. I've seen a previous question that went unanswered a few years ago about order selection ( http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003947.html). Following the above question, I searched how to calculate the Akaike Information Criterion (AIC) to calculate the correct model order. According to http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ I need to calculate the determinant of the noise covariance matrix, however the determinant (I've checked orders 1 to 10) is so small that matlab just rounds it to zero. This makes me feel that either I have a problem, I've misunderstood how to calculate AIC to select the correct model, or that AIC is not the correct way to go. So, my question is - does it seem that is something wrong with my data (which can be seen by the small determinant), am I misunderstanding the requirement of the determinant or is there a better way to select the order of the mvar model. (oh, I'm using mdcfg.toolbox = 'bsmart'; if it matters) Thanks, Nitzan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Sat Sep 27 02:42:21 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Fri, 26 Sep 2014 14:42:21 -1000 Subject: [FieldTrip] Where to add a trialfun? Message-ID: Hello all! I'm having a simple problem. I want to add this trialfun: http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun I get this error: Reference to non-existent field 'trialdef'. Error in trialfun_bit2dec (line 52) if strcmp(event(i).type, cfg.trialdef.eventtype) I'm quite sure it's because I'm not writing it in the correct part of my script. This is my trial definition part. Where should I add it and how should I write the line? % TRIAL DEFINITION cfg=[]; cfg.filename = ['my/folders/', subject, '.RAW']; cfg.headerfile = ['my/folders/', subject, '.RAW']; cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = cgrmrk; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 1; cfg.trialdef.eventtype=?; cfg = definetrial(cfg); trl = cfg.trl; cfg=[]; cfg.dataset = ['my/folders/', subject, '.RAW']; cfg.trl = trl; cfg.reref = 'yes'; cfg.refchannel = ['all']; THANKS! -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Sat Sep 27 11:05:40 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Sat, 27 Sep 2014 11:05:40 +0200 (CEST) Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: Message-ID: <1456425059.1815959.1411808740191.JavaMail.root@indus.zimbra.ru.nl> Hi Ana Laura, In general, you need to determine which trial function (Trialfun) to use when using definetrial (see this tutorial: http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the trial definition for the fully incongruent (FIC) condition). Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to your code before calling definetrial (see below). % TRIAL DEFINITION cfg=[]; cfg.filename = ['my/folders/', subject, '.RAW']; cfg.headerfile = ['my/folders/', subject, '.RAW']; cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = cgrmrk; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 1; cfg.trialdef.eventtype=?; cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition cfg = definetrial(cfg); As an addition note: based on your error message, it seemed that the problem was in the function trialfun_bit2dec. However, from the code you showed us, you haven't referenced/called this function. I was wondering if the code you provide corresponded to the code that created your error message? I'm guessing you ran [trl] =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which case, it was looking for cfg.trialdef.eventtype. You can call trialfun_bit2dec as long as you have all the relevant information in the cfg (which is in the code you showed us). Hope this helps. Best, Nietzsche ----- Original Message ----- > From: "Ana Laura Diez Martini" > To: "FieldTrip discussion list" > Sent: Saturday, 27 September, 2014 2:42:21 AM > Subject: [FieldTrip] Where to add a trialfun? > Hello all! I'm having a simple problem. I want to add this trialfun: > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > I get this error: > > > > Reference to non-existent field 'trialdef'. > > > Error in trialfun_bit2dec (line 52) > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > I'm quite sure it's because I'm not writing it in the correct part of > my script. This is my trial definition part. Where should I add it and > how should I write the line? > > > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['my/folders/', subject, '.RAW']; > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > cfg.trialdef.eventtype=?; > > > cfg = definetrial(cfg); > > > trl = cfg.trl; > cfg=[]; > cfg.dataset = ['my/folders/', subject, '.RAW']; > cfg.trl = trl; > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > > > THANKS! > _______________________________________________ > 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 matt.gerhold at gmail.com Sat Sep 27 12:52:50 2014 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Sat, 27 Sep 2014 12:52:50 +0200 Subject: [FieldTrip] Taper Function MVAR Model Fit Message-ID: Hi, I have a question(s) regarding the MVAR model fitting routine in FieldTrip. I haven't had enough time outside of my current commitments to scan through the MATLAB code when fitting the model. I hope to do so at some point. Given my time constraints, I wonder if it will be possible for you to answer one or two questions regarding the treatment of the data prior to model fitting? Is it necessary to apply a taper function such as a hamming window prior to fitting the model? I've gone through a few papers and no authors have explicitly mentioned it in the context of EEG and EMG/EEG MVAR modelling. How does the FieldTrip routine execute in default mode with regards to a taper function in the MVAR routine? What would you recommend as authors of the code and as experienced practitioners of the method(s)? Many Thanks, Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Sat Sep 27 19:18:25 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Sat, 27 Sep 2014 07:18:25 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: <1456425059.1815959.1411808740191.JavaMail.root@indus.zimbra.ru.nl> References: <1456425059.1815959.1411808740191.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Thank you Nietzsche! I added it where you suggested and now this is the error I get: Error using feval Invalid function name 'trialfun_bit2dec(cfg)'. Error in definetrial (line 105) trl = feval(cfg.trialfun, cfg); Error in process_ERP_1_fieldtrip (line 97) cfg = definetrial(cfg); Something I was worried about is that I use an old version of Fieldtrip for my scripts because I wrote them long ago and this trialfun uses the new format (with 'ft_s',etc.). Could this affect it in any way? Thanks again! On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche wrote: > Hi Ana Laura, > > In general, you need to determine which trial function (Trialfun) to use > when using definetrial (see this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the trial > definition for the fully incongruent (FIC) condition). > > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to your > code before calling definetrial (see below). > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['my/folders/', subject, '.RAW']; > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > cfg.trialdef.eventtype=?; > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun > definition > cfg = definetrial(cfg); > > > As an addition note: based on your error message, it seemed that the > problem was in the function trialfun_bit2dec. However, from the code you > showed us, you haven't referenced/called this function. I was wondering if > the code you provide corresponded to the code that created your error > message? I'm guessing you ran [trl] =trialfun_bit2dec(cfg) directly (i.e. > not via definetrial). In which case, it was looking for > cfg.trialdef.eventtype. You can call trialfun_bit2dec as long as you have > all the relevant information in the cfg (which is in the code you showed > us). Hope this helps. > > Best, > Nietzsche > > > > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" > > To: "FieldTrip discussion list" > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > Subject: [FieldTrip] Where to add a trialfun? > > Hello all! I'm having a simple problem. I want to add this trialfun: > > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > I get this error: > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > Error in trialfun_bit2dec (line 52) > > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > > > > I'm quite sure it's because I'm not writing it in the correct part of > > my script. This is my trial definition part. Where should I add it and > > how should I write the line? > > > > > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > > > > > cfg = definetrial(cfg); > > > > > > trl = cfg.trl; > > cfg=[]; > > cfg.dataset = ['my/folders/', subject, '.RAW']; > > cfg.trl = trl; > > cfg.reref = 'yes'; > > cfg.refchannel = ['all']; > > > > > > THANKS! > > _______________________________________________ > > 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 katrinheimann at gmail.com Sun Sep 28 11:54:54 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 28 Sep 2014 11:54:54 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point Message-ID: Dear all, I know I asked this already twice, but I did not get the right answer yet and just cannot figure it out myself. So, I did cut my data in quite large trials using ft_define trial and logging it to the beginning of a slide. cfg = []; cfg.dataset = name; cfg.trialfun = 'ft_trialfun_general'; % this is the default cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger cfg.trialdef.prestim = 0.216; % in seconds cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) cfg = ft_definetrial(cfg); % cancel out training trials cfg.trl([1:4],:) = []; %change timeline according to constant offset of 16 ms = 8 samples (because recorded with 500 hz)in %structure trial - plus delay reported by EGE = 18 ms = 9 samples cfg.trl(:,3)=cfg.trl(:,3)-17 Then I preprocessed these trials %% preprocess data cfg.channel = 'all'; cfg.preproc.detrend = 'yes'; cfg.preproc.demean = 'yes'; cfg.preproc.baselinewindow = [-0.1 0] % mov_data = ft_preprocessing(cfg); % save (strcat(sb,'mov_data') , 'mov_data') Now I wanna cut out smaller pieces that are centered around another trigger - the response of the subject. I did not use this trigger at the beginning as then defining a baselinewindow is impossible (as the response is always happening at a different time). I tried to just use ft_definetrial again, as I don't see a possibility to use ft_redefine trial: cfg = [] cfg.dataset= strcat(sb,'mov_data.mat') cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'resp' cfg.trialdef.prestim = 0.75 cfg.trialdef.poststim = 0.75 mov_data_small = ft_definetrial(cfg) but I get the error message: Error using ft_read_header (line 1833) unsupported header format (matlab) Error in ft_trialfun_general (line 71) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); Error in ft_definetrial (line 169) [trl, event] = feval(cfg.trialfun, cfg); I wonder if that is as the file produced by fieldtrip during the preprocessing is not one that is specified for ft_read_header - but how do I deal with this? Thanks a lot for your help Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From anne.urai at gmail.com Sun Sep 28 18:35:57 2014 From: anne.urai at gmail.com (Anne Urai) Date: Sun, 28 Sep 2014 18:35:57 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point In-Reply-To: References: Message-ID: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> Dear Katrin, if you use a custom trialfun (http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition) you can code the time between stimulus onset and response in an additional column. That way, you can shift the time axis of the data by this amount on each trial. For example: % redefine trials offset = (data.trialinfo(:,RTcol)); prestim = 1; poststim = 2; cfg = []; cfg.begsample = round(offset - prestim*data.fsample); cfg.endsample = round(offset + poststim*data.fsample); data = ft_redefinetrial(cfg, data); % then shift the time axis cfg = []; cfg.offset = -offset; data = ft_redefinetrial(cfg, data); % timelock cfg = []; cfg.keeptrials = 'yes'; data = ft_timelockanalysis(cfg, data); That way, your new data structure will now be response locked. Note that the timelockanalysis is optional, and only works when you have trials that are all the same length. If you do not want to use a custom trialfun, you could also rerun the same analysis as you have for the stimulus-locked data, but then taking the response code as your eventvalue. Good luck, --- Anne E. Urai, MSc PhD student | Institut für Neurophysiologie und Pathophysiologie | Universitätsklinikum Hamburg-Eppendorf Martinistrasse 52, 20246 Hamburg, Germany | http://anneurai.wordpress.com On 28 Sep 2014, at 11:54, KatrinH Heimann wrote: > Dear all, > I know I asked this already twice, but I did not get the right answer yet and just cannot figure it out myself. > So, I did cut my data in quite large trials using ft_define trial and logging it to the beginning of a slide. > > cfg = []; > cfg.dataset = name; > cfg.trialfun = 'ft_trialfun_general'; % this is the default > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger > cfg.trialdef.prestim = 0.216; % in seconds > cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) > cfg = ft_definetrial(cfg); > > % cancel out training trials > cfg.trl([1:4],:) = []; > > %change timeline according to constant offset of 16 ms = 8 samples (because recorded with 500 hz)in > %structure trial - plus delay reported by EGE = 18 ms = 9 samples > cfg.trl(:,3)=cfg.trl(:,3)-17 > > > > Then I preprocessed these trials > > %% preprocess data > cfg.channel = 'all'; > cfg.preproc.detrend = 'yes'; > cfg.preproc.demean = 'yes'; > cfg.preproc.baselinewindow = [-0.1 0] > % > mov_data = ft_preprocessing(cfg); > % > save (strcat(sb,'mov_data') , 'mov_data') > > > Now I wanna cut out smaller pieces that are centered around another trigger - the response of the subject. I did not use this trigger at the beginning as then defining a baselinewindow is impossible (as the response is always happening at a different time). > > I tried to just use ft_definetrial again, as I don't see a possibility to use ft_redefine trial: > > cfg = [] > cfg.dataset= strcat(sb,'mov_data.mat') > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'resp' > cfg.trialdef.prestim = 0.75 > cfg.trialdef.poststim = 0.75 > > mov_data_small = ft_definetrial(cfg) > > but I get the error message: > > Error using ft_read_header (line 1833) > unsupported header format (matlab) > > Error in ft_trialfun_general (line 71) > hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); > > Error in ft_definetrial (line 169) > [trl, event] = feval(cfg.trialfun, cfg); > > > I wonder if that is as the file produced by fieldtrip during the preprocessing is not one that is specified for ft_read_header - but how do I deal with this? > > Thanks a lot for your help > > Katrin > _______________________________________________ > 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 katrinheimann at gmail.com Sun Sep 28 19:02:40 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 28 Sep 2014 19:02:40 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point In-Reply-To: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> References: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> Message-ID: Thanks Anne! I will try that! :) Katrin 2014-09-28 18:35 GMT+02:00 Anne Urai : > Dear Katrin, > > if you use a custom trialfun ( > http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition) > you can code the time between stimulus onset and response in an additional > column. That way, you can shift the time axis of the data by this amount on > each trial. For example: > > % redefine trials > offset = (data.trialinfo(:,RTcol)); > prestim = 1; > poststim = 2; > > > cfg = []; > cfg.begsample = round(offset - prestim*data.fsample); > cfg.endsample = round(offset + poststim*data.fsample); > data = ft_redefinetrial(cfg, data); > > > % then shift the time axis > cfg = []; > cfg.offset = -offset; > data = ft_redefinetrial(cfg, data); > > % timelock > cfg = []; > cfg.keeptrials = 'yes'; > data = ft_timelockanalysis(cfg, data); > > That way, your new data structure will now be response locked. Note that > the timelockanalysis is optional, and only works when you have trials that > are all the same length. > > If you do not want to use a custom trialfun, you could also rerun the same > analysis as you have for the stimulus-locked data, but then taking the > response code as your eventvalue. > > Good luck, > > --- > Anne E. Urai, MSc > PhD student | Institut für Neurophysiologie und Pathophysiologie > | Universitätsklinikum Hamburg-Eppendorf > Martinistrasse 52, 20246 Hamburg, Germany | http://anneurai.wordpress.com > > > > > > On 28 Sep 2014, at 11:54, KatrinH Heimann wrote: > > Dear all, > I know I asked this already twice, but I did not get the right answer yet > and just cannot figure it out myself. > So, I did cut my data in quite large trials using ft_define trial and > logging it to the beginning of a slide. > > cfg = []; > cfg.dataset = name; > cfg.trialfun = 'ft_trialfun_general'; % this is the default > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger > cfg.trialdef.prestim = 0.216; % in seconds > cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) > cfg = ft_definetrial(cfg); > > > % cancel out training trials > cfg.trl([1:4],:) = []; > > > %change timeline according to constant offset of 16 ms = 8 samples > (because recorded with 500 hz)in > %structure trial - plus delay reported by EGE = 18 ms = 9 samples > cfg.trl(:,3)=cfg.trl(:,3)-17 > > > > > > Then I preprocessed these trials > > %% preprocess data > cfg.channel = 'all'; > cfg.preproc.detrend = 'yes'; > cfg.preproc.demean = 'yes'; > cfg.preproc.baselinewindow = [-0.1 0] > % > mov_data = ft_preprocessing(cfg); > % > save (strcat(sb,'mov_data') , 'mov_data') > > > > Now I wanna cut out smaller pieces that are centered around another > trigger - the response of the subject. I did not use this trigger at the > beginning as then defining a baselinewindow is impossible (as the response > is always happening at a different time). > > I tried to just use ft_definetrial again, as I don't see a possibility to > use ft_redefine trial: > > cfg = [] > cfg.dataset= strcat(sb,'mov_data.mat') > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'resp' > cfg.trialdef.prestim = 0.75 > cfg.trialdef.poststim = 0.75 > > > mov_data_small = ft_definetrial(cfg) > > but I get the error message: > > Error using ft_read_header (line 1833) > unsupported header format (matlab) > > Error in ft_trialfun_general (line 71) > hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); > > Error in ft_definetrial (line 169) > [trl, event] = feval(cfg.trialfun, cfg); > > > > I wonder if that is as the file produced by fieldtrip during the > preprocessing is not one that is specified for ft_read_header - but how do > I deal with this? > > Thanks a lot for your help > > Katrin > _______________________________________________ > 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 n.lam at fcdonders.ru.nl Mon Sep 29 10:45:53 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Mon, 29 Sep 2014 10:45:53 +0200 (CEST) Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: Message-ID: <1618358664.1830927.1411980353708.JavaMail.root@indus.zimbra.ru.nl> Hi Ana Laura, I've now noticed that you use "definetrial(cfg)" instead of "ft_definetrial", it was probably about 5 years ago that we used "definetrial". We do maintain backward compatibility, but from what I can see "trialfun_bit2dec" was only written this year, so that is probably why "definetrial" doesn't recognize it, and you get the error message "Error using feval Invalid function name 'trialfun_bit2dec(cfg)". For a bit more background, we constantly change, and update these changes in FieldTrip, so it would be best to get the newest version of Fieldtrip, and adjust your script(s) accordingly. You also referred to "this trialfun" in your email. Both "trialfun_bit2dec" and "ft_trialfun_general" are trialfuns (trial functions). Ft_definetrial is not (strictly) a trial function. Ft_definetrial gets information from a trial function (like one of the two aforementioned, or you can custom write your own) and then segments the data accordingly. Best, Nietzsche ----- Original Message ----- > From: "Ana Laura Diez Martini" > To: "FieldTrip discussion list" > Sent: Saturday, 27 September, 2014 7:18:25 PM > Subject: Re: [FieldTrip] Where to add a trialfun? > Thank you Nietzsche! > > > I added it where you suggested and now this is the error I get: > > > > Error using feval > Invalid function name 'trialfun_bit2dec(cfg)'. > > > Error in definetrial (line 105) > trl = feval(cfg.trialfun, cfg); > > > Error in process_ERP_1_fieldtrip (line 97) > cfg = definetrial(cfg); > > > Something I was worried about is that I use an old version of > Fieldtrip for my scripts because I wrote them long ago and this > trialfun uses the new format (with 'ft_s',etc.). Could this affect it > in any way? > > > Thanks again! > > > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < > n.lam at fcdonders.ru.nl > wrote: > > > Hi Ana Laura, > > In general, you need to determine which trial function (Trialfun) to > use when using definetrial (see this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the > trial definition for the fully incongruent (FIC) condition). > > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to > your code before calling definetrial (see below). > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['my/folders/', subject, '.RAW']; > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > cfg.trialdef.eventtype=?; > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition > cfg = definetrial(cfg); > > > As an addition note: based on your error message, it seemed that the > problem was in the function trialfun_bit2dec. However, from the code > you showed us, you haven't referenced/called this function. I was > wondering if the code you provide corresponded to the code that > created your error message? I'm guessing you ran [trl] > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which > case, it was looking for cfg.trialdef.eventtype. You can call > trialfun_bit2dec as long as you have all the relevant information in > the cfg (which is in the code you showed us). Hope this helps. > > Best, > Nietzsche > > > > > > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > Subject: [FieldTrip] Where to add a trialfun? > > Hello all! I'm having a simple problem. I want to add this trialfun: > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > I get this error: > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > Error in trialfun_bit2dec (line 52) > > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > > > > I'm quite sure it's because I'm not writing it in the correct part > > of > > my script. This is my trial definition part. Where should I add it > > and > > how should I write the line? > > > > > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > > > > > cfg = definetrial(cfg); > > > > > > trl = cfg.trl; > > cfg=[]; > > cfg.dataset = ['my/folders/', subject, '.RAW']; > > cfg.trl = trl; > > cfg.reref = 'yes'; > > cfg.refchannel = ['all']; > > > > > > THANKS! > > _______________________________________________ > > 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 > > > _______________________________________________ > 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 n.lam at fcdonders.ru.nl Mon Sep 29 10:53:00 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Mon, 29 Sep 2014 10:53:00 +0200 (CEST) Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: Message-ID: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Hi again Ana Laura, One other thing that I thought of was to make sure that the function "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial can find this function. By updating your fieldtrip to the most recent version "trialfun_bit2dec" is *not* included. So you'll need to store that as a separate .m file in a location that can be accessed by the paths set in matlab. Nietzsche ----- Original Message ----- > From: "Ana Laura Diez Martini" > To: "FieldTrip discussion list" > Sent: Saturday, 27 September, 2014 7:18:25 PM > Subject: Re: [FieldTrip] Where to add a trialfun? > Thank you Nietzsche! > > > I added it where you suggested and now this is the error I get: > > > > Error using feval > Invalid function name 'trialfun_bit2dec(cfg)'. > > > Error in definetrial (line 105) > trl = feval(cfg.trialfun, cfg); > > > Error in process_ERP_1_fieldtrip (line 97) > cfg = definetrial(cfg); > > > Something I was worried about is that I use an old version of > Fieldtrip for my scripts because I wrote them long ago and this > trialfun uses the new format (with 'ft_s',etc.). Could this affect it > in any way? > > > Thanks again! > > > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < > n.lam at fcdonders.ru.nl > wrote: > > > Hi Ana Laura, > > In general, you need to determine which trial function (Trialfun) to > use when using definetrial (see this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the > trial definition for the fully incongruent (FIC) condition). > > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to > your code before calling definetrial (see below). > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['my/folders/', subject, '.RAW']; > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > cfg.trialdef.eventtype=?; > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition > cfg = definetrial(cfg); > > > As an addition note: based on your error message, it seemed that the > problem was in the function trialfun_bit2dec. However, from the code > you showed us, you haven't referenced/called this function. I was > wondering if the code you provide corresponded to the code that > created your error message? I'm guessing you ran [trl] > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which > case, it was looking for cfg.trialdef.eventtype. You can call > trialfun_bit2dec as long as you have all the relevant information in > the cfg (which is in the code you showed us). Hope this helps. > > Best, > Nietzsche > > > > > > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > Subject: [FieldTrip] Where to add a trialfun? > > Hello all! I'm having a simple problem. I want to add this trialfun: > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > I get this error: > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > Error in trialfun_bit2dec (line 52) > > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > > > > I'm quite sure it's because I'm not writing it in the correct part > > of > > my script. This is my trial definition part. Where should I add it > > and > > how should I write the line? > > > > > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > > > > > cfg = definetrial(cfg); > > > > > > trl = cfg.trl; > > cfg=[]; > > cfg.dataset = ['my/folders/', subject, '.RAW']; > > cfg.trl = trl; > > cfg.reref = 'yes'; > > cfg.refchannel = ['all']; > > > > > > THANKS! > > _______________________________________________ > > 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 > > > _______________________________________________ > 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 linkgoron at gmail.com Mon Sep 29 11:46:38 2014 From: linkgoron at gmail.com (Nitzan Uziely) Date: Mon, 29 Sep 2014 12:46:38 +0300 Subject: [FieldTrip] Using Akaike Information Criterion for order selection with ft_mvaranalysis In-Reply-To: References: Message-ID: Hi again, Just to clarify the above, here is the code that I use to calculate the AIC: "source" is my inverse-solution after being partitioned into virtual channels using the AAL atlas. % mvar analysis. cfg = []; cfg.order = order; cfg.toolbox = 'bsmart'; mdata = ft_mvaranalysis(cfg, source); % aic calculation: www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ k = size(source.label,1); p = cfg.order; logv = log(det(mdata.noisecov)); % this gives me inf, as det(mdata.noisecov) is 0. % look at source nTotal = size(source.time,2)*length(source.time{1}); aic = -logv + 2*p*(k^2)/nTotal; disp(strcat(['order:' num2str(order) ', aic:',num2str(aic)])); Any ideas would be greatly appreciated! Best, Nitzan On Fri, Sep 26, 2014 at 9:24 PM, Nitzan Uziely wrote: > Hi, > > My name is Nitzan Uziely, and I'm a student (under-grad) at the Hebrew > University of Jerusalem. > > I'm using fieldtrip to process EEG signals at our lab, and I'm trying to > run a PDC analysis on my data. > > I took the data, calculated the inverse-solution and segmented it into > virtual channels using the AAL atlas. > > I'm trying to to calculate the correct order for the ft_mvaranalysis > function. > I've seen a previous question that went unanswered a few years ago about > order selection ( > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003947.html). > > Following the above question, I searched how to calculate the Akaike > Information Criterion (AIC) to calculate the correct model order. According > to http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ I need to > calculate the determinant of the noise covariance matrix, however the > determinant (I've checked orders 1 to 10) is so small that matlab just > rounds it to zero. This makes me feel that either I have a problem, I've > misunderstood how to calculate AIC to select the correct model, or that AIC > is not the correct way to go. > > So, my question is - does it seem that is something wrong with my data > (which can be seen by the small determinant), am I misunderstanding the > requirement of the determinant or is there a better way to select the order > of the mvar model. (oh, I'm using mdcfg.toolbox = 'bsmart'; if it matters) > > Thanks, > > Nitzan. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Sep 29 12:18:20 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 29 Sep 2014 12:18:20 +0200 Subject: [FieldTrip] Using Akaike Information Criterion for order selection with ft_mvaranalysis In-Reply-To: References: Message-ID: A determinant of 0 to me suggests that your data is rank deficient, which suggests the number of virtual channels is larger than the number of original observations. Best, Jan-Mathijs On Sep 29, 2014, at 11:46 AM, Nitzan Uziely wrote: > Hi again, > > Just to clarify the above, here is the code that I use to calculate the AIC: > "source" is my inverse-solution after being partitioned into virtual channels using the AAL atlas. > > % mvar analysis. > cfg = []; > cfg.order = order; > cfg.toolbox = 'bsmart'; > mdata = ft_mvaranalysis(cfg, source); > > % aic calculation: www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ > k = size(source.label,1); > p = cfg.order; > logv = log(det(mdata.noisecov)); % this gives me inf, as det(mdata.noisecov) is 0. > > % look at source > nTotal = size(source.time,2)*length(source.time{1}); > aic = -logv + 2*p*(k^2)/nTotal; > disp(strcat(['order:' num2str(order) ', aic:',num2str(aic)])); > > Any ideas would be greatly appreciated! > Best, > > Nitzan > > On Fri, Sep 26, 2014 at 9:24 PM, Nitzan Uziely wrote: > Hi, > > My name is Nitzan Uziely, and I'm a student (under-grad) at the Hebrew University of Jerusalem. > > I'm using fieldtrip to process EEG signals at our lab, and I'm trying to run a PDC analysis on my data. > > I took the data, calculated the inverse-solution and segmented it into virtual channels using the AAL atlas. > > I'm trying to to calculate the correct order for the ft_mvaranalysis function. > I've seen a previous question that went unanswered a few years ago about order selection (http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003947.html). > > Following the above question, I searched how to calculate the Akaike Information Criterion (AIC) to calculate the correct model order. According to http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ I need to calculate the determinant of the noise covariance matrix, however the determinant (I've checked orders 1 to 10) is so small that matlab just rounds it to zero. This makes me feel that either I have a problem, I've misunderstood how to calculate AIC to select the correct model, or that AIC is not the correct way to go. > > So, my question is - does it seem that is something wrong with my data (which can be seen by the small determinant), am I misunderstanding the requirement of the determinant or is there a better way to select the order of the mvar model. (oh, I'm using mdcfg.toolbox = 'bsmart'; if it matters) > > Thanks, > > Nitzan. > > _______________________________________________ > 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 dominic.nathan at gmail.com Mon Sep 29 17:04:12 2014 From: dominic.nathan at gmail.com (dominic nathan) Date: Mon, 29 Sep 2014 11:04:12 -0400 Subject: [FieldTrip] preprocessing Elekta Neuromag datasets Message-ID: Dear All, We are starting to use Fieldtrip to process our Elekta Neuromag data and were wondering if anyone has some scripts that we could follow for standard preprocessing. One of the main challenges that we face is how to combine both the gradiometers and magnetometers for the preprocessing. Thank you. dominic From diezmartini at gmail.com Mon Sep 29 19:00:26 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Mon, 29 Sep 2014 07:00:26 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Thank you again Nietzsche!! Yes, I was referring to trialfun_bit2dec. I followed your advice and I changed definetrial to ft_definetrial and I confirm the function was added to my paths. After doing this, the error I get is: Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. Error in trialfun_bit2dec (line 66) idx = any(diff(trl(:,1),1,1),2); Error in ft_definetrial (line 169) trl = feval(cfg.trialfun, cfg); Error in process_ERP_1_fieldtrip (line 95) cfg = ft_definetrial(cfg); This is again the trial definition part in which I think I added what I think are useless lines but I was just trying to make it run it. % TRIAL DEFINITION cfg=[]; cfg.filename = ['myfolders/subject.RAW']; cfg.headerfile = ['myfolders/subject.RAW']; cfg.dataset = ['myfolders/subject.RAW']; cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers cfg.trialdef.prestim = 0.2; % latency in seconds cfg.trialdef.poststim = 1; % latency in seconds cfg = ft_definetrial(cfg); trl = cfg.trl; cfg=[]; cfg.dataset = ['myfolders/subject.RAW']; cfg.trl = trl; cfg.reref = 'yes'; cfg.refchannel = ['all']; Unfortunately using this function is crucial to my analysis because I would like to use only Fieldtrip to analyse all my data. Thank you for taking all this time. On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche wrote: > Hi again Ana Laura, > > One other thing that I thought of was to make sure that the function > "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial > can find this function. > > By updating your fieldtrip to the most recent version "trialfun_bit2dec" > is *not* included. So you'll need to store that as a separate .m file in a > location that can be accessed by the paths set in matlab. > > Nietzsche > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" > > To: "FieldTrip discussion list" > > Sent: Saturday, 27 September, 2014 7:18:25 PM > > Subject: Re: [FieldTrip] Where to add a trialfun? > > Thank you Nietzsche! > > > > > > I added it where you suggested and now this is the error I get: > > > > > > > > Error using feval > > Invalid function name 'trialfun_bit2dec(cfg)'. > > > > > > Error in definetrial (line 105) > > trl = feval(cfg.trialfun, cfg); > > > > > > Error in process_ERP_1_fieldtrip (line 97) > > cfg = definetrial(cfg); > > > > > > Something I was worried about is that I use an old version of > > Fieldtrip for my scripts because I wrote them long ago and this > > trialfun uses the new format (with 'ft_s',etc.). Could this affect it > > in any way? > > > > > > Thanks again! > > > > > > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < > > n.lam at fcdonders.ru.nl > wrote: > > > > > > Hi Ana Laura, > > > > In general, you need to determine which trial function (Trialfun) to > > use when using definetrial (see this tutorial: > > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the > > trial definition for the fully incongruent (FIC) condition). > > > > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to > > your code before calling definetrial (see below). > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition > > cfg = definetrial(cfg); > > > > > > As an addition note: based on your error message, it seemed that the > > problem was in the function trialfun_bit2dec. However, from the code > > you showed us, you haven't referenced/called this function. I was > > wondering if the code you provide corresponded to the code that > > created your error message? I'm guessing you ran [trl] > > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which > > case, it was looking for cfg.trialdef.eventtype. You can call > > trialfun_bit2dec as long as you have all the relevant information in > > the cfg (which is in the code you showed us). Hope this helps. > > > > Best, > > Nietzsche > > > > > > > > > > > > > > ----- Original Message ----- > > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > > Subject: [FieldTrip] Where to add a trialfun? > > > Hello all! I'm having a simple problem. I want to add this trialfun: > > > > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > > > > > I get this error: > > > > > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > > > > Error in trialfun_bit2dec (line 52) > > > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > > > > > > > I'm quite sure it's because I'm not writing it in the correct part > > > of > > > my script. This is my trial definition part. Where should I add it > > > and > > > how should I write the line? > > > > > > > > > > > > % TRIAL DEFINITION > > > cfg=[]; > > > cfg.filename = ['my/folders/', subject, '.RAW']; > > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > > cfg.trialdef.eventvalue = cgrmrk; > > > cfg.trialdef.prestim = 0.2; > > > cfg.trialdef.poststim = 1; > > > cfg.trialdef.eventtype=?; > > > > > > > > > cfg = definetrial(cfg); > > > > > > > > > trl = cfg.trl; > > > cfg=[]; > > > cfg.dataset = ['my/folders/', subject, '.RAW']; > > > cfg.trl = trl; > > > cfg.reref = 'yes'; > > > cfg.refchannel = ['all']; > > > > > > > > > THANKS! > > > _______________________________________________ > > > 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 > > > > > > _______________________________________________ > > 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 a.stolk8 at gmail.com Mon Sep 29 20:57:40 2014 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 29 Sep 2014 20:57:40 +0200 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Hey Ana Laura, Seems from the error message you're getting "Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]." that none of the triggers were found in your event data. You might wanna check why this is happening, by debugging 'trialfun_bit2dec' on your input. Best, Arjen 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini : > Thank you again Nietzsche!! > > Yes, I was referring to trialfun_bit2dec. I followed your advice and I > changed definetrial to ft_definetrial and I confirm the function was added > to my paths. After doing this, the error I get is: > > Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > Error in process_ERP_1_fieldtrip (line 95) > cfg = ft_definetrial(cfg); > > This is again the trial definition part in which I think I added what I > think are useless lines but I was just trying to make it run it. > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['myfolders/subject.RAW']; > cfg.headerfile = ['myfolders/subject.RAW']; > cfg.dataset = ['myfolders/subject.RAW']; > cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers > cfg.trialdef.prestim = 0.2; % latency in seconds > cfg.trialdef.poststim = 1; % latency in seconds > cfg = ft_definetrial(cfg); > > trl = cfg.trl; > cfg=[]; > cfg.dataset = ['myfolders/subject.RAW']; > cfg.trl = trl; > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > > Unfortunately using this function is crucial to my analysis because I > would like to use only Fieldtrip to analyse all my data. Thank you for > taking all this time. > > On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche > wrote: > >> Hi again Ana Laura, >> >> One other thing that I thought of was to make sure that the function >> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >> can find this function. >> >> By updating your fieldtrip to the most recent version "trialfun_bit2dec" >> is *not* included. So you'll need to store that as a separate .m file in a >> location that can be accessed by the paths set in matlab. >> >> Nietzsche >> >> ----- Original Message ----- >> > From: "Ana Laura Diez Martini" >> > To: "FieldTrip discussion list" >> > Sent: Saturday, 27 September, 2014 7:18:25 PM >> > Subject: Re: [FieldTrip] Where to add a trialfun? >> > Thank you Nietzsche! >> > >> > >> > I added it where you suggested and now this is the error I get: >> > >> > >> > >> > Error using feval >> > Invalid function name 'trialfun_bit2dec(cfg)'. >> > >> > >> > Error in definetrial (line 105) >> > trl = feval(cfg.trialfun, cfg); >> > >> > >> > Error in process_ERP_1_fieldtrip (line 97) >> > cfg = definetrial(cfg); >> > >> > >> > Something I was worried about is that I use an old version of >> > Fieldtrip for my scripts because I wrote them long ago and this >> > trialfun uses the new format (with 'ft_s',etc.). Could this affect it >> > in any way? >> > >> > >> > Thanks again! >> > >> > >> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >> > n.lam at fcdonders.ru.nl > wrote: >> > >> > >> > Hi Ana Laura, >> > >> > In general, you need to determine which trial function (Trialfun) to >> > use when using definetrial (see this tutorial: >> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >> > trial definition for the fully incongruent (FIC) condition). >> > >> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >> > your code before calling definetrial (see below). >> > >> > % TRIAL DEFINITION >> > cfg=[]; >> > cfg.filename = ['my/folders/', subject, '.RAW']; >> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >> > >> > cfg.trialdef.eventtype = 'STATUS'; >> > cfg.trialdef.eventvalue = cgrmrk; >> > cfg.trialdef.prestim = 0.2; >> > cfg.trialdef.poststim = 1; >> > cfg.trialdef.eventtype=?; >> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >> > cfg = definetrial(cfg); >> > >> > >> > As an addition note: based on your error message, it seemed that the >> > problem was in the function trialfun_bit2dec. However, from the code >> > you showed us, you haven't referenced/called this function. I was >> > wondering if the code you provide corresponded to the code that >> > created your error message? I'm guessing you ran [trl] >> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >> > case, it was looking for cfg.trialdef.eventtype. You can call >> > trialfun_bit2dec as long as you have all the relevant information in >> > the cfg (which is in the code you showed us). Hope this helps. >> > >> > Best, >> > Nietzsche >> > >> > >> > >> > >> > >> > >> > ----- Original Message ----- >> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >> > > Subject: [FieldTrip] Where to add a trialfun? >> > > Hello all! I'm having a simple problem. I want to add this trialfun: >> > > >> > > >> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >> > > >> > > >> > > >> > > I get this error: >> > > >> > > >> > > >> > > Reference to non-existent field 'trialdef'. >> > > >> > > >> > > Error in trialfun_bit2dec (line 52) >> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >> > > >> > > >> > > I'm quite sure it's because I'm not writing it in the correct part >> > > of >> > > my script. This is my trial definition part. Where should I add it >> > > and >> > > how should I write the line? >> > > >> > > >> > > >> > > % TRIAL DEFINITION >> > > cfg=[]; >> > > cfg.filename = ['my/folders/', subject, '.RAW']; >> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >> > > >> > > >> > > cfg.trialdef.eventtype = 'STATUS'; >> > > cfg.trialdef.eventvalue = cgrmrk; >> > > cfg.trialdef.prestim = 0.2; >> > > cfg.trialdef.poststim = 1; >> > > cfg.trialdef.eventtype=?; >> > > >> > > >> > > cfg = definetrial(cfg); >> > > >> > > >> > > trl = cfg.trl; >> > > cfg=[]; >> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >> > > cfg.trl = trl; >> > > cfg.reref = 'yes'; >> > > cfg.refchannel = ['all']; >> > > >> > > >> > > THANKS! >> > > _______________________________________________ >> > > 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 >> > >> > >> > _______________________________________________ >> > 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 >> > > > _______________________________________________ > 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 e.maris at psych.ru.nl Mon Sep 29 21:12:33 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Mon, 29 Sep 2014 21:12:33 +0200 (CEST) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: <006b01cfdc19$4dfccce0$e9f666a0$@maris@psych.ru.nl> Hi Steve, Have a look here: http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests Best, Eric Maris From: Stephen Politzer-Ahles [mailto:spa268 at nyu.edu] Sent: woensdag 24 september 2014 11:18 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Hi Eelke, Thanks for this information. I just wanted to jump in and ask: what about for interactions in a mixed 2x2 design? For example, say I expect a difference between conditions A and B for group 1, but not group 2. Would the correct way to do this be to 1) make difference waves (A-B) for each participant, then 2) do a between-UO test on the difference waves using indepsamplesT? In the past I have always tested within-UO interactions using basically this method (based on http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html), but I was under the impression that this is not OK for mixed designs (from this post: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004244.html) Thanks, Steve > > ------------------------------ > > Message: 12 > Date: Wed, 24 Sep 2014 07:59:31 +0200 > From: Eelke Spaak > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > Message-ID: > > > > > Content-Type: text/plain; charset=UTF-8 > > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > wrote: > > Hello, > > > > So far, the tutorial on "Cluster-based permutation tests on > > time-frequency > > data" has been very helpful. > > > > Out of the four combinations from the two UO-types (subjects and trials) > > and > > the two experimental designs (between- and within-UO), the tutorial > > covers > > statistics on data in two conditions in a between-trials, in a > > within-trials > > and in a within-subjects design. However, I am wondering if there is any > > information about the fourth type of experiment design: > > between-subjects. > > > > I have data for 2 groups with 12 subjects in each group. Both groups are > > measured during 11 conditions. > > Can I approach this in a similar fashion to within-subjects design > > (multiple > > subjects in multiple experimental conditions), such that my design is > > multiple groups in multiple experimental conditions. Is it a case of > > first > > averaging over all trials belonging to each of the experimental > > conditions > > for each subject (as instructed in tutorial), and then averaging over > > all > > subjects in each group? > > > > Configuration code for setting up the design currently looks like this; > > grp = 2; > > subj = 11; > > design = zeros(2, subj*grp); > > > > for i = 1:grp > > design(1,i:2:end) = i; > > end > > > > idx = 1; > > for i = 1:subj > > design(2,idx:idx+1) = i; > > idx = idx+2; > > end > > > > Is there anything else I need to take into consideration when doing > > these > > statistics? > > > > Thank you, > > Dr Dylan DeLosAngeles > > Research Fellow > > Brain Signal Laboratory > > Flinders University > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > All the forward modelling in FieldTrip is based on a user-specified > MRI (preferably an individual one, but can be a template brain if an > individual MRI is not available). You probably will want to have a > look at this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Mon Sep 29 22:38:58 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Mon, 29 Sep 2014 22:38:58 +0200 Subject: [FieldTrip] preprocessing Elekta Neuromag datasets In-Reply-To: References: Message-ID: Dear Dominic, We have just started a week-long FieldTrip/invited lectures workshop, that we have optimized for our Neuromag system, and specifically for combined EEG and MEG recordings. We are also recording the lectures and creating wiki tutorials. In short - in a couple of weeks you can expect a lot of material coming online. I'll make sure to announce it on the mailinglist. This week will be too busy, but I keep an eye out for your (and other Neuromag users) questions. Good luck! Stephen On 29 September 2014 17:04, dominic nathan wrote: > Dear All, > > We are starting to use Fieldtrip to process our Elekta Neuromag data > and were wondering if anyone has some scripts that we could follow for > standard preprocessing. One of the main challenges that we face is how > to combine both the gradiometers and magnetometers for the > preprocessing. > > Thank you. > > dominic > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From diezmartini at gmail.com Tue Sep 30 00:11:40 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Mon, 29 Sep 2014 12:11:40 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Dear Arjen and Nietzsche, I tried debugging with dbstop if error and cfg.debug = 'saveonerror' and matlab points to: % discard the repeated values idx = any(diff(trl(:,1),1,1),2); trl = trl(idx,:); It does seem it is not reading the events. When I read them with the raw data, they seem to be there, with the DIN prefix. Any idea? On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk wrote: > Hey Ana Laura, > > Seems from the error message you're getting > > "Attempted to access trl(:,1); index out of bounds because > size(trl)=[0,0]." > > that none of the triggers were found in your event data. You might wanna > check why this is happening, by debugging 'trialfun_bit2dec' on your input. > > Best, > Arjen > > > > 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini : > >> Thank you again Nietzsche!! >> >> Yes, I was referring to trialfun_bit2dec. I followed your advice and I >> changed definetrial to ft_definetrial and I confirm the function was added >> to my paths. After doing this, the error I get is: >> >> Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> Error in process_ERP_1_fieldtrip (line 95) >> cfg = ft_definetrial(cfg); >> >> This is again the trial definition part in which I think I added what I >> think are useless lines but I was just trying to make it run it. >> >> % TRIAL DEFINITION >> cfg=[]; >> cfg.filename = ['myfolders/subject.RAW']; >> cfg.headerfile = ['myfolders/subject.RAW']; >> cfg.dataset = ['myfolders/subject.RAW']; >> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition >> cfg.trialdef.eventtype = 'STATUS'; >> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >> cfg.trialdef.prestim = 0.2; % latency in seconds >> cfg.trialdef.poststim = 1; % latency in seconds >> cfg = ft_definetrial(cfg); >> >> trl = cfg.trl; >> cfg=[]; >> cfg.dataset = ['myfolders/subject.RAW']; >> cfg.trl = trl; >> cfg.reref = 'yes'; >> cfg.refchannel = ['all']; >> >> Unfortunately using this function is crucial to my analysis because I >> would like to use only Fieldtrip to analyse all my data. Thank you for >> taking all this time. >> >> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche >> wrote: >> >>> Hi again Ana Laura, >>> >>> One other thing that I thought of was to make sure that the function >>> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >>> can find this function. >>> >>> By updating your fieldtrip to the most recent version "trialfun_bit2dec" >>> is *not* included. So you'll need to store that as a separate .m file in a >>> location that can be accessed by the paths set in matlab. >>> >>> Nietzsche >>> >>> ----- Original Message ----- >>> > From: "Ana Laura Diez Martini" >>> > To: "FieldTrip discussion list" >>> > Sent: Saturday, 27 September, 2014 7:18:25 PM >>> > Subject: Re: [FieldTrip] Where to add a trialfun? >>> > Thank you Nietzsche! >>> > >>> > >>> > I added it where you suggested and now this is the error I get: >>> > >>> > >>> > >>> > Error using feval >>> > Invalid function name 'trialfun_bit2dec(cfg)'. >>> > >>> > >>> > Error in definetrial (line 105) >>> > trl = feval(cfg.trialfun, cfg); >>> > >>> > >>> > Error in process_ERP_1_fieldtrip (line 97) >>> > cfg = definetrial(cfg); >>> > >>> > >>> > Something I was worried about is that I use an old version of >>> > Fieldtrip for my scripts because I wrote them long ago and this >>> > trialfun uses the new format (with 'ft_s',etc.). Could this affect it >>> > in any way? >>> > >>> > >>> > Thanks again! >>> > >>> > >>> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >>> > n.lam at fcdonders.ru.nl > wrote: >>> > >>> > >>> > Hi Ana Laura, >>> > >>> > In general, you need to determine which trial function (Trialfun) to >>> > use when using definetrial (see this tutorial: >>> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >>> > trial definition for the fully incongruent (FIC) condition). >>> > >>> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >>> > your code before calling definetrial (see below). >>> > >>> > % TRIAL DEFINITION >>> > cfg=[]; >>> > cfg.filename = ['my/folders/', subject, '.RAW']; >>> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>> > >>> > cfg.trialdef.eventtype = 'STATUS'; >>> > cfg.trialdef.eventvalue = cgrmrk; >>> > cfg.trialdef.prestim = 0.2; >>> > cfg.trialdef.poststim = 1; >>> > cfg.trialdef.eventtype=?; >>> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >>> > cfg = definetrial(cfg); >>> > >>> > >>> > As an addition note: based on your error message, it seemed that the >>> > problem was in the function trialfun_bit2dec. However, from the code >>> > you showed us, you haven't referenced/called this function. I was >>> > wondering if the code you provide corresponded to the code that >>> > created your error message? I'm guessing you ran [trl] >>> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >>> > case, it was looking for cfg.trialdef.eventtype. You can call >>> > trialfun_bit2dec as long as you have all the relevant information in >>> > the cfg (which is in the code you showed us). Hope this helps. >>> > >>> > Best, >>> > Nietzsche >>> > >>> > >>> > >>> > >>> > >>> > >>> > ----- Original Message ----- >>> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >>> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >>> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >>> > > Subject: [FieldTrip] Where to add a trialfun? >>> > > Hello all! I'm having a simple problem. I want to add this trialfun: >>> > > >>> > > >>> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >>> > > >>> > > >>> > > >>> > > I get this error: >>> > > >>> > > >>> > > >>> > > Reference to non-existent field 'trialdef'. >>> > > >>> > > >>> > > Error in trialfun_bit2dec (line 52) >>> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >>> > > >>> > > >>> > > I'm quite sure it's because I'm not writing it in the correct part >>> > > of >>> > > my script. This is my trial definition part. Where should I add it >>> > > and >>> > > how should I write the line? >>> > > >>> > > >>> > > >>> > > % TRIAL DEFINITION >>> > > cfg=[]; >>> > > cfg.filename = ['my/folders/', subject, '.RAW']; >>> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>> > > >>> > > >>> > > cfg.trialdef.eventtype = 'STATUS'; >>> > > cfg.trialdef.eventvalue = cgrmrk; >>> > > cfg.trialdef.prestim = 0.2; >>> > > cfg.trialdef.poststim = 1; >>> > > cfg.trialdef.eventtype=?; >>> > > >>> > > >>> > > cfg = definetrial(cfg); >>> > > >>> > > >>> > > trl = cfg.trl; >>> > > cfg=[]; >>> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >>> > > cfg.trl = trl; >>> > > cfg.reref = 'yes'; >>> > > cfg.refchannel = ['all']; >>> > > >>> > > >>> > > THANKS! >>> > > _______________________________________________ >>> > > 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 >>> > >>> > >>> > _______________________________________________ >>> > 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 >>> >> >> >> _______________________________________________ >> 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 diezmartini at gmail.com Tue Sep 30 06:20:29 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Mon, 29 Sep 2014 18:20:29 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: This is my attempt of adapting the code for the new Fieldtrip % TRIAL DEFINITION cfg=[]; cfg.dataset = 'myfile'; hdr = ft_read_header( 'myfile'); dat = ft_read_data('myfile'); cfg.trialfun = 'trialfun_bit2dec'; cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 1; cfg.reref = 'yes'; cfg.refchannel = ['all']; cfg = ft_definetrial(cfg); again the error is: Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. Error in trialfun_bit2dec (line 66) idx = any(diff(trl(:,1),1,1),2); Error in ft_definetrial (line 169) trl = feval(cfg.trialfun, cfg); Error in process_ERP_1_fieldtrip (line 106) cfg = ft_definetrial(cfg); On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini < diezmartini at gmail.com> wrote: > Dear Arjen and Nietzsche, > > I tried debugging with dbstop if error and cfg.debug = 'saveonerror' and > matlab points to: > > % discard the repeated values > idx = any(diff(trl(:,1),1,1),2); > trl = trl(idx,:); > > It does seem it is not reading the events. When I read them with the raw > data, they seem to be there, with the DIN prefix. Any idea? > > On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk wrote: > >> Hey Ana Laura, >> >> Seems from the error message you're getting >> >> "Attempted to access trl(:,1); index out of bounds because >> size(trl)=[0,0]." >> >> that none of the triggers were found in your event data. You might wanna >> check why this is happening, by debugging 'trialfun_bit2dec' on your input. >> >> Best, >> Arjen >> >> >> >> 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini >> : >> >>> Thank you again Nietzsche!! >>> >>> Yes, I was referring to trialfun_bit2dec. I followed your advice and I >>> changed definetrial to ft_definetrial and I confirm the function was added >>> to my paths. After doing this, the error I get is: >>> >>> Attempted to access trl(:,1); index out of bounds because >>> size(trl)=[0,0]. >>> >>> Error in trialfun_bit2dec (line 66) >>> idx = any(diff(trl(:,1),1,1),2); >>> >>> Error in ft_definetrial (line 169) >>> trl = feval(cfg.trialfun, cfg); >>> >>> Error in process_ERP_1_fieldtrip (line 95) >>> cfg = ft_definetrial(cfg); >>> >>> This is again the trial definition part in which I think I added what I >>> think are useless lines but I was just trying to make it run it. >>> >>> % TRIAL DEFINITION >>> cfg=[]; >>> cfg.filename = ['myfolders/subject.RAW']; >>> cfg.headerfile = ['myfolders/subject.RAW']; >>> cfg.dataset = ['myfolders/subject.RAW']; >>> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition >>> cfg.trialdef.eventtype = 'STATUS'; >>> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >>> cfg.trialdef.prestim = 0.2; % latency in seconds >>> cfg.trialdef.poststim = 1; % latency in seconds >>> cfg = ft_definetrial(cfg); >>> >>> trl = cfg.trl; >>> cfg=[]; >>> cfg.dataset = ['myfolders/subject.RAW']; >>> cfg.trl = trl; >>> cfg.reref = 'yes'; >>> cfg.refchannel = ['all']; >>> >>> Unfortunately using this function is crucial to my analysis because I >>> would like to use only Fieldtrip to analyse all my data. Thank you for >>> taking all this time. >>> >>> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche >>> wrote: >>> >>>> Hi again Ana Laura, >>>> >>>> One other thing that I thought of was to make sure that the function >>>> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >>>> can find this function. >>>> >>>> By updating your fieldtrip to the most recent version >>>> "trialfun_bit2dec" is *not* included. So you'll need to store that as a >>>> separate .m file in a location that can be accessed by the paths set in >>>> matlab. >>>> >>>> Nietzsche >>>> >>>> ----- Original Message ----- >>>> > From: "Ana Laura Diez Martini" >>>> > To: "FieldTrip discussion list" >>>> > Sent: Saturday, 27 September, 2014 7:18:25 PM >>>> > Subject: Re: [FieldTrip] Where to add a trialfun? >>>> > Thank you Nietzsche! >>>> > >>>> > >>>> > I added it where you suggested and now this is the error I get: >>>> > >>>> > >>>> > >>>> > Error using feval >>>> > Invalid function name 'trialfun_bit2dec(cfg)'. >>>> > >>>> > >>>> > Error in definetrial (line 105) >>>> > trl = feval(cfg.trialfun, cfg); >>>> > >>>> > >>>> > Error in process_ERP_1_fieldtrip (line 97) >>>> > cfg = definetrial(cfg); >>>> > >>>> > >>>> > Something I was worried about is that I use an old version of >>>> > Fieldtrip for my scripts because I wrote them long ago and this >>>> > trialfun uses the new format (with 'ft_s',etc.). Could this affect it >>>> > in any way? >>>> > >>>> > >>>> > Thanks again! >>>> > >>>> > >>>> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >>>> > n.lam at fcdonders.ru.nl > wrote: >>>> > >>>> > >>>> > Hi Ana Laura, >>>> > >>>> > In general, you need to determine which trial function (Trialfun) to >>>> > use when using definetrial (see this tutorial: >>>> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >>>> > trial definition for the fully incongruent (FIC) condition). >>>> > >>>> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >>>> > your code before calling definetrial (see below). >>>> > >>>> > % TRIAL DEFINITION >>>> > cfg=[]; >>>> > cfg.filename = ['my/folders/', subject, '.RAW']; >>>> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>> > >>>> > cfg.trialdef.eventtype = 'STATUS'; >>>> > cfg.trialdef.eventvalue = cgrmrk; >>>> > cfg.trialdef.prestim = 0.2; >>>> > cfg.trialdef.poststim = 1; >>>> > cfg.trialdef.eventtype=?; >>>> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >>>> > cfg = definetrial(cfg); >>>> > >>>> > >>>> > As an addition note: based on your error message, it seemed that the >>>> > problem was in the function trialfun_bit2dec. However, from the code >>>> > you showed us, you haven't referenced/called this function. I was >>>> > wondering if the code you provide corresponded to the code that >>>> > created your error message? I'm guessing you ran [trl] >>>> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >>>> > case, it was looking for cfg.trialdef.eventtype. You can call >>>> > trialfun_bit2dec as long as you have all the relevant information in >>>> > the cfg (which is in the code you showed us). Hope this helps. >>>> > >>>> > Best, >>>> > Nietzsche >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > ----- Original Message ----- >>>> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >>>> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >>>> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >>>> > > Subject: [FieldTrip] Where to add a trialfun? >>>> > > Hello all! I'm having a simple problem. I want to add this trialfun: >>>> > > >>>> > > >>>> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >>>> > > >>>> > > >>>> > > >>>> > > I get this error: >>>> > > >>>> > > >>>> > > >>>> > > Reference to non-existent field 'trialdef'. >>>> > > >>>> > > >>>> > > Error in trialfun_bit2dec (line 52) >>>> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >>>> > > >>>> > > >>>> > > I'm quite sure it's because I'm not writing it in the correct part >>>> > > of >>>> > > my script. This is my trial definition part. Where should I add it >>>> > > and >>>> > > how should I write the line? >>>> > > >>>> > > >>>> > > >>>> > > % TRIAL DEFINITION >>>> > > cfg=[]; >>>> > > cfg.filename = ['my/folders/', subject, '.RAW']; >>>> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>> > > >>>> > > >>>> > > cfg.trialdef.eventtype = 'STATUS'; >>>> > > cfg.trialdef.eventvalue = cgrmrk; >>>> > > cfg.trialdef.prestim = 0.2; >>>> > > cfg.trialdef.poststim = 1; >>>> > > cfg.trialdef.eventtype=?; >>>> > > >>>> > > >>>> > > cfg = definetrial(cfg); >>>> > > >>>> > > >>>> > > trl = cfg.trl; >>>> > > cfg=[]; >>>> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >>>> > > cfg.trl = trl; >>>> > > cfg.reref = 'yes'; >>>> > > cfg.refchannel = ['all']; >>>> > > >>>> > > >>>> > > THANKS! >>>> > > _______________________________________________ >>>> > > 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 >>>> > >>>> > >>>> > _______________________________________________ >>>> > 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 >>>> >>> >>> >>> _______________________________________________ >>> 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 a.stolk8 at gmail.com Tue Sep 30 09:01:11 2014 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Tue, 30 Sep 2014 09:01:11 +0200 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Hi Ana Laura, Your 'trl' is empty, which it shouldn't be. So anytime you try to index an element in it, it will throw an error. Can you check what 'event.values' you find in your dataset? And compare those with any of the ones falling under the switch case statement? One way to do this, is to put a debug marker (red dot) at the 'end' of the first for-loop (judging from the wiki). Then check the value of event(i).value, and click the continue button to move on to the next. An alternative way is to put a debug marker after event = ft_read_event and to instantly check all values of event with "[event(:).value]". Goodluck, Arjen 2014-09-30 6:20 GMT+02:00 Ana Laura Diez Martini : > This is my attempt of adapting the code for the new Fieldtrip > > % TRIAL DEFINITION > > cfg=[]; > cfg.dataset = 'myfile'; > > hdr = ft_read_header( 'myfile'); > dat = ft_read_data('myfile'); > cfg.trialfun = 'trialfun_bit2dec'; > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > cfg = ft_definetrial(cfg); > > again the error is: > > Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > Error in process_ERP_1_fieldtrip (line 106) > cfg = ft_definetrial(cfg); > > > > On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini < > diezmartini at gmail.com> wrote: > >> Dear Arjen and Nietzsche, >> >> I tried debugging with dbstop if error and cfg.debug = 'saveonerror' and >> matlab points to: >> >> % discard the repeated values >> idx = any(diff(trl(:,1),1,1),2); >> trl = trl(idx,:); >> >> It does seem it is not reading the events. When I read them with the raw >> data, they seem to be there, with the DIN prefix. Any idea? >> >> On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk wrote: >> >>> Hey Ana Laura, >>> >>> Seems from the error message you're getting >>> >>> "Attempted to access trl(:,1); index out of bounds because >>> size(trl)=[0,0]." >>> >>> that none of the triggers were found in your event data. You might wanna >>> check why this is happening, by debugging 'trialfun_bit2dec' on your input. >>> >>> Best, >>> Arjen >>> >>> >>> >>> 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini >> >: >>> >>>> Thank you again Nietzsche!! >>>> >>>> Yes, I was referring to trialfun_bit2dec. I followed your advice and I >>>> changed definetrial to ft_definetrial and I confirm the function was added >>>> to my paths. After doing this, the error I get is: >>>> >>>> Attempted to access trl(:,1); index out of bounds because >>>> size(trl)=[0,0]. >>>> >>>> Error in trialfun_bit2dec (line 66) >>>> idx = any(diff(trl(:,1),1,1),2); >>>> >>>> Error in ft_definetrial (line 169) >>>> trl = feval(cfg.trialfun, cfg); >>>> >>>> Error in process_ERP_1_fieldtrip (line 95) >>>> cfg = ft_definetrial(cfg); >>>> >>>> This is again the trial definition part in which I think I added what I >>>> think are useless lines but I was just trying to make it run it. >>>> >>>> % TRIAL DEFINITION >>>> cfg=[]; >>>> cfg.filename = ['myfolders/subject.RAW']; >>>> cfg.headerfile = ['myfolders/subject.RAW']; >>>> cfg.dataset = ['myfolders/subject.RAW']; >>>> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition >>>> cfg.trialdef.eventtype = 'STATUS'; >>>> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >>>> cfg.trialdef.prestim = 0.2; % latency in seconds >>>> cfg.trialdef.poststim = 1; % latency in seconds >>>> cfg = ft_definetrial(cfg); >>>> >>>> trl = cfg.trl; >>>> cfg=[]; >>>> cfg.dataset = ['myfolders/subject.RAW']; >>>> cfg.trl = trl; >>>> cfg.reref = 'yes'; >>>> cfg.refchannel = ['all']; >>>> >>>> Unfortunately using this function is crucial to my analysis because I >>>> would like to use only Fieldtrip to analyse all my data. Thank you for >>>> taking all this time. >>>> >>>> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche >>> > wrote: >>>> >>>>> Hi again Ana Laura, >>>>> >>>>> One other thing that I thought of was to make sure that the function >>>>> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >>>>> can find this function. >>>>> >>>>> By updating your fieldtrip to the most recent version >>>>> "trialfun_bit2dec" is *not* included. So you'll need to store that as a >>>>> separate .m file in a location that can be accessed by the paths set in >>>>> matlab. >>>>> >>>>> Nietzsche >>>>> >>>>> ----- Original Message ----- >>>>> > From: "Ana Laura Diez Martini" >>>>> > To: "FieldTrip discussion list" >>>>> > Sent: Saturday, 27 September, 2014 7:18:25 PM >>>>> > Subject: Re: [FieldTrip] Where to add a trialfun? >>>>> > Thank you Nietzsche! >>>>> > >>>>> > >>>>> > I added it where you suggested and now this is the error I get: >>>>> > >>>>> > >>>>> > >>>>> > Error using feval >>>>> > Invalid function name 'trialfun_bit2dec(cfg)'. >>>>> > >>>>> > >>>>> > Error in definetrial (line 105) >>>>> > trl = feval(cfg.trialfun, cfg); >>>>> > >>>>> > >>>>> > Error in process_ERP_1_fieldtrip (line 97) >>>>> > cfg = definetrial(cfg); >>>>> > >>>>> > >>>>> > Something I was worried about is that I use an old version of >>>>> > Fieldtrip for my scripts because I wrote them long ago and this >>>>> > trialfun uses the new format (with 'ft_s',etc.). Could this affect it >>>>> > in any way? >>>>> > >>>>> > >>>>> > Thanks again! >>>>> > >>>>> > >>>>> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >>>>> > n.lam at fcdonders.ru.nl > wrote: >>>>> > >>>>> > >>>>> > Hi Ana Laura, >>>>> > >>>>> > In general, you need to determine which trial function (Trialfun) to >>>>> > use when using definetrial (see this tutorial: >>>>> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >>>>> > trial definition for the fully incongruent (FIC) condition). >>>>> > >>>>> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >>>>> > your code before calling definetrial (see below). >>>>> > >>>>> > % TRIAL DEFINITION >>>>> > cfg=[]; >>>>> > cfg.filename = ['my/folders/', subject, '.RAW']; >>>>> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>>> > >>>>> > cfg.trialdef.eventtype = 'STATUS'; >>>>> > cfg.trialdef.eventvalue = cgrmrk; >>>>> > cfg.trialdef.prestim = 0.2; >>>>> > cfg.trialdef.poststim = 1; >>>>> > cfg.trialdef.eventtype=?; >>>>> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >>>>> > cfg = definetrial(cfg); >>>>> > >>>>> > >>>>> > As an addition note: based on your error message, it seemed that the >>>>> > problem was in the function trialfun_bit2dec. However, from the code >>>>> > you showed us, you haven't referenced/called this function. I was >>>>> > wondering if the code you provide corresponded to the code that >>>>> > created your error message? I'm guessing you ran [trl] >>>>> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >>>>> > case, it was looking for cfg.trialdef.eventtype. You can call >>>>> > trialfun_bit2dec as long as you have all the relevant information in >>>>> > the cfg (which is in the code you showed us). Hope this helps. >>>>> > >>>>> > Best, >>>>> > Nietzsche >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > ----- Original Message ----- >>>>> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >>>>> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >>>>> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >>>>> > > Subject: [FieldTrip] Where to add a trialfun? >>>>> > > Hello all! I'm having a simple problem. I want to add this >>>>> trialfun: >>>>> > > >>>>> > > >>>>> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >>>>> > > >>>>> > > >>>>> > > >>>>> > > I get this error: >>>>> > > >>>>> > > >>>>> > > >>>>> > > Reference to non-existent field 'trialdef'. >>>>> > > >>>>> > > >>>>> > > Error in trialfun_bit2dec (line 52) >>>>> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >>>>> > > >>>>> > > >>>>> > > I'm quite sure it's because I'm not writing it in the correct part >>>>> > > of >>>>> > > my script. This is my trial definition part. Where should I add it >>>>> > > and >>>>> > > how should I write the line? >>>>> > > >>>>> > > >>>>> > > >>>>> > > % TRIAL DEFINITION >>>>> > > cfg=[]; >>>>> > > cfg.filename = ['my/folders/', subject, '.RAW']; >>>>> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>>> > > >>>>> > > >>>>> > > cfg.trialdef.eventtype = 'STATUS'; >>>>> > > cfg.trialdef.eventvalue = cgrmrk; >>>>> > > cfg.trialdef.prestim = 0.2; >>>>> > > cfg.trialdef.poststim = 1; >>>>> > > cfg.trialdef.eventtype=?; >>>>> > > >>>>> > > >>>>> > > cfg = definetrial(cfg); >>>>> > > >>>>> > > >>>>> > > trl = cfg.trl; >>>>> > > cfg=[]; >>>>> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >>>>> > > cfg.trl = trl; >>>>> > > cfg.reref = 'yes'; >>>>> > > cfg.refchannel = ['all']; >>>>> > > >>>>> > > >>>>> > > THANKS! >>>>> > > _______________________________________________ >>>>> > > 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 >>>>> > >>>>> > >>>>> > _______________________________________________ >>>>> > 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 >>>>> >>>> >>>> >>>> _______________________________________________ >>>> 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: From russgport at gmail.com Tue Sep 30 16:08:39 2014 From: russgport at gmail.com (Russell G Port) Date: Tue, 30 Sep 2014 10:08:39 -0400 Subject: [FieldTrip] applying ica rejection to differently epoched data Message-ID: Hi All, I have a question, which I hope someone can help with. Currently I read in my dataset (*.ds) via standard fieldtrip commands, epoching 1 second bins for the length of the data. After proper removal of all jump and muscle artifact, I apply ICA to the resample data (now 300Hz before it was 1200Hz). This is just like fieldtrip's website suggests. Then I verify which components I want to remove via topoplots and coherence in the time domain with the ECG channels. So I now have the list of components that I think are artifact and want removed. Can these components be applied for rejection onto the same dataset, but differently parsed into epochs, now trials being centered 1 second bins around a trigger? I am trying to see if this works, because I hope if I include more data in the ICA analysis (all data in the dataset) I will get a better components since there are more trials to train the data on, rather than if I based trials around the trigger. I guess what I want to know is if I can get better estimates of my artifacts via using a larger dataset, and then apply then to the same dataset just differently epoched? Best, Russ Port -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Tue Sep 30 22:27:25 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Tue, 30 Sep 2014 10:27:25 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: For a more simple check, when I try to read the events without the trialfun ( so it uses ft_trialfun_general by default) I get the original event values: >> cfg = []; >> cfg.dataset = '27CW1.RAW'; >> cfg.trialdef.eventtype = '?'; >> cfg=ft_definetrial(cfg); Warning: no trialfun was specified, using ft_trialfun_general > In ft_definetrial at 135 evaluating trialfunction 'ft_trialfun_general' reading the events from '27CW1.RAW' the following events were found in the datafile event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' no trials have been defined yet, see FT_DEFINETRIAL for further help found 750 events created 0 trials the call to "ft_definetrial" took 4 seconds Then I try to use the trialfun, I get the same error >> cfg = []; >> cfg.dataset = '27CW1.RAW'; >> cfg.trialfun = 'trialfun_bit2dec'; >> cfg.trialdef.eventtype = '?'; >> cfg=ft_definetrial(cfg); evaluating trialfunction 'trialfun_bit2dec' Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. Error in trialfun_bit2dec (line 66) idx = any(diff(trl(:,1),1,1),2); Error in ft_definetrial (line 169) trl = feval(cfg.trialfun, cfg); So there is something the trialfun_bit2dec does that events cannot be read anymore. On Mon, Sep 29, 2014 at 9:01 PM, Arjen Stolk wrote: > Hi Ana Laura, > > Your 'trl' is empty, which it shouldn't be. So anytime you try to index an > element in it, it will throw an error. > > Can you check what 'event.values' you find in your dataset? And compare > those with any of the ones falling under the switch case statement? One way > to do this, is to put a debug marker (red dot) at the 'end' of the first > for-loop (judging from the wiki). Then check the value of event(i).value, > and click the continue button to move on to the next. An alternative way is > to put a debug marker after event = ft_read_event and to instantly check > all values of event with "[event(:).value]". > > Goodluck, > Arjen > > 2014-09-30 6:20 GMT+02:00 Ana Laura Diez Martini : > >> This is my attempt of adapting the code for the new Fieldtrip >> >> % TRIAL DEFINITION >> >> cfg=[]; >> cfg.dataset = 'myfile'; >> >> hdr = ft_read_header( 'myfile'); >> dat = ft_read_data('myfile'); >> cfg.trialfun = 'trialfun_bit2dec'; >> cfg.trialdef.eventtype = 'STATUS'; >> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >> cfg.trialdef.prestim = 0.2; >> cfg.trialdef.poststim = 1; >> >> cfg.reref = 'yes'; >> cfg.refchannel = ['all']; >> cfg = ft_definetrial(cfg); >> >> again the error is: >> >> Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> Error in process_ERP_1_fieldtrip (line 106) >> cfg = ft_definetrial(cfg); >> >> >> >> On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini < >> diezmartini at gmail.com> wrote: >> >>> Dear Arjen and Nietzsche, >>> >>> I tried debugging with dbstop if error and cfg.debug = 'saveonerror' >>> and matlab points to: >>> >>> % discard the repeated values >>> idx = any(diff(trl(:,1),1,1),2); >>> trl = trl(idx,:); >>> >>> It does seem it is not reading the events. When I read them with the raw >>> data, they seem to be there, with the DIN prefix. Any idea? >>> >>> On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk wrote: >>> >>>> Hey Ana Laura, >>>> >>>> Seems from the error message you're getting >>>> >>>> "Attempted to access trl(:,1); index out of bounds because >>>> size(trl)=[0,0]." >>>> >>>> that none of the triggers were found in your event data. You might >>>> wanna check why this is happening, by debugging 'trialfun_bit2dec' on your >>>> input. >>>> >>>> Best, >>>> Arjen >>>> >>>> >>>> >>>> 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini < >>>> diezmartini at gmail.com>: >>>> >>>>> Thank you again Nietzsche!! >>>>> >>>>> Yes, I was referring to trialfun_bit2dec. I followed your advice and I >>>>> changed definetrial to ft_definetrial and I confirm the function was added >>>>> to my paths. After doing this, the error I get is: >>>>> >>>>> Attempted to access trl(:,1); index out of bounds because >>>>> size(trl)=[0,0]. >>>>> >>>>> Error in trialfun_bit2dec (line 66) >>>>> idx = any(diff(trl(:,1),1,1),2); >>>>> >>>>> Error in ft_definetrial (line 169) >>>>> trl = feval(cfg.trialfun, cfg); >>>>> >>>>> Error in process_ERP_1_fieldtrip (line 95) >>>>> cfg = ft_definetrial(cfg); >>>>> >>>>> This is again the trial definition part in which I think I added what >>>>> I think are useless lines but I was just trying to make it run it. >>>>> >>>>> % TRIAL DEFINITION >>>>> cfg=[]; >>>>> cfg.filename = ['myfolders/subject.RAW']; >>>>> cfg.headerfile = ['myfolders/subject.RAW']; >>>>> cfg.dataset = ['myfolders/subject.RAW']; >>>>> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition >>>>> cfg.trialdef.eventtype = 'STATUS'; >>>>> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >>>>> cfg.trialdef.prestim = 0.2; % latency in seconds >>>>> cfg.trialdef.poststim = 1; % latency in seconds >>>>> cfg = ft_definetrial(cfg); >>>>> >>>>> trl = cfg.trl; >>>>> cfg=[]; >>>>> cfg.dataset = ['myfolders/subject.RAW']; >>>>> cfg.trl = trl; >>>>> cfg.reref = 'yes'; >>>>> cfg.refchannel = ['all']; >>>>> >>>>> Unfortunately using this function is crucial to my analysis because I >>>>> would like to use only Fieldtrip to analyse all my data. Thank you for >>>>> taking all this time. >>>>> >>>>> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche < >>>>> n.lam at fcdonders.ru.nl> wrote: >>>>> >>>>>> Hi again Ana Laura, >>>>>> >>>>>> One other thing that I thought of was to make sure that the function >>>>>> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >>>>>> can find this function. >>>>>> >>>>>> By updating your fieldtrip to the most recent version >>>>>> "trialfun_bit2dec" is *not* included. So you'll need to store that as a >>>>>> separate .m file in a location that can be accessed by the paths set in >>>>>> matlab. >>>>>> >>>>>> Nietzsche >>>>>> >>>>>> ----- Original Message ----- >>>>>> > From: "Ana Laura Diez Martini" >>>>>> > To: "FieldTrip discussion list" >>>>>> > Sent: Saturday, 27 September, 2014 7:18:25 PM >>>>>> > Subject: Re: [FieldTrip] Where to add a trialfun? >>>>>> > Thank you Nietzsche! >>>>>> > >>>>>> > >>>>>> > I added it where you suggested and now this is the error I get: >>>>>> > >>>>>> > >>>>>> > >>>>>> > Error using feval >>>>>> > Invalid function name 'trialfun_bit2dec(cfg)'. >>>>>> > >>>>>> > >>>>>> > Error in definetrial (line 105) >>>>>> > trl = feval(cfg.trialfun, cfg); >>>>>> > >>>>>> > >>>>>> > Error in process_ERP_1_fieldtrip (line 97) >>>>>> > cfg = definetrial(cfg); >>>>>> > >>>>>> > >>>>>> > Something I was worried about is that I use an old version of >>>>>> > Fieldtrip for my scripts because I wrote them long ago and this >>>>>> > trialfun uses the new format (with 'ft_s',etc.). Could this affect >>>>>> it >>>>>> > in any way? >>>>>> > >>>>>> > >>>>>> > Thanks again! >>>>>> > >>>>>> > >>>>>> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >>>>>> > n.lam at fcdonders.ru.nl > wrote: >>>>>> > >>>>>> > >>>>>> > Hi Ana Laura, >>>>>> > >>>>>> > In general, you need to determine which trial function (Trialfun) to >>>>>> > use when using definetrial (see this tutorial: >>>>>> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >>>>>> > trial definition for the fully incongruent (FIC) condition). >>>>>> > >>>>>> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >>>>>> > your code before calling definetrial (see below). >>>>>> > >>>>>> > % TRIAL DEFINITION >>>>>> > cfg=[]; >>>>>> > cfg.filename = ['my/folders/', subject, '.RAW']; >>>>>> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>>>> > >>>>>> > cfg.trialdef.eventtype = 'STATUS'; >>>>>> > cfg.trialdef.eventvalue = cgrmrk; >>>>>> > cfg.trialdef.prestim = 0.2; >>>>>> > cfg.trialdef.poststim = 1; >>>>>> > cfg.trialdef.eventtype=?; >>>>>> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >>>>>> > cfg = definetrial(cfg); >>>>>> > >>>>>> > >>>>>> > As an addition note: based on your error message, it seemed that the >>>>>> > problem was in the function trialfun_bit2dec. However, from the code >>>>>> > you showed us, you haven't referenced/called this function. I was >>>>>> > wondering if the code you provide corresponded to the code that >>>>>> > created your error message? I'm guessing you ran [trl] >>>>>> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >>>>>> > case, it was looking for cfg.trialdef.eventtype. You can call >>>>>> > trialfun_bit2dec as long as you have all the relevant information in >>>>>> > the cfg (which is in the code you showed us). Hope this helps. >>>>>> > >>>>>> > Best, >>>>>> > Nietzsche >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > ----- Original Message ----- >>>>>> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >>>>>> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >>>>>> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >>>>>> > > Subject: [FieldTrip] Where to add a trialfun? >>>>>> > > Hello all! I'm having a simple problem. I want to add this >>>>>> trialfun: >>>>>> > > >>>>>> > > >>>>>> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > I get this error: >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > Reference to non-existent field 'trialdef'. >>>>>> > > >>>>>> > > >>>>>> > > Error in trialfun_bit2dec (line 52) >>>>>> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >>>>>> > > >>>>>> > > >>>>>> > > I'm quite sure it's because I'm not writing it in the correct part >>>>>> > > of >>>>>> > > my script. This is my trial definition part. Where should I add it >>>>>> > > and >>>>>> > > how should I write the line? >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > % TRIAL DEFINITION >>>>>> > > cfg=[]; >>>>>> > > cfg.filename = ['my/folders/', subject, '.RAW']; >>>>>> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>>>> > > >>>>>> > > >>>>>> > > cfg.trialdef.eventtype = 'STATUS'; >>>>>> > > cfg.trialdef.eventvalue = cgrmrk; >>>>>> > > cfg.trialdef.prestim = 0.2; >>>>>> > > cfg.trialdef.poststim = 1; >>>>>> > > cfg.trialdef.eventtype=?; >>>>>> > > >>>>>> > > >>>>>> > > cfg = definetrial(cfg); >>>>>> > > >>>>>> > > >>>>>> > > trl = cfg.trl; >>>>>> > > cfg=[]; >>>>>> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >>>>>> > > cfg.trl = trl; >>>>>> > > cfg.reref = 'yes'; >>>>>> > > cfg.refchannel = ['all']; >>>>>> > > >>>>>> > > >>>>>> > > THANKS! >>>>>> > > _______________________________________________ >>>>>> > > 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 >>>>>> > >>>>>> > >>>>>> > _______________________________________________ >>>>>> > 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 >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> 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 >> > > > _______________________________________________ > 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 kathrin.muesch at gmail.com Tue Sep 30 22:49:08 2014 From: kathrin.muesch at gmail.com (=?iso-8859-1?Q?Kathrin_M=FCsch?=) Date: Tue, 30 Sep 2014 16:49:08 -0400 Subject: [FieldTrip] loading neuroscan cnt files - noninteger samples Message-ID: Dear All, I would like to analyze CNT files acquired with a Neuroscan Synamps2 system. I manage to correctly load it in the 32 bit data format. However, the samples for my trigger events are not integers. This shouldn’t be happening because precision cannot be higher than the sampling rate. I noticed that this only happens when the the teeg parameter that is read out of the cnt file is set to 3 but not to 2. For some of my data files the teeg=3 and for some it is 2 and then I get integer samples. The files come from the same data session so I cannot understand why they are read out differently. Has anyone experienced this before and has suggestions how this can be solved? Any help is appreciated. Best, Kathrin -- Kathrin Müsch, Ph.D. Department of Psychology University of Toronto Toronto, Canada www.honeylab.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Mon Sep 1 09:02:16 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Mon, 1 Sep 2014 07:02:16 +0000 Subject: [FieldTrip] Grand Average on time lock data Message-ID: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Dear all, I would like to perform the grand average in a separate script than the preprocessing one, to avoid a crash, because of the number of participants. In the preprocessing script, I performed a timelockanalysis for each participants : avgFC = ft_timelockanalysis(cfg, cleandata); and then save this file : finfname = [subjID{s} '_RP']; mkdir(subjID{s}) save([subjPath filesep finfname '.mat'], 'avgFC'); So, in my grand average script, I wrote the following : cfg = []; homePath = '/Users/emilie/Desktop/EEG_RP/Grandaverage/'; eegPath = homePath; %% Subjects datafiles = {'S83_RP','S84_RP','S85_RP','S87_RP','S88_RP','S89_RP','S90_RP','S91_RP','S92_RP','S93_RP','S94_RP','S97_RP','S98_RP','S99_RP','S100_RP', 'S101_RP'}; nFiles = length(datafiles); avgs = cell(1,nFiles); cfg.channel = 'all'; cfg.latency = 'all'; %cfg.parameter = 'avg'; for iFile = 1:nFiles thisfile = datafiles{iFile}; subjPath = [eegPath thisfile]; file = dir([subjPath '*.mat']); avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', 'feedback', 'no'); avgs{iFile} = load(datafiles{iFile}); end GA = ft_timelockgrandaverage(cfg, avgs{:}); But I'm not pretty sure to understand the error message : Error using ft_checkdata (line 366) This function requires timelock data as input. Error in Averaging (line 33) avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', 'feedback', 'no'); Because If I'm right, the files in 'datafiles' are the time locked data from the preprocessing script. Thank you, Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Sep 1 09:28:21 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 1 Sep 2014 09:28:21 +0200 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Message-ID: Dear Emilie, If you assign the return value of MATLAB's load() to a variable, that variable will become a struct with the variables in the specified mat-file as its fields. In your case avgs{k} will probably (have not read your script very thoroughly) be a struct, so avgs{k}.avgFC is the actual timelock structure. You should replace avgs{iFile} = load(datafiles{iFile}); with tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; and then I think it should work. Best, Eelke On 1 September 2014 09:02, Caspar, Emilie wrote: > Dear all, > > > I would like to perform the grand average in a separate script than the > preprocessing one, to avoid a crash, because of the number of participants. > In the preprocessing script, I performed a timelockanalysis for each > participants : avgFC = ft_timelockanalysis(cfg, cleandata); > and then save this file : > finfname = [subjID{s} '_RP']; > mkdir(subjID{s}) > save([subjPath filesep finfname '.mat'], 'avgFC'); > > > So, in my grand average script, I wrote the following : > > cfg = []; > homePath = '/Users/emilie/Desktop/EEG_RP/Grandaverage/'; > eegPath = homePath; > > > > %% Subjects > datafiles = > {'S83_RP','S84_RP','S85_RP','S87_RP','S88_RP','S89_RP','S90_RP','S91_RP','S92_RP','S93_RP','S94_RP','S97_RP','S98_RP','S99_RP','S100_RP', > 'S101_RP'}; > nFiles = length(datafiles); > avgs = cell(1,nFiles); > > > > cfg.channel = 'all'; > cfg.latency = 'all'; > %cfg.parameter = 'avg'; > > > > for iFile = 1:nFiles > thisfile = datafiles{iFile}; > subjPath = [eegPath thisfile]; > file = dir([subjPath '*.mat']); > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > 'feedback', 'no'); > avgs{iFile} = load(datafiles{iFile}); > end > > > > GA = ft_timelockgrandaverage(cfg, avgs{:}); > > But I'm not pretty sure to understand the error message : > Error using ft_checkdata (line 366) > This function requires timelock data as input. > > Error in Averaging (line 33) > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > 'feedback', 'no'); > > Because If I'm right, the files in 'datafiles' are the time locked data from > the preprocessing script. > > Thank you, > > Emilie > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Mon Sep 1 09:48:30 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 1 Sep 2014 09:48:30 +0200 Subject: [FieldTrip] Using clusterstat.m straight giving her specific statobs and statrnd In-Reply-To: References: Message-ID: Dear Constantino, First, you need to specify cfg.dim as the size of the data matrix, in your case probably just [102 500], the size(statobs) before reshaping. Note that you need to put in statobs as a vector (statobs(:)) and statrnd as a numel(statobs) X nRand matrix. Second, I don't know why you are specifying a cfg.layout, this is not used by the function. The same goes for cfg.neighbours, this is also not used. The higher-level statistics functions convert the cfg.neighbours struct-array into a logical connectivity array using the low-level private function channelconnectivity. To use clusterstat (a low-level function) directly, you need to do this beforehand. So, do something like this: cfg = []; cfg.neighbours = neighbours; cfg.channel = datachannels; % order is important here, must be the same as the data connectivity = channelconnectivity(cfg); cfg = []; ... cfg.dim = size(statobs); % assuming statobs is still a chan X time matrix cfg.connectivity = connectivity; % this assumes statrnd is a chan X time X nRand array statrnd = reshape(statrnd, [numel(statobs), size(statrnd,3)]); statobs = statobs(:); stat = clusterstat(cfg, statrnd, statobs); Best, Eelke On 29 August 2014 18:36, Constantino Méndez Bértolo < constantino.mendezbertolo at ctb.upm.es> wrote: > Dear Fieldtrippers > > We have a 3x3 design and MEG data, say only mag channels (n102) to > simplify. > > We want to perform a cluster-based permutation approach but > timelockstatistics (cfg.method = 'montecarlo', cfg.correctm = 'cluster', > etc) cannot deal with interactions when you have more than three levels > (true?) > > So we built our 'statobs' and 'statrnd' doing a GLM in -R Statistical > Package- and feed 'clusterstat.m' with them > > We have done this with one channel over time with success. However, I am > clueless now about how to solve the problem when dealing with the whole > channel set. > > I wonder what is the nature of the cfg.dim that we need to feed > 'clusterstat.m' with. > > Up to now, we use, (cioming out of -R-): > > size(statobs) = nchan*ntime % (102*500) % twin = [0 .5] % seconds > size(statrnd) = nchan*ntime*nrandomizations % (102*500*1000) > > > and the following presets: > > cfg=[]; > cfg.clustercritval = Fcritmain; % We genereate this before hand > cfg.tail = 1; cfg.clustertail = 1; cfg.clusterthreshold = 'parametric'; > cfg.dim = [1 size(statobs,1) size(statobs,2) ] % <<< The key may be here > load('neuromag306mag_neighb.mat'); > cfg.neighbours = neighbours; > cfg.feedback = 'yes'; > cfg.numrandomization = 1000; > cfg.clusterstatistic = 'maxsum'; > cfg.layout = 'neuromag306mag.lay'; > for i = 1:length(cfg.neighbours) > cfg.channel{i} = cfg.neighbours(i).label; > end > > stat = clusterstat(cfg,statrnd, statobs) > > > Which lead us to an error within findcluster > > Error using findcluster (line 59) > invalid dimension of spatdimneighbstructmat > > Error in clusterstat (line 197) > posclusobs = findcluster(reshape(postailobs, > [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); > > > If anybody has got some insigth it would be greatly appreciated. Or any > hints. Are the size of my statobs and starnd correct? I can share more > information and firstly apologize if I was not able to describe the > problem accurately, I am confused regarding that 'reshape' and the addition > of one dimension at "...reshape(postailobs,[cfg.dim,1])...", but the > problem arises first when findcluster.m tries to calculate the size of > spatdimneighbstructmat > > First line of findcluster.m calcualtes 'spatdimlength' by : " > spatdimlength = size(onoff, 1);" which in our case is "1", which is > obviously wrong?. > > manythanks&peace2all > > -- > Constantino Méndez-Bértolo > Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) > > Parque Científico y Tecnológico de la UPM, Campus de Montegancedo > > 28223 Pozuelo de Alarcón, Madrid, SPAIN > > > > _______________________________________________ > 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 Christoph.Maier at hs-heilbronn.de Mon Sep 1 11:54:28 2014 From: Christoph.Maier at hs-heilbronn.de (Maier, Christoph) Date: Mon, 1 Sep 2014 09:54:28 +0000 Subject: [FieldTrip] Realtime question: tmsi2ft saving to gdf file Message-ID: <2401574ECDCE3246B11D77FD57BFEB1E010D5D31E2@exmbx2.hhn.hs-heilbronn.de> Dear Fieldtrip Users, from the tmsi2ft description on the web (http://fieldtrip.fcdonders.nl/development/realtime/tmsi) I understand that tmsi2ft should allow to transparently save the acquired data to a gdf file while streaming it out. I successfully can read the Signal/Event data acquired with tmsi2ft into Matlab using the realtime functions. However, I can't find a gdf file, and I can't see any place where a file name could be specified. The command line accepts only the parameters tmsi2ft config.txt [hostname [port [ctrlPort]]] The parseFile() Method of the SignalConfiguration-Class does not seem to permit a specification of a filename in the configuration file, and I couldn't identify a call to ODM->setFilename() or ODM->enableSaving() in the tmsi2ft code (as opposed to the biosemi2ft code, where such calls are present and where the filename can be specified in the command line). Therefore my question is: Did I overlook anything and can a filename for a gdf file be specified anyhwere during startup of tmsi2ft? Or is the only intended way to use the TCP command interface of the OnlineDataManager? Thanks in advance for your help Christoph Maier ------------------------------------------------------------------------------------------------- Dr. Christoph Maier, Dipl.-Inform. Med. Department of Medical Informatics Faculty of Informatics (IT) Max-Planck-Str. 39 D-74081 Heilbronn Germany Tel.: +49 (0)7131 504-355 Fax: +49 (0)7131 252 470 E-Mail: christoph.maier at hs-heilbronn.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Mon Sep 1 16:51:48 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Mon, 1 Sep 2014 14:51:48 +0000 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Message-ID: <0AD437C8-8D04-4598-AD49-F50B41E0E046@live.ucl.ac.uk> Dear Eelke, Thank you for your answer. Unfortunately, I still have the same error message. It occurs at the lines you mention, as they occurred in the line I had written in the previous script: tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; Error message: Error using ft_checkdata (line 366) This function requires timelock data as input. And I still don't understand the error. Emilie Le 1 sept. 2014 à 09:28, Eelke Spaak > a écrit : tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Sep 1 16:57:56 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 1 Sep 2014 16:57:56 +0200 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: <0AD437C8-8D04-4598-AD49-F50B41E0E046@live.ucl.ac.uk> References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> <0AD437C8-8D04-4598-AD49-F50B41E0E046@live.ucl.ac.uk> Message-ID: I just now noticed you are calling ft_checkdata yourself, inside the loop. I don't understand why this is, but to me it seems you can remove it. Does it work then? Best, Eelke On 1 September 2014 16:51, Caspar, Emilie wrote: > Dear Eelke, > > Thank you for your answer. Unfortunately, I still have the same error > message. It occurs at the lines you mention, as they occurred in the line I > had written in the previous script: > > tmp = load(datafiles{iFile}); > avgs{iFile} = tmp.avgFC; > > Error message: > Error using ft_checkdata (line 366) > This function requires timelock data as input. > > And I still don't understand the error. > > Emilie > > > > Le 1 sept. 2014 à 09:28, Eelke Spaak a écrit : > > tmp = load(datafiles{iFile}); > avgs{iFile} = tmp.avgFC; > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Tue Sep 2 11:08:59 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Tue, 2 Sep 2014 09:08:59 +0000 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> <0AD437C8-8D04-4598-AD49-F50B41E0E046@live.ucl.ac.uk> Message-ID: Yes! Thank you again! Emilie Le 1 sept. 2014 à 16:57, Eelke Spaak > a écrit : I just now noticed you are calling ft_checkdata yourself, inside the loop. I don't understand why this is, but to me it seems you can remove it. Does it work then? Best, Eelke On 1 September 2014 16:51, Caspar, Emilie > wrote: Dear Eelke, Thank you for your answer. Unfortunately, I still have the same error message. It occurs at the lines you mention, as they occurred in the line I had written in the previous script: tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; Error message: Error using ft_checkdata (line 366) This function requires timelock data as input. And I still don't understand the error. Emilie Le 1 sept. 2014 à 09:28, Eelke Spaak > a écrit : tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; _______________________________________________ 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 Wed Sep 3 08:59:06 2014 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 3 Sep 2014 09:59:06 +0300 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Message-ID: Dear fieldtrippers, I found it uncomfortable having to know the names of different variables as I load them, so I have written a function called "load2struct" (see below). It should be used in cases in which the mat file holds only one variable (a volume, a grid, etc), otherwise only the first variable is loaded. In your example, Emilie, you could use: avgs{iFile} = load2struct(datafiles{iFile}); For me it helped increase the code readability, and allowed my codes to be more compatible with changes I did along the way, like changing the naming format for variables used for specific subjects. I hope you find it useful (and also that it's not silly (maybe there's a much simpler solution), or just wrong). Best, Roey =========================================================== function struct = load2struct(filePath) % LOAD2STRUCT loads the struct in the filePath mat file to a variable, % without needing to know the original field name of this struct. struct = load(filePath); structFieldName = fieldnames(struct); if (length(structFieldName) > 1) warning('Note: load2struct only loads the first variable in the mat file') end eval(['struct = struct.' structFieldName{1} ';']); end On Mon, Sep 1, 2014 at 10:28 AM, Eelke Spaak wrote: > Dear Emilie, > > If you assign the return value of MATLAB's load() to a variable, that > variable will become a struct with the variables in the specified > mat-file as its fields. In your case avgs{k} will probably (have not > read your script very thoroughly) be a struct, so avgs{k}.avgFC is the > actual timelock structure. You should replace > > avgs{iFile} = load(datafiles{iFile}); > > with > > tmp = load(datafiles{iFile}); > avgs{iFile} = tmp.avgFC; > > and then I think it should work. > > Best, > Eelke > > On 1 September 2014 09:02, Caspar, Emilie wrote: > > Dear all, > > > > > > I would like to perform the grand average in a separate script than the > > preprocessing one, to avoid a crash, because of the number of > participants. > > In the preprocessing script, I performed a timelockanalysis for each > > participants : avgFC = ft_timelockanalysis(cfg, cleandata); > > and then save this file : > > finfname = [subjID{s} '_RP']; > > mkdir(subjID{s}) > > save([subjPath filesep finfname '.mat'], 'avgFC'); > > > > > > So, in my grand average script, I wrote the following : > > > > cfg = []; > > homePath = '/Users/emilie/Desktop/EEG_RP/Grandaverage/'; > > eegPath = homePath; > > > > > > > > %% Subjects > > datafiles = > > > {'S83_RP','S84_RP','S85_RP','S87_RP','S88_RP','S89_RP','S90_RP','S91_RP','S92_RP','S93_RP','S94_RP','S97_RP','S98_RP','S99_RP','S100_RP', > > 'S101_RP'}; > > nFiles = length(datafiles); > > avgs = cell(1,nFiles); > > > > > > > > cfg.channel = 'all'; > > cfg.latency = 'all'; > > %cfg.parameter = 'avg'; > > > > > > > > for iFile = 1:nFiles > > thisfile = datafiles{iFile}; > > subjPath = [eegPath thisfile]; > > file = dir([subjPath '*.mat']); > > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > > 'feedback', 'no'); > > avgs{iFile} = load(datafiles{iFile}); > > end > > > > > > > > GA = ft_timelockgrandaverage(cfg, avgs{:}); > > > > But I'm not pretty sure to understand the error message : > > Error using ft_checkdata (line 366) > > This function requires timelock data as input. > > > > Error in Averaging (line 33) > > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > > 'feedback', 'no'); > > > > Because If I'm right, the files in 'datafiles' are the time locked data > from > > the preprocessing script. > > > > Thank you, > > > > Emilie > > > > > > _______________________________________________ > > 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 jm.horschig at donders.ru.nl Wed Sep 3 10:29:43 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 03 Sep 2014 10:29:43 +0200 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Message-ID: <5406D177.3060105@donders.ru.nl> Hi all, there is also a feature in FieldTrip to load or save data, which is supported by nearly all functions (if you find one which does not support it and it should, let us know). You can set cfg.inputfile = 'filename' for loading data or cfg.outputfile = 'filename' for saving data. Note, however, that cfg.inputfile is to my knowldge exclusively compatible to having used cfg.outputfile, i.e. if the variable that is saved/loaded has a different name than what FieldTrip expects, this won't work. It might be worth a try for you guys, because then everything is 'in Fieldtrip style' (and more importantly, history is kept on what data was loaded in data.cfg.previous). Apart from that, thanks Roey for sharing your code! I am sure people will use your function ;) Best, Jörn On 9/3/2014 8:59 AM, Roey Schurr wrote: > Dear fieldtrippers, > > I found it uncomfortable having to know the names of different > variables as I load them, so I have written a function called > "load2struct" (see below). > It should be used in cases in which the mat file holds only one > variable (a volume, a grid, etc), otherwise only the first variable is > loaded. In your example, Emilie, you could use: > > avgs{iFile} = load2struct(datafiles{iFile}); > > For me it helped increase the code readability, and allowed my codes > to be more compatible with changes I did along the way, like changing > the naming format for variables used for specific subjects. > I hope you find it useful (and also that it's not silly (maybe there's > a much simpler solution), or just wrong). > > Best, > Roey > > > =========================================================== > function struct = load2struct(filePath) > % LOAD2STRUCT loads the struct in the filePath mat file to a variable, > % without needing to know the original field name of this struct. > struct = load(filePath); > structFieldName = fieldnames(struct); > if (length(structFieldName) > 1) > warning('Note: load2struct only loads the first variable in > the mat file') > end > eval(['struct = struct.' structFieldName{1} ';']); > end > > > On Mon, Sep 1, 2014 at 10:28 AM, Eelke Spaak > > wrote: > > Dear Emilie, > > If you assign the return value of MATLAB's load() to a variable, that > variable will become a struct with the variables in the specified > mat-file as its fields. In your case avgs{k} will probably (have not > read your script very thoroughly) be a struct, so avgs{k}.avgFC is the > actual timelock structure. You should replace > > avgs{iFile} = load(datafiles{iFile}); > > with > > tmp = load(datafiles{iFile}); > avgs{iFile} = tmp.avgFC; > > and then I think it should work. > > Best, > Eelke > > On 1 September 2014 09:02, Caspar, Emilie > wrote: > > Dear all, > > > > > > I would like to perform the grand average in a separate script > than the > > preprocessing one, to avoid a crash, because of the number of > participants. > > In the preprocessing script, I performed a timelockanalysis for each > > participants : avgFC = ft_timelockanalysis(cfg, cleandata); > > and then save this file : > > finfname = [subjID{s} '_RP']; > > mkdir(subjID{s}) > > save([subjPath filesep finfname '.mat'], 'avgFC'); > > > > > > So, in my grand average script, I wrote the following : > > > > cfg = []; > > homePath = '/Users/emilie/Desktop/EEG_RP/Grandaverage/'; > > eegPath = homePath; > > > > > > > > %% Subjects > > datafiles = > > > {'S83_RP','S84_RP','S85_RP','S87_RP','S88_RP','S89_RP','S90_RP','S91_RP','S92_RP','S93_RP','S94_RP','S97_RP','S98_RP','S99_RP','S100_RP', > > 'S101_RP'}; > > nFiles = length(datafiles); > > avgs = cell(1,nFiles); > > > > > > > > cfg.channel = 'all'; > > cfg.latency = 'all'; > > %cfg.parameter = 'avg'; > > > > > > > > for iFile = 1:nFiles > > thisfile = datafiles{iFile}; > > subjPath = [eegPath thisfile]; > > file = dir([subjPath '*.mat']); > > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > > 'feedback', 'no'); > > avgs{iFile} = load(datafiles{iFile}); > > end > > > > > > > > GA = ft_timelockgrandaverage(cfg, avgs{:}); > > > > But I'm not pretty sure to understand the error message : > > Error using ft_checkdata (line 366) > > This function requires timelock data as input. > > > > Error in Averaging (line 33) > > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > > 'feedback', 'no'); > > > > Because If I'm right, the files in 'datafiles' are the time > locked data from > > the preprocessing script. > > > > Thank you, > > > > Emilie > > > > > > _______________________________________________ > > 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 agreene24 at gmail.com Wed Sep 3 11:58:29 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Wed, 3 Sep 2014 18:58:29 +0900 Subject: [FieldTrip] ft_rejectvisual: removing trials marked as bad Message-ID: Hello, I have used the rejectvisual function in attempt to remove bad trials, but after marking them and pressing the quit button, although the command window states that the selected trials have been removed, there is no obvious change in the data; all of the trials are still intact. Have I overlooked something? Thanks, Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Thu Sep 4 20:30:50 2014 From: mcantor at umich.edu (Max Cantor) Date: Thu, 4 Sep 2014 14:30:50 -0400 Subject: [FieldTrip] TRENTOOL pipeline help Message-ID: Hi fieldtrippers, I know trentool is not produced by the Donders Institute, so I'm not 100% sure if it is appropriate to ask questions about it here, but to the best of my knowledge they do not have a mailing list and I saw a few trentool questions in the archives, so I'm going to assume it's ok... In any case, below is my current pipeline (slightly modified for comprehensibility): (notes in bold are comments/questions made in this email, not present in the pipeline. Sorry in advance for the long post! Any help would be greatly appreciated as I'm a bit over my head on this but I think I'm close!) ***** % Prepare group TE data cfgP = []; cfgP.Path2TSTOOL = *TSTOOLPATH* cfgP.TEcalctype = 'VW_ds'; cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; *I'm trying to find the transfer entropy between the left and right auditory cortices in my experiment. The input is virtual sensor data that was produced using SAM in fieldtrip on real MEG data. * % specify u to be scanned cfgP.predicttime_u = 30; cfgP.toi = [-0.4 0.4]; *For clarification, the predicttime_u is in seconds but the toi is in milliseconds. If I understand correctly, the predicttime_u must fit within the toi, but beyond that are there any benefits to it being earlier or later?* % ACT (Autocorrelation Time) estimation and constraints cfgP.maxlag = 150; cfgP.actthrvalue = 7.5; cfgP.minnrtrials = 5; *My understanding is maxlag should be 1/2 the sampling rate, so since the data are downsampled to 300hz, it should be 150. I know that the sample rate and filters are used to determine the actthrvalue, but I don't actually know the calculation. 7.5 was a rough guess just to test the pipeline. I'm also uncertain of what minnrtrials should be.* % Optimization cfgP.optimizemethod = 'ragwitz'; cfgP.ragdim = 4:8; cfgP.ragtaurange = [0.2 0.4]; cfgP.ragtausteps = 15; cfgP.repPred = 100; *I am completely at a loss for this. I've done some reading into transfer entropy, mutual information, etc., cited in trentool, but I'm yet to understand how exactly this optimization works and what the configuration should be, given my data and experimental intentions.* % Kernel-based TE estimation cfgP.flagNei = 'Mass'; cfgP.sizeNei = 4; % Default cfgP.ensemblemethod = 'no'; cfgP.outputpath = *OUTPUT PATH*; if ~exist(*Path for TEprepare data object*) load VSdat; TE_Wrd = {}; for i = 1:nConds for j = 1:Nsub TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); end end clear VSdat; save('TE_Wrd', 'TE_Wrd'); end *The configuration and virtual sensor data, organized in a 3 x 15 cell of structures (condition by subject) are the input. The TEprepare substructure is added to each individual condition x subject .mat files' data structure which are stored on disk independently.* % Use object_to_mat_conversion.m to replace individual condition x subject virtual sensor data % .mat files with their TE_Wrd equivalent *I'm using a separate script to make some manipulations to the objects from disk; this will all eventually be integrated into the main pipeline*.* TRENTOOL seems to handle data output very differently from fieldtrip and I've had trouble thinking through the most logical way to handle the data so it's a bit haphazard right now.* load cond080sub01.mat cfgG = []; cfgG.dim = cond080sub01.TEprepare.optdim; cfgG.tau = cond080sub01.TEprepare.opttau; if isfield(cond080sub01, 'TEprepare') TEgroup_prepare(cfgG, fileCell); else error('Need to run TEprepare before TEgroup_prepare'); end *For clarification, fileCell is a cell with the name of each condition x subject .mat file, which as I said before is collectively the same as the 3 x 15 VSdat structure (condition x subject).* % Replace .mat files with '_for_TEgroup_calculate' version in % object_to_mat_conversion.m % TE Group Calculate load cond080sub01.mat if isfield(cond080sub01, 'TEgroupprepare') for i = 1:length(fileCell) TEgroup_calculate(fileCell{i}); end else error('Need to run TEgroup_prepare before TEgroup_calculate'); end *At this step I get the following error:Error using transferentropy (line 337)\nTRENTOOL ERROR: not enough data points left after embeddingError in TEgroup_calculate (line 133)[TEresult] = transferentropy(cfg,data);* % TE Group Stats cfgGSTAT = []; cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; cfgGSTAT.uvar = 1; cfgGSTAT.ivar = 2; cfgGSTAT.fileidout = 'test_groupstats'; TEgroup_stats(cfgGSTAT, fileCell); *Given the error above, I am yet to get to this step, but it does not seem fundamentally different from normal fieldtrip stats.* ***** In case my notes were not clear or you skipped to the bottom, *my primary concern is whether the error I'm getting in TEgroup_calculate is a pipeline issue* (I noticed the example pipeline in trentool, the manual, and published methods articles all seem to have slightly or significantly different pipeline compositions), *or if the error is* due to ACT, ragwitz optimization, or some other faulty parameterization *on my part due to a lack of understanding of how transfer entropy works on a more theoretical/mathematical level*. If the latter is the case, is there any relatively straightforward way to conceptualize this, or is this something where I'm just going to have to keep reading and rereading until it eventually makes sense? I've already done quite a bit of that and it hasn't pierced my thick skull yet but I'm sure it will eventually! Thank you so much, Max Cantor -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Fri Sep 5 14:06:36 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Fri, 5 Sep 2014 12:06:36 +0000 Subject: [FieldTrip] Data Interpolation Message-ID: Dear Fieldtrippers, I need to interpolate my data to remove artifacts due to the electric stimulation at the moment of the trigger. So I wrote : cfg = []; epData = ft_redefinetrial(epData_cfg, allData_prepross); fname = [contfname]; save([subjPath filesep fname '.mat'], 'epData'); electric_windows = [0.002 0.013]; electric_window_idx = [nearest(epData.time{1},electric_window(1)) nearest(epData.time{1},electric_window(2))]; for i=1:numel(epData.trial) % Loop through all trials epData.trial{i}(:,electric_window_idx(1):electric_window_idx(2))=nan; % Replace the segment of data corresponding to our window of interest with nans end; cfg.method = 'linear'; cfg.prewindow = 0.01; cfg.postwindow = 0.01; interpoldata = ft_interpolatenan(cfg, epData); But I get the following error: Undefined function 'electric_window' for input arguments of type 'double'. Even if I see what the problem is, I don't know how to solve it without doing any mistakes. Thank you! Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Sep 5 14:22:09 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 5 Sep 2014 14:22:09 +0200 Subject: [FieldTrip] Data Interpolation In-Reply-To: References: Message-ID: The error is here: electric_window_idx = [nearest(epData.time{1},electric_window(1)) nearest(epData.time{1},electric_window(2))]; Find the missing 's' ;) On 5 September 2014 14:06, Caspar, Emilie wrote: > Dear Fieldtrippers, > > I need to interpolate my data to remove artifacts due to the electric > stimulation at the moment of the trigger. So I wrote : > > > cfg = []; > epData = ft_redefinetrial(epData_cfg, > allData_prepross); > fname = [contfname]; > save([subjPath filesep fname '.mat'], 'epData'); > > > electric_windows = [0.002 0.013]; > electric_window_idx = [nearest(epData.time{1},electric_window(1)) > nearest(epData.time{1},electric_window(2))]; > for i=1:numel(epData.trial) % Loop through all trials > > epData.trial{i}(:,electric_window_idx(1):electric_window_idx(2))=nan; % > Replace the segment of data corresponding to our window of interest with > nans > end; > > > > cfg.method = 'linear'; > cfg.prewindow = 0.01; > cfg.postwindow = 0.01; > interpoldata = ft_interpolatenan(cfg, epData); > > But I get the following error: > Undefined function 'electric_window' for input arguments of type 'double'. > > Even if I see what the problem is, I don't know how to solve it without > doing any mistakes. > > Thank you! > > Emilie > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Fri Sep 5 14:41:52 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Fri, 5 Sep 2014 12:41:52 +0000 Subject: [FieldTrip] Data Interpolation In-Reply-To: References: Message-ID: <18261BAB-F049-4920-A2DA-EC31DA16F9A3@live.ucl.ac.uk> Oh yes! scatterbrained, sorry ;) Thanks! Le 5 sept. 2014 à 14:06, "Caspar, Emilie" > a écrit : Dear Fieldtrippers, I need to interpolate my data to remove artifacts due to the electric stimulation at the moment of the trigger. So I wrote : cfg = []; epData = ft_redefinetrial(epData_cfg, allData_prepross); fname = [contfname]; save([subjPath filesep fname '.mat'], 'epData'); electric_windows = [0.002 0.013]; electric_window_idx = [nearest(epData.time{1},electric_window(1)) nearest(epData.time{1},electric_window(2))]; for i=1:numel(epData.trial) % Loop through all trials epData.trial{i}(:,electric_window_idx(1):electric_window_idx(2))=nan; % Replace the segment of data corresponding to our window of interest with nans end; cfg.method = 'linear'; cfg.prewindow = 0.01; cfg.postwindow = 0.01; interpoldata = ft_interpolatenan(cfg, epData); But I get the following error: Undefined function 'electric_window' for input arguments of type 'double'. Even if I see what the problem is, I don't know how to solve it without doing any mistakes. Thank you! Emilie _______________________________________________ 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 constantino.mendezbertolo at ctb.upm.es Fri Sep 5 17:30:26 2014 From: constantino.mendezbertolo at ctb.upm.es (=?UTF-8?Q?Constantino_M=C3=A9ndez_B=C3=A9rtolo?=) Date: Fri, 5 Sep 2014 17:30:26 +0200 Subject: [FieldTrip] Using clusterstat.m straight giving her specific statobs and statrnd In-Reply-To: References: Message-ID: Dear Eelke, Many thank yous - just a follow-up after your response on how to call clusterstat with proper dimensions (days later because it took sometime to compute the statobs and the statrnd) Yes it works! :) ps: To make this message less spammy, I will add the things we finally need to consider in case it helps anyone. This assumes you have computed the statobs and the statrnd structure (using whatever statistic you are into, in this case, the interaction effect of two factors within a manova was tested for each time point and channel in -R-). Statobs should be Nchan*Ntime and statrnd Nchan*Ntime*Nrand (randomizations performed) Statobs should be converted int oa single vector and statrnd a matrix as long * Nrand Cfg.dim will have the same dimensions and statobs. Use cfg.connectivity by calling ft_channelconnectivity Of course you need to provide clusterstat with the specific critvalue calculated beforehand. You will encounter that you need to reshape back fields prob and clusterlabelmat (eg: reshape(stat.posclusterslabelmat,[Nchan Ntime]) to make it readable for humans Last advice: you may be asking yourself why matlab says there is no channelconnectivity functions or clusterstat.m --- they are inside fieldtrip##\private and you may need to includes them in the path/alter the name of the folder Thanks a lot again Eelke, Tino 2014-09-01 9:48 GMT+02:00 Eelke Spaak : > Dear Constantino, > > First, you need to specify cfg.dim as the size of the data matrix, in your > case probably just [102 500], the size(statobs) before reshaping. Note that > you need to put in statobs as a vector (statobs(:)) and statrnd as a > numel(statobs) X nRand matrix. > > Second, I don't know why you are specifying a cfg.layout, this is not used > by the function. The same goes for cfg.neighbours, this is also not used. > The higher-level statistics functions convert the cfg.neighbours > struct-array into a logical connectivity array using the low-level private > function channelconnectivity. To use clusterstat (a low-level function) > directly, you need to do this beforehand. > > So, do something like this: > > cfg = []; > cfg.neighbours = neighbours; > cfg.channel = datachannels; % order is important here, must be the same as > the data > connectivity = channelconnectivity(cfg); > > cfg = []; > ... > cfg.dim = size(statobs); % assuming statobs is still a chan X time matrix > cfg.connectivity = connectivity; > > % this assumes statrnd is a chan X time X nRand array > statrnd = reshape(statrnd, [numel(statobs), size(statrnd,3)]); > > statobs = statobs(:); > stat = clusterstat(cfg, statrnd, statobs); > > Best, > Eelke > > > On 29 August 2014 18:36, Constantino Méndez Bértolo < > constantino.mendezbertolo at ctb.upm.es> wrote: > >> Dear Fieldtrippers >> >> We have a 3x3 design and MEG data, say only mag channels (n102) to >> simplify. >> >> We want to perform a cluster-based permutation approach but >> timelockstatistics (cfg.method = 'montecarlo', cfg.correctm = 'cluster', >> etc) cannot deal with interactions when you have more than three levels >> (true?) >> >> So we built our 'statobs' and 'statrnd' doing a GLM in -R Statistical >> Package- and feed 'clusterstat.m' with them >> >> We have done this with one channel over time with success. However, I am >> clueless now about how to solve the problem when dealing with the whole >> channel set. >> >> I wonder what is the nature of the cfg.dim that we need to feed >> 'clusterstat.m' with. >> >> Up to now, we use, (cioming out of -R-): >> >> size(statobs) = nchan*ntime % (102*500) % twin = [0 .5] % seconds >> size(statrnd) = nchan*ntime*nrandomizations % (102*500*1000) >> >> >> and the following presets: >> >> cfg=[]; >> cfg.clustercritval = Fcritmain; % We genereate this before hand >> cfg.tail = 1; cfg.clustertail = 1; cfg.clusterthreshold = 'parametric'; >> cfg.dim = [1 size(statobs,1) size(statobs,2) ] % <<< The key may be here >> load('neuromag306mag_neighb.mat'); >> cfg.neighbours = neighbours; >> cfg.feedback = 'yes'; >> cfg.numrandomization = 1000; >> cfg.clusterstatistic = 'maxsum'; >> cfg.layout = 'neuromag306mag.lay'; >> for i = 1:length(cfg.neighbours) >> cfg.channel{i} = cfg.neighbours(i).label; >> end >> >> stat = clusterstat(cfg,statrnd, statobs) >> >> >> Which lead us to an error within findcluster >> >> Error using findcluster (line 59) >> invalid dimension of spatdimneighbstructmat >> >> Error in clusterstat (line 197) >> posclusobs = findcluster(reshape(postailobs, >> [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); >> >> >> If anybody has got some insigth it would be greatly appreciated. Or any >> hints. Are the size of my statobs and starnd correct? I can share more >> information and firstly apologize if I was not able to describe the >> problem accurately, I am confused regarding that 'reshape' and the addition >> of one dimension at "...reshape(postailobs,[cfg.dim,1])...", but the >> problem arises first when findcluster.m tries to calculate the size of >> spatdimneighbstructmat >> >> First line of findcluster.m calcualtes 'spatdimlength' by : " >> spatdimlength = size(onoff, 1);" which in our case is "1", which is >> obviously wrong?. >> >> manythanks&peace2all >> >> -- >> Constantino Méndez-Bértolo >> Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) >> >> Parque Científico y Tecnológico de la UPM, Campus de Montegancedo >> >> 28223 Pozuelo de Alarcón, Madrid, SPAIN >> >> >> >> _______________________________________________ >> 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 > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Sat Sep 6 09:55:25 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Sat, 6 Sep 2014 07:55:25 +0000 Subject: [FieldTrip] ft_channelrepair and connectivity Message-ID: <1409990124934.33614@flinders.edu.au> ?Hello fieldtrip, I was just wondering whether there would be potential issues with using the function ft_channelrepair to effectively fill in missing EEG channels (which would have been originally dirty) and calculating connectivity (in the time domain). I cant really see an issue because of how well it is implemented, but its making me doubt myself. Any thoughts? Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66125 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Sat Sep 6 14:07:33 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Sat, 6 Sep 2014 12:07:33 +0000 Subject: [FieldTrip] timelockanalysis and beamformer Message-ID: <1410005248989.24450@flinders.edu.au> ?Hello fieldtrip, I was just wondering when it is appropriate to use the configuration cfg.keeptrials = 'yes' in ft_timelockanalysis, and when it is appropriate to have it as 'no'. I have continuous data of 30 seconds. However its separated into a 5, 6 and 19 second segments. So they arent event-related events. At present I am not asking timelockanalysis to keep the trials, or ft_sourceanalysis (LCMV beamformer) for that matter. Is this bad? Im worried about unstable spatial filters (if I calculate covariance matrices and spatial filters for each trial) and loss of phase (if I average the covariance matrices over trials and produce one spatial filter). I noticed that in the tutorial connectivityextended that they never specify these things and therefore use the default, which is cfg.keeptrials = 'no' and they calculate . Is that my answer? Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66125 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdien07 at mac.com Sun Sep 7 07:53:57 2014 From: jdien07 at mac.com (Joseph Dien) Date: Sun, 07 Sep 2014 01:53:57 -0400 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: Message-ID: <85691A9F-3696-4881-B2C6-147935FBFB9A@mac.com> Hi, I’m one of the main Fieldtrip contributors working on supporting EGI data. A couple things. First of all, exactly which net do you use? If they are 129-channel, there is still the question of whether they are the Hydrocel or the older geodesic nets. Regardless, that shouldn't cause an error like this. Could you send me the file you are trying to process and the script you are using and I’ll try troubleshooting it. Joe On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini wrote: > Which nets do you use? I use EGI. I tried both the ones you mention and they didn't work. It was hard to find that exact one online but it was the only file that actually worked. > > > On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann wrote: > Dear Ana, dear all, > the layout you used does not correspond to our nets. I tried the > GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. Please can anybody help? > Cheers > Katrin > > > 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : > > Try this one I use > > > On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann wrote: > Dear all, my problems seem neverending. This time however i really need help. > I implemented a pipeline for ERPs. All works now, trialdefinition, preprocessing, channelreplacement, ica, componentrejection, final artifactdetection, timelock of the single subject data. However, when I wanna compute the grandaverage of the single subjects I get the following error message: > > computing average of avg over 19 subjects > Warning: discarding electrode information because it cannot be averaged > > In ft_timelockgrandaverage at 249 > the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 3 MB > computing average of avg over 2 subjects > Warning: discarding electrode information because it cannot be averaged > > In ft_timelockgrandaverage at 249 > the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 0 MB > the call to "ft_prepare_layout" took 0 seconds and required the additional allocation of an estimated 0 MB > the call to "ft_topoplotER" took 0 seconds and required the additional allocation of an estimated 0 MB > > Furthermore in the plot of the significant clusters, the channelnames are mixed up (do not correspond to my net) > > > I guess that there is a problem with the layout I use. > Here the code that I use > > %For generating the layout (also in the single subjects): > cfg = []; > > cfg.channel = obs_data.label; > > cfg.layout = 'GSN-HydroCel-129.sfp'; > > cfg.feedback = 'yes'; > > lay = ft_prepare_layout(cfg); > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = lay; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > > > > %For computing the grand average > > cfg = []; > > cfg.channel = 'all'; > > cfg.latency = 'all'; > > cfg.parameter = 'avg'; > > cfg.keepindividual = 'no' > > GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > > GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > > % "{:}" means to use data from all elements of the variable > > > For plotting the significant clusters > > cfg = []; > > cfg.style = 'blank'; > > cfg.layout = lay; > > cfg.channellabels = 'yes'; > > cfg.highlight = 'labels'; > > cfg.highlightchannel = find(stat.mask); > > cfg.comment = 'no'; > > figure; ft_topoplotER(cfg, GA_90) > > title('Nonparametric: significant with cluster multiple comparison correction') > > > > Do you have ANY idea to this? I am really completely helpless.... > > thanks and best > > Katrin > > > _______________________________________________ > 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 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------------------------------------------------------------------------- Joseph Dien, PhD Research Associate Cognitive Neurology The Johns Hopkins University School of Medicine Lab E-mail: jdien1 at jhmi.edu Private E-mail: jdien07 at mac.com Office Phone: 410-614-3115 Cell Phone: 202-297-8117 Fax: 410-955-0188 http://joedien.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Mon Sep 8 14:22:13 2014 From: roeysc at gmail.com (Roey Schurr) Date: Mon, 8 Sep 2014 15:22:13 +0300 Subject: [FieldTrip] MNE Source Reconstruction Sanity Check In-Reply-To: References: <346147900.8004488.1406126123454.JavaMail.root@sculptor.zimbra.ru.nl> <790E6AB9-6372-4F70-9B98-2DE6E084F552@donders.ru.nl> <53D1FD3B.7040600@donders.ru.nl> Message-ID: Dear fieldtrippers, I am reposting this question in hope someone could help me use the template BEM head model in EEG source reconstruction. Any help would be greatly appreciated! Thank you all, roey On Wed, Aug 20, 2014 at 5:23 PM, Roey Schurr wrote: > Dear fieldtrippers, dear Jörn, > > > > I am currently trying to use the standard BEM head model provided in the > fieldtrip toolbox (on a 19 electrodes EEG recording, segmented into > 10-seconds trials, not time-locked), but I have encountered a problem I > could not resolve: > > > > Error using svd > > Input to SVD must not contain NaN or Inf. > > > > Error in pinv (line 29) > > [U,S,V] = svd(A,0); > > > > Error in pinv (line 27) > > X = pinv(A',varargin{:})'; > > > > Error in minimumnormestimate (line 151) > > w = pinv(lf); > > > > Error in ft_sourceanalysis (line 876) > > dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, > optarg{:}); > > > > Following some old posts in the mailing list I made sure the electrodes > data structure of the data is the same as that given in the cfg > of ft_sourceanalysis. However, it is still possible that using a 19 > electrodes recording is not possible using the source model I am using? > > > > I am also afraid computing the source reconstruction on such continuous > data, that is not time-locked, could be a problem. For example, having to > calculate the “avg” field artificially seems a little fishy. > > > > I also tried running the code on the EEG data of the continuous data > preprocessing tutorial (after choosing only 19 of its electrodes, though > possibly not the right ones). > > > > Any advice would be greatly appreciated! > > Thank you all, > > Roey > > > > > > > THE CODE > > --------------- > > % Load head model, “vol” > > hdmfile = fullfile(which('standard_bem.mat')); > > load(hdmfile); > > > > % Create grid > > gridcfg = []; > > gridcfg.grid.xgrid = -20:1:20; > > gridcfg.grid.ygrid = -20:1:20; > > gridcfg.grid.zgrid = -20:1:20; > > gridcfg.grid.unit = 'cm'; > > gridcfg.grid.tight = 'yes'; > > gridcfg.inwardshift = -1.5; > > gridcfg.vol = vol; > > > > gridVar = ft_prepare_sourcemodel(gridcfg); > > > > % Restrict source reconstruction to outside of the cerrebellum > > gridVar = getRidOfCerrebellum([], gridVar); > > > > % Source reconstruction > > slcfg = struct; > > slcfg.method = ‘mne’; > > slcfg.elec = data.elec; > > slcfg.grid = gridVar; > > slcfg.vol = vol; > > slcfg.rawtrial = 'yes'; > > slcfg.hdmfile = hdmfile; > > slcfg.mne.lambda = '5%'; > > slcfg.keepfilter = 'yes'; > > slcfg.rawtrial = 'no'; % this is because we are now just computing the > spatial filter > > slcfg.singletrial = 'no'; > > slcfg.keeptrials = 'yes'; > > > > % calculate the avg of each trial, for use in ft_sourceanalysis > > for trialI = 1:length(data.trial) > > data.avg(:,trialI) = mean(data.trial{trialI}')'; > > end > > > > source_for_filter = ft_sourceanalysis(slcfg, data); %this source structure > is used to compute the filter to be used later > > > > On Fri, Jul 25, 2014 at 9:46 AM, "Jörn M. Horschig" < > jm.horschig at donders.ru.nl> wrote: > >> Dear Roey, >> >> I agreet that this is a bad idea - independently of what result you will >> get, the error is just too big to draw any reliable conclusions. Imho, you >> can better try using ICA to decompose your data into components. >> >> Concerning the headmodel, there is a standard BEM headmodel template >> available in FieldTrip. >> >> Best, >> Jörn >> >> >> On 7/24/2014 8:50 PM, Roey Schurr wrote: >> >>> Dear Jim, >>> Thank you for drawing my attention to this problem. I have actually >>> tried building a realistic head model using OPENMEG but encountered some >>> compitability problems since our lab does not use Linux. This is indeed one >>> of the most important (short) future tasks - being able to use such >>> realistic head models. >>> Best, >>> roey >>> >>> >>> On Thu, Jul 24, 2014 at 6:34 PM, E688205 >> > wrote: >>> >>> Dear Roey, >>> >>> To add to Diego's comments, since you are dealing with EEG data a >>> single sphere headmodel is not a good idea because it does not >>> take into account the differences in conductivity between the >>> skull, scalp, and brain. This is not a problem for MEG but is >>> important for EEG. Therefore it is better to use, for example, a >>> BEM head model. >>> >>> Best, >>> >>> Jim >>> >>> On 23 jul. 2014, at 16:38, "Lozano Soldevilla, D. (Diego)" >>> >> > wrote: >>> >>> Dear Roey, >>>> >>>> In my opinion it's definitely not a good idea to compute MNE >>>> using 19 sensors. There are studies that have found a drastic >>>> localization precision from 31 to 63 electrodes and further >>>> improvements till 123: >>>> >>>> http://www.ncbi.nlm.nih.gov/pubmed/15351361 (see figure 1) >>>> http://www.ncbi.nlm.nih.gov/pubmed/12495765 >>>> >>>> Although it's very difficult to know the "minimum" number of >>>> electrodes needed to accurately localize a given source (it >>>> depends on the strength of the source you want to localize, >>>> source reconstruction algorithm, data noise...), 19 electrodes >>>> are too low to trust the results you can get. >>>> >>>> best, >>>> >>>> Diego >>>> >>>> >>>> ------------------------------------------------------------ >>>> ------------ >>>> From roeysc atgmail.com Mon Jul 21 11:21:32 >>>> 2014 >>>> From: roeysc atgmail.com (Roey Schurr) >>>> >>>> Date: Mon, 21 Jul 2014 12:21:32 +0300 >>>> Subject: [FieldTrip] MNE Source Reconstruction Sanity Check >>>> Message-ID: >>> mail.gmail.com >>> AQ_W43cHF_8J2b+rNyzd55x4aRviw at mail.gmail.com>> >>>> >>>> >>>> Dear fieldtrippers, >>>> >>>> >>>> >>>> I want to do a sanity check on mne source reconstruction. >>>> >>>> I'm working on continuous EEG recordings (19 electrodes), >>>> estimating the >>>> source reconstruction activity using the *mne* (minimum norm >>>> estimate) >>>> method, a *template MRI* (Colin27) and a *singlesphere* headmodel. >>>> As a >>>> sanity check for the source reconstruction itself, I wanted to >>>> compare >>>> conditions in which I could estimate the loci of significant >>>> changes, e.g.: >>>> rest vs movement of the hand, moving the right hand vs the left >>>> hand, etc. >>>> I have about 60 seconds of recording for each condition. >>>> >>>> >>>> >>>> What I did was: >>>> >>>> 1) Segment the recording of each condition into many "trials" of 2 >>>> seconds >>>> each. >>>> >>>> 2) For each trial, average the activity in each of the 90 ROIs of >>>> the aal >>>> atlas (I excluded the cerebellum from the source reconstruction). >>>> >>>> >>>> >>>> I was wondering what comparison would be best in this case. Since >>>> this is >>>> not Evoked Responses data, I find it hard to find relevant ideas, >>>> and would >>>> like to hear your thoughts. >>>> >>>> >>>> >>>> 1) I did a frequency analysis (mtmfft) in conventional bands of >>>> interest >>>> and ran ft_freqstatistics on the resulting structures (using ttest2 >>>> and the >>>> bonferoni correction for the multiple comparison problem). This >>>> gave some >>>> results, however for most conditions they are not very encouraging >>>> (the >>>> ROIs that showed significant differences were not close to those >>>> that I >>>> have assumed). >>>> >>>> >>>> >>>> *QUESTION 1*: do you think this is a proper method? Note that I did >>>> not use >>>> a frequency based source reconstruction in the first place, because >>>> I'm >>>> ultimately interested in the time course in the source space. >>>> >>>> >>>> >>>> 2) I was wondering if a cluster based permutation test is >>>> impossible to use >>>> here, since this is a continuous recording, so clustering according >>>> to time >>>> adjacency seems irrelevant. >>>> >>>> >>>> >>>> *QUESTION 2*: is it possible to use a cluster based statistical >>>> test here? >>>> If so, it could be better than a-priori averaging the source >>>> activity in >>>> the atlas ROIs, which could mask some of the effects, if they are >>>> located >>>> in a small area. >>>> >>>> >>>> >>>> 3) Another possibility is looking at the data itself. Unfortunately >>>> I >>>> encountered some problems using ft_sourcemovie, though this is a >>>> subject >>>> for a different thread. >>>> >>>> >>>> >>>> Any thoughts and advice are highly appreciated! >>>> >>>> Thank you for taking the time, >>>> >>>> roey >>>> _______________________________________________ >>>> >>>> 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 >> >> >> _______________________________________________ >> 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 e.maris at psych.ru.nl Mon Sep 8 15:46:11 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) Subject: [FieldTrip] Question regarding nonparametric testing for coherence differences In-Reply-To: References: Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris@psych.ru.nl> Dear Hwee Ling, In the paper you refer to (Maris et al, JNM, 2007), I did not perform a cluster-based permutation test at the level of the channel pairs. Instead, all coherences mentioned in the paper are coherence between a single EMG channel (2 electrodes mounted on the forearm) and all MEG electrodes. Thus, there are as many EMG-MEG coherences as there are MEG channels (275 in our lab), and the clustering of these coherences involves the same neighbourhood structure as the clustering of channel-specific statistics on power or evoked response. The analysis you propose involves clustering in a much more complex space, namely the formed by all (MEG,MEG) channel pairs (275*275=75625 pairs). In the early days of cluster-based permutation statistics, I have worked on this problem but did not pursue it because the resulting clusters are very hard to interpret. Best, Eric Maris Dear all and Prof Maris, I'm re-posting this question again, as I didn't get any replies previously. I’m interested to investigate if there are any differences in phase synchronization in resting state data at timepoint 2 versus timepoint 1. The EEG data was collected using 64 EEG channels, resting state, eyes opened and eyes closed. I’ve arbitrarily segmented the resting state data into epochs of 2s each, and the epochs with artifacts are excluded completely from further analyses. I then performed mtmfft to get the fourier representation of the data, extracted the coherence, and compared the coherence difference of timepoint 2 versus timepoint 1 of all channels paired with all other channels. I figured that if I extract the connectivity analyses without specifying the channelcmb, I get a 'chan_chan_freq' dimord variable that would allow me to perform cluster-based statistical analyses. I get an output with ‘chan_chan’ dimord variable. However, I was not 100% sure that this is correct, hence, I’ve inserted my code (see below). It’ll be great if you could tell me if what I’m doing makes any sense at all. Also, I don’t know how I can plot the results to see if it make any sense at all. Also, I checked the values obtained from when I specified "cfg.channelcmb" and when I did not specify "cfg.channelcmb", I noticed that the values were somehow different. I would assume that the values to be similar, although I'm not sure why they would have differences in the values obtained from specifying "cfg.channelcmb". This is my code that I've used thus far: for sub = 1:5 cfg = []; cfg.output = 'fourier'; cfg.channel = {'all'}; cfg.method = 'mtmfft'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 5; cfg.foilim = [0 100]; cfg.taper = 'dpss'; % find the index for the c200 condition pre_c200_idx = find(data5.trialinfo == 201); cfg.trials = pre_c200_idx; HLF_pre_c200 = ft_freqanalysis(cfg, data5); post_c200_idx = find(data5.trialinfo == 200); cfg.trials = post_c200_idx; HLF_post_c200 = ft_freqanalysis(cfg, data5); cfg = []; cfg.keeptrials = 'no'; cfg.channel = {'all'}; cfg.removemean = 'yes'; cfg.method = 'coh'; HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_pre_c200); HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_post_c200); end load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); cfg_neighb.method = 'template'; cfg_neighb.layout = lay; cfg_neighb.channel = 'all'; neighbours = ft_prepare_neighbours(cfg_neighb, sub_HLF_pre_c200coh{1}); cfg = []; cfg.layout = lay; cfg.neighbours = neighbours; cfg.channel = 'all'; cfg.channelcmb = {cfg.channel, cfg.channel}; cfg.latency = 'all'; cfg.avgovertime = 'no'; cfg.avgoverchan = 'no'; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.correctm = 'cluster'; cfg.tail = 0; % cfg.clustertail = 0; cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 frequency bands. cfg.numrandomization = 10000; cfg.ivar = 2; cfg.uvar = 1; % design matrices clear design; design(1,:) = [1:5, 1:5]; design(2,:) = [ones(1,5), ones(1,5) * 2]; cfg.design = design; % for theta band cfg.avgoverfreq = 'yes'; cfg.frequency = [4 8]; % I also performed the statistics for delta (2-4), alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma (30-40), and gamma (40-100). [diffc200_theta_stat] = ft_freqstatistics(cfg, sub_HLF_post_c200coh{:}, sub_HLF_pre_c200coh{:}); When I tried to plot the results, I used this code: cfg = []; cfg.channel = 'all'; cfg.layout = 'lay'; cfg.zlim = [-1 1]; cfg.alpha = 0.05; cfg.refchannel = 'all'; ft_clusterplot(cfg, diffc200_theta_stat); However, I was not sure how I could plot the results. I get an error message from Fieldtrip when using ft_clusterplot: Error using topoplot_common (line 366) no reference channel is specified Error in ft_topoplotTFR (line 192) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_clusterplot (line 372) ft_topoplotTFR(cfgtopo, stat); According to your paper in 2007, the topoplot of the results were masked by the spatio-spectral pattern of the significant clusters. I don't know how to do this, and I would really appreciate if you can show me how to make such a plot. Thank you very much. Kind regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Mon Sep 8 21:38:01 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Mon, 8 Sep 2014 21:38:01 +0200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: <85691A9F-3696-4881-B2C6-147935FBFB9A@mac.com> References: <85691A9F-3696-4881-B2C6-147935FBFB9A@mac.com> Message-ID: Dear Joseph, thanks so much, I really appreciate your help. I was also wandering, if maybe there is another bug in my code. Our nets are 128 channels, Hydrocel, but as a colleague of me adviced me to do so, I also tried the 129 layout. My code you find below (without selection of bad channels etc.) If you need also the data of two subjects to have a look, let me know!!! Best and thanks really! Katrin subject=input('Which subject do you want to analyse? ','s'); name = strcat(subject,'.raw'); subjectnumber=input('Which is the subjectnumber?', 's'); sb=subjectnumber %subjectnumber = strcat(subjectnumber, '.txt') %% cfg = []; cfg.dataset = name; cfg.trialfun = 'ft_trialfun_general'; % this is the default cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus trigger cfg.trialdef.prestim = 0.234; % in seconds cfg.trialdef.poststim = 7.266; % in seconds (whole time of video observation, but maybe we need less) cfg = ft_definetrial(cfg); cfg.trl([1:7],:) = []; %change timeline according to constant offset of 16 ms = 8 samples (because recorded with 500 hz)in %structure trial cfg.trl(:,3)=cfg.trl(:,3)-8 %change timeline to make the cut the zeropoint cfg.trl(:,3)=cfg.trl(:,3)- 1000; %% preprocess data cfg.channel = 'all'; cfg.preproc.detrend = 'yes'; cfg.preproc.demean = 'yes'; cfg.preproc.baselinewindow = [-2.1 -2.0] %cfg.preproc.bpfilter = 'yes'; - the data here has to be already filtered %(0.1-45) and bad channels have to be replaced!!!! %cfg.preproc.bpfreq = [6 32]; % % obs_data = ft_preprocessing(cfg); % save (strcat(sb,'obs_data') , 'obs_data') %% determining channel neighbours (necessary for Artifact detection) cfg = []; cfg.channel = obs_data.label; cfg.layout = 'GSN128.sfp'; cfg.feedback = 'yes'; lay = ft_prepare_layout(cfg); cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'GSN128.sfp'; neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); obs_data.elec = ft_read_sens('GSN128.sfp'); %% Artifacts - to detect bad channels - is not saved!!! cfg.method = 'summary'; cfg.latency=[0 1]; cfg.layout = 'GSN128.sfp'; % this allows for plotting obs_data_try = ft_rejectvisual(cfg, obs_data); cfg = []; cfg.viewmode = 'vertical'; cfg.latency=[0 1]; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs_data); %cfg.artfctdef.reject = 'complete'; obs_data_try = ft_rejectartifact (cfg,obs_data); %% Preparing neighbours for channel repair - but bad channel info in!!! % cfg_neighb = []; % cfg_neighb.feedback = 'yes'; % cfg_neighb.method = 'triangulation'; % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); % Interpolate and put into new data structure cfg = []; cfg.badchannel = {}; cfg.layout = 'GSN128.sfp'; cfg.method = 'nearest'; cfg.neighbours = neighbours; obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) % Check reconstruction cfg = []; cfg.viewmode = 'vertical'; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs_data_channelrepaired); %cfg.artfctdef.reject = 'complete'; obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); % dat1=obs_data; % dat2=obs_data_channelrepaired; % % x=dat1.trial{1}(62,:); % 68 is channel index of E68 % y=dat2.trial{1}(62,:); % plot(x);hold on;plot(y,'r'); % % x=dat1.trial{1}(72,:); % y=dat2.trial{1}(75,:); % figure; % plot(x);hold on;plot(y,'r') % % x=dat1.trial{1}(75,:); % y=dat2.trial{1}(75,:); % figure; % plot(x);hold on;plot(y,'r') %% artifact rejection/trial inspection - throw out electrode jumps etc. cfg = []; cfg.viewmode = 'vertical'; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs_data_channelrepaired); %cfg.artfctdef.reject = 'complete'; obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent according to channels interpolated %% 128-number of interp. channels) cfg = []; cfg.channel = {'all'}; cfg.numcomponent = 128 comp = ft_componentanalysis(cfg,obs_data_clean1); save (strcat(sb,'comp_all') , 'comp') %% cfg = []; cfg.viewmode = 'component'; cfg.continuous = 'no'; cfg.plotlabels='some'; cfg.layout = 'GSN128.sfp'; ft_databrowser(cfg,comp); %% poweranalysis components cfg = []; cfg.output = 'pow'; cfg.channel = 'all';%compute the power spectrum in all ICs cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = 0:0.2:50; obs_freq = ft_freqanalysis(cfg, comp); %And you can plot the spectra: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nsubplots = 16; nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain decimals, type doc subplot Nfigs = ceil(size(comp.topo,1)/nsubplots); tot = Nfigs*nsubplots; rptvect = 1:size(comp.topo,1); rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); rptvect = reshape(rptvect,nsubplots,Nfigs)'; for r=1:size(rptvect,1); figure;set(gcf,'units','normalized','outerposition',[0 0 1 1]);%full screen k=0; for j=1:size(rptvect,2); if~(rptvect(r,j)==0); k=k+1; cfg=[]; cfg.channel = rptvect(r,j); cfg.ylim =[0 500] cfg.xlim =[0 50] subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); end end end %For the IC topos you'll follow the same logic as above but with: figure cfg = []; cfg.component = [1:20]; % specify the component(s) that should be plotted cfg.layout = 'GSN128.sfp'; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) figure cfg = []; cfg.component = [21:40]; % specify the component(s) that should be plotted cfg.layout = 'GSN128.sfp'; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) figure cfg = []; cfg.component = [41:60]; % specify the component(s) that should be plotted cfg.layout = 'GSN128.sfp'; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) figure cfg = []; cfg.component = [61:80]; % specify the component(s) that should be plotted cfg.layout = 'GSN128.sfp'; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) %% Seperate observation conditions name1= strcat(num2str(sb),'_90.xls'); list1=xlsread (name1) name2= strcat(num2str(sb),'_180.xls'); list2=xlsread (name2) % cfg = [] cfg.trials = [list1] obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) cfg = [] cfg.trials = [list2] obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) %%PIPELINE FOR obs90 %% Decompose original data according to the components found before load (strcat(sb,'comp_all')) cfg = []; cfg.numcomponent = 128; cfg.unmixing = comp.unmixing; cfg.topolabel = comp.topolabel; comp_1 = ft_componentanalysis(cfg, obs90_data); %% Reject component cfg = []; cfg.component = []; obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') %% Artifacts - final detection cfg.method = 'summary'; cfg.latency=[0 1]; cfg.layout = 'GSN128.sfp'; % this allows for plotting obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); cfg = []; cfg.viewmode = 'vertical'; cfg.latency=[0 1]; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs90_data_clean3); %cfg.artfctdef.reject = 'complete'; obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); % Save clean data save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') %% Rereferencing data cfg = []; cfg.channel = 'all'; cfg.preproc.reref = 'yes'; cfg.preproc.refchannel = 'all'; obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) save (strcat(subject,'obs90_ref') , 'obs90_data_ref') %% Snap out smaller pieces (the third second) cfg = [] cfg.toilim = [0 1] obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) %% TIMELOCK ERP obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') %% plot it cfg = []; cfg.layout = lay ; cfg.interactive = 'yes'; ft_multiplotER(cfg, obs90_data_ERP) %% PIPELINE FOR obs180 %% Decompose original data according to the components found before load (strcat(sb,'comp_all')) cfg = []; cfg.numcomponent = 128 cfg.unmixing = comp.unmixing; cfg.topolabel = comp.topolabel; comp_2 = ft_componentanalysis(cfg, obs180_data); %% Reject component cfg = []; cfg.component = []; obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, obs180_data); save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') %% Artifacts final 180 cfg.method = 'summary'; cfg.latency=[0 1]; cfg.layout = 'GSN128.sfp'; % this allows for plotting obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); cfg = []; cfg.viewmode = 'vertical'; cfg.latency=[0 1]; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs180_data_clean3); %cfg.artfctdef.reject = 'complete'; obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); % Save clean data save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') %% Rereferencing data cfg = []; cfg.channel = 'all'; cfg.preproc.reref = 'yes'; cfg.preproc.refchannel = 'all'; obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) save (strcat(subject,'obs180_ref') , 'obs180_data_ref') %% Snap out smaller pieces (the third second) cfg = [] cfg.toilim = [0 1] obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) %% TIMELOCK ERP obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') %% plot 180 ERP cfg = []; cfg.layout = lay ; cfg.interactive = 'yes'; ft_multiplotER(cfg, obs180_data_ERP) %% plot both ERPs cfg = []; cfg.layout = lay ; cfg.interactive = 'yes'; cfg.showlabels = 'yes'; ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) %% plot difference wave difference = obs180_data_ERP; % copy one of the structures difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute the difference ERP cfg = []; cfg.layout = lay; cfg.interactive = 'yes'; ft_multiplotER(cfg, difference) 2014-09-07 7:53 GMT+02:00 Joseph Dien : > Hi, > I’m one of the main Fieldtrip contributors working on supporting EGI > data. A couple things. First of all, exactly which net do you use? If > they are 129-channel, there is still the question of whether they are the > Hydrocel or the older geodesic nets. Regardless, that shouldn't cause an > error like this. Could you send me the file you are trying to process and > the script you are using and I’ll try troubleshooting it. > > Joe > > > On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < > diezmartini at gmail.com> wrote: > > Which nets do you use? I use EGI. I tried both the ones you mention and > they didn't work. It was hard to find that exact one online but it was the > only file that actually worked. > > > On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > wrote: > >> Dear Ana, dear all, >> the layout you used does not correspond to our nets. I tried the >> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. >> Please can anybody help? >> Cheers >> Katrin >> >> >> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : >> >> Try this one >>> I use >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>> katrinheimann at gmail.com> wrote: >>> >>>> Dear all, my problems seem neverending. This time however i really need >>>> help. >>>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>>> preprocessing, channelreplacement, ica, componentrejection, final >>>> artifactdetection, timelock of the single subject data. However, when I >>>> wanna compute the grandaverage of the single subjects I get the following >>>> error message: >>>> >>>> computing average of avg over 19 subjects >>>> Warning: discarding electrode information because it cannot be averaged >>>> > In ft_timelockgrandaverage at 249 >>>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>>> additional allocation of an estimated 3 MB >>>> computing average of avg over 2 subjects >>>> Warning: discarding electrode information because it cannot be averaged >>>> > In ft_timelockgrandaverage at 249 >>>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>>> additional allocation of an estimated 0 MB >>>> the call to "ft_prepare_layout" took 0 seconds and required the >>>> additional allocation of an estimated 0 MB >>>> the call to "ft_topoplotER" took 0 seconds and required the additional >>>> allocation of an estimated 0 MB >>>> >>>> Furthermore in the plot of the significant clusters, the channelnames >>>> are mixed up (do not correspond to my net) >>>> >>>> >>>> I guess that there is a problem with the layout I use. >>>> Here the code that I use >>>> >>>> %For generating the layout (also in the single subjects): >>>> >>>> cfg = []; >>>> >>>> cfg.channel = obs_data.label; >>>> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>>> >>>> cfg.feedback = 'yes'; >>>> >>>> lay = ft_prepare_layout(cfg); >>>> >>>> >>>> cfg_neighb = []; >>>> >>>> cfg_neighb.feedback = 'yes'; >>>> >>>> cfg_neighb.method = 'triangulation'; >>>> >>>> cfg_neighb.layout = lay; >>>> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>>> >>>> >>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>>> >>>> >>>> %For computing the grand average >>>> >>>> cfg = []; >>>> >>>> cfg.channel = 'all'; >>>> >>>> cfg.latency = 'all'; >>>> >>>> cfg.parameter = 'avg'; >>>> >>>> cfg.keepindividual = 'no' >>>> >>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>>> >>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>>> >>>> % "{:}" means to use data from all elements of the variable >>>> >>>> >>>> For plotting the significant clusters >>>> >>>> cfg = []; >>>> >>>> cfg.style = 'blank'; >>>> >>>> cfg.layout = lay; >>>> >>>> cfg.channellabels = 'yes'; >>>> >>>> cfg.highlight = 'labels'; >>>> >>>> cfg.highlightchannel = find(stat.mask); >>>> >>>> cfg.comment = 'no'; >>>> >>>> figure; ft_topoplotER(cfg, GA_90) >>>> >>>> title('Nonparametric: significant with cluster multiple comparison >>>> correction') >>>> >>>> >>>> Do you have ANY idea to this? I am really completely helpless.... >>>> >>>> thanks and best >>>> >>>> Katrin >>>> >>>> _______________________________________________ >>>> 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 >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -------------------------------------------------------------------------------- > > Joseph Dien, PhD > Research Associate > Cognitive Neurology > The Johns Hopkins University School of Medicine > > Lab E-mail: jdien1 at jhmi.edu > Private E-mail: jdien07 at mac.com > Office Phone: 410-614-3115 > Cell Phone: 202-297-8117 > Fax: 410-955-0188 > http://joedien.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 jdien07 at mac.com Tue Sep 9 03:55:44 2014 From: jdien07 at mac.com (Joseph Dien) Date: Mon, 08 Sep 2014 21:55:44 -0400 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: <85691A9F-3696-4881-B2C6-147935FBFB9A@mac.com> Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03@mac.com> yes, please do send me the data. Thanks! Joe On Sep 8, 2014, at 3:38 PM, KatrinH Heimann wrote: > Dear Joseph, thanks so much, I really appreciate your help. I was also wandering, if maybe there is another bug in my code. > Our nets are 128 channels, Hydrocel, but as a colleague of me adviced me to do so, I also tried the 129 layout. > My code you find below (without selection of bad channels etc.) > If you need also the data of two subjects to have a look, let me know!!! > Best and thanks really! > Katrin > > > > subject=input('Which subject do you want to analyse? ','s'); > > name = strcat(subject,'.raw'); > > subjectnumber=input('Which is the subjectnumber?', 's'); > > sb=subjectnumber > > %subjectnumber = strcat(subjectnumber, '.txt') > > %% > > > > cfg = []; > > cfg.dataset = name; > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus trigger > > cfg.trialdef.prestim = 0.234; % in seconds > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video observation, but maybe we need less) > > cfg = ft_definetrial(cfg); > > > > cfg.trl([1:7],:) = []; > > > > %change timeline according to constant offset of 16 ms = 8 samples (because recorded with 500 hz)in > > %structure trial > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > > %change timeline to make the cut the zeropoint > > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > > > %% preprocess data > > cfg.channel = 'all'; > > cfg.preproc.detrend = 'yes'; > > cfg.preproc.demean = 'yes'; > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already filtered > > %(0.1-45) and bad channels have to be replaced!!!! > > %cfg.preproc.bpfreq = [6 32]; > > % > > % > > obs_data = ft_preprocessing(cfg); > > % > > save (strcat(sb,'obs_data') , 'obs_data') > > > > %% determining channel neighbours (necessary for Artifact detection) > > cfg = []; > > cfg.channel = obs_data.label; > > cfg.layout = 'GSN128.sfp'; > > cfg.feedback = 'yes'; > > lay = ft_prepare_layout(cfg); > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = 'GSN128.sfp'; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > > > %% Preparing neighbours for channel repair - but bad channel info in!!! > > > > % cfg_neighb = []; > > % cfg_neighb.feedback = 'yes'; > > % cfg_neighb.method = 'triangulation'; > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > % Interpolate and put into new data structure > > cfg = []; > > cfg.badchannel = {}; > > cfg.layout = 'GSN128.sfp'; > > cfg.method = 'nearest'; > > cfg.neighbours = neighbours; > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > > % Check reconstruction > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > % dat1=obs_data; > > % dat2=obs_data_channelrepaired; > > % > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > % y=dat2.trial{1}(62,:); > > % plot(x);hold on;plot(y,'r'); > > % > > % x=dat1.trial{1}(72,:); > > % y=dat2.trial{1}(75,:); > > % figure; > > % plot(x);hold on;plot(y,'r') > > % > > % x=dat1.trial{1}(75,:); > > % y=dat2.trial{1}(75,:); > > % figure; > > % plot(x);hold on;plot(y,'r') > > %% artifact rejection/trial inspection - throw out electrode jumps etc. > > > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent according to channels interpolated %% 128-number of interp. channels) > > > cfg = []; > > cfg.channel = {'all'}; > > cfg.numcomponent = 128 > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > save (strcat(sb,'comp_all') , 'comp') > > > > %% > > cfg = []; > > cfg.viewmode = 'component'; > > cfg.continuous = 'no'; > > cfg.plotlabels='some'; > > cfg.layout = 'GSN128.sfp'; > > ft_databrowser(cfg,comp); > > > > %% poweranalysis components > > cfg = []; > > cfg.output = 'pow'; > > cfg.channel = 'all';%compute the power spectrum in all ICs > > cfg.method = 'mtmfft'; > > cfg.taper = 'hanning'; > > cfg.foi = 0:0.2:50; > > obs_freq = ft_freqanalysis(cfg, comp); > > > > %And you can plot the spectra: > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > nsubplots = 16; > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain decimals, type doc subplot > > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > tot = Nfigs*nsubplots; > > > > rptvect = 1:size(comp.topo,1); > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > > for r=1:size(rptvect,1); > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 1]);%full screen > > k=0; > > for j=1:size(rptvect,2); > > if~(rptvect(r,j)==0); > > k=k+1; > > cfg=[]; > > cfg.channel = rptvect(r,j); > > cfg.ylim =[0 500] > > cfg.xlim =[0 50] > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > end > > end > > end > > > > %For the IC topos you'll follow the same logic as above but with: > > > > figure > > cfg = []; > > cfg.component = [1:20]; % specify the component(s) that should be plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > figure > > cfg = []; > > cfg.component = [21:40]; % specify the component(s) that should be plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > figure > > cfg = []; > > cfg.component = [41:60]; % specify the component(s) that should be plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > figure > > cfg = []; > > cfg.component = [61:80]; % specify the component(s) that should be plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > > > > > > > > > %% Seperate observation conditions > > > > name1= strcat(num2str(sb),'_90.xls'); > > list1=xlsread (name1) > > > > name2= strcat(num2str(sb),'_180.xls'); > > list2=xlsread (name2) > > > % > > > > cfg = [] > > cfg.trials = [list1] > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > cfg = [] > > cfg.trials = [list2] > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > %%PIPELINE FOR obs90 > > > > %% Decompose original data according to the components found before > > load (strcat(sb,'comp_all')) > > > > cfg = []; > > cfg.numcomponent = 128; > > cfg.unmixing = comp.unmixing; > > cfg.topolabel = comp.topolabel; > > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > > > %% Reject component > > cfg = []; > > cfg.component = []; > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > > > > %% Artifacts - final detection > > > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > %cfg.artfctdef.reject = 'complete'; > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > > > % Save clean data > > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > > > %% Rereferencing data > > cfg = []; > > > > cfg.channel = 'all'; > > cfg.preproc.reref = 'yes'; > > cfg.preproc.refchannel = 'all'; > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > %% Snap out smaller pieces (the third second) > > > > cfg = [] > > cfg.toilim = [0 1] > > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > > %% TIMELOCK ERP > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > > %% plot it > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > > > > > > > %% PIPELINE FOR obs180 > > > > > > %% Decompose original data according to the components found before > > load (strcat(sb,'comp_all')) > > > > cfg = []; > > cfg.numcomponent = 128 > > cfg.unmixing = comp.unmixing; > > cfg.topolabel = comp.topolabel; > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > > > %% Reject component > > cfg = []; > > cfg.component = []; > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, obs180_data); > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > > > > %% Artifacts final 180 > > > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > %cfg.artfctdef.reject = 'complete'; > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > > > % Save clean data > > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > > > %% Rereferencing data > > cfg = []; > > cfg.channel = 'all'; > > cfg.preproc.reref = 'yes'; > > cfg.preproc.refchannel = 'all'; > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > %% Snap out smaller pieces (the third second) > > > > cfg = [] > > cfg.toilim = [0 1] > > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > > %% TIMELOCK ERP > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > > %% plot 180 ERP > > > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, obs180_data_ERP) > > > > %% plot both ERPs > > > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > cfg.showlabels = 'yes'; > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > > %% plot difference wave > > > > difference = obs180_data_ERP; % copy one of the structures > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute the difference ERP > > > cfg = []; > > cfg.layout = lay; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, difference) > > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > Hi, > I’m one of the main Fieldtrip contributors working on supporting EGI data. A couple things. First of all, exactly which net do you use? If they are 129-channel, there is still the question of whether they are the Hydrocel or the older geodesic nets. Regardless, that shouldn't cause an error like this. Could you send me the file you are trying to process and the script you are using and I’ll try troubleshooting it. > > Joe > > > On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini wrote: > >> Which nets do you use? I use EGI. I tried both the ones you mention and they didn't work. It was hard to find that exact one online but it was the only file that actually worked. >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann wrote: >> Dear Ana, dear all, >> the layout you used does not correspond to our nets. I tried the >> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. Please can anybody help? >> Cheers >> Katrin >> >> >> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : >> >> Try this one I use >> >> >> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann wrote: >> Dear all, my problems seem neverending. This time however i really need help. >> I implemented a pipeline for ERPs. All works now, trialdefinition, preprocessing, channelreplacement, ica, componentrejection, final artifactdetection, timelock of the single subject data. However, when I wanna compute the grandaverage of the single subjects I get the following error message: >> >> computing average of avg over 19 subjects >> Warning: discarding electrode information because it cannot be averaged >> > In ft_timelockgrandaverage at 249 >> the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 3 MB >> computing average of avg over 2 subjects >> Warning: discarding electrode information because it cannot be averaged >> > In ft_timelockgrandaverage at 249 >> the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 0 MB >> the call to "ft_prepare_layout" took 0 seconds and required the additional allocation of an estimated 0 MB >> the call to "ft_topoplotER" took 0 seconds and required the additional allocation of an estimated 0 MB >> >> Furthermore in the plot of the significant clusters, the channelnames are mixed up (do not correspond to my net) >> >> >> I guess that there is a problem with the layout I use. >> Here the code that I use >> >> %For generating the layout (also in the single subjects): >> cfg = []; >> >> cfg.channel = obs_data.label; >> >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >> cfg.feedback = 'yes'; >> >> lay = ft_prepare_layout(cfg); >> >> >> cfg_neighb = []; >> >> cfg_neighb.feedback = 'yes'; >> >> cfg_neighb.method = 'triangulation'; >> >> cfg_neighb.layout = lay; >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >> >> >> %For computing the grand average >> >> cfg = []; >> >> cfg.channel = 'all'; >> >> cfg.latency = 'all'; >> >> cfg.parameter = 'avg'; >> >> cfg.keepindividual = 'no' >> >> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >> % "{:}" means to use data from all elements of the variable >> >> >> For plotting the significant clusters >> >> cfg = []; >> >> cfg.style = 'blank'; >> >> cfg.layout = lay; >> >> cfg.channellabels = 'yes'; >> >> cfg.highlight = 'labels'; >> >> cfg.highlightchannel = find(stat.mask); >> >> cfg.comment = 'no'; >> >> figure; ft_topoplotER(cfg, GA_90) >> >> title('Nonparametric: significant with cluster multiple comparison correction') >> >> >> >> Do you have ANY idea to this? I am really completely helpless.... >> >> thanks and best >> >> Katrin >> >> >> _______________________________________________ >> 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 >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------------------------------------------------------------------------- > > Joseph Dien, PhD > Research Associate > Cognitive Neurology > The Johns Hopkins University School of Medicine > > Lab E-mail: jdien1 at jhmi.edu > Private E-mail: jdien07 at mac.com > Office Phone: 410-614-3115 > Cell Phone: 202-297-8117 > Fax: 410-955-0188 > http://joedien.com > > > _______________________________________________ > 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 -------------------------------------------------------------------------------- Joseph Dien, PhD Research Associate Cognitive Neurology The Johns Hopkins University School of Medicine Lab E-mail: jdien1 at jhmi.edu Private E-mail: jdien07 at mac.com Office Phone: 410-614-3115 Cell Phone: 202-297-8117 Fax: 410-955-0188 http://joedien.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Tue Sep 9 08:37:13 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Tue, 9 Sep 2014 06:37:13 +0000 Subject: [FieldTrip] ft_rejectvisual: removing trials marked as bad In-Reply-To: References: Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6@live.ucl.ac.uk> Hi Ashley, Maybe the mistake is you did not integrate in your script the command to save the rejection. Normally, with the following command, you will see in the Matlab Window that artifacts are correctly rejected after the "quit" button. clean_data = ft_rejectvisual(cfg, interpoldata); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; cleandata = ft_rejectartifact(cfg,clean_data); Emilie Le 3 sept. 2014 à 11:58, Ashley Greene > a écrit : Hello, I have used the rejectvisual function in attempt to remove bad trials, but after marking them and pressing the quit button, although the command window states that the selected trials have been removed, there is no obvious change in the data; all of the trials are still intact. Have I overlooked something? Thanks, Ashley _______________________________________________ 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 Patricia.Wollstadt at gmx.de Tue Sep 9 14:16:20 2014 From: Patricia.Wollstadt at gmx.de (Patricia Wollstadt) Date: Tue, 09 Sep 2014 14:16:20 +0200 Subject: [FieldTrip] TRENTOOL pipeline help In-Reply-To: References: Message-ID: <540EEF94.9080601@gmx.de> Hello Max, I added a few comments to the questions regarding individual parameters below. To address the general problem of TRENTOOL telling you, that there are not enough sample points in your data: From what I can see in your script, you probably don't have enough data points in each time series to robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, which gives you 240 samples per time series. Can you maybe avoid downsampling to 300 Hz and downsample to 600 Hz instead? Or could you analyze a longer time window of interest? Note that you also 'lose' data to embedding and the interaction delay: The first point that can be used for TE estimation is at max. embedding length + max. interaction delay in samples. For example: max. embedding length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max interaction delay of 30 ms = 9 samples. In this example, you would be left with 240 - 29 samples for TE estimation per trial. There is also the possibility to estimate time resolved TE/TE for shorter time windows of interest (see section 4.4 in the manual); however, this method requires the use of a GPU for TE estimation. I would further recommend to use the new pipeline for group statistics described in the manual in section 4.5 (the function 'TEgroup_calculate' is deprecated). The new pipeline allows you to reconstruct the interaction delay and uses the following functions (see also comments in the script): TEgroup_prepare -> prepares all data sets (all subjects/all conditions) for group analysis (this means finding common embedding parameters such that estimates are not biased between groups) InteractionDelayReconstruction_calculate -> estimates TE for individual data sets and all assumed interaction delays u InteractionDelayReconstruction_analyze -> reconstructs the interaction delay by selecting the u that maximizes TE for each channel TEgroup_stats -> calculate group statistics using a permutation test I can send you an example script for group TE analysis using this pipeline to get you started. I hope this helps you to get the group analysis running. Just write again if you're having trouble setting up the pipeline or something is not clear about the parameters/my comments. Best, Patricia On 09/04/2014 08:30 PM, Max Cantor wrote: > Hi fieldtrippers, > > I know trentool is not produced by the Donders Institute, so I'm not > 100% sure if it is appropriate to ask questions about it here, but to > the best of my knowledge they do not have a mailing list and I saw a > few trentool questions in the archives, so I'm going to assume it's ok... > > In any case, below is my current pipeline (slightly modified for > comprehensibility): > > (notes in bold are comments/questions made in this email, not present > in the pipeline. Sorry in advance for the long post! Any help would be > greatly appreciated as I'm a bit over my head on this but I think I'm > close!) > > ***** > > % Prepare group TE data > > cfgP = []; > cfgP.Path2TSTOOL = *TSTOOLPATH* > cfgP.TEcalctype = 'VW_ds'; > cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > > *I'm trying to find the transfer entropy between the left and right > auditory cortices in my experiment. The input is virtual sensor data > that was produced using SAM in fieldtrip on real MEG data. * > > % specify u to be scanned > > cfgP.predicttime_u = 30; > cfgP.toi = [-0.4 0.4]; > > *For clarification, the predicttime_u is in seconds but the toi is in > milliseconds. If I understand correctly, the predicttime_u must fit > within the toi, but beyond that are there any benefits to it being > earlier or later?* PW: The predictiontime_u is in milliseconds and the > toi is in seconds. The prediction time is the assumed interaction > delay between your two sources and should fit within your toi. In > general it is preferable to use the method for interaction delay > reconstruction for TE estimation, because it allows you to reconstruct > the actual delay between your source and target times series. A > non-optimal u/interaction delay may cause an underestimation of TE, so > it is recommended to use the pipeline for interaction delay > reconstruction whenever estimating TE for unknown delays. > If you use the methods for interaction delay reconstruction > 'predicttime_u' is replaced by > cfgTEP.predicttimemin_u % minimum u to be scanned > cfgTEP.predicttimemax_u % maximum u to be scanned > cfgTEP.predicttimestepsize % time steps between u to be scanned > A large range for u values to be scanned increases computing time a > lot, so it is best to limit the u range to values that are > physiologically plausible. > > % ACT (Autocorrelation Time) estimation and constraints > > cfgP.maxlag = 150; > cfgP.actthrvalue = 7.5; > cfgP.minnrtrials = 5; > > *My understanding is maxlag should be 1/2 the sampling rate, so since > the data are downsampled to 300hz, it should be 150. I know that the > sample rate and filters are used to determine the actthrvalue, but I > don't actually know the calculation. 7.5 was a rough guess just to > test the pipeline. I'm also uncertain of what minnrtrials should be.* > PW: You can set the actthrvalue based on the filtering you did prior > to TE analysis. If you for example highpass filtered at 10 Hz, you > shouldn't find an ACT higher than 30 samples, because you filtered out > any components of the signal slower than 10 Hz/30 samples (given your > sampling frequency of 300 Hz). So in this scenario the actthrvalue > would be 30. > A good value for cfgP.minnrtrials is 12 (a minimum number of trials is > needed to realize the permutation test for estimated TE values). > > % Optimization > > cfgP.optimizemethod = 'ragwitz'; > cfgP.ragdim = 4:8; > cfgP.ragtaurange = [0.2 0.4]; > cfgP.ragtausteps = 15; > cfgP.repPred = 100; > * > * > *I am completely at a loss for this. I've done some reading into > transfer entropy, mutual information, etc., cited in trentool, but I'm > yet to understand how exactly this optimization works and what the > configuration should be, given my data and experimental intentions.* > PW: The Ragwitz criterion tries to find optimal embedding parameters > dim and tau for the data. To do that, the method iteratively takes all > possible combinations of dim and tau values that are provided in > cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well these > combinations embed the data. To test an embedding, the method builds > the embedding vectors from the data; it then tests for each point how > well the next point in time can be predicted from the reference > point's nearest neighbours. So for each embedded point, the method > searches for the nearest neighbours and calculates the average of > those nearest neighbours. The difference between the > averaged/predicted point and the actual next point is the error of the > local predictor. The Ragwitz criterion will then return the parameter > combination for which this error over all points is minimal. > The parameters set the following: 'ragdim' are dimensions to be tested > by the method (I would reccomend to start with 2:10), 'ragtaurange' > together with 'ragtausteps' specifies the tau values to be tested > (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, that > the values here are factors that are later multiplied with the ACT to > obtain the actual tau. 'repPred' is the number of points that will be > used for the local prediction, i.e. the Ragwitz criterion will test > the local prediction and calculate the error for the first 100 points > in your time series. The two parameters 'flagNei' ans 'sizeNei' below > specify the type of neighbour search conducted by the Ragwitz > criterion: 'flagNei' tells the method to either conduct a kNN or range > search; 'sizeNei' specifies the number of neighbours or the radius to > be searched by a range search. > > > % Kernel-based TE estimation > > cfgP.flagNei = 'Mass'; > cfgP.sizeNei = 4; % Default > > cfgP.ensemblemethod = 'no'; > cfgP.outputpath = *OUTPUT PATH*; > > if ~exist(*Path for TEprepare data object*) > load VSdat; > TE_Wrd = {}; > for i = 1:nConds > for j = 1:Nsub > TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > end > end > clear VSdat; > save('TE_Wrd', 'TE_Wrd'); > end > * > * > *The configuration and virtual sensor data, organized in a 3 x 15 cell > of structures (condition by subject) are the input. The TEprepare > substructure is added to each individual condition x subject .mat > files' data structure which are stored on disk independently.* > > % Use object_to_mat_conversion.m to replace individual condition x > subject virtual sensor data > % .mat files with their TE_Wrd equivalent > * > * > *I'm using a separate script to make some manipulations to the objects > from disk; this will all eventually be integrated into the main > pipeline*.*TRENTOOL seems to handle data output very differently from > fieldtrip and I've had trouble thinking through the most logical way > to handle the data so it's a bit haphazard right now.* > > load cond080sub01.mat > > cfgG = []; > cfgG.dim = cond080sub01.TEprepare.optdim; > cfgG.tau = cond080sub01.TEprepare.opttau; > > if isfield(cond080sub01, 'TEprepare') > TEgroup_prepare(cfgG, fileCell); > else > error('Need to run TEprepare before TEgroup_prepare'); > end > * > * > *For clarification, fileCell is a cell with the name of each condition > x subject .mat file, which as I said before is collectively the same > as the 3 x 15 VSdat structure (condition x subject).* > > % Replace .mat files with '_for_TEgroup_calculate' version in > % object_to_mat_conversion.m > > % TE Group Calculate > > load cond080sub01.mat > if isfield(cond080sub01, 'TEgroupprepare') > for i = 1:length(fileCell) > TEgroup_calculate(fileCell{i}); > end > else > error('Need to run TEgroup_prepare before TEgroup_calculate'); > end > * > * > *At this step I get the following error: > > Error using transferentropy (line 337) > \nTRENTOOL ERROR: not enough data points left after embedding > > Error in TEgroup_calculate (line 133) > [TEresult] = transferentropy(cfg,data);* > > % TE Group Stats > > cfgGSTAT = []; > cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > > cfgGSTAT.uvar = 1; > cfgGSTAT.ivar = 2; > cfgGSTAT.fileidout = 'test_groupstats'; > > TEgroup_stats(cfgGSTAT, fileCell); > > *Given the error above, I am yet to get to this step, but it does not > seem fundamentally different from normal fieldtrip stats.* > > ***** > > In case my notes were not clear or you skipped to the bottom, *my > primary concern is whether the error I'm getting in TEgroup_calculate > is a pipeline issue* (I noticed the example pipeline in trentool, the > manual, and published methods articles all seem to have slightly or > significantly different pipeline compositions), *or if the error is* > due to ACT, ragwitz optimization, or some other faulty > parameterization *on my part due to a lack of understanding of how > transfer entropy works on a more theoretical/mathematical level*. If > the latter is the case, is there any relatively straightforward way to > conceptualize this, or is this something where I'm just going to have > to keep reading and rereading until it eventually makes sense? I've > already done quite a bit of that and it hasn't pierced my thick skull > yet but I'm sure it will eventually! > > Thank you so much, > > Max Cantor > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > > _______________________________________________ > 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 Holger.Krause at med.uni-duesseldorf.de Tue Sep 9 15:21:20 2014 From: Holger.Krause at med.uni-duesseldorf.de (Holger Krause) Date: Tue, 9 Sep 2014 15:21:20 +0200 Subject: [FieldTrip] Latest FT version on ftp-server is from three days ago Message-ID: <201409091521.22589.Holger.Krause@med.uni-duesseldorf.de> Dear developers, Could you please check the process for creation/publication of zip-files on the FTP server? The latest file I can find there is fieldtrip-20140906.zip. Thanks in advance, Holger From mcantor at umich.edu Tue Sep 9 15:19:55 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 9 Sep 2014 09:19:55 -0400 Subject: [FieldTrip] TRENTOOL pipeline help In-Reply-To: <540EEF94.9080601@gmx.de> References: <540EEF94.9080601@gmx.de> Message-ID: This is immensely helpful, thank you. I was very confused about why some versions of the pipeline I saw were using group calculate and others were using interaction delay reconstruction and what that meant, and I think I have a more clear idea of what the different steps of the pipeline are doing. There are still a few things I'm a bit confused about though in terms of the pipeline. For instance, whether or not I need to do TEprepare before group prepare, and if I need to do graph analysis (which I'm not sure I fully understand but also haven't looked deeply into) before group stats. If you don't mind me taking you up on your offer, I think seeing your example script might help clarify some of these issues. Thank you! On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < Patricia.Wollstadt at gmx.de> wrote: > Hello Max, > > I added a few comments to the questions regarding individual parameters > below. To address the general problem of TRENTOOL telling you, that there > are not enough sample points in your data: From what I can see in your > script, you probably don't have enough data points in each time series to > robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, which > gives you 240 samples per time series. Can you maybe avoid downsampling to > 300 Hz and downsample to 600 Hz instead? Or could you analyze a longer time > window of interest? > Note that you also 'lose' data to embedding and the interaction delay: The > first point that can be used for TE estimation is at max. embedding length > + max. interaction delay in samples. For example: max. embedding length = > dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max interaction > delay of 30 ms = 9 samples. In this example, you would be left with 240 - > 29 samples for TE estimation per trial. There is also the possibility to > estimate time resolved TE/TE for shorter time windows of interest (see > section 4.4 in the manual); however, this method requires the use of a GPU > for TE estimation. > > I would further recommend to use the new pipeline for group statistics > described in the manual in section 4.5 (the function 'TEgroup_calculate' is > deprecated). The new pipeline allows you to reconstruct the interaction > delay and uses the following functions (see also comments in the script): > > TEgroup_prepare -> prepares all data sets (all subjects/all conditions) > for group analysis (this means finding common embedding parameters such > that estimates are not biased between groups) > InteractionDelayReconstruction_calculate -> estimates TE for > individual data sets and all assumed interaction delays u > InteractionDelayReconstruction_analyze -> reconstructs the > interaction delay by selecting the u that maximizes TE for each channel > TEgroup_stats -> calculate group statistics using a permutation test > > I can send you an example script for group TE analysis using this pipeline > to get you started. I hope this helps you to get the group analysis > running. Just write again if you're having trouble setting up the pipeline > or something is not clear about the parameters/my comments. > > Best, > Patricia > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: > > Hi fieldtrippers, > > I know trentool is not produced by the Donders Institute, so I'm not 100% > sure if it is appropriate to ask questions about it here, but to the best > of my knowledge they do not have a mailing list and I saw a few trentool > questions in the archives, so I'm going to assume it's ok... > > In any case, below is my current pipeline (slightly modified for > comprehensibility): > > (notes in bold are comments/questions made in this email, not present in > the pipeline. Sorry in advance for the long post! Any help would be greatly > appreciated as I'm a bit over my head on this but I think I'm close!) > > ***** > > % Prepare group TE data > > cfgP = []; > cfgP.Path2TSTOOL = *TSTOOLPATH* > cfgP.TEcalctype = 'VW_ds'; > cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > > *I'm trying to find the transfer entropy between the left and right > auditory cortices in my experiment. The input is virtual sensor data that > was produced using SAM in fieldtrip on real MEG data. * > > % specify u to be scanned > > cfgP.predicttime_u = 30; > cfgP.toi = [-0.4 0.4]; > > *For clarification, the predicttime_u is in seconds but the toi is in > milliseconds. If I understand correctly, the predicttime_u must fit within > the toi, but beyond that are there any benefits to it being earlier or > later?* PW: The predictiontime_u is in milliseconds and the toi is in > seconds. The prediction time is the assumed interaction delay between your > two sources and should fit within your toi. In general it is preferable to > use the method for interaction delay reconstruction for TE estimation, > because it allows you to reconstruct the actual delay between your source > and target times series. A non-optimal u/interaction delay may cause an > underestimation of TE, so it is recommended to use the pipeline for > interaction delay reconstruction whenever estimating TE for unknown delays. > If you use the methods for interaction delay reconstruction > 'predicttime_u' is replaced by > cfgTEP.predicttimemin_u % minimum u to be scanned > cfgTEP.predicttimemax_u % maximum u to be scanned > cfgTEP.predicttimestepsize % time steps between u to be scanned > A large range for u values to be scanned increases computing time a lot, > so it is best to limit the u range to values that are physiologically > plausible. > > > % ACT (Autocorrelation Time) estimation and constraints > > cfgP.maxlag = 150; > cfgP.actthrvalue = 7.5; > cfgP.minnrtrials = 5; > > *My understanding is maxlag should be 1/2 the sampling rate, so since > the data are downsampled to 300hz, it should be 150. I know that the sample > rate and filters are used to determine the actthrvalue, but I don't > actually know the calculation. 7.5 was a rough guess just to test the > pipeline. I'm also uncertain of what minnrtrials should be.* PW: You can > set the actthrvalue based on the filtering you did prior to TE analysis. If > you for example highpass filtered at 10 Hz, you shouldn't find an ACT > higher than 30 samples, because you filtered out any components of the > signal slower than 10 Hz/30 samples (given your sampling frequency of 300 > Hz). So in this scenario the actthrvalue would be 30. > A good value for cfgP.minnrtrials is 12 (a minimum number of trials is > needed to realize the permutation test for estimated TE values). > > > % Optimization > > cfgP.optimizemethod = 'ragwitz'; > cfgP.ragdim = 4:8; > cfgP.ragtaurange = [0.2 0.4]; > cfgP.ragtausteps = 15; > cfgP.repPred = 100; > > *I am completely at a loss for this. I've done some reading into > transfer entropy, mutual information, etc., cited in trentool, but I'm yet > to understand how exactly this optimization works and what the > configuration should be, given my data and experimental intentions.* PW: > The Ragwitz criterion tries to find optimal embedding parameters dim and > tau for the data. To do that, the method iteratively takes all possible > combinations of dim and tau values that are provided in cfgP.ragdim and > cfgP.ragtaurange/.ragtausteps and tests how well these combinations embed > the data. To test an embedding, the method builds the embedding vectors > from the data; it then tests for each point how well the next point in time > can be predicted from the reference point's nearest neighbours. So for each > embedded point, the method searches for the nearest neighbours and > calculates the average of those nearest neighbours. The difference between > the averaged/predicted point and the actual next point is the error of the > local predictor. The Ragwitz criterion will then return the parameter > combination for which this error over all points is minimal. > The parameters set the following: 'ragdim' are dimensions to be tested by > the method (I would reccomend to start with 2:10), 'ragtaurange' together > with 'ragtausteps' specifies the tau values to be tested (TRENTOOL will > build a vector from 0.2 to 0.4 in 15 steps). Note, that the values here are > factors that are later multiplied with the ACT to obtain the actual tau. > 'repPred' is the number of points that will be used for the local > prediction, i.e. the Ragwitz criterion will test the local prediction and > calculate the error for the first 100 points in your time series. The two > parameters 'flagNei' ans 'sizeNei' below specify the type of neighbour > search conducted by the Ragwitz criterion: 'flagNei' tells the method to > either conduct a kNN or range search; 'sizeNei' specifies the number of > neighbours or the radius to be searched by a range search. > > > % Kernel-based TE estimation > > cfgP.flagNei = 'Mass'; > cfgP.sizeNei = 4; % Default > > cfgP.ensemblemethod = 'no'; > cfgP.outputpath = *OUTPUT PATH*; > > if ~exist(*Path for TEprepare data object*) > load VSdat; > TE_Wrd = {}; > for i = 1:nConds > for j = 1:Nsub > TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > end > end > clear VSdat; > save('TE_Wrd', 'TE_Wrd'); > end > > *The configuration and virtual sensor data, organized in a 3 x 15 cell > of structures (condition by subject) are the input. The TEprepare > substructure is added to each individual condition x subject .mat files' > data structure which are stored on disk independently.* > > % Use object_to_mat_conversion.m to replace individual condition x subject > virtual sensor data > % .mat files with their TE_Wrd equivalent > > *I'm using a separate script to make some manipulations to the objects > from disk; this will all eventually be integrated into the main pipeline*.* > TRENTOOL seems to handle data output very differently from fieldtrip and > I've had trouble thinking through the most logical way to handle the data > so it's a bit haphazard right now.* > > load cond080sub01.mat > > cfgG = []; > cfgG.dim = cond080sub01.TEprepare.optdim; > cfgG.tau = cond080sub01.TEprepare.opttau; > > if isfield(cond080sub01, 'TEprepare') > TEgroup_prepare(cfgG, fileCell); > else > error('Need to run TEprepare before TEgroup_prepare'); > end > > *For clarification, fileCell is a cell with the name of each condition x > subject .mat file, which as I said before is collectively the same as the 3 > x 15 VSdat structure (condition x subject).* > > % Replace .mat files with '_for_TEgroup_calculate' version in > % object_to_mat_conversion.m > > % TE Group Calculate > > load cond080sub01.mat > if isfield(cond080sub01, 'TEgroupprepare') > for i = 1:length(fileCell) > TEgroup_calculate(fileCell{i}); > end > else > error('Need to run TEgroup_prepare before TEgroup_calculate'); > end > > > > > > > > *At this step I get the following error: Error using transferentropy (line > 337) \nTRENTOOL ERROR: not enough data points left after embedding Error in > TEgroup_calculate (line 133) [TEresult] = transferentropy(cfg,data);* > > % TE Group Stats > > cfgGSTAT = []; > cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > > cfgGSTAT.uvar = 1; > cfgGSTAT.ivar = 2; > cfgGSTAT.fileidout = 'test_groupstats'; > > TEgroup_stats(cfgGSTAT, fileCell); > > *Given the error above, I am yet to get to this step, but it does not > seem fundamentally different from normal fieldtrip stats.* > > ***** > > In case my notes were not clear or you skipped to the bottom, *my > primary concern is whether the error I'm getting in TEgroup_calculate is a > pipeline issue* (I noticed the example pipeline in trentool, the manual, > and published methods articles all seem to have slightly or significantly > different pipeline compositions), *or if the error is* due to ACT, > ragwitz optimization, or some other faulty parameterization *on my part > due to a lack of understanding of how transfer entropy works on a more > theoretical/mathematical level*. If the latter is the case, is there any > relatively straightforward way to conceptualize this, or is this something > where I'm just going to have to keep reading and rereading until it > eventually makes sense? I've already done quite a bit of that and it hasn't > pierced my thick skull yet but I'm sure it will eventually! > > Thank you so much, > > Max Cantor > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patricia.Wollstadt at gmx.de Tue Sep 9 15:51:33 2014 From: Patricia.Wollstadt at gmx.de (Patricia Wollstadt) Date: Tue, 09 Sep 2014 15:51:33 +0200 Subject: [FieldTrip] TRENTOOL pipeline help In-Reply-To: References: <540EEF94.9080601@gmx.de> Message-ID: <540F05E5.1000109@gmx.de> I'm glad that cleared things up a little. Sorry about the confusion, we will try to include warnings for deprecated function in the next release of TRENTOOL. You don't need to run TEprepare before running TEgroup_prepare. You just run the four functions - TEgroup_prepare - InteractionDelayReconstruction_calculate - InteractionDelayReconstruction_analyze - TEgroup_stats in that order. The graph analysis is an optional step that can be run on the individual outputs of InteractionDelayReconstruction_analyze. The function will partially correct the output for multivariate effects. Since you are looking at one connection only, you don't need to include the graph analysis step into your pipeline. (I also sent you an example script directly, because I think it is not a good idea to send attachments via the mailing list.) Best, Patricia On 09/09/2014 03:19 PM, Max Cantor wrote: > This is immensely helpful, thank you. I was very confused about why > some versions of the pipeline I saw were using group calculate and > others were using interaction delay reconstruction and what that > meant, and I think I have a more clear idea of what the different > steps of the pipeline are doing. There are still a few things I'm a > bit confused about though in terms of the pipeline. For instance, > whether or not I need to do TEprepare before group prepare, and if I > need to do graph analysis (which I'm not sure I fully understand but > also haven't looked deeply into) before group stats. > > If you don't mind me taking you up on your offer, I think seeing your > example script might help clarify some of these issues. > > Thank you! > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt > > wrote: > > Hello Max, > > I added a few comments to the questions regarding individual > parameters below. To address the general problem of TRENTOOL > telling you, that there are not enough sample points in your data: > From what I can see in your script, you probably don't have enough > data points in each time series to robustly estimate TE. You > analyze 800 ms of data sampled at 300 Hz, which gives you 240 > samples per time series. Can you maybe avoid downsampling to 300 > Hz and downsample to 600 Hz instead? Or could you analyze a longer > time window of interest? > Note that you also 'lose' data to embedding and the interaction > delay: The first point that can be used for TE estimation is at > max. embedding length + max. interaction delay in samples. For > example: max. embedding length = dim * tau_factor * ACT = 10 * 0.4 > * 5 = 20 samples plus the max interaction delay of 30 ms = 9 > samples. In this example, you would be left with 240 - 29 samples > for TE estimation per trial. There is also the possibility to > estimate time resolved TE/TE for shorter time windows of interest > (see section 4.4 in the manual); however, this method requires the > use of a GPU for TE estimation. > > I would further recommend to use the new pipeline for group > statistics described in the manual in section 4.5 (the function > 'TEgroup_calculate' is deprecated). The new pipeline allows you to > reconstruct the interaction delay and uses the following functions > (see also comments in the script): > > TEgroup_prepare -> prepares all data sets (all subjects/all > conditions) for group analysis (this means finding common > embedding parameters such that estimates are not biased between > groups) > InteractionDelayReconstruction_calculate -> estimates TE for > individual data sets and all assumed interaction delays u > InteractionDelayReconstruction_analyze -> reconstructs the > interaction delay by selecting the u that maximizes TE for each > channel > TEgroup_stats -> calculate group statistics using a > permutation test > > I can send you an example script for group TE analysis using this > pipeline to get you started. I hope this helps you to get the > group analysis running. Just write again if you're having trouble > setting up the pipeline or something is not clear about the > parameters/my comments. > > Best, > Patricia > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: >> Hi fieldtrippers, >> >> I know trentool is not produced by the Donders Institute, so I'm >> not 100% sure if it is appropriate to ask questions about it >> here, but to the best of my knowledge they do not have a mailing >> list and I saw a few trentool questions in the archives, so I'm >> going to assume it's ok... >> >> In any case, below is my current pipeline (slightly modified for >> comprehensibility): >> >> (notes in bold are comments/questions made in this email, not >> present in the pipeline. Sorry in advance for the long post! Any >> help would be greatly appreciated as I'm a bit over my head on >> this but I think I'm close!) >> >> ***** >> >> % Prepare group TE data >> >> cfgP = []; >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> cfgP.TEcalctype = 'VW_ds'; >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> *I'm trying to find the transfer entropy between the left and >> right auditory cortices in my experiment. The input is virtual >> sensor data that was produced using SAM in fieldtrip on real MEG >> data. * >> >> % specify u to be scanned >> >> cfgP.predicttime_u = 30; >> cfgP.toi = [-0.4 0.4]; >> >> *For clarification, the predicttime_u is in seconds but the toi >> is in milliseconds. If I understand correctly, the predicttime_u >> must fit within the toi, but beyond that are there any benefits >> to it being earlier or later?* PW: The predictiontime_u is in >> milliseconds and the toi is in seconds. The prediction time is >> the assumed interaction delay between your two sources and should >> fit within your toi. In general it is preferable to use the >> method for interaction delay reconstruction for TE estimation, >> because it allows you to reconstruct the actual delay between >> your source and target times series. A non-optimal u/interaction >> delay may cause an underestimation of TE, so it is recommended to >> use the pipeline for interaction delay reconstruction whenever >> estimating TE for unknown delays. >> If you use the methods for interaction delay reconstruction >> 'predicttime_u' is replaced by >> cfgTEP.predicttimemin_u % minimum u to be scanned >> cfgTEP.predicttimemax_u % maximum u to be scanned >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> A large range for u values to be scanned increases computing time >> a lot, so it is best to limit the u range to values that are >> physiologically plausible. >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> cfgP.maxlag = 150; >> cfgP.actthrvalue = 7.5; >> cfgP.minnrtrials = 5; >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> since the data are downsampled to 300hz, it should be 150. I know >> that the sample rate and filters are used to determine the >> actthrvalue, but I don't actually know the calculation. 7.5 was a >> rough guess just to test the pipeline. I'm also uncertain of what >> minnrtrials should be.* PW: You can set the actthrvalue based on >> the filtering you did prior to TE analysis. If you for example >> highpass filtered at 10 Hz, you shouldn't find an ACT higher than >> 30 samples, because you filtered out any components of the signal >> slower than 10 Hz/30 samples (given your sampling frequency of >> 300 Hz). So in this scenario the actthrvalue would be 30. >> A good value for cfgP.minnrtrials is 12 (a minimum number of >> trials is needed to realize the permutation test for estimated >> TE values). >> >> % Optimization >> >> cfgP.optimizemethod = 'ragwitz'; >> cfgP.ragdim = 4:8; >> cfgP.ragtaurange = [0.2 0.4]; >> cfgP.ragtausteps = 15; >> cfgP.repPred = 100; >> * >> * >> *I am completely at a loss for this. I've done some reading into >> transfer entropy, mutual information, etc., cited in trentool, >> but I'm yet to understand how exactly this optimization works and >> what the configuration should be, given my data and experimental >> intentions.* PW: The Ragwitz criterion tries to find optimal >> embedding parameters dim and tau for the data. To do that, the >> method iteratively takes all possible combinations of dim and tau >> values that are provided in cfgP.ragdim and >> cfgP.ragtaurange/.ragtausteps and tests how well these >> combinations embed the data. To test an embedding, the method >> builds the embedding vectors from the data; it then tests for >> each point how well the next point in time can be predicted from >> the reference point's nearest neighbours. So for each embedded >> point, the method searches for the nearest neighbours and >> calculates the average of those nearest neighbours. The >> difference between the averaged/predicted point and the actual >> next point is the error of the local predictor. The Ragwitz >> criterion will then return the parameter combination for which >> this error over all points is minimal. >> The parameters set the following: 'ragdim' are dimensions to be >> tested by the method (I would reccomend to start with 2:10), >> 'ragtaurange' together with 'ragtausteps' specifies the tau >> values to be tested (TRENTOOL will build a vector from 0.2 to 0.4 >> in 15 steps). Note, that the values here are factors that are >> later multiplied with the ACT to obtain the actual tau. 'repPred' >> is the number of points that will be used for the local >> prediction, i.e. the Ragwitz criterion will test the local >> prediction and calculate the error for the first 100 points in >> your time series. The two parameters 'flagNei' ans 'sizeNei' >> below specify the type of neighbour search conducted by the >> Ragwitz criterion: 'flagNei' tells the method to either conduct a >> kNN or range search; 'sizeNei' specifies the number of neighbours >> or the radius to be searched by a range search. >> >> >> % Kernel-based TE estimation >> >> cfgP.flagNei = 'Mass'; >> cfgP.sizeNei = 4; % Default >> >> cfgP.ensemblemethod = 'no'; >> cfgP.outputpath = *OUTPUT PATH*; >> >> if ~exist(*Path for TEprepare data object*) >> load VSdat; >> TE_Wrd = {}; >> for i = 1:nConds >> for j = 1:Nsub >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> end >> end >> clear VSdat; >> save('TE_Wrd', 'TE_Wrd'); >> end >> * >> * >> *The configuration and virtual sensor data, organized in a 3 x 15 >> cell of structures (condition by subject) are the input. The >> TEprepare substructure is added to each individual condition x >> subject .mat files' data structure which are stored on disk >> independently.* >> >> % Use object_to_mat_conversion.m to replace individual condition >> x subject virtual sensor data >> % .mat files with their TE_Wrd equivalent >> * >> * >> *I'm using a separate script to make some manipulations to the >> objects from disk; this will all eventually be integrated into >> the main pipeline*.*TRENTOOL seems to handle data output very >> differently from fieldtrip and I've had trouble thinking through >> the most logical way to handle the data so it's a bit haphazard >> right now.* >> >> load cond080sub01.mat >> >> cfgG = []; >> cfgG.dim = cond080sub01.TEprepare.optdim; >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> if isfield(cond080sub01, 'TEprepare') >> TEgroup_prepare(cfgG, fileCell); >> else >> error('Need to run TEprepare before TEgroup_prepare'); >> end >> * >> * >> *For clarification, fileCell is a cell with the name of each >> condition x subject .mat file, which as I said before is >> collectively the same as the 3 x 15 VSdat structure (condition x >> subject).* >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> % object_to_mat_conversion.m >> >> % TE Group Calculate >> >> load cond080sub01.mat >> if isfield(cond080sub01, 'TEgroupprepare') >> for i = 1:length(fileCell) >> TEgroup_calculate(fileCell{i}); >> end >> else >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> end >> * >> * >> *At this step I get the following error: >> >> Error using transferentropy (line 337) >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in TEgroup_calculate (line 133) >> [TEresult] = transferentropy(cfg,data);* >> >> % TE Group Stats >> >> cfgGSTAT = []; >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> cfgGSTAT.uvar = 1; >> cfgGSTAT.ivar = 2; >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> *Given the error above, I am yet to get to this step, but it does >> not seem fundamentally different from normal fieldtrip stats.* >> >> ***** >> >> In case my notes were not clear or you skipped to the bottom, *my >> primary concern is whether the error I'm getting in >> TEgroup_calculate is a pipeline issue* (I noticed the example >> pipeline in trentool, the manual, and published methods articles >> all seem to have slightly or significantly different pipeline >> compositions), *or if the error is* due to ACT, ragwitz >> optimization, or some other faulty parameterization *on my part >> due to a lack of understanding of how transfer entropy works on a >> more theoretical/mathematical level*. If the latter is the case, >> is there any relatively straightforward way to conceptualize >> this, or is this something where I'm just going to have to keep >> reading and rereading until it eventually makes sense? I've >> already done quite a bit of that and it hasn't pierced my thick >> skull yet but I'm sure it will eventually! >> >> Thank you so much, >> >> Max Cantor >> >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> >> _______________________________________________ >> 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 > > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > > _______________________________________________ > 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 mcantor at umich.edu Tue Sep 9 16:39:18 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 9 Sep 2014 10:39:18 -0400 Subject: [FieldTrip] TRENTOOL pipeline help In-Reply-To: <540F05E5.1000109@gmx.de> References: <540EEF94.9080601@gmx.de> <540F05E5.1000109@gmx.de> Message-ID: Looking at the sample script, it should be reasonably straightforward for me to adapt my pipeline, and between the ragwitz tutorial and your notes I should be able to develop a better understanding of what the pipeline is doing in a more sophisticated way. Again, thank you so much! I will try to incorporate this new information as soon as possible, and if I have any other issues I'll follow up, but hopefully this should solve most of my problems. On Tue, Sep 9, 2014 at 9:51 AM, Patricia Wollstadt < Patricia.Wollstadt at gmx.de> wrote: > I'm glad that cleared things up a little. Sorry about the confusion, we > will try to include warnings for deprecated function in the next release of > TRENTOOL. > > You don't need to run TEprepare before running TEgroup_prepare. You just > run the four functions > - TEgroup_prepare > - InteractionDelayReconstruction_calculate > - InteractionDelayReconstruction_analyze > - TEgroup_stats > in that order. > > The graph analysis is an optional step that can be run on the individual > outputs of InteractionDelayReconstruction_analyze. The function will > partially correct the output for multivariate effects. Since you are > looking at one connection only, you don't need to include the graph > analysis step into your pipeline. (I also sent you an example script > directly, because I think it is not a good idea to send attachments via the > mailing list.) > > Best, Patricia > > > > > On 09/09/2014 03:19 PM, Max Cantor wrote: > > This is immensely helpful, thank you. I was very confused about why some > versions of the pipeline I saw were using group calculate and others were > using interaction delay reconstruction and what that meant, and I think I > have a more clear idea of what the different steps of the pipeline are > doing. There are still a few things I'm a bit confused about though in > terms of the pipeline. For instance, whether or not I need to do TEprepare > before group prepare, and if I need to do graph analysis (which I'm not > sure I fully understand but also haven't looked deeply into) before group > stats. > > If you don't mind me taking you up on your offer, I think seeing your > example script might help clarify some of these issues. > > Thank you! > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > Patricia.Wollstadt at gmx.de> wrote: > >> Hello Max, >> >> I added a few comments to the questions regarding individual parameters >> below. To address the general problem of TRENTOOL telling you, that there >> are not enough sample points in your data: From what I can see in your >> script, you probably don't have enough data points in each time series to >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, which >> gives you 240 samples per time series. Can you maybe avoid downsampling to >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a longer time >> window of interest? >> Note that you also 'lose' data to embedding and the interaction delay: >> The first point that can be used for TE estimation is at max. embedding >> length + max. interaction delay in samples. For example: max. embedding >> length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >> interaction delay of 30 ms = 9 samples. In this example, you would be left >> with 240 - 29 samples for TE estimation per trial. There is also the >> possibility to estimate time resolved TE/TE for shorter time windows of >> interest (see section 4.4 in the manual); however, this method requires the >> use of a GPU for TE estimation. >> >> I would further recommend to use the new pipeline for group statistics >> described in the manual in section 4.5 (the function 'TEgroup_calculate' is >> deprecated). The new pipeline allows you to reconstruct the interaction >> delay and uses the following functions (see also comments in the script): >> >> TEgroup_prepare -> prepares all data sets (all subjects/all >> conditions) for group analysis (this means finding common embedding >> parameters such that estimates are not biased between groups) >> InteractionDelayReconstruction_calculate -> estimates TE for >> individual data sets and all assumed interaction delays u >> InteractionDelayReconstruction_analyze -> reconstructs the >> interaction delay by selecting the u that maximizes TE for each channel >> TEgroup_stats -> calculate group statistics using a permutation >> test >> >> I can send you an example script for group TE analysis using this >> pipeline to get you started. I hope this helps you to get the group >> analysis running. Just write again if you're having trouble setting up the >> pipeline or something is not clear about the parameters/my comments. >> >> Best, >> Patricia >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> I know trentool is not produced by the Donders Institute, so I'm not >> 100% sure if it is appropriate to ask questions about it here, but to the >> best of my knowledge they do not have a mailing list and I saw a few >> trentool questions in the archives, so I'm going to assume it's ok... >> >> In any case, below is my current pipeline (slightly modified for >> comprehensibility): >> >> (notes in bold are comments/questions made in this email, not present in >> the pipeline. Sorry in advance for the long post! Any help would be greatly >> appreciated as I'm a bit over my head on this but I think I'm close!) >> >> ***** >> >> % Prepare group TE data >> >> cfgP = []; >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> cfgP.TEcalctype = 'VW_ds'; >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> *I'm trying to find the transfer entropy between the left and right >> auditory cortices in my experiment. The input is virtual sensor data that >> was produced using SAM in fieldtrip on real MEG data. * >> >> % specify u to be scanned >> >> cfgP.predicttime_u = 30; >> cfgP.toi = [-0.4 0.4]; >> >> *For clarification, the predicttime_u is in seconds but the toi is in >> milliseconds. If I understand correctly, the predicttime_u must fit within >> the toi, but beyond that are there any benefits to it being earlier or >> later?* PW: The predictiontime_u is in milliseconds and the toi is in >> seconds. The prediction time is the assumed interaction delay between your >> two sources and should fit within your toi. In general it is preferable to >> use the method for interaction delay reconstruction for TE estimation, >> because it allows you to reconstruct the actual delay between your source >> and target times series. A non-optimal u/interaction delay may cause an >> underestimation of TE, so it is recommended to use the pipeline for >> interaction delay reconstruction whenever estimating TE for unknown delays. >> If you use the methods for interaction delay reconstruction >> 'predicttime_u' is replaced by >> cfgTEP.predicttimemin_u % minimum u to be scanned >> cfgTEP.predicttimemax_u % maximum u to be scanned >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> A large range for u values to be scanned increases computing time a lot, >> so it is best to limit the u range to values that are physiologically >> plausible. >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> cfgP.maxlag = 150; >> cfgP.actthrvalue = 7.5; >> cfgP.minnrtrials = 5; >> >> *My understanding is maxlag should be 1/2 the sampling rate, so since >> the data are downsampled to 300hz, it should be 150. I know that the sample >> rate and filters are used to determine the actthrvalue, but I don't >> actually know the calculation. 7.5 was a rough guess just to test the >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: You can >> set the actthrvalue based on the filtering you did prior to TE analysis. If >> you for example highpass filtered at 10 Hz, you shouldn't find an ACT >> higher than 30 samples, because you filtered out any components of the >> signal slower than 10 Hz/30 samples (given your sampling frequency of 300 >> Hz). So in this scenario the actthrvalue would be 30. >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials is >> needed to realize the permutation test for estimated TE values). >> >> >> % Optimization >> >> cfgP.optimizemethod = 'ragwitz'; >> cfgP.ragdim = 4:8; >> cfgP.ragtaurange = [0.2 0.4]; >> cfgP.ragtausteps = 15; >> cfgP.repPred = 100; >> >> *I am completely at a loss for this. I've done some reading into >> transfer entropy, mutual information, etc., cited in trentool, but I'm yet >> to understand how exactly this optimization works and what the >> configuration should be, given my data and experimental intentions.* PW: >> The Ragwitz criterion tries to find optimal embedding parameters dim and >> tau for the data. To do that, the method iteratively takes all possible >> combinations of dim and tau values that are provided in cfgP.ragdim and >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations embed >> the data. To test an embedding, the method builds the embedding vectors >> from the data; it then tests for each point how well the next point in time >> can be predicted from the reference point's nearest neighbours. So for each >> embedded point, the method searches for the nearest neighbours and >> calculates the average of those nearest neighbours. The difference between >> the averaged/predicted point and the actual next point is the error of the >> local predictor. The Ragwitz criterion will then return the parameter >> combination for which this error over all points is minimal. >> The parameters set the following: 'ragdim' are dimensions to be tested by >> the method (I would reccomend to start with 2:10), 'ragtaurange' together >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL will >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values here are >> factors that are later multiplied with the ACT to obtain the actual tau. >> 'repPred' is the number of points that will be used for the local >> prediction, i.e. the Ragwitz criterion will test the local prediction and >> calculate the error for the first 100 points in your time series. The two >> parameters 'flagNei' ans 'sizeNei' below specify the type of neighbour >> search conducted by the Ragwitz criterion: 'flagNei' tells the method to >> either conduct a kNN or range search; 'sizeNei' specifies the number of >> neighbours or the radius to be searched by a range search. >> >> >> % Kernel-based TE estimation >> >> cfgP.flagNei = 'Mass'; >> cfgP.sizeNei = 4; % Default >> >> cfgP.ensemblemethod = 'no'; >> cfgP.outputpath = *OUTPUT PATH*; >> >> if ~exist(*Path for TEprepare data object*) >> load VSdat; >> TE_Wrd = {}; >> for i = 1:nConds >> for j = 1:Nsub >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> end >> end >> clear VSdat; >> save('TE_Wrd', 'TE_Wrd'); >> end >> >> *The configuration and virtual sensor data, organized in a 3 x 15 cell >> of structures (condition by subject) are the input. The TEprepare >> substructure is added to each individual condition x subject .mat files' >> data structure which are stored on disk independently.* >> >> % Use object_to_mat_conversion.m to replace individual condition x >> subject virtual sensor data >> % .mat files with their TE_Wrd equivalent >> >> *I'm using a separate script to make some manipulations to the objects >> from disk; this will all eventually be integrated into the main pipeline* >> .* TRENTOOL seems to handle data output very differently from fieldtrip >> and I've had trouble thinking through the most logical way to handle the >> data so it's a bit haphazard right now.* >> >> load cond080sub01.mat >> >> cfgG = []; >> cfgG.dim = cond080sub01.TEprepare.optdim; >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> if isfield(cond080sub01, 'TEprepare') >> TEgroup_prepare(cfgG, fileCell); >> else >> error('Need to run TEprepare before TEgroup_prepare'); >> end >> >> *For clarification, fileCell is a cell with the name of each condition >> x subject .mat file, which as I said before is collectively the same as the >> 3 x 15 VSdat structure (condition x subject).* >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> % object_to_mat_conversion.m >> >> % TE Group Calculate >> >> load cond080sub01.mat >> if isfield(cond080sub01, 'TEgroupprepare') >> for i = 1:length(fileCell) >> TEgroup_calculate(fileCell{i}); >> end >> else >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> end >> >> >> >> >> >> >> >> *At this step I get the following error: Error using transferentropy >> (line 337) \nTRENTOOL ERROR: not enough data points left after embedding >> Error in TEgroup_calculate (line 133) [TEresult] = >> transferentropy(cfg,data);* >> >> % TE Group Stats >> >> cfgGSTAT = []; >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> cfgGSTAT.uvar = 1; >> cfgGSTAT.ivar = 2; >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> *Given the error above, I am yet to get to this step, but it does not >> seem fundamentally different from normal fieldtrip stats.* >> >> ***** >> >> In case my notes were not clear or you skipped to the bottom, *my >> primary concern is whether the error I'm getting in TEgroup_calculate is a >> pipeline issue* (I noticed the example pipeline in trentool, the manual, >> and published methods articles all seem to have slightly or significantly >> different pipeline compositions), *or if the error is* due to ACT, >> ragwitz optimization, or some other faulty parameterization *on my part >> due to a lack of understanding of how transfer entropy works on a more >> theoretical/mathematical level*. If the latter is the case, is there any >> relatively straightforward way to conceptualize this, or is this something >> where I'm just going to have to keep reading and rereading until it >> eventually makes sense? I've already done quite a bit of that and it hasn't >> pierced my thick skull yet but I'm sure it will eventually! >> >> Thank you so much, >> >> Max Cantor >> >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> >> _______________________________________________ >> fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 >> > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From cas243 at georgetown.edu Tue Sep 9 21:25:21 2014 From: cas243 at georgetown.edu (Clara A. Scholl) Date: Tue, 9 Sep 2014 15:25:21 -0400 Subject: [FieldTrip] data.sampleinfo when preprocessing was completed in EEGLAB Message-ID: Dear FieldTrip Community, I did preprocessing in EEGLAB and imported into FieldTrip using eeglab2fieldtrip (from EEGLAB version 13.3.2b). The resulting FieldTrip data structures do not have the data field "sampleinfo" to specify the position of each trial relative to the actual recording. As a result of this, I get the warning "reconstructing sampleinfo by assuming that the trials are consecutive segments of a continuous recording" when calling the functions ft_timelockanalysis and ft_mvaranalysis. My questions are twofold: 1) when can I ignore this warning? 2) has anyone imported the sampleinfo into FieldTrip from an EEGLAB EEG structure? Any guidance on the best way to do this? Thanks immensely for feedback! Respectfully, Clara -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Sep 10 10:49:58 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 10 Sep 2014 10:49:58 +0200 Subject: [FieldTrip] data.sampleinfo when preprocessing was completed in EEGLAB In-Reply-To: References: Message-ID: Dear Clara, 1) Some FT functions require a sampleinfo for their inner workings, so they reconstruct it in a simple way if it is not present. You can safely ignore this warning if you are not doing anything with sample indices yourself. Specifically, the FT artifact and event functions use sample indices (i.e. return segments of artifacts/events in terms of samples relative to the original recording), if you are not using these you are probably safe. 2) Not me ;) Best, Eelke On 9 September 2014 21:25, Clara A. Scholl wrote: > Dear FieldTrip Community, > > I did preprocessing in EEGLAB and imported into FieldTrip using > eeglab2fieldtrip (from EEGLAB version 13.3.2b). The resulting FieldTrip > data structures do not have the data field "sampleinfo" to specify the > position of each trial relative to the actual recording. As a result of > this, I get the warning "reconstructing sampleinfo by assuming that the > trials are consecutive segments of a continuous recording" when calling the > functions ft_timelockanalysis and ft_mvaranalysis. > > My questions are twofold: > > 1) when can I ignore this warning? > 2) has anyone imported the sampleinfo into FieldTrip from an EEGLAB EEG > structure? Any guidance on the best way to do this? > > Thanks immensely for feedback! > Respectfully, > Clara > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From barbara.schorr at uni-ulm.de Wed Sep 10 14:07:14 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Wed, 10 Sep 2014 14:07:14 +0200 Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' In-Reply-To: References: Message-ID: <20140910140714.9n2t9bxs008o400c@imap.uni-ulm.de> Dear fieldtripers. as mentioned in the subject line I would like to anaylse my timelocked ERP Data with the function ft_globalmeanfield. I get the Error: Undefined function or variable 'abort' Error in ft_globalmeanfield (line84) if abort in the function it says: %the abort variable is set to true or false in ft_preamble_inti if abort % do not continue function execution in case the outputfile is present and the user indicated to keep it return end I don't understand what this means. I would really appreciate your help to get this running. Also, what is the result when I run this function on my data? (This method was proposed from a reviewer. I never used it before, so I don't exactly know what it does and what the result will look like). Thank you very much in advance! Best, Barbara Schorr Zitat von 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: Question regarding nonparametric testing for coherence > differences (Eric Maris) > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) > 4. Re: ft_rejectvisual: removing trials marked as bad > (Caspar, Emilie) > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) > 6. Latest FT version on ftp-server is from three days ago > (Holger Krause) > 7. Re: TRENTOOL pipeline help (Max Cantor) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) > From: "Eric Maris" > To: , "'FieldTrip discussion list'" > > Subject: Re: [FieldTrip] Question regarding nonparametric testing for > coherence differences > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Dear Hwee Ling, > > > > In the paper you refer to (Maris et al, JNM, 2007), I did not perform a > cluster-based permutation test at the level of the channel pairs. Instead, > all coherences mentioned in the paper are coherence between a single EMG > channel (2 electrodes mounted on the forearm) and all MEG electrodes. Thus, > there are as many EMG-MEG coherences as there are MEG channels (275 in our > lab), and the clustering of these coherences involves the same neighbourhood > structure as the clustering of channel-specific statistics on power or > evoked response. The analysis you propose involves clustering in a much more > complex space, namely the formed by all (MEG,MEG) channel pairs > (275*275=75625 pairs). In the early days of cluster-based permutation > statistics, I have worked on this problem but did not pursue it because the > resulting clusters are very hard to interpret. > > > > Best, > > > > Eric Maris > > > > > > Dear all and Prof Maris, > > I'm re-posting this question again, as I didn't get any replies previously. > > I?m interested to investigate if there are any differences in phase > synchronization in resting state data at timepoint 2 versus timepoint 1. The > EEG data was collected using 64 EEG channels, resting state, eyes opened and > eyes closed. I?ve arbitrarily segmented the resting state data into epochs > of 2s each, and the epochs with artifacts are excluded completely from > further analyses. I then performed mtmfft to get the fourier representation > of the data, extracted the coherence, and compared the coherence difference > of timepoint 2 versus timepoint 1 of all channels paired with all other > channels. > > I figured that if I extract the connectivity analyses without specifying the > channelcmb, I get a 'chan_chan_freq' dimord variable that would allow me to > perform cluster-based statistical analyses. I get an output with ?chan_chan? > dimord variable. However, I was not 100% sure that this is correct, > hence, I?ve > inserted my code (see below). It?ll be great if you could tell me if what I?m > doing makes any sense at all. Also, I don?t know how I can plot the results > to see if it make any sense at all. > > Also, I checked the values obtained from when I specified "cfg.channelcmb" > and when I did not specify "cfg.channelcmb", I noticed that the values were > somehow different. I would assume that the values to be similar, although > I'm not sure why they would have differences in the values obtained from > specifying "cfg.channelcmb". > > This is my code that I've used thus far: > > for sub = 1:5 > > cfg = []; > > cfg.output = 'fourier'; > > cfg.channel = {'all'}; > > cfg.method = 'mtmfft'; > > cfg.keeptrials = 'yes'; > > cfg.tapsmofrq = 5; > > cfg.foilim = [0 100]; > > cfg.taper = 'dpss'; > > % find the index for the c200 condition > > pre_c200_idx = find(data5.trialinfo == 201); > > cfg.trials = pre_c200_idx; > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > post_c200_idx = find(data5.trialinfo == 200); > > cfg.trials = post_c200_idx; > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > cfg = []; > > cfg.keeptrials = 'no'; > > cfg.channel = {'all'}; > > cfg.removemean = 'yes'; > > cfg.method = 'coh'; > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_pre_c200); > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > HLF_post_c200); > > end > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); > > cfg_neighb.method = 'template'; > > cfg_neighb.layout = lay; > > cfg_neighb.channel = 'all'; > > neighbours = ft_prepare_neighbours(cfg_neighb, sub_HLF_pre_c200coh{1}); > > > > cfg = []; > > cfg.layout = lay; > > cfg.neighbours = neighbours; > > cfg.channel = 'all'; > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > cfg.latency = 'all'; > > cfg.avgovertime = 'no'; > > cfg.avgoverchan = 'no'; > > cfg.parameter = 'cohspctrm'; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'depsamplesT'; > > cfg.correctm = 'cluster'; > > cfg.tail = 0; > > % cfg.clustertail = 0; > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 frequency > bands. > > cfg.numrandomization = 10000; > > cfg.ivar = 2; > > cfg.uvar = 1; > > > > % design matrices > > clear design; > > design(1,:) = [1:5, 1:5]; > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > cfg.design = design; > > % for theta band > > cfg.avgoverfreq = 'yes'; > > cfg.frequency = [4 8]; % I also performed the statistics for delta (2-4), > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma (30-40), > and gamma (40-100). > > [diffc200_theta_stat] = ft_freqstatistics(cfg, sub_HLF_post_c200coh{:}, > sub_HLF_pre_c200coh{:}); > > > > When I tried to plot the results, I used this code: > > cfg = []; > > cfg.channel = 'all'; > > cfg.layout = 'lay'; > > cfg.zlim = [-1 1]; > > cfg.alpha = 0.05; > > cfg.refchannel = 'all'; > > ft_clusterplot(cfg, diffc200_theta_stat); > > However, I was not sure how I could plot the results. I get an error message > from Fieldtrip when using ft_clusterplot: > > Error using topoplot_common (line 366) > > no reference channel is specified > > Error in ft_topoplotTFR (line 192) > > [cfg] = topoplot_common(cfg, varargin{:}); > > Error in ft_clusterplot (line 372) > > ft_topoplotTFR(cfgtopo, stat); > > > > According to your paper in 2007, the topoplot of the results were masked by > the spatio-spectral pattern of the significant clusters. I don't know how to > do this, and I would really appreciate if you can show me how to make such a > plot. > > Thank you very much. > > Kind regards, > > Hweeling > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 2 > Date: Mon, 8 Sep 2014 21:38:01 +0200 > From: KatrinH Heimann > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Joseph, thanks so much, I really appreciate your help. I was also > wandering, if maybe there is another bug in my code. > Our nets are 128 channels, Hydrocel, but as a colleague of me adviced me to > do so, I also tried the 129 layout. > My code you find below (without selection of bad channels etc.) > If you need also the data of two subjects to have a look, let me know!!! > Best and thanks really! > Katrin > > > subject=input('Which subject do you want to analyse? ','s'); > > name = strcat(subject,'.raw'); > > subjectnumber=input('Which is the subjectnumber?', 's'); > > sb=subjectnumber > > %subjectnumber = strcat(subjectnumber, '.txt') > > %% > > > cfg = []; > > cfg.dataset = name; > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus trigger > > cfg.trialdef.prestim = 0.234; % in seconds > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > observation, but maybe we need less) > > cfg = ft_definetrial(cfg); > > > cfg.trl([1:7],:) = []; > > > %change timeline according to constant offset of 16 ms = 8 samples (because > recorded with 500 hz)in > > %structure trial > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > %change timeline to make the cut the zeropoint > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > %% preprocess data > > cfg.channel = 'all'; > > cfg.preproc.detrend = 'yes'; > > cfg.preproc.demean = 'yes'; > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already filtered > > %(0.1-45) and bad channels have to be replaced!!!! > > %cfg.preproc.bpfreq = [6 32]; > > % > > % > > obs_data = ft_preprocessing(cfg); > > % > > save (strcat(sb,'obs_data') , 'obs_data') > > > %% determining channel neighbours (necessary for Artifact detection) > > cfg = []; > > cfg.channel = obs_data.label; > > cfg.layout = 'GSN128.sfp'; > > cfg.feedback = 'yes'; > > lay = ft_prepare_layout(cfg); > > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = 'GSN128.sfp'; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > %% Preparing neighbours for channel repair - but bad channel info in!!! > > > % cfg_neighb = []; > > % cfg_neighb.feedback = 'yes'; > > % cfg_neighb.method = 'triangulation'; > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > % Interpolate and put into new data structure > > cfg = []; > > cfg.badchannel = {}; > > cfg.layout = 'GSN128.sfp'; > > cfg.method = 'nearest'; > > cfg.neighbours = neighbours; > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > % Check reconstruction > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > % dat1=obs_data; > > % dat2=obs_data_channelrepaired; > > % > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > % y=dat2.trial{1}(62,:); > > % plot(x);hold on;plot(y,'r'); > > % > > % x=dat1.trial{1}(72,:); > > % y=dat2.trial{1}(75,:); > > % figure; > > % plot(x);hold on;plot(y,'r') > > % > > % x=dat1.trial{1}(75,:); > > % y=dat2.trial{1}(75,:); > > % figure; > > % plot(x);hold on;plot(y,'r') > > %% artifact rejection/trial inspection - throw out electrode jumps etc. > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent according to > channels interpolated %% 128-number of interp. channels) > > > > cfg = []; > > cfg.channel = {'all'}; > > cfg.numcomponent = 128 > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > save (strcat(sb,'comp_all') , 'comp') > > > %% > > cfg = []; > > cfg.viewmode = 'component'; > > cfg.continuous = 'no'; > > cfg.plotlabels='some'; > > cfg.layout = 'GSN128.sfp'; > > ft_databrowser(cfg,comp); > > > %% poweranalysis components > > cfg = []; > > cfg.output = 'pow'; > > cfg.channel = 'all';%compute the power spectrum in all ICs > > cfg.method = 'mtmfft'; > > cfg.taper = 'hanning'; > > cfg.foi = 0:0.2:50; > > obs_freq = ft_freqanalysis(cfg, comp); > > > %And you can plot the spectra: > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > nsubplots = 16; > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain decimals, type > doc subplot > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > tot = Nfigs*nsubplots; > > > rptvect = 1:size(comp.topo,1); > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > for r=1:size(rptvect,1); > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 1]);%full > screen > > k=0; > > for j=1:size(rptvect,2); > > if~(rptvect(r,j)==0); > > k=k+1; > > cfg=[]; > > cfg.channel = rptvect(r,j); > > cfg.ylim =[0 500] > > cfg.xlim =[0 50] > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > end > > end > > end > > > %For the IC topos you'll follow the same logic as above but with: > > > figure > > cfg = []; > > cfg.component = [1:20]; % specify the component(s) that should be > plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > figure > > cfg = []; > > cfg.component = [21:40]; % specify the component(s) that should be > plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > figure > > cfg = []; > > cfg.component = [41:60]; % specify the component(s) that should be > plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > figure > > cfg = []; > > cfg.component = [61:80]; % specify the component(s) that should be > plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > > > > %% Seperate observation conditions > > > name1= strcat(num2str(sb),'_90.xls'); > > list1=xlsread (name1) > > > > > > name2= strcat(num2str(sb),'_180.xls'); > > list2=xlsread (name2) > > > > % > > > cfg = [] > > cfg.trials = [list1] > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > cfg = [] > > cfg.trials = [list2] > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > %%PIPELINE FOR obs90 > > > %% Decompose original data according to the components found before > > load (strcat(sb,'comp_all')) > > > cfg = []; > > cfg.numcomponent = 128; > > cfg.unmixing = comp.unmixing; > > cfg.topolabel = comp.topolabel; > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > %% Reject component > > cfg = []; > > cfg.component = []; > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > %% Artifacts - final detection > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > %cfg.artfctdef.reject = 'complete'; > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > % Save clean data > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > %% Rereferencing data > > cfg = []; > > > cfg.channel = 'all'; > > cfg.preproc.reref = 'yes'; > > cfg.preproc.refchannel = 'all'; > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > %% Snap out smaller pieces (the third second) > > > cfg = [] > > cfg.toilim = [0 1] > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > %% TIMELOCK ERP > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > %% plot it > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > %% PIPELINE FOR obs180 > > > > %% Decompose original data according to the components found before > > load (strcat(sb,'comp_all')) > > > cfg = []; > > cfg.numcomponent = 128 > > cfg.unmixing = comp.unmixing; > > cfg.topolabel = comp.topolabel; > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > %% Reject component > > cfg = []; > > cfg.component = []; > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, obs180_data); > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > %% Artifacts final 180 > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > %cfg.artfctdef.reject = 'complete'; > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > % Save clean data > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > %% Rereferencing data > > cfg = []; > > cfg.channel = 'all'; > > cfg.preproc.reref = 'yes'; > > cfg.preproc.refchannel = 'all'; > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > %% Snap out smaller pieces (the third second) > > > cfg = [] > > cfg.toilim = [0 1] > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > %% TIMELOCK ERP > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > %% plot 180 ERP > > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, obs180_data_ERP) > > > %% plot both ERPs > > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > cfg.showlabels = 'yes'; > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > %% plot difference wave > > > difference = obs180_data_ERP; % copy one of the > structures > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute the > difference ERP > > > > cfg = []; > > cfg.layout = lay; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, difference) > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > >> Hi, >> I?m one of the main Fieldtrip contributors working on supporting EGI >> data. A couple things. First of all, exactly which net do you use? If >> they are 129-channel, there is still the question of whether they are the >> Hydrocel or the older geodesic nets. Regardless, that shouldn't cause an >> error like this. Could you send me the file you are trying to process and >> the script you are using and I?ll try troubleshooting it. >> >> Joe >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >> diezmartini at gmail.com> wrote: >> >> Which nets do you use? I use EGI. I tried both the ones you mention and >> they didn't work. It was hard to find that exact one online but it was the >> only file that actually worked. >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> wrote: >> >>> Dear Ana, dear all, >>> the layout you used does not correspond to our nets. I tried the >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. >>> Please can anybody help? >>> Cheers >>> Katrin >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : >>> >>> Try this one >>>> I use >>>> >>>> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>>> katrinheimann at gmail.com> wrote: >>>> >>>>> Dear all, my problems seem neverending. This time however i really need >>>>> help. >>>>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>>>> preprocessing, channelreplacement, ica, componentrejection, final >>>>> artifactdetection, timelock of the single subject data. However, when I >>>>> wanna compute the grandaverage of the single subjects I get the following >>>>> error message: >>>>> >>>>> computing average of avg over 19 subjects >>>>> Warning: discarding electrode information because it cannot be averaged >>>>> > In ft_timelockgrandaverage at 249 >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>>>> additional allocation of an estimated 3 MB >>>>> computing average of avg over 2 subjects >>>>> Warning: discarding electrode information because it cannot be averaged >>>>> > In ft_timelockgrandaverage at 249 >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>>>> additional allocation of an estimated 0 MB >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >>>>> additional allocation of an estimated 0 MB >>>>> the call to "ft_topoplotER" took 0 seconds and required the additional >>>>> allocation of an estimated 0 MB >>>>> >>>>> Furthermore in the plot of the significant clusters, the channelnames >>>>> are mixed up (do not correspond to my net) >>>>> >>>>> >>>>> I guess that there is a problem with the layout I use. >>>>> Here the code that I use >>>>> >>>>> %For generating the layout (also in the single subjects): >>>>> >>>>> cfg = []; >>>>> >>>>> cfg.channel = obs_data.label; >>>>> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>>>> >>>>> cfg.feedback = 'yes'; >>>>> >>>>> lay = ft_prepare_layout(cfg); >>>>> >>>>> >>>>> cfg_neighb = []; >>>>> >>>>> cfg_neighb.feedback = 'yes'; >>>>> >>>>> cfg_neighb.method = 'triangulation'; >>>>> >>>>> cfg_neighb.layout = lay; >>>>> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>>>> >>>>> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>>>> >>>>> >>>>> %For computing the grand average >>>>> >>>>> cfg = []; >>>>> >>>>> cfg.channel = 'all'; >>>>> >>>>> cfg.latency = 'all'; >>>>> >>>>> cfg.parameter = 'avg'; >>>>> >>>>> cfg.keepindividual = 'no' >>>>> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>>>> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>>>> >>>>> % "{:}" means to use data from all elements of the variable >>>>> >>>>> >>>>> For plotting the significant clusters >>>>> >>>>> cfg = []; >>>>> >>>>> cfg.style = 'blank'; >>>>> >>>>> cfg.layout = lay; >>>>> >>>>> cfg.channellabels = 'yes'; >>>>> >>>>> cfg.highlight = 'labels'; >>>>> >>>>> cfg.highlightchannel = find(stat.mask); >>>>> >>>>> cfg.comment = 'no'; >>>>> >>>>> figure; ft_topoplotER(cfg, GA_90) >>>>> >>>>> title('Nonparametric: significant with cluster multiple comparison >>>>> correction') >>>>> >>>>> >>>>> Do you have ANY idea to this? I am really completely helpless.... >>>>> >>>>> thanks and best >>>>> >>>>> Katrin >>>>> >>>>> _______________________________________________ >>>>> 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 >>> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -------------------------------------------------------------------------------- >> >> Joseph Dien, PhD >> Research Associate >> Cognitive Neurology >> The Johns Hopkins University School of Medicine >> >> Lab E-mail: jdien1 at jhmi.edu >> Private E-mail: jdien07 at mac.com >> Office Phone: 410-614-3115 >> Cell Phone: 202-297-8117 >> Fax: 410-955-0188 >> http://joedien.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: > > > ------------------------------ > > Message: 3 > Date: Mon, 08 Sep 2014 21:55:44 -0400 > From: Joseph Dien > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> > Content-Type: text/plain; charset="windows-1252" > > yes, please do send me the data. > > Thanks! > > Joe > > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann wrote: > >> Dear Joseph, thanks so much, I really appreciate your help. I was >> also wandering, if maybe there is another bug in my code. >> Our nets are 128 channels, Hydrocel, but as a colleague of me >> adviced me to do so, I also tried the 129 layout. >> My code you find below (without selection of bad channels etc.) >> If you need also the data of two subjects to have a look, let me know!!! >> Best and thanks really! >> Katrin >> >> >> >> subject=input('Which subject do you want to analyse? ','s'); >> >> name = strcat(subject,'.raw'); >> >> subjectnumber=input('Which is the subjectnumber?', 's'); >> >> sb=subjectnumber >> >> %subjectnumber = strcat(subjectnumber, '.txt') >> >> %% >> >> >> >> cfg = []; >> >> cfg.dataset = name; >> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> >> cfg.trialdef.eventtype = 'trigger'; >> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus trigger >> >> cfg.trialdef.prestim = 0.234; % in seconds >> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> observation, but maybe we need less) >> >> cfg = ft_definetrial(cfg); >> >> >> >> cfg.trl([1:7],:) = []; >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> (because recorded with 500 hz)in >> >> %structure trial >> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >> >> >> >> %change timeline to make the cut the zeropoint >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> >> >> >> >> >> %% preprocess data >> >> cfg.channel = 'all'; >> >> cfg.preproc.detrend = 'yes'; >> >> cfg.preproc.demean = 'yes'; >> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already filtered >> >> %(0.1-45) and bad channels have to be replaced!!!! >> >> %cfg.preproc.bpfreq = [6 32]; >> >> % >> >> % >> >> obs_data = ft_preprocessing(cfg); >> >> % >> >> save (strcat(sb,'obs_data') , 'obs_data') >> >> >> >> %% determining channel neighbours (necessary for Artifact detection) >> >> cfg = []; >> >> cfg.channel = obs_data.label; >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.feedback = 'yes'; >> >> lay = ft_prepare_layout(cfg); >> >> >> cfg_neighb = []; >> >> cfg_neighb.feedback = 'yes'; >> >> >> >> cfg_neighb.method = 'triangulation'; >> >> cfg_neighb.layout = 'GSN128.sfp'; >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >> >> >> >> %% Artifacts - to detect bad channels - is not saved!!! >> >> >> >> >> >> cfg.method = 'summary'; >> >> cfg.latency=[0 1]; >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >> >> >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.latency=[0 1]; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs_data); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >> >> >> >> >> >> %% Preparing neighbours for channel repair - but bad channel info in!!! >> >> >> >> % cfg_neighb = []; >> >> % cfg_neighb.feedback = 'yes'; >> >> % cfg_neighb.method = 'triangulation'; >> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> % Interpolate and put into new data structure >> >> cfg = []; >> >> cfg.badchannel = {}; >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.method = 'nearest'; >> >> cfg.neighbours = neighbours; >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> >> % Check reconstruction >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> % dat1=obs_data; >> >> % dat2=obs_data_channelrepaired; >> >> % >> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> >> % y=dat2.trial{1}(62,:); >> >> % plot(x);hold on;plot(y,'r'); >> >> % >> >> % x=dat1.trial{1}(72,:); >> >> % y=dat2.trial{1}(75,:); >> >> % figure; >> >> % plot(x);hold on;plot(y,'r') >> >> % >> >> % x=dat1.trial{1}(75,:); >> >> % y=dat2.trial{1}(75,:); >> >> % figure; >> >> % plot(x);hold on;plot(y,'r') >> >> %% artifact rejection/trial inspection - throw out electrode jumps etc. >> >> >> >> >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> according to channels interpolated %% 128-number of interp. channels) >> >> >> cfg = []; >> >> cfg.channel = {'all'}; >> >> cfg.numcomponent = 128 >> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >> >> save (strcat(sb,'comp_all') , 'comp') >> >> >> >> %% >> >> cfg = []; >> >> cfg.viewmode = 'component'; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='some'; >> >> cfg.layout = 'GSN128.sfp'; >> >> ft_databrowser(cfg,comp); >> >> >> >> %% poweranalysis components >> >> cfg = []; >> >> cfg.output = 'pow'; >> >> cfg.channel = 'all';%compute the power spectrum in all ICs >> >> cfg.method = 'mtmfft'; >> >> cfg.taper = 'hanning'; >> >> cfg.foi = 0:0.2:50; >> >> obs_freq = ft_freqanalysis(cfg, comp); >> >> >> >> %And you can plot the spectra: >> >> >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> nsubplots = 16; >> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> decimals, type doc subplot >> >> >> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >> >> tot = Nfigs*nsubplots; >> >> >> >> rptvect = 1:size(comp.topo,1); >> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> >> >> >> for r=1:size(rptvect,1); >> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> 1]);%full screen >> >> k=0; >> >> for j=1:size(rptvect,2); >> >> if~(rptvect(r,j)==0); >> >> k=k+1; >> >> cfg=[]; >> >> cfg.channel = rptvect(r,j); >> >> cfg.ylim =[0 500] >> >> cfg.xlim =[0 50] >> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> >> end >> >> end >> >> end >> >> >> >> %For the IC topos you'll follow the same logic as above but with: >> >> >> >> figure >> >> cfg = []; >> >> cfg.component = [1:20]; % specify the component(s) that >> should be plotted >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.comment = 'no'; >> >> ft_topoplotIC(cfg, comp) >> >> >> >> figure >> >> cfg = []; >> >> cfg.component = [21:40]; % specify the component(s) that >> should be plotted >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.comment = 'no'; >> >> ft_topoplotIC(cfg, comp) >> >> >> >> figure >> >> cfg = []; >> >> cfg.component = [41:60]; % specify the component(s) that >> should be plotted >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.comment = 'no'; >> >> ft_topoplotIC(cfg, comp) >> >> >> >> figure >> >> cfg = []; >> >> cfg.component = [61:80]; % specify the component(s) that >> should be plotted >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.comment = 'no'; >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> >> >> >> >> %% Seperate observation conditions >> >> >> >> name1= strcat(num2str(sb),'_90.xls'); >> >> list1=xlsread (name1) >> >> >> >> name2= strcat(num2str(sb),'_180.xls'); >> >> list2=xlsread (name2) >> >> >> % >> >> >> >> cfg = [] >> >> cfg.trials = [list1] >> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> cfg = [] >> >> cfg.trials = [list2] >> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> %%PIPELINE FOR obs90 >> >> >> >> %% Decompose original data according to the components found before >> >> load (strcat(sb,'comp_all')) >> >> >> >> cfg = []; >> >> cfg.numcomponent = 128; >> >> cfg.unmixing = comp.unmixing; >> >> cfg.topolabel = comp.topolabel; >> >> >> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >> >> >> >> >> >> %% Reject component >> >> cfg = []; >> >> cfg.component = []; >> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); >> >> >> >> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> >> >> >> >> >> >> >> %% Artifacts - final detection >> >> >> >> >> >> cfg.method = 'summary'; >> >> cfg.latency=[0 1]; >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> >> >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.latency=[0 1]; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> >> >> >> >> >> % Save clean data >> >> >> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> >> >> >> >> >> %% Rereferencing data >> >> cfg = []; >> >> >> >> cfg.channel = 'all'; >> >> cfg.preproc.reref = 'yes'; >> >> cfg.preproc.refchannel = 'all'; >> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> >> >> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> >> %% Snap out smaller pieces (the third second) >> >> >> >> cfg = [] >> >> cfg.toilim = [0 1] >> >> >> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> >> >> >> %% TIMELOCK ERP >> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> >> >> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> >> >> >> %% plot it >> >> cfg = []; >> >> cfg.layout = lay ; >> >> cfg.interactive = 'yes'; >> >> ft_multiplotER(cfg, obs90_data_ERP) >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% PIPELINE FOR obs180 >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> load (strcat(sb,'comp_all')) >> >> >> >> cfg = []; >> >> cfg.numcomponent = 128 >> >> cfg.unmixing = comp.unmixing; >> >> cfg.topolabel = comp.topolabel; >> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >> >> >> >> >> >> %% Reject component >> >> cfg = []; >> >> cfg.component = []; >> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, obs180_data); >> >> >> >> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> >> >> >> >> >> >> >> %% Artifacts final 180 >> >> >> >> >> >> cfg.method = 'summary'; >> >> cfg.latency=[0 1]; >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> >> >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.latency=[0 1]; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> >> >> >> >> >> % Save clean data >> >> >> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> >> >> >> >> >> %% Rereferencing data >> >> cfg = []; >> >> cfg.channel = 'all'; >> >> cfg.preproc.reref = 'yes'; >> >> cfg.preproc.refchannel = 'all'; >> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> >> >> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> >> %% Snap out smaller pieces (the third second) >> >> >> >> cfg = [] >> >> cfg.toilim = [0 1] >> >> >> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> >> >> >> %% TIMELOCK ERP >> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> >> >> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> >> >> >> %% plot 180 ERP >> >> >> >> cfg = []; >> >> cfg.layout = lay ; >> >> cfg.interactive = 'yes'; >> >> ft_multiplotER(cfg, obs180_data_ERP) >> >> >> >> %% plot both ERPs >> >> >> >> cfg = []; >> >> cfg.layout = lay ; >> >> cfg.interactive = 'yes'; >> >> cfg.showlabels = 'yes'; >> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> >> >> >> %% plot difference wave >> >> >> >> difference = obs180_data_ERP; % copy one of >> the structures >> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >> compute the difference ERP >> >> >> cfg = []; >> >> cfg.layout = lay; >> >> cfg.interactive = 'yes'; >> >> ft_multiplotER(cfg, difference) >> >> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> Hi, >> I?m one of the main Fieldtrip contributors working on supporting >> EGI data. A couple things. First of all, exactly which net do >> you use? If they are 129-channel, there is still the question of >> whether they are the Hydrocel or the older geodesic nets. >> Regardless, that shouldn't cause an error like this. Could you >> send me the file you are trying to process and the script you are >> using and I?ll try troubleshooting it. >> >> Joe >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >> wrote: >> >>> Which nets do you use? I use EGI. I tried both the ones you >>> mention and they didn't work. It was hard to find that exact one >>> online but it was the only file that actually worked. >>> >>> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> wrote: >>> Dear Ana, dear all, >>> the layout you used does not correspond to our nets. I tried the >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> work. Please can anybody help? >>> Cheers >>> Katrin >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : >>> >>> Try this one I use >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >>> wrote: >>> Dear all, my problems seem neverending. This time however i really >>> need help. >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> preprocessing, channelreplacement, ica, componentrejection, final >>> artifactdetection, timelock of the single subject data. However, >>> when I wanna compute the grandaverage of the single subjects I get >>> the following error message: >>> >>> computing average of avg over 19 subjects >>> Warning: discarding electrode information because it cannot be averaged >>> > In ft_timelockgrandaverage at 249 >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> the additional allocation of an estimated 3 MB >>> computing average of avg over 2 subjects >>> Warning: discarding electrode information because it cannot be averaged >>> > In ft_timelockgrandaverage at 249 >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> the additional allocation of an estimated 0 MB >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> additional allocation of an estimated 0 MB >>> the call to "ft_topoplotER" took 0 seconds and required the >>> additional allocation of an estimated 0 MB >>> >>> Furthermore in the plot of the significant clusters, the >>> channelnames are mixed up (do not correspond to my net) >>> >>> >>> I guess that there is a problem with the layout I use. >>> Here the code that I use >>> >>> %For generating the layout (also in the single subjects): >>> cfg = []; >>> >>> cfg.channel = obs_data.label; >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> cfg.feedback = 'yes'; >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> cfg_neighb = []; >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> cfg_neighb.layout = lay; >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> >>> %For computing the grand average >>> >>> cfg = []; >>> >>> cfg.channel = 'all'; >>> >>> cfg.latency = 'all'; >>> >>> cfg.parameter = 'avg'; >>> >>> cfg.keepindividual = 'no' >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> For plotting the significant clusters >>> >>> cfg = []; >>> >>> cfg.style = 'blank'; >>> >>> cfg.layout = lay; >>> >>> cfg.channellabels = 'yes'; >>> >>> cfg.highlight = 'labels'; >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> cfg.comment = 'no'; >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> correction') >>> >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> thanks and best >>> >>> Katrin >>> >>> >>> _______________________________________________ >>> 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 >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -------------------------------------------------------------------------------- >> >> Joseph Dien, PhD >> Research Associate >> Cognitive Neurology >> The Johns Hopkins University School of Medicine >> >> Lab E-mail: jdien1 at jhmi.edu >> Private E-mail: jdien07 at mac.com >> Office Phone: 410-614-3115 >> Cell Phone: 202-297-8117 >> Fax: 410-955-0188 >> http://joedien.com >> >> >> _______________________________________________ >> 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 > > -------------------------------------------------------------------------------- > > Joseph Dien, PhD > Research Associate > Cognitive Neurology > The Johns Hopkins University School of Medicine > > Lab E-mail: jdien1 at jhmi.edu > Private E-mail: jdien07 at mac.com > Office Phone: 410-614-3115 > Cell Phone: 202-297-8117 > Fax: 410-955-0188 > http://joedien.com > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 4 > Date: Tue, 9 Sep 2014 06:37:13 +0000 > From: "Caspar, Emilie" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > bad > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Ashley, > > Maybe the mistake is you did not integrate in your script the > command to save the rejection. Normally, with the following command, > you will see in the Matlab Window that artifacts are correctly > rejected after the "quit" button. > > clean_data = ft_rejectvisual(cfg, interpoldata); > cfg.artfctdef.reject = 'complete'; > cfg.artfctdef.feedback = 'yes'; > cleandata = ft_rejectartifact(cfg,clean_data); > > Emilie > > > > > > Le 3 sept. 2014 ? 11:58, Ashley Greene > > a ?crit : > > Hello, > > I have used the rejectvisual function in attempt to remove bad > trials, but after marking them and pressing the quit button, > although the command window states that the selected trials have > been removed, there is no obvious change in the data; all of the > trials are still intact. Have I overlooked something? > > Thanks, > > Ashley > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 5 > Date: Tue, 09 Sep 2014 14:16:20 +0200 > From: Patricia Wollstadt > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] TRENTOOL pipeline help > Message-ID: <540EEF94.9080601 at gmx.de> > Content-Type: text/plain; charset="windows-1252" > > Hello Max, > > I added a few comments to the questions regarding individual parameters > below. To address the general problem of TRENTOOL telling you, that > there are not enough sample points in your data: From what I can see in > your script, you probably don't have enough data points in each time > series to robustly estimate TE. You analyze 800 ms of data sampled at > 300 Hz, which gives you 240 samples per time series. Can you maybe avoid > downsampling to 300 Hz and downsample to 600 Hz instead? Or could you > analyze a longer time window of interest? > Note that you also 'lose' data to embedding and the interaction delay: > The first point that can be used for TE estimation is at max. embedding > length + max. interaction delay in samples. For example: max. embedding > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max > interaction delay of 30 ms = 9 samples. In this example, you would be > left with 240 - 29 samples for TE estimation per trial. There is also > the possibility to estimate time resolved TE/TE for shorter time windows > of interest (see section 4.4 in the manual); however, this method > requires the use of a GPU for TE estimation. > > I would further recommend to use the new pipeline for group statistics > described in the manual in section 4.5 (the function 'TEgroup_calculate' > is deprecated). The new pipeline allows you to reconstruct the > interaction delay and uses the following functions (see also comments in > the script): > > TEgroup_prepare -> prepares all data sets (all subjects/all > conditions) for group analysis (this means finding common embedding > parameters such that estimates are not biased between groups) > InteractionDelayReconstruction_calculate -> estimates TE for > individual data sets and all assumed interaction delays u > InteractionDelayReconstruction_analyze -> reconstructs the > interaction delay by selecting the u that maximizes TE for each channel > TEgroup_stats -> calculate group statistics using a permutation test > > I can send you an example script for group TE analysis using this > pipeline to get you started. I hope this helps you to get the group > analysis running. Just write again if you're having trouble setting up > the pipeline or something is not clear about the parameters/my comments. > > Best, > Patricia > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: >> Hi fieldtrippers, >> >> I know trentool is not produced by the Donders Institute, so I'm not >> 100% sure if it is appropriate to ask questions about it here, but to >> the best of my knowledge they do not have a mailing list and I saw a >> few trentool questions in the archives, so I'm going to assume it's ok... >> >> In any case, below is my current pipeline (slightly modified for >> comprehensibility): >> >> (notes in bold are comments/questions made in this email, not present >> in the pipeline. Sorry in advance for the long post! Any help would be >> greatly appreciated as I'm a bit over my head on this but I think I'm >> close!) >> >> ***** >> >> % Prepare group TE data >> >> cfgP = []; >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> cfgP.TEcalctype = 'VW_ds'; >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> *I'm trying to find the transfer entropy between the left and right >> auditory cortices in my experiment. The input is virtual sensor data >> that was produced using SAM in fieldtrip on real MEG data. * >> >> % specify u to be scanned >> >> cfgP.predicttime_u = 30; >> cfgP.toi = [-0.4 0.4]; >> >> *For clarification, the predicttime_u is in seconds but the toi is in >> milliseconds. If I understand correctly, the predicttime_u must fit >> within the toi, but beyond that are there any benefits to it being >> earlier or later?* PW: The predictiontime_u is in milliseconds and the >> toi is in seconds. The prediction time is the assumed interaction >> delay between your two sources and should fit within your toi. In >> general it is preferable to use the method for interaction delay >> reconstruction for TE estimation, because it allows you to reconstruct >> the actual delay between your source and target times series. A >> non-optimal u/interaction delay may cause an underestimation of TE, so >> it is recommended to use the pipeline for interaction delay >> reconstruction whenever estimating TE for unknown delays. >> If you use the methods for interaction delay reconstruction >> 'predicttime_u' is replaced by >> cfgTEP.predicttimemin_u % minimum u to be scanned >> cfgTEP.predicttimemax_u % maximum u to be scanned >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> A large range for u values to be scanned increases computing time a >> lot, so it is best to limit the u range to values that are >> physiologically plausible. >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> cfgP.maxlag = 150; >> cfgP.actthrvalue = 7.5; >> cfgP.minnrtrials = 5; >> >> *My understanding is maxlag should be 1/2 the sampling rate, so since >> the data are downsampled to 300hz, it should be 150. I know that the >> sample rate and filters are used to determine the actthrvalue, but I >> don't actually know the calculation. 7.5 was a rough guess just to >> test the pipeline. I'm also uncertain of what minnrtrials should be.* >> PW: You can set the actthrvalue based on the filtering you did prior >> to TE analysis. If you for example highpass filtered at 10 Hz, you >> shouldn't find an ACT higher than 30 samples, because you filtered out >> any components of the signal slower than 10 Hz/30 samples (given your >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >> would be 30. >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials is >> needed to realize the permutation test for estimated TE values). >> >> % Optimization >> >> cfgP.optimizemethod = 'ragwitz'; >> cfgP.ragdim = 4:8; >> cfgP.ragtaurange = [0.2 0.4]; >> cfgP.ragtausteps = 15; >> cfgP.repPred = 100; >> * >> * >> *I am completely at a loss for this. I've done some reading into >> transfer entropy, mutual information, etc., cited in trentool, but I'm >> yet to understand how exactly this optimization works and what the >> configuration should be, given my data and experimental intentions.* >> PW: The Ragwitz criterion tries to find optimal embedding parameters >> dim and tau for the data. To do that, the method iteratively takes all >> possible combinations of dim and tau values that are provided in >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well these >> combinations embed the data. To test an embedding, the method builds >> the embedding vectors from the data; it then tests for each point how >> well the next point in time can be predicted from the reference >> point's nearest neighbours. So for each embedded point, the method >> searches for the nearest neighbours and calculates the average of >> those nearest neighbours. The difference between the >> averaged/predicted point and the actual next point is the error of the >> local predictor. The Ragwitz criterion will then return the parameter >> combination for which this error over all points is minimal. >> The parameters set the following: 'ragdim' are dimensions to be tested >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >> together with 'ragtausteps' specifies the tau values to be tested >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, that >> the values here are factors that are later multiplied with the ACT to >> obtain the actual tau. 'repPred' is the number of points that will be >> used for the local prediction, i.e. the Ragwitz criterion will test >> the local prediction and calculate the error for the first 100 points >> in your time series. The two parameters 'flagNei' ans 'sizeNei' below >> specify the type of neighbour search conducted by the Ragwitz >> criterion: 'flagNei' tells the method to either conduct a kNN or range >> search; 'sizeNei' specifies the number of neighbours or the radius to >> be searched by a range search. >> >> >> % Kernel-based TE estimation >> >> cfgP.flagNei = 'Mass'; >> cfgP.sizeNei = 4; % Default >> >> cfgP.ensemblemethod = 'no'; >> cfgP.outputpath = *OUTPUT PATH*; >> >> if ~exist(*Path for TEprepare data object*) >> load VSdat; >> TE_Wrd = {}; >> for i = 1:nConds >> for j = 1:Nsub >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> end >> end >> clear VSdat; >> save('TE_Wrd', 'TE_Wrd'); >> end >> * >> * >> *The configuration and virtual sensor data, organized in a 3 x 15 cell >> of structures (condition by subject) are the input. The TEprepare >> substructure is added to each individual condition x subject .mat >> files' data structure which are stored on disk independently.* >> >> % Use object_to_mat_conversion.m to replace individual condition x >> subject virtual sensor data >> % .mat files with their TE_Wrd equivalent >> * >> * >> *I'm using a separate script to make some manipulations to the objects >> from disk; this will all eventually be integrated into the main >> pipeline*.*TRENTOOL seems to handle data output very differently from >> fieldtrip and I've had trouble thinking through the most logical way >> to handle the data so it's a bit haphazard right now.* >> >> load cond080sub01.mat >> >> cfgG = []; >> cfgG.dim = cond080sub01.TEprepare.optdim; >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> if isfield(cond080sub01, 'TEprepare') >> TEgroup_prepare(cfgG, fileCell); >> else >> error('Need to run TEprepare before TEgroup_prepare'); >> end >> * >> * >> *For clarification, fileCell is a cell with the name of each condition >> x subject .mat file, which as I said before is collectively the same >> as the 3 x 15 VSdat structure (condition x subject).* >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> % object_to_mat_conversion.m >> >> % TE Group Calculate >> >> load cond080sub01.mat >> if isfield(cond080sub01, 'TEgroupprepare') >> for i = 1:length(fileCell) >> TEgroup_calculate(fileCell{i}); >> end >> else >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> end >> * >> * >> *At this step I get the following error: >> >> Error using transferentropy (line 337) >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in TEgroup_calculate (line 133) >> [TEresult] = transferentropy(cfg,data);* >> >> % TE Group Stats >> >> cfgGSTAT = []; >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> cfgGSTAT.uvar = 1; >> cfgGSTAT.ivar = 2; >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> *Given the error above, I am yet to get to this step, but it does not >> seem fundamentally different from normal fieldtrip stats.* >> >> ***** >> >> In case my notes were not clear or you skipped to the bottom, *my >> primary concern is whether the error I'm getting in TEgroup_calculate >> is a pipeline issue* (I noticed the example pipeline in trentool, the >> manual, and published methods articles all seem to have slightly or >> significantly different pipeline compositions), *or if the error is* >> due to ACT, ragwitz optimization, or some other faulty >> parameterization *on my part due to a lack of understanding of how >> transfer entropy works on a more theoretical/mathematical level*. If >> the latter is the case, is there any relatively straightforward way to >> conceptualize this, or is this something where I'm just going to have >> to keep reading and rereading until it eventually makes sense? I've >> already done quite a bit of that and it hasn't pierced my thick skull >> yet but I'm sure it will eventually! >> >> Thank you so much, >> >> Max Cantor >> >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> >> _______________________________________________ >> 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: > > > ------------------------------ > > Message: 6 > Date: Tue, 9 Sep 2014 15:21:20 +0200 > From: Holger Krause > To: FieldTrip discussion list > Subject: [FieldTrip] Latest FT version on ftp-server is from three > days ago > Message-ID: <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> > Content-Type: text/plain; charset="us-ascii" > > Dear developers, > > Could you please check the process for creation/publication of zip-files on > the FTP server? The latest file I can find there is fieldtrip-20140906.zip. > > Thanks in advance, > > Holger > > > ------------------------------ > > Message: 7 > Date: Tue, 9 Sep 2014 09:19:55 -0400 > From: Max Cantor > To: FieldTrip discussion list > Subject: Re: [FieldTrip] TRENTOOL pipeline help > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > This is immensely helpful, thank you. I was very confused about why some > versions of the pipeline I saw were using group calculate and others were > using interaction delay reconstruction and what that meant, and I think I > have a more clear idea of what the different steps of the pipeline are > doing. There are still a few things I'm a bit confused about though in > terms of the pipeline. For instance, whether or not I need to do TEprepare > before group prepare, and if I need to do graph analysis (which I'm not > sure I fully understand but also haven't looked deeply into) before group > stats. > > If you don't mind me taking you up on your offer, I think seeing your > example script might help clarify some of these issues. > > Thank you! > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > Patricia.Wollstadt at gmx.de> wrote: > >> Hello Max, >> >> I added a few comments to the questions regarding individual parameters >> below. To address the general problem of TRENTOOL telling you, that there >> are not enough sample points in your data: From what I can see in your >> script, you probably don't have enough data points in each time series to >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, which >> gives you 240 samples per time series. Can you maybe avoid downsampling to >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a longer time >> window of interest? >> Note that you also 'lose' data to embedding and the interaction delay: The >> first point that can be used for TE estimation is at max. embedding length >> + max. interaction delay in samples. For example: max. embedding length = >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max interaction >> delay of 30 ms = 9 samples. In this example, you would be left with 240 - >> 29 samples for TE estimation per trial. There is also the possibility to >> estimate time resolved TE/TE for shorter time windows of interest (see >> section 4.4 in the manual); however, this method requires the use of a GPU >> for TE estimation. >> >> I would further recommend to use the new pipeline for group statistics >> described in the manual in section 4.5 (the function 'TEgroup_calculate' is >> deprecated). The new pipeline allows you to reconstruct the interaction >> delay and uses the following functions (see also comments in the script): >> >> TEgroup_prepare -> prepares all data sets (all subjects/all conditions) >> for group analysis (this means finding common embedding parameters such >> that estimates are not biased between groups) >> InteractionDelayReconstruction_calculate -> estimates TE for >> individual data sets and all assumed interaction delays u >> InteractionDelayReconstruction_analyze -> reconstructs the >> interaction delay by selecting the u that maximizes TE for each channel >> TEgroup_stats -> calculate group statistics using a permutation test >> >> I can send you an example script for group TE analysis using this pipeline >> to get you started. I hope this helps you to get the group analysis >> running. Just write again if you're having trouble setting up the pipeline >> or something is not clear about the parameters/my comments. >> >> Best, >> Patricia >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> I know trentool is not produced by the Donders Institute, so I'm not 100% >> sure if it is appropriate to ask questions about it here, but to the best >> of my knowledge they do not have a mailing list and I saw a few trentool >> questions in the archives, so I'm going to assume it's ok... >> >> In any case, below is my current pipeline (slightly modified for >> comprehensibility): >> >> (notes in bold are comments/questions made in this email, not present in >> the pipeline. Sorry in advance for the long post! Any help would be greatly >> appreciated as I'm a bit over my head on this but I think I'm close!) >> >> ***** >> >> % Prepare group TE data >> >> cfgP = []; >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> cfgP.TEcalctype = 'VW_ds'; >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> *I'm trying to find the transfer entropy between the left and right >> auditory cortices in my experiment. The input is virtual sensor data that >> was produced using SAM in fieldtrip on real MEG data. * >> >> % specify u to be scanned >> >> cfgP.predicttime_u = 30; >> cfgP.toi = [-0.4 0.4]; >> >> *For clarification, the predicttime_u is in seconds but the toi is in >> milliseconds. If I understand correctly, the predicttime_u must fit within >> the toi, but beyond that are there any benefits to it being earlier or >> later?* PW: The predictiontime_u is in milliseconds and the toi is in >> seconds. The prediction time is the assumed interaction delay between your >> two sources and should fit within your toi. In general it is preferable to >> use the method for interaction delay reconstruction for TE estimation, >> because it allows you to reconstruct the actual delay between your source >> and target times series. A non-optimal u/interaction delay may cause an >> underestimation of TE, so it is recommended to use the pipeline for >> interaction delay reconstruction whenever estimating TE for unknown delays. >> If you use the methods for interaction delay reconstruction >> 'predicttime_u' is replaced by >> cfgTEP.predicttimemin_u % minimum u to be scanned >> cfgTEP.predicttimemax_u % maximum u to be scanned >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> A large range for u values to be scanned increases computing time a lot, >> so it is best to limit the u range to values that are physiologically >> plausible. >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> cfgP.maxlag = 150; >> cfgP.actthrvalue = 7.5; >> cfgP.minnrtrials = 5; >> >> *My understanding is maxlag should be 1/2 the sampling rate, so since >> the data are downsampled to 300hz, it should be 150. I know that the sample >> rate and filters are used to determine the actthrvalue, but I don't >> actually know the calculation. 7.5 was a rough guess just to test the >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: You can >> set the actthrvalue based on the filtering you did prior to TE analysis. If >> you for example highpass filtered at 10 Hz, you shouldn't find an ACT >> higher than 30 samples, because you filtered out any components of the >> signal slower than 10 Hz/30 samples (given your sampling frequency of 300 >> Hz). So in this scenario the actthrvalue would be 30. >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials is >> needed to realize the permutation test for estimated TE values). >> >> >> % Optimization >> >> cfgP.optimizemethod = 'ragwitz'; >> cfgP.ragdim = 4:8; >> cfgP.ragtaurange = [0.2 0.4]; >> cfgP.ragtausteps = 15; >> cfgP.repPred = 100; >> >> *I am completely at a loss for this. I've done some reading into >> transfer entropy, mutual information, etc., cited in trentool, but I'm yet >> to understand how exactly this optimization works and what the >> configuration should be, given my data and experimental intentions.* PW: >> The Ragwitz criterion tries to find optimal embedding parameters dim and >> tau for the data. To do that, the method iteratively takes all possible >> combinations of dim and tau values that are provided in cfgP.ragdim and >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations embed >> the data. To test an embedding, the method builds the embedding vectors >> from the data; it then tests for each point how well the next point in time >> can be predicted from the reference point's nearest neighbours. So for each >> embedded point, the method searches for the nearest neighbours and >> calculates the average of those nearest neighbours. The difference between >> the averaged/predicted point and the actual next point is the error of the >> local predictor. The Ragwitz criterion will then return the parameter >> combination for which this error over all points is minimal. >> The parameters set the following: 'ragdim' are dimensions to be tested by >> the method (I would reccomend to start with 2:10), 'ragtaurange' together >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL will >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values here are >> factors that are later multiplied with the ACT to obtain the actual tau. >> 'repPred' is the number of points that will be used for the local >> prediction, i.e. the Ragwitz criterion will test the local prediction and >> calculate the error for the first 100 points in your time series. The two >> parameters 'flagNei' ans 'sizeNei' below specify the type of neighbour >> search conducted by the Ragwitz criterion: 'flagNei' tells the method to >> either conduct a kNN or range search; 'sizeNei' specifies the number of >> neighbours or the radius to be searched by a range search. >> >> >> % Kernel-based TE estimation >> >> cfgP.flagNei = 'Mass'; >> cfgP.sizeNei = 4; % Default >> >> cfgP.ensemblemethod = 'no'; >> cfgP.outputpath = *OUTPUT PATH*; >> >> if ~exist(*Path for TEprepare data object*) >> load VSdat; >> TE_Wrd = {}; >> for i = 1:nConds >> for j = 1:Nsub >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> end >> end >> clear VSdat; >> save('TE_Wrd', 'TE_Wrd'); >> end >> >> *The configuration and virtual sensor data, organized in a 3 x 15 cell >> of structures (condition by subject) are the input. The TEprepare >> substructure is added to each individual condition x subject .mat files' >> data structure which are stored on disk independently.* >> >> % Use object_to_mat_conversion.m to replace individual condition x subject >> virtual sensor data >> % .mat files with their TE_Wrd equivalent >> >> *I'm using a separate script to make some manipulations to the objects >> from disk; this will all eventually be integrated into the main pipeline*.* >> TRENTOOL seems to handle data output very differently from fieldtrip and >> I've had trouble thinking through the most logical way to handle the data >> so it's a bit haphazard right now.* >> >> load cond080sub01.mat >> >> cfgG = []; >> cfgG.dim = cond080sub01.TEprepare.optdim; >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> if isfield(cond080sub01, 'TEprepare') >> TEgroup_prepare(cfgG, fileCell); >> else >> error('Need to run TEprepare before TEgroup_prepare'); >> end >> >> *For clarification, fileCell is a cell with the name of each condition x >> subject .mat file, which as I said before is collectively the same as the 3 >> x 15 VSdat structure (condition x subject).* >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> % object_to_mat_conversion.m >> >> % TE Group Calculate >> >> load cond080sub01.mat >> if isfield(cond080sub01, 'TEgroupprepare') >> for i = 1:length(fileCell) >> TEgroup_calculate(fileCell{i}); >> end >> else >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> end >> >> >> >> >> >> >> >> *At this step I get the following error: Error using transferentropy (line >> 337) \nTRENTOOL ERROR: not enough data points left after embedding Error in >> TEgroup_calculate (line 133) [TEresult] = transferentropy(cfg,data);* >> >> % TE Group Stats >> >> cfgGSTAT = []; >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> cfgGSTAT.uvar = 1; >> cfgGSTAT.ivar = 2; >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> *Given the error above, I am yet to get to this step, but it does not >> seem fundamentally different from normal fieldtrip stats.* >> >> ***** >> >> In case my notes were not clear or you skipped to the bottom, *my >> primary concern is whether the error I'm getting in TEgroup_calculate is a >> pipeline issue* (I noticed the example pipeline in trentool, the manual, >> and published methods articles all seem to have slightly or significantly >> different pipeline compositions), *or if the error is* due to ACT, >> ragwitz optimization, or some other faulty parameterization *on my part >> due to a lack of understanding of how transfer entropy works on a more >> theoretical/mathematical level*. If the latter is the case, is there any >> relatively straightforward way to conceptualize this, or is this something >> where I'm just going to have to keep reading and rereading until it >> eventually makes sense? I've already done quite a bit of that and it hasn't >> pierced my thick skull yet but I'm sure it will eventually! >> >> Thank you so much, >> >> Max Cantor >> >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> >> _______________________________________________ >> fieldtrip mailing >> listfieldtrip at donders.ru.nlhttp://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 >> > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > -------------- 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 46, Issue 3 > **************************************** > Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From clara.scholl at gmail.com Wed Sep 10 16:56:38 2014 From: clara.scholl at gmail.com (Clara A. Scholl) Date: Wed, 10 Sep 2014 10:56:38 -0400 Subject: [FieldTrip] data.sampleinfo when preprocessing was completed in EEGLAB In-Reply-To: References: Message-ID: Dear Eelke, Thank you! Just to clarify: when I use ft_mvaranalysis to perform multivariate autoregressive modeling on time series data over multiple trials, the relative temporal adjacency of each trial (assumed to be consecutive segments, when this is not the case) has no impact on the resulting autoregressive coefficients and the covariance of the residuals? Respectfully, Clara On Wed, Sep 10, 2014 at 4:49 AM, Eelke Spaak wrote: > Dear Clara, > > 1) Some FT functions require a sampleinfo for their inner workings, so > they reconstruct it in a simple way if it is not present. You can > safely ignore this warning if you are not doing anything with sample > indices yourself. Specifically, the FT artifact and event functions > use sample indices (i.e. return segments of artifacts/events in terms > of samples relative to the original recording), if you are not using > these you are probably safe. > > 2) Not me ;) > > Best, > Eelke > > On 9 September 2014 21:25, Clara A. Scholl wrote: > > Dear FieldTrip Community, > > > > I did preprocessing in EEGLAB and imported into FieldTrip using > > eeglab2fieldtrip (from EEGLAB version 13.3.2b). The resulting FieldTrip > > data structures do not have the data field "sampleinfo" to specify the > > position of each trial relative to the actual recording. As a result of > > this, I get the warning "reconstructing sampleinfo by assuming that the > > trials are consecutive segments of a continuous recording" when calling > the > > functions ft_timelockanalysis and ft_mvaranalysis. > > > > My questions are twofold: > > > > 1) when can I ignore this warning? > > 2) has anyone imported the sampleinfo into FieldTrip from an EEGLAB EEG > > structure? Any guidance on the best way to do this? > > > > Thanks immensely for feedback! > > Respectfully, > > Clara > > > > _______________________________________________ > > 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 eelke.spaak at donders.ru.nl Thu Sep 11 09:55:25 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 11 Sep 2014 09:55:25 +0200 Subject: [FieldTrip] data.sampleinfo when preprocessing was completed in EEGLAB In-Reply-To: References: Message-ID: Correct :) On 10 September 2014 16:56, Clara A. Scholl wrote: > Dear Eelke, > > Thank you! Just to clarify: when I use ft_mvaranalysis to perform > multivariate autoregressive modeling on time series data over multiple > trials, the relative temporal adjacency of each trial (assumed to be > consecutive segments, when this is not the case) has no impact on the > resulting autoregressive coefficients and the covariance of the residuals? > > Respectfully, > Clara > > > On Wed, Sep 10, 2014 at 4:49 AM, Eelke Spaak > wrote: >> >> Dear Clara, >> >> 1) Some FT functions require a sampleinfo for their inner workings, so >> they reconstruct it in a simple way if it is not present. You can >> safely ignore this warning if you are not doing anything with sample >> indices yourself. Specifically, the FT artifact and event functions >> use sample indices (i.e. return segments of artifacts/events in terms >> of samples relative to the original recording), if you are not using >> these you are probably safe. >> >> 2) Not me ;) >> >> Best, >> Eelke >> >> On 9 September 2014 21:25, Clara A. Scholl wrote: >> > Dear FieldTrip Community, >> > >> > I did preprocessing in EEGLAB and imported into FieldTrip using >> > eeglab2fieldtrip (from EEGLAB version 13.3.2b). The resulting FieldTrip >> > data structures do not have the data field "sampleinfo" to specify the >> > position of each trial relative to the actual recording. As a result of >> > this, I get the warning "reconstructing sampleinfo by assuming that the >> > trials are consecutive segments of a continuous recording" when calling >> > the >> > functions ft_timelockanalysis and ft_mvaranalysis. >> > >> > My questions are twofold: >> > >> > 1) when can I ignore this warning? >> > 2) has anyone imported the sampleinfo into FieldTrip from an EEGLAB EEG >> > structure? Any guidance on the best way to do this? >> > >> > Thanks immensely for feedback! >> > Respectfully, >> > Clara >> > >> > _______________________________________________ >> > 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 luke.bloy at gmail.com Thu Sep 11 18:30:57 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Thu, 11 Sep 2014 12:30:57 -0400 Subject: [FieldTrip] topoplot_common Message-ID: Is there a reason that topoplot_common doesn't support 'raw' datatypes. I have been using ft_topoplotER to plot topos at particular time windows in continuous raw datasets. This recently broke after an update. the error happens in ft_datatype_comp trying to convert my 'raw' to a 'comp' datatype. If i add 'raw' to the list of supported datatypes, https://github.com/fieldtrip/fieldtrip/blob/master/private/topoplot_common.m#L74 , everything seems to work fine? Thanks Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From agreene24 at gmail.com Fri Sep 12 14:39:43 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Fri, 12 Sep 2014 21:39:43 +0900 Subject: [FieldTrip] ft_rejectvisual: removing trials marked as bad In-Reply-To: <3C365782-4B07-4EFE-A921-99489BDD5DA6@live.ucl.ac.uk> References: <3C365782-4B07-4EFE-A921-99489BDD5DA6@live.ucl.ac.uk> Message-ID: Hi Emilie, Thanks!! I, of course, completely overlooked that. Ashley On Tue, Sep 9, 2014 at 3:37 PM, Caspar, Emilie wrote: > Hi Ashley, > > Maybe the mistake is you did not integrate in your script the command to > save the rejection. Normally, with the following command, you will see in > the Matlab Window that artifacts are correctly rejected after the "quit" > button. > > clean_data = ft_rejectvisual(cfg, interpoldata); > cfg.artfctdef.reject = 'complete'; > cfg.artfctdef.feedback = 'yes'; > cleandata = ft_rejectartifact(cfg,clean_data); > > Emilie > > > > > > Le 3 sept. 2014 à 11:58, Ashley Greene a écrit : > > Hello, > > I have used the rejectvisual function in attempt to remove bad trials, > but after marking them and pressing the quit button, although the command > window states that the selected trials have been removed, there is no > obvious change in the data; all of the trials are still intact. Have I > overlooked something? > > Thanks, > > Ashley > _______________________________________________ > 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 tobiastrame at uni-muenster.de Fri Sep 12 18:23:17 2014 From: tobiastrame at uni-muenster.de (Tobias Trame) Date: Fri, 12 Sep 2014 18:23:17 +0200 (CEST) Subject: [FieldTrip] Read only EEG data from combined MEG/EEG ctf file Message-ID: Hi everybody! I'm trying to read only the EEG data from a combined MEG/EEG ctf file in order to create leadfields later on, but the function "ft_read_sens" just returns the gradiometer information in a 'grad' field. It searches for an 'elec'-field in the header of the data which is not present. Is there a configuration to get the EEG-elecrodes by using "ft_read_sens"? My first attempt was to write the EEG-Information from the header by hand using the following code: hdr = ft_read_header('subject.ds', 'headerformat', 'ctf_ds'); elec.elecpos = [hdr.orig.eeg.pos]'; elec.chanpos = [hdr.orig.eeg.pos]'; elec.label = {hdr.orig.eeg.name}'; elec.type = 'eeg'; elec.unit = 'cm'; But now I get a similar problem if I want to create leadfields from timelock data. After doing the timelock analysis using timelock_data = ft_timelockanalysis(cfg, mydata); the structure timelock_data contains just a 'grad' and no 'elec' field so that ft_prepare_leadfield(cfg, timelock_data) always ignores the EEG-elecrodes and tries to use the gradiometes - even if I put the electrodes defined above into cfg.elec. Thanks for any suggestions! Tobias From j.herring at fcdonders.ru.nl Mon Sep 15 12:01:02 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Mon, 15 Sep 2014 12:01:02 +0200 (CEST) Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' In-Reply-To: <20140910140714.9n2t9bxs008o400c@imap.uni-ulm.de> Message-ID: <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> Dear Barbara, The error seems to be related to a bug that pops up now and then (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a corrupt installation of fieldtrip and/or the need to update fieldtrip. Could you please try downloading the most recent version of fieldtrip and see if the problem persists? For an example of what can be expected from this function see: Esser SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. Best, Jim ----- Oorspronkelijk bericht ----- > Van: "barbara schorr" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 10 september 2014 14:07:14 > Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' > Dear fieldtripers. > > as mentioned in the subject line I would like to anaylse my timelocked > ERP Data with the function ft_globalmeanfield. > > I get the Error: Undefined function or variable 'abort' > Error in ft_globalmeanfield (line84) > if abort > > in the function it says: > > %the abort variable is set to true or false in ft_preamble_inti > if abort > % do not continue function execution in case the outputfile is > present and the user indicated to keep it > return > end > > > I don't understand what this means. I would really appreciate your > help to get this running. > > Also, what is the result when I run this function on my data? (This > method was proposed from a reviewer. I never used it before, so I > don't exactly know what it does and what the result will look like). > > Thank you very much in advance! > > Best, > > Barbara Schorr > > > > > Zitat von 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: Question regarding nonparametric testing for coherence > > differences (Eric Maris) > > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) > > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) > > 4. Re: ft_rejectvisual: removing trials marked as bad > > (Caspar, Emilie) > > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) > > 6. Latest FT version on ftp-server is from three days ago > > (Holger Krause) > > 7. Re: TRENTOOL pipeline help (Max Cantor) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) > > From: "Eric Maris" > > To: , "'FieldTrip discussion list'" > > > > Subject: Re: [FieldTrip] Question regarding nonparametric testing > > for > > coherence differences > > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> > > Content-Type: text/plain; charset="utf-8" > > > > Dear Hwee Ling, > > > > > > > > In the paper you refer to (Maris et al, JNM, 2007), I did not > > perform a > > cluster-based permutation test at the level of the channel pairs. > > Instead, > > all coherences mentioned in the paper are coherence between a single > > EMG > > channel (2 electrodes mounted on the forearm) and all MEG > > electrodes. Thus, > > there are as many EMG-MEG coherences as there are MEG channels (275 > > in our > > lab), and the clustering of these coherences involves the same > > neighbourhood > > structure as the clustering of channel-specific statistics on power > > or > > evoked response. The analysis you propose involves clustering in a > > much more > > complex space, namely the formed by all (MEG,MEG) channel pairs > > (275*275=75625 pairs). In the early days of cluster-based > > permutation > > statistics, I have worked on this problem but did not pursue it > > because the > > resulting clusters are very hard to interpret. > > > > > > > > Best, > > > > > > > > Eric Maris > > > > > > > > > > > > Dear all and Prof Maris, > > > > I'm re-posting this question again, as I didn't get any replies > > previously. > > > > I?m interested to investigate if there are any differences in phase > > synchronization in resting state data at timepoint 2 versus > > timepoint 1. The > > EEG data was collected using 64 EEG channels, resting state, eyes > > opened and > > eyes closed. I?ve arbitrarily segmented the resting state data into > > epochs > > of 2s each, and the epochs with artifacts are excluded completely > > from > > further analyses. I then performed mtmfft to get the fourier > > representation > > of the data, extracted the coherence, and compared the coherence > > difference > > of timepoint 2 versus timepoint 1 of all channels paired with all > > other > > channels. > > > > I figured that if I extract the connectivity analyses without > > specifying the > > channelcmb, I get a 'chan_chan_freq' dimord variable that would > > allow me to > > perform cluster-based statistical analyses. I get an output with > > ?chan_chan? > > dimord variable. However, I was not 100% sure that this is correct, > > hence, I?ve > > inserted my code (see below). It?ll be great if you could tell me if > > what I?m > > doing makes any sense at all. Also, I don?t know how I can plot the > > results > > to see if it make any sense at all. > > > > Also, I checked the values obtained from when I specified > > "cfg.channelcmb" > > and when I did not specify "cfg.channelcmb", I noticed that the > > values were > > somehow different. I would assume that the values to be similar, > > although > > I'm not sure why they would have differences in the values obtained > > from > > specifying "cfg.channelcmb". > > > > This is my code that I've used thus far: > > > > for sub = 1:5 > > > > cfg = []; > > > > cfg.output = 'fourier'; > > > > cfg.channel = {'all'}; > > > > cfg.method = 'mtmfft'; > > > > cfg.keeptrials = 'yes'; > > > > cfg.tapsmofrq = 5; > > > > cfg.foilim = [0 100]; > > > > cfg.taper = 'dpss'; > > > > % find the index for the c200 condition > > > > pre_c200_idx = find(data5.trialinfo == 201); > > > > cfg.trials = pre_c200_idx; > > > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > > > post_c200_idx = find(data5.trialinfo == 200); > > > > cfg.trials = post_c200_idx; > > > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > > > > > cfg = []; > > > > cfg.keeptrials = 'no'; > > > > cfg.channel = {'all'}; > > > > cfg.removemean = 'yes'; > > > > cfg.method = 'coh'; > > > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_pre_c200); > > > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_post_c200); > > > > end > > > > > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); > > > > cfg_neighb.method = 'template'; > > > > cfg_neighb.layout = lay; > > > > cfg_neighb.channel = 'all'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, > > sub_HLF_pre_c200coh{1}); > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.neighbours = neighbours; > > > > cfg.channel = 'all'; > > > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > > > cfg.latency = 'all'; > > > > cfg.avgovertime = 'no'; > > > > cfg.avgoverchan = 'no'; > > > > cfg.parameter = 'cohspctrm'; > > > > cfg.method = 'montecarlo'; > > > > cfg.statistic = 'depsamplesT'; > > > > cfg.correctm = 'cluster'; > > > > cfg.tail = 0; > > > > % cfg.clustertail = 0; > > > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 > > frequency > > bands. > > > > cfg.numrandomization = 10000; > > > > cfg.ivar = 2; > > > > cfg.uvar = 1; > > > > > > > > % design matrices > > > > clear design; > > > > design(1,:) = [1:5, 1:5]; > > > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > > > cfg.design = design; > > > > % for theta band > > > > cfg.avgoverfreq = 'yes'; > > > > cfg.frequency = [4 8]; % I also performed the statistics for delta > > (2-4), > > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma > > (30-40), > > and gamma (40-100). > > > > [diffc200_theta_stat] = ft_freqstatistics(cfg, > > sub_HLF_post_c200coh{:}, > > sub_HLF_pre_c200coh{:}); > > > > > > > > When I tried to plot the results, I used this code: > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.layout = 'lay'; > > > > cfg.zlim = [-1 1]; > > > > cfg.alpha = 0.05; > > > > cfg.refchannel = 'all'; > > > > ft_clusterplot(cfg, diffc200_theta_stat); > > > > However, I was not sure how I could plot the results. I get an error > > message > > from Fieldtrip when using ft_clusterplot: > > > > Error using topoplot_common (line 366) > > > > no reference channel is specified > > > > Error in ft_topoplotTFR (line 192) > > > > [cfg] = topoplot_common(cfg, varargin{:}); > > > > Error in ft_clusterplot (line 372) > > > > ft_topoplotTFR(cfgtopo, stat); > > > > > > > > According to your paper in 2007, the topoplot of the results were > > masked by > > the spatio-spectral pattern of the significant clusters. I don't > > know how to > > do this, and I would really appreciate if you can show me how to > > make such a > > plot. > > > > Thank you very much. > > > > Kind regards, > > > > Hweeling > > > > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 2 > > Date: Mon, 8 Sep 2014 21:38:01 +0200 > > From: KatrinH Heimann > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > Dear Joseph, thanks so much, I really appreciate your help. I was > > also > > wandering, if maybe there is another bug in my code. > > Our nets are 128 channels, Hydrocel, but as a colleague of me > > adviced me to > > do so, I also tried the 129 layout. > > My code you find below (without selection of bad channels etc.) > > If you need also the data of two subjects to have a look, let me > > know!!! > > Best and thanks really! > > Katrin > > > > > > subject=input('Which subject do you want to analyse? ','s'); > > > > name = strcat(subject,'.raw'); > > > > subjectnumber=input('Which is the subjectnumber?', 's'); > > > > sb=subjectnumber > > > > %subjectnumber = strcat(subjectnumber, '.txt') > > > > %% > > > > > > cfg = []; > > > > cfg.dataset = name; > > > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > > > cfg.trialdef.eventtype = 'trigger'; > > > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > > trigger > > > > cfg.trialdef.prestim = 0.234; % in seconds > > > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > > observation, but maybe we need less) > > > > cfg = ft_definetrial(cfg); > > > > > > cfg.trl([1:7],:) = []; > > > > > > %change timeline according to constant offset of 16 ms = 8 samples > > (because > > recorded with 500 hz)in > > > > %structure trial > > > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > > > > %change timeline to make the cut the zeropoint > > > > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > > > > > %% preprocess data > > > > cfg.channel = 'all'; > > > > cfg.preproc.detrend = 'yes'; > > > > cfg.preproc.demean = 'yes'; > > > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > > filtered > > > > %(0.1-45) and bad channels have to be replaced!!!! > > > > %cfg.preproc.bpfreq = [6 32]; > > > > % > > > > % > > > > obs_data = ft_preprocessing(cfg); > > > > % > > > > save (strcat(sb,'obs_data') , 'obs_data') > > > > > > %% determining channel neighbours (necessary for Artifact detection) > > > > cfg = []; > > > > cfg.channel = obs_data.label; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.feedback = 'yes'; > > > > lay = ft_prepare_layout(cfg); > > > > > > > > cfg_neighb = []; > > > > cfg_neighb.feedback = 'yes'; > > > > > > cfg_neighb.method = 'triangulation'; > > > > cfg_neighb.layout = 'GSN128.sfp'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > > > > > %% Preparing neighbours for channel repair - but bad channel info > > in!!! > > > > > > % cfg_neighb = []; > > > > % cfg_neighb.feedback = 'yes'; > > > > % cfg_neighb.method = 'triangulation'; > > > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > % Interpolate and put into new data structure > > > > cfg = []; > > > > cfg.badchannel = {}; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.method = 'nearest'; > > > > cfg.neighbours = neighbours; > > > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > > > > % Check reconstruction > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > % dat1=obs_data; > > > > % dat2=obs_data_channelrepaired; > > > > % > > > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > > > % y=dat2.trial{1}(62,:); > > > > % plot(x);hold on;plot(y,'r'); > > > > % > > > > % x=dat1.trial{1}(72,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > % > > > > % x=dat1.trial{1}(75,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > %% artifact rejection/trial inspection - throw out electrode jumps > > etc. > > > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > > according to > > channels interpolated %% 128-number of interp. channels) > > > > > > > > cfg = []; > > > > cfg.channel = {'all'}; > > > > cfg.numcomponent = 128 > > > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > > > save (strcat(sb,'comp_all') , 'comp') > > > > > > %% > > > > cfg = []; > > > > cfg.viewmode = 'component'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='some'; > > > > cfg.layout = 'GSN128.sfp'; > > > > ft_databrowser(cfg,comp); > > > > > > %% poweranalysis components > > > > cfg = []; > > > > cfg.output = 'pow'; > > > > cfg.channel = 'all';%compute the power spectrum in all ICs > > > > cfg.method = 'mtmfft'; > > > > cfg.taper = 'hanning'; > > > > cfg.foi = 0:0.2:50; > > > > obs_freq = ft_freqanalysis(cfg, comp); > > > > > > %And you can plot the spectra: > > > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > nsubplots = 16; > > > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > > decimals, type > > doc subplot > > > > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > > > tot = Nfigs*nsubplots; > > > > > > rptvect = 1:size(comp.topo,1); > > > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > > > > for r=1:size(rptvect,1); > > > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 > > 1]);%full > > screen > > > > k=0; > > > > for j=1:size(rptvect,2); > > > > if~(rptvect(r,j)==0); > > > > k=k+1; > > > > cfg=[]; > > > > cfg.channel = rptvect(r,j); > > > > cfg.ylim =[0 500] > > > > cfg.xlim =[0 50] > > > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > > > end > > > > end > > > > end > > > > > > %For the IC topos you'll follow the same logic as above but with: > > > > > > figure > > > > cfg = []; > > > > cfg.component = [1:20]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [21:40]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [41:60]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [61:80]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > > > > > > > > > %% Seperate observation conditions > > > > > > name1= strcat(num2str(sb),'_90.xls'); > > > > list1=xlsread (name1) > > > > > > > > > > > > name2= strcat(num2str(sb),'_180.xls'); > > > > list2=xlsread (name2) > > > > > > > > % > > > > > > cfg = [] > > > > cfg.trials = [list1] > > > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > cfg = [] > > > > cfg.trials = [list2] > > > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > %%PIPELINE FOR obs90 > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128; > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > > obs90_data); > > > > > > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > > > > > > %% Artifacts - final detection > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > > > > %% plot it > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > > > > > > > > > %% PIPELINE FOR obs180 > > > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128 > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > > obs180_data); > > > > > > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > > > > > > %% Artifacts final 180 > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > > > > %% plot 180 ERP > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs180_data_ERP) > > > > > > %% plot both ERPs > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > cfg.showlabels = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > > > > %% plot difference wave > > > > > > difference = obs180_data_ERP; % copy one of the > > structures > > > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute > > the > > difference ERP > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, difference) > > > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > > > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI > >> data. A couple things. First of all, exactly which net do you use? > >> If > >> they are 129-channel, there is still the question of whether they > >> are the > >> Hydrocel or the older geodesic nets. Regardless, that shouldn't > >> cause an > >> error like this. Could you send me the file you are trying to > >> process and > >> the script you are using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < > >> diezmartini at gmail.com> wrote: > >> > >> Which nets do you use? I use EGI. I tried both the ones you mention > >> and > >> they didn't work. It was hard to find that exact one online but it > >> was the > >> only file that actually worked. > >> > >> > >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >> > >> wrote: > >> > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. > >>> Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one > >>> > >>>> I use > >>>> > >>>> > >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < > >>>> katrinheimann at gmail.com> wrote: > >>>> > >>>>> Dear all, my problems seem neverending. This time however i > >>>>> really need > >>>>> help. > >>>>> I implemented a pipeline for ERPs. All works now, > >>>>> trialdefinition, > >>>>> preprocessing, channelreplacement, ica, componentrejection, > >>>>> final > >>>>> artifactdetection, timelock of the single subject data. However, > >>>>> when I > >>>>> wanna compute the grandaverage of the single subjects I get the > >>>>> following > >>>>> error message: > >>>>> > >>>>> computing average of avg over 19 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 3 MB > >>>>> computing average of avg over 2 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_prepare_layout" took 0 seconds and required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_topoplotER" took 0 seconds and required the > >>>>> additional > >>>>> allocation of an estimated 0 MB > >>>>> > >>>>> Furthermore in the plot of the significant clusters, the > >>>>> channelnames > >>>>> are mixed up (do not correspond to my net) > >>>>> > >>>>> > >>>>> I guess that there is a problem with the layout I use. > >>>>> Here the code that I use > >>>>> > >>>>> %For generating the layout (also in the single subjects): > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = obs_data.label; > >>>>> > >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>>>> > >>>>> cfg.feedback = 'yes'; > >>>>> > >>>>> lay = ft_prepare_layout(cfg); > >>>>> > >>>>> > >>>>> cfg_neighb = []; > >>>>> > >>>>> cfg_neighb.feedback = 'yes'; > >>>>> > >>>>> cfg_neighb.method = 'triangulation'; > >>>>> > >>>>> cfg_neighb.layout = lay; > >>>>> > >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>>>> > >>>>> > >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>>>> > >>>>> > >>>>> %For computing the grand average > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = 'all'; > >>>>> > >>>>> cfg.latency = 'all'; > >>>>> > >>>>> cfg.parameter = 'avg'; > >>>>> > >>>>> cfg.keepindividual = 'no' > >>>>> > >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>>>> > >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>>>> > >>>>> % "{:}" means to use data from all elements of the variable > >>>>> > >>>>> > >>>>> For plotting the significant clusters > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.style = 'blank'; > >>>>> > >>>>> cfg.layout = lay; > >>>>> > >>>>> cfg.channellabels = 'yes'; > >>>>> > >>>>> cfg.highlight = 'labels'; > >>>>> > >>>>> cfg.highlightchannel = find(stat.mask); > >>>>> > >>>>> cfg.comment = 'no'; > >>>>> > >>>>> figure; ft_topoplotER(cfg, GA_90) > >>>>> > >>>>> title('Nonparametric: significant with cluster multiple > >>>>> comparison > >>>>> correction') > >>>>> > >>>>> > >>>>> Do you have ANY idea to this? I am really completely > >>>>> helpless.... > >>>>> > >>>>> thanks and best > >>>>> > >>>>> Katrin > >>>>> > >>>>> _______________________________________________ > >>>>> 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 > >>> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> > >> -------------------------------------------------------------------------------- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.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: > > > > > > ------------------------------ > > > > Message: 3 > > Date: Mon, 08 Sep 2014 21:55:44 -0400 > > From: Joseph Dien > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> > > Content-Type: text/plain; charset="windows-1252" > > > > yes, please do send me the data. > > > > Thanks! > > > > Joe > > > > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann > > wrote: > > > >> Dear Joseph, thanks so much, I really appreciate your help. I was > >> also wandering, if maybe there is another bug in my code. > >> Our nets are 128 channels, Hydrocel, but as a colleague of me > >> adviced me to do so, I also tried the 129 layout. > >> My code you find below (without selection of bad channels etc.) > >> If you need also the data of two subjects to have a look, let me > >> know!!! > >> Best and thanks really! > >> Katrin > >> > >> > >> > >> subject=input('Which subject do you want to analyse? ','s'); > >> > >> name = strcat(subject,'.raw'); > >> > >> subjectnumber=input('Which is the subjectnumber?', 's'); > >> > >> sb=subjectnumber > >> > >> %subjectnumber = strcat(subjectnumber, '.txt') > >> > >> %% > >> > >> > >> > >> cfg = []; > >> > >> cfg.dataset = name; > >> > >> cfg.trialfun = 'ft_trialfun_general'; % this is the default > >> > >> cfg.trialdef.eventtype = 'trigger'; > >> > >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > >> trigger > >> > >> cfg.trialdef.prestim = 0.234; % in seconds > >> > >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > >> observation, but maybe we need less) > >> > >> cfg = ft_definetrial(cfg); > >> > >> > >> > >> cfg.trl([1:7],:) = []; > >> > >> > >> > >> %change timeline according to constant offset of 16 ms = 8 samples > >> (because recorded with 500 hz)in > >> > >> %structure trial > >> > >> cfg.trl(:,3)=cfg.trl(:,3)-8 > >> > >> > >> > >> %change timeline to make the cut the zeropoint > >> > >> > >> > >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; > >> > >> > >> > >> > >> > >> %% preprocess data > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.detrend = 'yes'; > >> > >> cfg.preproc.demean = 'yes'; > >> > >> cfg.preproc.baselinewindow = [-2.1 -2.0] > >> > >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > >> filtered > >> > >> %(0.1-45) and bad channels have to be replaced!!!! > >> > >> %cfg.preproc.bpfreq = [6 32]; > >> > >> % > >> > >> % > >> > >> obs_data = ft_preprocessing(cfg); > >> > >> % > >> > >> save (strcat(sb,'obs_data') , 'obs_data') > >> > >> > >> > >> %% determining channel neighbours (necessary for Artifact > >> detection) > >> > >> cfg = []; > >> > >> cfg.channel = obs_data.label; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.feedback = 'yes'; > >> > >> lay = ft_prepare_layout(cfg); > >> > >> > >> cfg_neighb = []; > >> > >> cfg_neighb.feedback = 'yes'; > >> > >> > >> > >> cfg_neighb.method = 'triangulation'; > >> > >> cfg_neighb.layout = 'GSN128.sfp'; > >> > >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> obs_data.elec = ft_read_sens('GSN128.sfp'); > >> > >> > >> > >> %% Artifacts - to detect bad channels - is not saved!!! > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs_data_try = ft_rejectvisual(cfg, obs_data); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_try = ft_rejectartifact (cfg,obs_data); > >> > >> > >> > >> > >> > >> %% Preparing neighbours for channel repair - but bad channel info > >> in!!! > >> > >> > >> > >> % cfg_neighb = []; > >> > >> % cfg_neighb.feedback = 'yes'; > >> > >> % cfg_neighb.method = 'triangulation'; > >> > >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > >> > >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> % Interpolate and put into new data structure > >> > >> cfg = []; > >> > >> cfg.badchannel = {}; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.method = 'nearest'; > >> > >> cfg.neighbours = neighbours; > >> > >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >> > >> > >> > >> % Check reconstruction > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> % dat1=obs_data; > >> > >> % dat2=obs_data_channelrepaired; > >> > >> % > >> > >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > >> > >> % y=dat2.trial{1}(62,:); > >> > >> % plot(x);hold on;plot(y,'r'); > >> > >> % > >> > >> % x=dat1.trial{1}(72,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> % > >> > >> % x=dat1.trial{1}(75,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> %% artifact rejection/trial inspection - throw out electrode jumps > >> etc. > >> > >> > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > >> according to channels interpolated %% 128-number of interp. > >> channels) > >> > >> > >> cfg = []; > >> > >> cfg.channel = {'all'}; > >> > >> cfg.numcomponent = 128 > >> > >> comp = ft_componentanalysis(cfg,obs_data_clean1); > >> > >> save (strcat(sb,'comp_all') , 'comp') > >> > >> > >> > >> %% > >> > >> cfg = []; > >> > >> cfg.viewmode = 'component'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='some'; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> ft_databrowser(cfg,comp); > >> > >> > >> > >> %% poweranalysis components > >> > >> cfg = []; > >> > >> cfg.output = 'pow'; > >> > >> cfg.channel = 'all';%compute the power spectrum in all ICs > >> > >> cfg.method = 'mtmfft'; > >> > >> cfg.taper = 'hanning'; > >> > >> cfg.foi = 0:0.2:50; > >> > >> obs_freq = ft_freqanalysis(cfg, comp); > >> > >> > >> > >> %And you can plot the spectra: > >> > >> > >> > >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > >> > >> nsubplots = 16; > >> > >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > >> decimals, type doc subplot > >> > >> > >> > >> Nfigs = ceil(size(comp.topo,1)/nsubplots); > >> > >> tot = Nfigs*nsubplots; > >> > >> > >> > >> rptvect = 1:size(comp.topo,1); > >> > >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > >> > >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; > >> > >> > >> > >> for r=1:size(rptvect,1); > >> > >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 > >> 1]);%full screen > >> > >> k=0; > >> > >> for j=1:size(rptvect,2); > >> > >> if~(rptvect(r,j)==0); > >> > >> k=k+1; > >> > >> cfg=[]; > >> > >> cfg.channel = rptvect(r,j); > >> > >> cfg.ylim =[0 500] > >> > >> cfg.xlim =[0 50] > >> > >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > >> > >> end > >> > >> end > >> > >> end > >> > >> > >> > >> %For the IC topos you'll follow the same logic as above but with: > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [1:20]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [21:40]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [41:60]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [61:80]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% Seperate observation conditions > >> > >> > >> > >> name1= strcat(num2str(sb),'_90.xls'); > >> > >> list1=xlsread (name1) > >> > >> > >> > >> name2= strcat(num2str(sb),'_180.xls'); > >> > >> list2=xlsread (name2) > >> > >> > >> % > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list1] > >> > >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list2] > >> > >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> %%PIPELINE FOR obs90 > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128; > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> > >> > >> comp_1 = ft_componentanalysis(cfg, obs90_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > >> obs90_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts - final detection > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs90_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > >> > >> > >> > >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > >> > >> > >> > >> %% plot it > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% PIPELINE FOR obs180 > >> > >> > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128 > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> comp_2 = ft_componentanalysis(cfg, obs180_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > >> obs180_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts final 180 > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs180_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > >> > >> > >> > >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > >> > >> > >> > >> %% plot 180 ERP > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs180_data_ERP) > >> > >> > >> > >> %% plot both ERPs > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> cfg.showlabels = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > >> > >> > >> > >> %% plot difference wave > >> > >> > >> > >> difference = obs180_data_ERP; % copy one of > >> the structures > >> > >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % > >> compute the difference ERP > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, difference) > >> > >> > >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI data. A couple things. First of all, exactly which net do > >> you use? If they are 129-channel, there is still the question of > >> whether they are the Hydrocel or the older geodesic nets. > >> Regardless, that shouldn't cause an error like this. Could you > >> send me the file you are trying to process and the script you are > >> using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini > >> wrote: > >> > >>> Which nets do you use? I use EGI. I tried both the ones you > >>> mention and they didn't work. It was hard to find that exact one > >>> online but it was the only file that actually worked. > >>> > >>> > >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >>> wrote: > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one I use > >>> > >>> > >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > >>> wrote: > >>> Dear all, my problems seem neverending. This time however i really > >>> need help. > >>> I implemented a pipeline for ERPs. All works now, trialdefinition, > >>> preprocessing, channelreplacement, ica, componentrejection, final > >>> artifactdetection, timelock of the single subject data. However, > >>> when I wanna compute the grandaverage of the single subjects I get > >>> the following error message: > >>> > >>> computing average of avg over 19 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 3 MB > >>> computing average of avg over 2 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 0 MB > >>> the call to "ft_prepare_layout" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> the call to "ft_topoplotER" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> > >>> Furthermore in the plot of the significant clusters, the > >>> channelnames are mixed up (do not correspond to my net) > >>> > >>> > >>> I guess that there is a problem with the layout I use. > >>> Here the code that I use > >>> > >>> %For generating the layout (also in the single subjects): > >>> cfg = []; > >>> > >>> cfg.channel = obs_data.label; > >>> > >>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>> > >>> cfg.feedback = 'yes'; > >>> > >>> lay = ft_prepare_layout(cfg); > >>> > >>> > >>> cfg_neighb = []; > >>> > >>> cfg_neighb.feedback = 'yes'; > >>> > >>> cfg_neighb.method = 'triangulation'; > >>> > >>> cfg_neighb.layout = lay; > >>> > >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>> > >>> > >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>> > >>> > >>> > >>> %For computing the grand average > >>> > >>> cfg = []; > >>> > >>> cfg.channel = 'all'; > >>> > >>> cfg.latency = 'all'; > >>> > >>> cfg.parameter = 'avg'; > >>> > >>> cfg.keepindividual = 'no' > >>> > >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>> > >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>> > >>> % "{:}" means to use data from all elements of the variable > >>> > >>> > >>> For plotting the significant clusters > >>> > >>> cfg = []; > >>> > >>> cfg.style = 'blank'; > >>> > >>> cfg.layout = lay; > >>> > >>> cfg.channellabels = 'yes'; > >>> > >>> cfg.highlight = 'labels'; > >>> > >>> cfg.highlightchannel = find(stat.mask); > >>> > >>> cfg.comment = 'no'; > >>> > >>> figure; ft_topoplotER(cfg, GA_90) > >>> > >>> title('Nonparametric: significant with cluster multiple comparison > >>> correction') > >>> > >>> > >>> > >>> Do you have ANY idea to this? I am really completely helpless.... > >>> > >>> thanks and best > >>> > >>> Katrin > >>> > >>> > >>> _______________________________________________ > >>> 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 > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> -------------------------------------------------------------------------------- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.com > >> > >> > >> _______________________________________________ > >> 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 > > > > -------------------------------------------------------------------------------- > > > > Joseph Dien, PhD > > Research Associate > > Cognitive Neurology > > The Johns Hopkins University School of Medicine > > > > Lab E-mail: jdien1 at jhmi.edu > > Private E-mail: jdien07 at mac.com > > Office Phone: 410-614-3115 > > Cell Phone: 202-297-8117 > > Fax: 410-955-0188 > > http://joedien.com > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 4 > > Date: Tue, 9 Sep 2014 06:37:13 +0000 > > From: "Caspar, Emilie" > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > > bad > > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi Ashley, > > > > Maybe the mistake is you did not integrate in your script the > > command to save the rejection. Normally, with the following command, > > you will see in the Matlab Window that artifacts are correctly > > rejected after the "quit" button. > > > > clean_data = ft_rejectvisual(cfg, interpoldata); > > cfg.artfctdef.reject = 'complete'; > > cfg.artfctdef.feedback = 'yes'; > > cleandata = ft_rejectartifact(cfg,clean_data); > > > > Emilie > > > > > > > > > > > > Le 3 sept. 2014 ? 11:58, Ashley Greene > > > a ?crit : > > > > Hello, > > > > I have used the rejectvisual function in attempt to remove bad > > trials, but after marking them and pressing the quit button, > > although the command window states that the selected trials have > > been removed, there is no obvious change in the data; all of the > > trials are still intact. Have I overlooked something? > > > > Thanks, > > > > Ashley > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 5 > > Date: Tue, 09 Sep 2014 14:16:20 +0200 > > From: Patricia Wollstadt > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: <540EEF94.9080601 at gmx.de> > > Content-Type: text/plain; charset="windows-1252" > > > > Hello Max, > > > > I added a few comments to the questions regarding individual > > parameters > > below. To address the general problem of TRENTOOL telling you, that > > there are not enough sample points in your data: From what I can see > > in > > your script, you probably don't have enough data points in each time > > series to robustly estimate TE. You analyze 800 ms of data sampled > > at > > 300 Hz, which gives you 240 samples per time series. Can you maybe > > avoid > > downsampling to 300 Hz and downsample to 600 Hz instead? Or could > > you > > analyze a longer time window of interest? > > Note that you also 'lose' data to embedding and the interaction > > delay: > > The first point that can be used for TE estimation is at max. > > embedding > > length + max. interaction delay in samples. For example: max. > > embedding > > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the > > max > > interaction delay of 30 ms = 9 samples. In this example, you would > > be > > left with 240 - 29 samples for TE estimation per trial. There is > > also > > the possibility to estimate time resolved TE/TE for shorter time > > windows > > of interest (see section 4.4 in the manual); however, this method > > requires the use of a GPU for TE estimation. > > > > I would further recommend to use the new pipeline for group > > statistics > > described in the manual in section 4.5 (the function > > 'TEgroup_calculate' > > is deprecated). The new pipeline allows you to reconstruct the > > interaction delay and uses the following functions (see also > > comments in > > the script): > > > > TEgroup_prepare -> prepares all data sets (all subjects/all > > conditions) for group analysis (this means finding common embedding > > parameters such that estimates are not biased between groups) > > InteractionDelayReconstruction_calculate -> estimates TE for > > individual data sets and all assumed interaction delays u > > InteractionDelayReconstruction_analyze -> reconstructs the > > interaction delay by selecting the u that maximizes TE for each > > channel > > TEgroup_stats -> calculate group statistics using a permutation test > > > > I can send you an example script for group TE analysis using this > > pipeline to get you started. I hope this helps you to get the group > > analysis running. Just write again if you're having trouble setting > > up > > the pipeline or something is not clear about the parameters/my > > comments. > > > > Best, > > Patricia > > > > > > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not > >> 100% sure if it is appropriate to ask questions about it here, but > >> to > >> the best of my knowledge they do not have a mailing list and I saw > >> a > >> few trentool questions in the archives, so I'm going to assume it's > >> ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present > >> in the pipeline. Sorry in advance for the long post! Any help would > >> be > >> greatly appreciated as I'm a bit over my head on this but I think > >> I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data > >> that was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi is > >> in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within the toi, but beyond that are there any benefits to it being > >> earlier or later?* PW: The predictiontime_u is in milliseconds and > >> the > >> toi is in seconds. The prediction time is the assumed interaction > >> delay between your two sources and should fit within your toi. In > >> general it is preferable to use the method for interaction delay > >> reconstruction for TE estimation, because it allows you to > >> reconstruct > >> the actual delay between your source and target times series. A > >> non-optimal u/interaction delay may cause an underestimation of TE, > >> so > >> it is recommended to use the pipeline for interaction delay > >> reconstruction whenever estimating TE for unknown delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, so it is best to limit the u range to values that are > >> physiologically plausible. > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the > >> sample rate and filters are used to determine the actthrvalue, but > >> I > >> don't actually know the calculation. 7.5 was a rough guess just to > >> test the pipeline. I'm also uncertain of what minnrtrials should > >> be.* > >> PW: You can set the actthrvalue based on the filtering you did > >> prior > >> to TE analysis. If you for example highpass filtered at 10 Hz, you > >> shouldn't find an ACT higher than 30 samples, because you filtered > >> out > >> any components of the signal slower than 10 Hz/30 samples (given > >> your > >> sampling frequency of 300 Hz). So in this scenario the actthrvalue > >> would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> * > >> * > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm > >> yet to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* > >> PW: The Ragwitz criterion tries to find optimal embedding > >> parameters > >> dim and tau for the data. To do that, the method iteratively takes > >> all > >> possible combinations of dim and tau values that are provided in > >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well > >> these > >> combinations embed the data. To test an embedding, the method > >> builds > >> the embedding vectors from the data; it then tests for each point > >> how > >> well the next point in time can be predicted from the reference > >> point's nearest neighbours. So for each embedded point, the method > >> searches for the nearest neighbours and calculates the average of > >> those nearest neighbours. The difference between the > >> averaged/predicted point and the actual next point is the error of > >> the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested > >> by the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together with 'ragtausteps' specifies the tau values to be tested > >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, > >> that > >> the values here are factors that are later multiplied with the ACT > >> to > >> obtain the actual tau. 'repPred' is the number of points that will > >> be > >> used for the local prediction, i.e. the Ragwitz criterion will test > >> the local prediction and calculate the error for the first 100 > >> points > >> in your time series. The two parameters 'flagNei' ans 'sizeNei' > >> below > >> specify the type of neighbour search conducted by the Ragwitz > >> criterion: 'flagNei' tells the method to either conduct a kNN or > >> range > >> search; 'sizeNei' specifies the number of neighbours or the radius > >> to > >> be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> * > >> * > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> * > >> * > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.*TRENTOOL seems to handle data output very differently > >> from > >> fieldtrip and I've had trouble thinking through the most logical > >> way > >> to handle the data so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> * > >> * > >> *For clarification, fileCell is a cell with the name of each > >> condition > >> x subject .mat file, which as I said before is collectively the > >> same > >> as the 3 x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> * > >> * > >> *At this step I get the following error: > >> > >> Error using transferentropy (line 337) > >> \nTRENTOOL ERROR: not enough data points left after embedding > >> > >> Error in TEgroup_calculate (line 133) > >> [TEresult] = transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate > >> is a pipeline issue* (I noticed the example pipeline in trentool, > >> the > >> manual, and published methods articles all seem to have slightly or > >> significantly different pipeline compositions), *or if the error > >> is* > >> due to ACT, ragwitz optimization, or some other faulty > >> parameterization *on my part due to a lack of understanding of how > >> transfer entropy works on a more theoretical/mathematical level*. > >> If > >> the latter is the case, is there any relatively straightforward way > >> to > >> conceptualize this, or is this something where I'm just going to > >> have > >> to keep reading and rereading until it eventually makes sense? I've > >> already done quite a bit of that and it hasn't pierced my thick > >> skull > >> yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> 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: > > > > > > ------------------------------ > > > > Message: 6 > > Date: Tue, 9 Sep 2014 15:21:20 +0200 > > From: Holger Krause > > To: FieldTrip discussion list > > Subject: [FieldTrip] Latest FT version on ftp-server is from three > > days ago > > Message-ID: > > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> > > Content-Type: text/plain; charset="us-ascii" > > > > Dear developers, > > > > Could you please check the process for creation/publication of > > zip-files on > > the FTP server? The latest file I can find there is > > fieldtrip-20140906.zip. > > > > Thanks in advance, > > > > Holger > > > > > > ------------------------------ > > > > Message: 7 > > Date: Tue, 9 Sep 2014 09:19:55 -0400 > > From: Max Cantor > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > This is immensely helpful, thank you. I was very confused about why > > some > > versions of the pipeline I saw were using group calculate and others > > were > > using interaction delay reconstruction and what that meant, and I > > think I > > have a more clear idea of what the different steps of the pipeline > > are > > doing. There are still a few things I'm a bit confused about though > > in > > terms of the pipeline. For instance, whether or not I need to do > > TEprepare > > before group prepare, and if I need to do graph analysis (which I'm > > not > > sure I fully understand but also haven't looked deeply into) before > > group > > stats. > > > > If you don't mind me taking you up on your offer, I think seeing > > your > > example script might help clarify some of these issues. > > > > Thank you! > > > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > > Patricia.Wollstadt at gmx.de> wrote: > > > >> Hello Max, > >> > >> I added a few comments to the questions regarding individual > >> parameters > >> below. To address the general problem of TRENTOOL telling you, that > >> there > >> are not enough sample points in your data: From what I can see in > >> your > >> script, you probably don't have enough data points in each time > >> series to > >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, > >> which > >> gives you 240 samples per time series. Can you maybe avoid > >> downsampling to > >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a > >> longer time > >> window of interest? > >> Note that you also 'lose' data to embedding and the interaction > >> delay: The > >> first point that can be used for TE estimation is at max. embedding > >> length > >> + max. interaction delay in samples. For example: max. embedding > >> length = > >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max > >> interaction > >> delay of 30 ms = 9 samples. In this example, you would be left with > >> 240 - > >> 29 samples for TE estimation per trial. There is also the > >> possibility to > >> estimate time resolved TE/TE for shorter time windows of interest > >> (see > >> section 4.4 in the manual); however, this method requires the use > >> of a GPU > >> for TE estimation. > >> > >> I would further recommend to use the new pipeline for group > >> statistics > >> described in the manual in section 4.5 (the function > >> 'TEgroup_calculate' is > >> deprecated). The new pipeline allows you to reconstruct the > >> interaction > >> delay and uses the following functions (see also comments in the > >> script): > >> > >> TEgroup_prepare -> prepares all data sets (all subjects/all > >> conditions) > >> for group analysis (this means finding common embedding parameters > >> such > >> that estimates are not biased between groups) > >> InteractionDelayReconstruction_calculate -> estimates TE for > >> individual data sets and all assumed interaction delays u > >> InteractionDelayReconstruction_analyze -> reconstructs the > >> interaction delay by selecting the u that maximizes TE for each > >> channel > >> TEgroup_stats -> calculate group statistics using a permutation > >> test > >> > >> I can send you an example script for group TE analysis using this > >> pipeline > >> to get you started. I hope this helps you to get the group analysis > >> running. Just write again if you're having trouble setting up the > >> pipeline > >> or something is not clear about the parameters/my comments. > >> > >> Best, > >> Patricia > >> > >> > >> > >> > >> On 09/04/2014 08:30 PM, Max Cantor wrote: > >> > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not 100% > >> sure if it is appropriate to ask questions about it here, but to > >> the best > >> of my knowledge they do not have a mailing list and I saw a few > >> trentool > >> questions in the archives, so I'm going to assume it's ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present in > >> the pipeline. Sorry in advance for the long post! Any help would be > >> greatly > >> appreciated as I'm a bit over my head on this but I think I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data that > >> was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi > >> is in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within > >> the toi, but beyond that are there any benefits to it being earlier > >> or > >> later?* PW: The predictiontime_u is in milliseconds and the toi is > >> in > >> seconds. The prediction time is the assumed interaction delay > >> between your > >> two sources and should fit within your toi. In general it is > >> preferable to > >> use the method for interaction delay reconstruction for TE > >> estimation, > >> because it allows you to reconstruct the actual delay between your > >> source > >> and target times series. A non-optimal u/interaction delay may > >> cause an > >> underestimation of TE, so it is recommended to use the pipeline for > >> interaction delay reconstruction whenever estimating TE for unknown > >> delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, > >> so it is best to limit the u range to values that are > >> physiologically > >> plausible. > >> > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the sample > >> rate and filters are used to determine the actthrvalue, but I don't > >> actually know the calculation. 7.5 was a rough guess just to test > >> the > >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: > >> You can > >> set the actthrvalue based on the filtering you did prior to TE > >> analysis. If > >> you for example highpass filtered at 10 Hz, you shouldn't find an > >> ACT > >> higher than 30 samples, because you filtered out any components of > >> the > >> signal slower than 10 Hz/30 samples (given your sampling frequency > >> of 300 > >> Hz). So in this scenario the actthrvalue would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm yet > >> to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* PW: > >> The Ragwitz criterion tries to find optimal embedding parameters > >> dim and > >> tau for the data. To do that, the method iteratively takes all > >> possible > >> combinations of dim and tau values that are provided in cfgP.ragdim > >> and > >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations > >> embed > >> the data. To test an embedding, the method builds the embedding > >> vectors > >> from the data; it then tests for each point how well the next point > >> in time > >> can be predicted from the reference point's nearest neighbours. So > >> for each > >> embedded point, the method searches for the nearest neighbours and > >> calculates the average of those nearest neighbours. The difference > >> between > >> the averaged/predicted point and the actual next point is the error > >> of the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested by > >> the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together > >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL > >> will > >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values > >> here are > >> factors that are later multiplied with the ACT to obtain the actual > >> tau. > >> 'repPred' is the number of points that will be used for the local > >> prediction, i.e. the Ragwitz criterion will test the local > >> prediction and > >> calculate the error for the first 100 points in your time series. > >> The two > >> parameters 'flagNei' ans 'sizeNei' below specify the type of > >> neighbour > >> search conducted by the Ragwitz criterion: 'flagNei' tells the > >> method to > >> either conduct a kNN or range search; 'sizeNei' specifies the > >> number of > >> neighbours or the radius to be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' > >> data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject > >> virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.* > >> TRENTOOL seems to handle data output very differently from > >> fieldtrip and > >> I've had trouble thinking through the most logical way to handle > >> the data > >> so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> > >> *For clarification, fileCell is a cell with the name of each > >> condition x > >> subject .mat file, which as I said before is collectively the same > >> as the 3 > >> x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> > >> > >> > >> > >> > >> > >> > >> *At this step I get the following error: Error using > >> transferentropy (line > >> 337) \nTRENTOOL ERROR: not enough data points left after embedding > >> Error in > >> TEgroup_calculate (line 133) [TEresult] = > >> transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate is a > >> pipeline issue* (I noticed the example pipeline in trentool, the > >> manual, > >> and published methods articles all seem to have slightly or > >> significantly > >> different pipeline compositions), *or if the error is* due to ACT, > >> ragwitz optimization, or some other faulty parameterization *on my > >> part > >> due to a lack of understanding of how transfer entropy works on a > >> more > >> theoretical/mathematical level*. If the latter is the case, is > >> there any > >> relatively straightforward way to conceptualize this, or is this > >> something > >> where I'm just going to have to keep reading and rereading until it > >> eventually makes sense? I've already done quite a bit of that and > >> it hasn't > >> pierced my thick skull yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> fieldtrip mailing > >> listfieldtrip at donders.ru.nlhttp://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 > >> > > > > > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > -------------- 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 46, Issue 3 > > **************************************** > > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen From f.roux at bcbl.eu Mon Sep 15 12:09:24 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Mon, 15 Sep 2014 12:09:24 +0200 (CEST) Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs In-Reply-To: <81946224.3066122.1410775297001.JavaMail.root@bcbl.eu> Message-ID: <867006743.3066178.1410775764568.JavaMail.root@bcbl.eu> Dear all, my question relates to the computation of combined planar gradients using the ft_combineplanar function. Our data has been recorded with an Elekta Neuromag 306 channel system, and I would like to know if it is "safe" to compute combined gradients before calling ft_freqstatistics, if the input data contains single trial TFRs. The reason why I am asking is because in the documentation of the function it says % Use as % [data] = ft_combineplanar(cfg, data) % where data contains an averaged planar gradient (either ERF or TFR). However, the following tutorial suggests that this can be safely applied if the input data contains TFRs which have been computed with the cfg.keeptrials = 'yes' option: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq I am bit confused as both information (the fieldtrip documentation and the tutorial) seem to contradict each other. The 2 options that are see are: 1) compute TFRs with cfg.keeptrials = 'yes', then call ft_frestatistics, then call ft_combineplanar by using the output of ft_freqstatistics as input for the ft_combineplanar function. 2) compute TFRs with cfg.keeptrials = 'yes', then call ft_combineplanar, then call ft_freqstatistics Could anyone with experience on this issue please let me know what the best way to proceed would be? Fred --------------------------------------------------------------------------- From gamaliel.ghu at gmail.com Mon Sep 15 18:12:38 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Mon, 15 Sep 2014 13:12:38 -0300 Subject: [FieldTrip] dipole simulation on head model Message-ID: hi all I hope you can help my problem. I have generated a model of head fieldtrip, and now I need to simulate sources at different positions within the crust generated. I followed the tutorial head model generation for EEG. However I have not found information on how to simulate a source. Any help would be welcome. Thank you greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Mon Sep 15 18:38:26 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 15 Sep 2014 18:38:26 +0200 Subject: [FieldTrip] dipole simulation on head model In-Reply-To: References: Message-ID: <6677301D-D72C-4C12-BC84-779D5E4DF8F3@uni-konstanz.de> Dear Gamaliel, you might try something like this: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit good luck tzvetan Am 15.09.2014 um 18:12 schrieb gamaliel huerta urrea : > hi all > > I hope you can help my problem. > > I have generated a model of head fieldtrip, and now I need to simulate sources at different positions within the crust generated. I followed the tutorial head model generation for EEG. However I have not found information on how to simulate a source. Any help would be welcome. > > Thank you > greetings > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 jingfan.jf at gmail.com Mon Sep 15 19:40:41 2014 From: jingfan.jf at gmail.com (Jing Fan) Date: Mon, 15 Sep 2014 12:40:41 -0500 Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' In-Reply-To: <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> References: <20140910140714.9n2t9bxs008o400c@imap.uni-ulm.de> <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> Message-ID: <000001cfd10c$2b7786a0$826693e0$@gmail.com> Hi Jim, I download the latest .zip file from FTP. I received the same error message when calling function ft_definetrial(cfg). It seems to me that ft_preamble init command will go to script ft_preamble.m instead of ft_preamble_init.m. Any help to resolve this issue will be appreciated. Best, Jing -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) Sent: Monday, September 15, 2014 5:01 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' Dear Barbara, The error seems to be related to a bug that pops up now and then (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a corrupt installation of fieldtrip and/or the need to update fieldtrip. Could you please try downloading the most recent version of fieldtrip and see if the problem persists? For an example of what can be expected from this function see: Esser SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. Best, Jim ----- Oorspronkelijk bericht ----- > Van: "barbara schorr" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 10 september 2014 14:07:14 > Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' > Dear fieldtripers. > > as mentioned in the subject line I would like to anaylse my timelocked > ERP Data with the function ft_globalmeanfield. > > I get the Error: Undefined function or variable 'abort' > Error in ft_globalmeanfield (line84) > if abort > > in the function it says: > > %the abort variable is set to true or false in ft_preamble_inti > if abort > % do not continue function execution in case the outputfile is > present and the user indicated to keep it > return > end > > > I don't understand what this means. I would really appreciate your > help to get this running. > > Also, what is the result when I run this function on my data? (This > method was proposed from a reviewer. I never used it before, so I > don't exactly know what it does and what the result will look like). > > Thank you very much in advance! > > Best, > > Barbara Schorr > > > > > Zitat von 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: Question regarding nonparametric testing for coherence > > differences (Eric Maris) > > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) > > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) > > 4. Re: ft_rejectvisual: removing trials marked as bad > > (Caspar, Emilie) > > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) > > 6. Latest FT version on ftp-server is from three days ago > > (Holger Krause) > > 7. Re: TRENTOOL pipeline help (Max Cantor) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) > > From: "Eric Maris" > > To: , "'FieldTrip discussion list'" > > > > Subject: Re: [FieldTrip] Question regarding nonparametric testing > > for > > coherence differences > > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> > > Content-Type: text/plain; charset="utf-8" > > > > Dear Hwee Ling, > > > > > > > > In the paper you refer to (Maris et al, JNM, 2007), I did not > > perform a > > cluster-based permutation test at the level of the channel pairs. > > Instead, > > all coherences mentioned in the paper are coherence between a single > > EMG > > channel (2 electrodes mounted on the forearm) and all MEG > > electrodes. Thus, > > there are as many EMG-MEG coherences as there are MEG channels (275 > > in our > > lab), and the clustering of these coherences involves the same > > neighbourhood > > structure as the clustering of channel-specific statistics on power > > or > > evoked response. The analysis you propose involves clustering in a > > much more > > complex space, namely the formed by all (MEG,MEG) channel pairs > > (275*275=75625 pairs). In the early days of cluster-based > > permutation > > statistics, I have worked on this problem but did not pursue it > > because the > > resulting clusters are very hard to interpret. > > > > > > > > Best, > > > > > > > > Eric Maris > > > > > > > > > > > > Dear all and Prof Maris, > > > > I'm re-posting this question again, as I didn't get any replies > > previously. > > > > I?m interested to investigate if there are any differences in phase > > synchronization in resting state data at timepoint 2 versus > > timepoint 1. The > > EEG data was collected using 64 EEG channels, resting state, eyes > > opened and > > eyes closed. I?ve arbitrarily segmented the resting state data into > > epochs > > of 2s each, and the epochs with artifacts are excluded completely > > from > > further analyses. I then performed mtmfft to get the fourier > > representation > > of the data, extracted the coherence, and compared the coherence > > difference > > of timepoint 2 versus timepoint 1 of all channels paired with all > > other > > channels. > > > > I figured that if I extract the connectivity analyses without > > specifying the > > channelcmb, I get a 'chan_chan_freq' dimord variable that would > > allow me to > > perform cluster-based statistical analyses. I get an output with > > ?chan_chan? > > dimord variable. However, I was not 100% sure that this is correct, > > hence, I?ve > > inserted my code (see below). It?ll be great if you could tell me if > > what I?m > > doing makes any sense at all. Also, I don?t know how I can plot the > > results > > to see if it make any sense at all. > > > > Also, I checked the values obtained from when I specified > > "cfg.channelcmb" > > and when I did not specify "cfg.channelcmb", I noticed that the > > values were > > somehow different. I would assume that the values to be similar, > > although > > I'm not sure why they would have differences in the values obtained > > from > > specifying "cfg.channelcmb". > > > > This is my code that I've used thus far: > > > > for sub = 1:5 > > > > cfg = []; > > > > cfg.output = 'fourier'; > > > > cfg.channel = {'all'}; > > > > cfg.method = 'mtmfft'; > > > > cfg.keeptrials = 'yes'; > > > > cfg.tapsmofrq = 5; > > > > cfg.foilim = [0 100]; > > > > cfg.taper = 'dpss'; > > > > % find the index for the c200 condition > > > > pre_c200_idx = find(data5.trialinfo == 201); > > > > cfg.trials = pre_c200_idx; > > > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > > > post_c200_idx = find(data5.trialinfo == 200); > > > > cfg.trials = post_c200_idx; > > > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > > > > > cfg = []; > > > > cfg.keeptrials = 'no'; > > > > cfg.channel = {'all'}; > > > > cfg.removemean = 'yes'; > > > > cfg.method = 'coh'; > > > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_pre_c200); > > > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_post_c200); > > > > end > > > > > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat '); > > > > cfg_neighb.method = 'template'; > > > > cfg_neighb.layout = lay; > > > > cfg_neighb.channel = 'all'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, > > sub_HLF_pre_c200coh{1}); > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.neighbours = neighbours; > > > > cfg.channel = 'all'; > > > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > > > cfg.latency = 'all'; > > > > cfg.avgovertime = 'no'; > > > > cfg.avgoverchan = 'no'; > > > > cfg.parameter = 'cohspctrm'; > > > > cfg.method = 'montecarlo'; > > > > cfg.statistic = 'depsamplesT'; > > > > cfg.correctm = 'cluster'; > > > > cfg.tail = 0; > > > > % cfg.clustertail = 0; > > > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 > > frequency > > bands. > > > > cfg.numrandomization = 10000; > > > > cfg.ivar = 2; > > > > cfg.uvar = 1; > > > > > > > > % design matrices > > > > clear design; > > > > design(1,:) = [1:5, 1:5]; > > > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > > > cfg.design = design; > > > > % for theta band > > > > cfg.avgoverfreq = 'yes'; > > > > cfg.frequency = [4 8]; % I also performed the statistics for delta > > (2-4), > > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma > > (30-40), > > and gamma (40-100). > > > > [diffc200_theta_stat] = ft_freqstatistics(cfg, > > sub_HLF_post_c200coh{:}, > > sub_HLF_pre_c200coh{:}); > > > > > > > > When I tried to plot the results, I used this code: > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.layout = 'lay'; > > > > cfg.zlim = [-1 1]; > > > > cfg.alpha = 0.05; > > > > cfg.refchannel = 'all'; > > > > ft_clusterplot(cfg, diffc200_theta_stat); > > > > However, I was not sure how I could plot the results. I get an error > > message > > from Fieldtrip when using ft_clusterplot: > > > > Error using topoplot_common (line 366) > > > > no reference channel is specified > > > > Error in ft_topoplotTFR (line 192) > > > > [cfg] = topoplot_common(cfg, varargin{:}); > > > > Error in ft_clusterplot (line 372) > > > > ft_topoplotTFR(cfgtopo, stat); > > > > > > > > According to your paper in 2007, the topoplot of the results were > > masked by > > the spatio-spectral pattern of the significant clusters. I don't > > know how to > > do this, and I would really appreciate if you can show me how to > > make such a > > plot. > > > > Thank you very much. > > > > Kind regards, > > > > Hweeling > > > > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 2 > > Date: Mon, 8 Sep 2014 21:38:01 +0200 > > From: KatrinH Heimann > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > Dear Joseph, thanks so much, I really appreciate your help. I was > > also > > wandering, if maybe there is another bug in my code. > > Our nets are 128 channels, Hydrocel, but as a colleague of me > > adviced me to > > do so, I also tried the 129 layout. > > My code you find below (without selection of bad channels etc.) > > If you need also the data of two subjects to have a look, let me > > know!!! > > Best and thanks really! > > Katrin > > > > > > subject=input('Which subject do you want to analyse? ','s'); > > > > name = strcat(subject,'.raw'); > > > > subjectnumber=input('Which is the subjectnumber?', 's'); > > > > sb=subjectnumber > > > > %subjectnumber = strcat(subjectnumber, '.txt') > > > > %% > > > > > > cfg = []; > > > > cfg.dataset = name; > > > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > > > cfg.trialdef.eventtype = 'trigger'; > > > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > > trigger > > > > cfg.trialdef.prestim = 0.234; % in seconds > > > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > > observation, but maybe we need less) > > > > cfg = ft_definetrial(cfg); > > > > > > cfg.trl([1:7],:) = []; > > > > > > %change timeline according to constant offset of 16 ms = 8 samples > > (because > > recorded with 500 hz)in > > > > %structure trial > > > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > > > > %change timeline to make the cut the zeropoint > > > > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > > > > > %% preprocess data > > > > cfg.channel = 'all'; > > > > cfg.preproc.detrend = 'yes'; > > > > cfg.preproc.demean = 'yes'; > > > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > > filtered > > > > %(0.1-45) and bad channels have to be replaced!!!! > > > > %cfg.preproc.bpfreq = [6 32]; > > > > % > > > > % > > > > obs_data = ft_preprocessing(cfg); > > > > % > > > > save (strcat(sb,'obs_data') , 'obs_data') > > > > > > %% determining channel neighbours (necessary for Artifact detection) > > > > cfg = []; > > > > cfg.channel = obs_data.label; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.feedback = 'yes'; > > > > lay = ft_prepare_layout(cfg); > > > > > > > > cfg_neighb = []; > > > > cfg_neighb.feedback = 'yes'; > > > > > > cfg_neighb.method = 'triangulation'; > > > > cfg_neighb.layout = 'GSN128.sfp'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > > > > > %% Preparing neighbours for channel repair - but bad channel info > > in!!! > > > > > > % cfg_neighb = []; > > > > % cfg_neighb.feedback = 'yes'; > > > > % cfg_neighb.method = 'triangulation'; > > > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > % Interpolate and put into new data structure > > > > cfg = []; > > > > cfg.badchannel = {}; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.method = 'nearest'; > > > > cfg.neighbours = neighbours; > > > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > > > > % Check reconstruction > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > % dat1=obs_data; > > > > % dat2=obs_data_channelrepaired; > > > > % > > > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > > > % y=dat2.trial{1}(62,:); > > > > % plot(x);hold on;plot(y,'r'); > > > > % > > > > % x=dat1.trial{1}(72,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > % > > > > % x=dat1.trial{1}(75,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > %% artifact rejection/trial inspection - throw out electrode jumps > > etc. > > > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > > according to > > channels interpolated %% 128-number of interp. channels) > > > > > > > > cfg = []; > > > > cfg.channel = {'all'}; > > > > cfg.numcomponent = 128 > > > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > > > save (strcat(sb,'comp_all') , 'comp') > > > > > > %% > > > > cfg = []; > > > > cfg.viewmode = 'component'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='some'; > > > > cfg.layout = 'GSN128.sfp'; > > > > ft_databrowser(cfg,comp); > > > > > > %% poweranalysis components > > > > cfg = []; > > > > cfg.output = 'pow'; > > > > cfg.channel = 'all';%compute the power spectrum in all ICs > > > > cfg.method = 'mtmfft'; > > > > cfg.taper = 'hanning'; > > > > cfg.foi = 0:0.2:50; > > > > obs_freq = ft_freqanalysis(cfg, comp); > > > > > > %And you can plot the spectra: > > > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > nsubplots = 16; > > > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > > decimals, type > > doc subplot > > > > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > > > tot = Nfigs*nsubplots; > > > > > > rptvect = 1:size(comp.topo,1); > > > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > > > > for r=1:size(rptvect,1); > > > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 > > 1]);%full > > screen > > > > k=0; > > > > for j=1:size(rptvect,2); > > > > if~(rptvect(r,j)==0); > > > > k=k+1; > > > > cfg=[]; > > > > cfg.channel = rptvect(r,j); > > > > cfg.ylim =[0 500] > > > > cfg.xlim =[0 50] > > > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > > > end > > > > end > > > > end > > > > > > %For the IC topos you'll follow the same logic as above but with: > > > > > > figure > > > > cfg = []; > > > > cfg.component = [1:20]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [21:40]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [41:60]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [61:80]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > > > > > > > > > %% Seperate observation conditions > > > > > > name1= strcat(num2str(sb),'_90.xls'); > > > > list1=xlsread (name1) > > > > > > > > > > > > name2= strcat(num2str(sb),'_180.xls'); > > > > list2=xlsread (name2) > > > > > > > > % > > > > > > cfg = [] > > > > cfg.trials = [list1] > > > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > cfg = [] > > > > cfg.trials = [list2] > > > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > %%PIPELINE FOR obs90 > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128; > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > > obs90_data); > > > > > > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > > > > > > %% Artifacts - final detection > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > > > > %% plot it > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > > > > > > > > > %% PIPELINE FOR obs180 > > > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128 > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > > obs180_data); > > > > > > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > > > > > > %% Artifacts final 180 > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > > > > %% plot 180 ERP > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs180_data_ERP) > > > > > > %% plot both ERPs > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > cfg.showlabels = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > > > > %% plot difference wave > > > > > > difference = obs180_data_ERP; % copy one of the > > structures > > > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute > > the > > difference ERP > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, difference) > > > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > > > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI > >> data. A couple things. First of all, exactly which net do you use? > >> If > >> they are 129-channel, there is still the question of whether they > >> are the > >> Hydrocel or the older geodesic nets. Regardless, that shouldn't > >> cause an > >> error like this. Could you send me the file you are trying to > >> process and > >> the script you are using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < > >> diezmartini at gmail.com> wrote: > >> > >> Which nets do you use? I use EGI. I tried both the ones you mention > >> and > >> they didn't work. It was hard to find that exact one online but it > >> was the > >> only file that actually worked. > >> > >> > >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >> > >> wrote: > >> > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. > >>> Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one > >>> > >>>> I use > >>>> > >>>> > >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < > >>>> katrinheimann at gmail.com> wrote: > >>>> > >>>>> Dear all, my problems seem neverending. This time however i > >>>>> really need > >>>>> help. > >>>>> I implemented a pipeline for ERPs. All works now, > >>>>> trialdefinition, > >>>>> preprocessing, channelreplacement, ica, componentrejection, > >>>>> final > >>>>> artifactdetection, timelock of the single subject data. However, > >>>>> when I > >>>>> wanna compute the grandaverage of the single subjects I get the > >>>>> following > >>>>> error message: > >>>>> > >>>>> computing average of avg over 19 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 3 MB > >>>>> computing average of avg over 2 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_prepare_layout" took 0 seconds and required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_topoplotER" took 0 seconds and required the > >>>>> additional > >>>>> allocation of an estimated 0 MB > >>>>> > >>>>> Furthermore in the plot of the significant clusters, the > >>>>> channelnames > >>>>> are mixed up (do not correspond to my net) > >>>>> > >>>>> > >>>>> I guess that there is a problem with the layout I use. > >>>>> Here the code that I use > >>>>> > >>>>> %For generating the layout (also in the single subjects): > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = obs_data.label; > >>>>> > >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>>>> > >>>>> cfg.feedback = 'yes'; > >>>>> > >>>>> lay = ft_prepare_layout(cfg); > >>>>> > >>>>> > >>>>> cfg_neighb = []; > >>>>> > >>>>> cfg_neighb.feedback = 'yes'; > >>>>> > >>>>> cfg_neighb.method = 'triangulation'; > >>>>> > >>>>> cfg_neighb.layout = lay; > >>>>> > >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>>>> > >>>>> > >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>>>> > >>>>> > >>>>> %For computing the grand average > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = 'all'; > >>>>> > >>>>> cfg.latency = 'all'; > >>>>> > >>>>> cfg.parameter = 'avg'; > >>>>> > >>>>> cfg.keepindividual = 'no' > >>>>> > >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>>>> > >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>>>> > >>>>> % "{:}" means to use data from all elements of the variable > >>>>> > >>>>> > >>>>> For plotting the significant clusters > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.style = 'blank'; > >>>>> > >>>>> cfg.layout = lay; > >>>>> > >>>>> cfg.channellabels = 'yes'; > >>>>> > >>>>> cfg.highlight = 'labels'; > >>>>> > >>>>> cfg.highlightchannel = find(stat.mask); > >>>>> > >>>>> cfg.comment = 'no'; > >>>>> > >>>>> figure; ft_topoplotER(cfg, GA_90) > >>>>> > >>>>> title('Nonparametric: significant with cluster multiple > >>>>> comparison > >>>>> correction') > >>>>> > >>>>> > >>>>> Do you have ANY idea to this? I am really completely > >>>>> helpless.... > >>>>> > >>>>> thanks and best > >>>>> > >>>>> Katrin > >>>>> > >>>>> _______________________________________________ > >>>>> 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 > >>> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> > >> ---------------------------------------------------------------------------- ---- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.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: > > > > > > ------------------------------ > > > > Message: 3 > > Date: Mon, 08 Sep 2014 21:55:44 -0400 > > From: Joseph Dien > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> > > Content-Type: text/plain; charset="windows-1252" > > > > yes, please do send me the data. > > > > Thanks! > > > > Joe > > > > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann > > wrote: > > > >> Dear Joseph, thanks so much, I really appreciate your help. I was > >> also wandering, if maybe there is another bug in my code. > >> Our nets are 128 channels, Hydrocel, but as a colleague of me > >> adviced me to do so, I also tried the 129 layout. > >> My code you find below (without selection of bad channels etc.) > >> If you need also the data of two subjects to have a look, let me > >> know!!! > >> Best and thanks really! > >> Katrin > >> > >> > >> > >> subject=input('Which subject do you want to analyse? ','s'); > >> > >> name = strcat(subject,'.raw'); > >> > >> subjectnumber=input('Which is the subjectnumber?', 's'); > >> > >> sb=subjectnumber > >> > >> %subjectnumber = strcat(subjectnumber, '.txt') > >> > >> %% > >> > >> > >> > >> cfg = []; > >> > >> cfg.dataset = name; > >> > >> cfg.trialfun = 'ft_trialfun_general'; % this is the default > >> > >> cfg.trialdef.eventtype = 'trigger'; > >> > >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > >> trigger > >> > >> cfg.trialdef.prestim = 0.234; % in seconds > >> > >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > >> observation, but maybe we need less) > >> > >> cfg = ft_definetrial(cfg); > >> > >> > >> > >> cfg.trl([1:7],:) = []; > >> > >> > >> > >> %change timeline according to constant offset of 16 ms = 8 samples > >> (because recorded with 500 hz)in > >> > >> %structure trial > >> > >> cfg.trl(:,3)=cfg.trl(:,3)-8 > >> > >> > >> > >> %change timeline to make the cut the zeropoint > >> > >> > >> > >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; > >> > >> > >> > >> > >> > >> %% preprocess data > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.detrend = 'yes'; > >> > >> cfg.preproc.demean = 'yes'; > >> > >> cfg.preproc.baselinewindow = [-2.1 -2.0] > >> > >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > >> filtered > >> > >> %(0.1-45) and bad channels have to be replaced!!!! > >> > >> %cfg.preproc.bpfreq = [6 32]; > >> > >> % > >> > >> % > >> > >> obs_data = ft_preprocessing(cfg); > >> > >> % > >> > >> save (strcat(sb,'obs_data') , 'obs_data') > >> > >> > >> > >> %% determining channel neighbours (necessary for Artifact > >> detection) > >> > >> cfg = []; > >> > >> cfg.channel = obs_data.label; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.feedback = 'yes'; > >> > >> lay = ft_prepare_layout(cfg); > >> > >> > >> cfg_neighb = []; > >> > >> cfg_neighb.feedback = 'yes'; > >> > >> > >> > >> cfg_neighb.method = 'triangulation'; > >> > >> cfg_neighb.layout = 'GSN128.sfp'; > >> > >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> obs_data.elec = ft_read_sens('GSN128.sfp'); > >> > >> > >> > >> %% Artifacts - to detect bad channels - is not saved!!! > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs_data_try = ft_rejectvisual(cfg, obs_data); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_try = ft_rejectartifact (cfg,obs_data); > >> > >> > >> > >> > >> > >> %% Preparing neighbours for channel repair - but bad channel info > >> in!!! > >> > >> > >> > >> % cfg_neighb = []; > >> > >> % cfg_neighb.feedback = 'yes'; > >> > >> % cfg_neighb.method = 'triangulation'; > >> > >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > >> > >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> % Interpolate and put into new data structure > >> > >> cfg = []; > >> > >> cfg.badchannel = {}; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.method = 'nearest'; > >> > >> cfg.neighbours = neighbours; > >> > >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >> > >> > >> > >> % Check reconstruction > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> % dat1=obs_data; > >> > >> % dat2=obs_data_channelrepaired; > >> > >> % > >> > >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > >> > >> % y=dat2.trial{1}(62,:); > >> > >> % plot(x);hold on;plot(y,'r'); > >> > >> % > >> > >> % x=dat1.trial{1}(72,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> % > >> > >> % x=dat1.trial{1}(75,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> %% artifact rejection/trial inspection - throw out electrode jumps > >> etc. > >> > >> > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > >> according to channels interpolated %% 128-number of interp. > >> channels) > >> > >> > >> cfg = []; > >> > >> cfg.channel = {'all'}; > >> > >> cfg.numcomponent = 128 > >> > >> comp = ft_componentanalysis(cfg,obs_data_clean1); > >> > >> save (strcat(sb,'comp_all') , 'comp') > >> > >> > >> > >> %% > >> > >> cfg = []; > >> > >> cfg.viewmode = 'component'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='some'; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> ft_databrowser(cfg,comp); > >> > >> > >> > >> %% poweranalysis components > >> > >> cfg = []; > >> > >> cfg.output = 'pow'; > >> > >> cfg.channel = 'all';%compute the power spectrum in all ICs > >> > >> cfg.method = 'mtmfft'; > >> > >> cfg.taper = 'hanning'; > >> > >> cfg.foi = 0:0.2:50; > >> > >> obs_freq = ft_freqanalysis(cfg, comp); > >> > >> > >> > >> %And you can plot the spectra: > >> > >> > >> > >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > >> > >> nsubplots = 16; > >> > >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > >> decimals, type doc subplot > >> > >> > >> > >> Nfigs = ceil(size(comp.topo,1)/nsubplots); > >> > >> tot = Nfigs*nsubplots; > >> > >> > >> > >> rptvect = 1:size(comp.topo,1); > >> > >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > >> > >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; > >> > >> > >> > >> for r=1:size(rptvect,1); > >> > >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 > >> 1]);%full screen > >> > >> k=0; > >> > >> for j=1:size(rptvect,2); > >> > >> if~(rptvect(r,j)==0); > >> > >> k=k+1; > >> > >> cfg=[]; > >> > >> cfg.channel = rptvect(r,j); > >> > >> cfg.ylim =[0 500] > >> > >> cfg.xlim =[0 50] > >> > >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > >> > >> end > >> > >> end > >> > >> end > >> > >> > >> > >> %For the IC topos you'll follow the same logic as above but with: > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [1:20]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [21:40]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [41:60]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [61:80]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% Seperate observation conditions > >> > >> > >> > >> name1= strcat(num2str(sb),'_90.xls'); > >> > >> list1=xlsread (name1) > >> > >> > >> > >> name2= strcat(num2str(sb),'_180.xls'); > >> > >> list2=xlsread (name2) > >> > >> > >> % > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list1] > >> > >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list2] > >> > >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> %%PIPELINE FOR obs90 > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128; > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> > >> > >> comp_1 = ft_componentanalysis(cfg, obs90_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > >> obs90_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts - final detection > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs90_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > >> > >> > >> > >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > >> > >> > >> > >> %% plot it > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% PIPELINE FOR obs180 > >> > >> > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128 > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> comp_2 = ft_componentanalysis(cfg, obs180_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > >> obs180_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts final 180 > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs180_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > >> > >> > >> > >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > >> > >> > >> > >> %% plot 180 ERP > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs180_data_ERP) > >> > >> > >> > >> %% plot both ERPs > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> cfg.showlabels = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > >> > >> > >> > >> %% plot difference wave > >> > >> > >> > >> difference = obs180_data_ERP; % copy one of > >> the structures > >> > >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % > >> compute the difference ERP > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, difference) > >> > >> > >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI data. A couple things. First of all, exactly which net do > >> you use? If they are 129-channel, there is still the question of > >> whether they are the Hydrocel or the older geodesic nets. > >> Regardless, that shouldn't cause an error like this. Could you > >> send me the file you are trying to process and the script you are > >> using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini > >> wrote: > >> > >>> Which nets do you use? I use EGI. I tried both the ones you > >>> mention and they didn't work. It was hard to find that exact one > >>> online but it was the only file that actually worked. > >>> > >>> > >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >>> wrote: > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one I use > >>> > >>> > >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > >>> wrote: > >>> Dear all, my problems seem neverending. This time however i really > >>> need help. > >>> I implemented a pipeline for ERPs. All works now, trialdefinition, > >>> preprocessing, channelreplacement, ica, componentrejection, final > >>> artifactdetection, timelock of the single subject data. However, > >>> when I wanna compute the grandaverage of the single subjects I get > >>> the following error message: > >>> > >>> computing average of avg over 19 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 3 MB > >>> computing average of avg over 2 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 0 MB > >>> the call to "ft_prepare_layout" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> the call to "ft_topoplotER" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> > >>> Furthermore in the plot of the significant clusters, the > >>> channelnames are mixed up (do not correspond to my net) > >>> > >>> > >>> I guess that there is a problem with the layout I use. > >>> Here the code that I use > >>> > >>> %For generating the layout (also in the single subjects): > >>> cfg = []; > >>> > >>> cfg.channel = obs_data.label; > >>> > >>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>> > >>> cfg.feedback = 'yes'; > >>> > >>> lay = ft_prepare_layout(cfg); > >>> > >>> > >>> cfg_neighb = []; > >>> > >>> cfg_neighb.feedback = 'yes'; > >>> > >>> cfg_neighb.method = 'triangulation'; > >>> > >>> cfg_neighb.layout = lay; > >>> > >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>> > >>> > >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>> > >>> > >>> > >>> %For computing the grand average > >>> > >>> cfg = []; > >>> > >>> cfg.channel = 'all'; > >>> > >>> cfg.latency = 'all'; > >>> > >>> cfg.parameter = 'avg'; > >>> > >>> cfg.keepindividual = 'no' > >>> > >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>> > >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>> > >>> % "{:}" means to use data from all elements of the variable > >>> > >>> > >>> For plotting the significant clusters > >>> > >>> cfg = []; > >>> > >>> cfg.style = 'blank'; > >>> > >>> cfg.layout = lay; > >>> > >>> cfg.channellabels = 'yes'; > >>> > >>> cfg.highlight = 'labels'; > >>> > >>> cfg.highlightchannel = find(stat.mask); > >>> > >>> cfg.comment = 'no'; > >>> > >>> figure; ft_topoplotER(cfg, GA_90) > >>> > >>> title('Nonparametric: significant with cluster multiple comparison > >>> correction') > >>> > >>> > >>> > >>> Do you have ANY idea to this? I am really completely helpless.... > >>> > >>> thanks and best > >>> > >>> Katrin > >>> > >>> > >>> _______________________________________________ > >>> 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 > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> ---------------------------------------------------------------------------- ---- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.com > >> > >> > >> _______________________________________________ > >> 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 > > > > ---------------------------------------------------------------------------- ---- > > > > Joseph Dien, PhD > > Research Associate > > Cognitive Neurology > > The Johns Hopkins University School of Medicine > > > > Lab E-mail: jdien1 at jhmi.edu > > Private E-mail: jdien07 at mac.com > > Office Phone: 410-614-3115 > > Cell Phone: 202-297-8117 > > Fax: 410-955-0188 > > http://joedien.com > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 4 > > Date: Tue, 9 Sep 2014 06:37:13 +0000 > > From: "Caspar, Emilie" > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > > bad > > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi Ashley, > > > > Maybe the mistake is you did not integrate in your script the > > command to save the rejection. Normally, with the following command, > > you will see in the Matlab Window that artifacts are correctly > > rejected after the "quit" button. > > > > clean_data = ft_rejectvisual(cfg, interpoldata); > > cfg.artfctdef.reject = 'complete'; > > cfg.artfctdef.feedback = 'yes'; > > cleandata = ft_rejectartifact(cfg,clean_data); > > > > Emilie > > > > > > > > > > > > Le 3 sept. 2014 ? 11:58, Ashley Greene > > > a ?crit : > > > > Hello, > > > > I have used the rejectvisual function in attempt to remove bad > > trials, but after marking them and pressing the quit button, > > although the command window states that the selected trials have > > been removed, there is no obvious change in the data; all of the > > trials are still intact. Have I overlooked something? > > > > Thanks, > > > > Ashley > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 5 > > Date: Tue, 09 Sep 2014 14:16:20 +0200 > > From: Patricia Wollstadt > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: <540EEF94.9080601 at gmx.de> > > Content-Type: text/plain; charset="windows-1252" > > > > Hello Max, > > > > I added a few comments to the questions regarding individual > > parameters > > below. To address the general problem of TRENTOOL telling you, that > > there are not enough sample points in your data: From what I can see > > in > > your script, you probably don't have enough data points in each time > > series to robustly estimate TE. You analyze 800 ms of data sampled > > at > > 300 Hz, which gives you 240 samples per time series. Can you maybe > > avoid > > downsampling to 300 Hz and downsample to 600 Hz instead? Or could > > you > > analyze a longer time window of interest? > > Note that you also 'lose' data to embedding and the interaction > > delay: > > The first point that can be used for TE estimation is at max. > > embedding > > length + max. interaction delay in samples. For example: max. > > embedding > > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the > > max > > interaction delay of 30 ms = 9 samples. In this example, you would > > be > > left with 240 - 29 samples for TE estimation per trial. There is > > also > > the possibility to estimate time resolved TE/TE for shorter time > > windows > > of interest (see section 4.4 in the manual); however, this method > > requires the use of a GPU for TE estimation. > > > > I would further recommend to use the new pipeline for group > > statistics > > described in the manual in section 4.5 (the function > > 'TEgroup_calculate' > > is deprecated). The new pipeline allows you to reconstruct the > > interaction delay and uses the following functions (see also > > comments in > > the script): > > > > TEgroup_prepare -> prepares all data sets (all subjects/all > > conditions) for group analysis (this means finding common embedding > > parameters such that estimates are not biased between groups) > > InteractionDelayReconstruction_calculate -> estimates TE for > > individual data sets and all assumed interaction delays u > > InteractionDelayReconstruction_analyze -> reconstructs the > > interaction delay by selecting the u that maximizes TE for each > > channel > > TEgroup_stats -> calculate group statistics using a permutation test > > > > I can send you an example script for group TE analysis using this > > pipeline to get you started. I hope this helps you to get the group > > analysis running. Just write again if you're having trouble setting > > up > > the pipeline or something is not clear about the parameters/my > > comments. > > > > Best, > > Patricia > > > > > > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not > >> 100% sure if it is appropriate to ask questions about it here, but > >> to > >> the best of my knowledge they do not have a mailing list and I saw > >> a > >> few trentool questions in the archives, so I'm going to assume it's > >> ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present > >> in the pipeline. Sorry in advance for the long post! Any help would > >> be > >> greatly appreciated as I'm a bit over my head on this but I think > >> I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data > >> that was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi is > >> in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within the toi, but beyond that are there any benefits to it being > >> earlier or later?* PW: The predictiontime_u is in milliseconds and > >> the > >> toi is in seconds. The prediction time is the assumed interaction > >> delay between your two sources and should fit within your toi. In > >> general it is preferable to use the method for interaction delay > >> reconstruction for TE estimation, because it allows you to > >> reconstruct > >> the actual delay between your source and target times series. A > >> non-optimal u/interaction delay may cause an underestimation of TE, > >> so > >> it is recommended to use the pipeline for interaction delay > >> reconstruction whenever estimating TE for unknown delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, so it is best to limit the u range to values that are > >> physiologically plausible. > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the > >> sample rate and filters are used to determine the actthrvalue, but > >> I > >> don't actually know the calculation. 7.5 was a rough guess just to > >> test the pipeline. I'm also uncertain of what minnrtrials should > >> be.* > >> PW: You can set the actthrvalue based on the filtering you did > >> prior > >> to TE analysis. If you for example highpass filtered at 10 Hz, you > >> shouldn't find an ACT higher than 30 samples, because you filtered > >> out > >> any components of the signal slower than 10 Hz/30 samples (given > >> your > >> sampling frequency of 300 Hz). So in this scenario the actthrvalue > >> would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> * > >> * > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm > >> yet to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* > >> PW: The Ragwitz criterion tries to find optimal embedding > >> parameters > >> dim and tau for the data. To do that, the method iteratively takes > >> all > >> possible combinations of dim and tau values that are provided in > >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well > >> these > >> combinations embed the data. To test an embedding, the method > >> builds > >> the embedding vectors from the data; it then tests for each point > >> how > >> well the next point in time can be predicted from the reference > >> point's nearest neighbours. So for each embedded point, the method > >> searches for the nearest neighbours and calculates the average of > >> those nearest neighbours. The difference between the > >> averaged/predicted point and the actual next point is the error of > >> the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested > >> by the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together with 'ragtausteps' specifies the tau values to be tested > >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, > >> that > >> the values here are factors that are later multiplied with the ACT > >> to > >> obtain the actual tau. 'repPred' is the number of points that will > >> be > >> used for the local prediction, i.e. the Ragwitz criterion will test > >> the local prediction and calculate the error for the first 100 > >> points > >> in your time series. The two parameters 'flagNei' ans 'sizeNei' > >> below > >> specify the type of neighbour search conducted by the Ragwitz > >> criterion: 'flagNei' tells the method to either conduct a kNN or > >> range > >> search; 'sizeNei' specifies the number of neighbours or the radius > >> to > >> be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> * > >> * > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> * > >> * > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.*TRENTOOL seems to handle data output very differently > >> from > >> fieldtrip and I've had trouble thinking through the most logical > >> way > >> to handle the data so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> * > >> * > >> *For clarification, fileCell is a cell with the name of each > >> condition > >> x subject .mat file, which as I said before is collectively the > >> same > >> as the 3 x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> * > >> * > >> *At this step I get the following error: > >> > >> Error using transferentropy (line 337) > >> \nTRENTOOL ERROR: not enough data points left after embedding > >> > >> Error in TEgroup_calculate (line 133) > >> [TEresult] = transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate > >> is a pipeline issue* (I noticed the example pipeline in trentool, > >> the > >> manual, and published methods articles all seem to have slightly or > >> significantly different pipeline compositions), *or if the error > >> is* > >> due to ACT, ragwitz optimization, or some other faulty > >> parameterization *on my part due to a lack of understanding of how > >> transfer entropy works on a more theoretical/mathematical level*. > >> If > >> the latter is the case, is there any relatively straightforward way > >> to > >> conceptualize this, or is this something where I'm just going to > >> have > >> to keep reading and rereading until it eventually makes sense? I've > >> already done quite a bit of that and it hasn't pierced my thick > >> skull > >> yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> 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: > > > > > > ------------------------------ > > > > Message: 6 > > Date: Tue, 9 Sep 2014 15:21:20 +0200 > > From: Holger Krause > > To: FieldTrip discussion list > > Subject: [FieldTrip] Latest FT version on ftp-server is from three > > days ago > > Message-ID: > > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> > > Content-Type: text/plain; charset="us-ascii" > > > > Dear developers, > > > > Could you please check the process for creation/publication of > > zip-files on > > the FTP server? The latest file I can find there is > > fieldtrip-20140906.zip. > > > > Thanks in advance, > > > > Holger > > > > > > ------------------------------ > > > > Message: 7 > > Date: Tue, 9 Sep 2014 09:19:55 -0400 > > From: Max Cantor > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > This is immensely helpful, thank you. I was very confused about why > > some > > versions of the pipeline I saw were using group calculate and others > > were > > using interaction delay reconstruction and what that meant, and I > > think I > > have a more clear idea of what the different steps of the pipeline > > are > > doing. There are still a few things I'm a bit confused about though > > in > > terms of the pipeline. For instance, whether or not I need to do > > TEprepare > > before group prepare, and if I need to do graph analysis (which I'm > > not > > sure I fully understand but also haven't looked deeply into) before > > group > > stats. > > > > If you don't mind me taking you up on your offer, I think seeing > > your > > example script might help clarify some of these issues. > > > > Thank you! > > > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > > Patricia.Wollstadt at gmx.de> wrote: > > > >> Hello Max, > >> > >> I added a few comments to the questions regarding individual > >> parameters > >> below. To address the general problem of TRENTOOL telling you, that > >> there > >> are not enough sample points in your data: From what I can see in > >> your > >> script, you probably don't have enough data points in each time > >> series to > >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, > >> which > >> gives you 240 samples per time series. Can you maybe avoid > >> downsampling to > >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a > >> longer time > >> window of interest? > >> Note that you also 'lose' data to embedding and the interaction > >> delay: The > >> first point that can be used for TE estimation is at max. embedding > >> length > >> + max. interaction delay in samples. For example: max. embedding > >> length = > >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max > >> interaction > >> delay of 30 ms = 9 samples. In this example, you would be left with > >> 240 - > >> 29 samples for TE estimation per trial. There is also the > >> possibility to > >> estimate time resolved TE/TE for shorter time windows of interest > >> (see > >> section 4.4 in the manual); however, this method requires the use > >> of a GPU > >> for TE estimation. > >> > >> I would further recommend to use the new pipeline for group > >> statistics > >> described in the manual in section 4.5 (the function > >> 'TEgroup_calculate' is > >> deprecated). The new pipeline allows you to reconstruct the > >> interaction > >> delay and uses the following functions (see also comments in the > >> script): > >> > >> TEgroup_prepare -> prepares all data sets (all subjects/all > >> conditions) > >> for group analysis (this means finding common embedding parameters > >> such > >> that estimates are not biased between groups) > >> InteractionDelayReconstruction_calculate -> estimates TE for > >> individual data sets and all assumed interaction delays u > >> InteractionDelayReconstruction_analyze -> reconstructs the > >> interaction delay by selecting the u that maximizes TE for each > >> channel > >> TEgroup_stats -> calculate group statistics using a permutation > >> test > >> > >> I can send you an example script for group TE analysis using this > >> pipeline > >> to get you started. I hope this helps you to get the group analysis > >> running. Just write again if you're having trouble setting up the > >> pipeline > >> or something is not clear about the parameters/my comments. > >> > >> Best, > >> Patricia > >> > >> > >> > >> > >> On 09/04/2014 08:30 PM, Max Cantor wrote: > >> > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not 100% > >> sure if it is appropriate to ask questions about it here, but to > >> the best > >> of my knowledge they do not have a mailing list and I saw a few > >> trentool > >> questions in the archives, so I'm going to assume it's ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present in > >> the pipeline. Sorry in advance for the long post! Any help would be > >> greatly > >> appreciated as I'm a bit over my head on this but I think I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data that > >> was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi > >> is in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within > >> the toi, but beyond that are there any benefits to it being earlier > >> or > >> later?* PW: The predictiontime_u is in milliseconds and the toi is > >> in > >> seconds. The prediction time is the assumed interaction delay > >> between your > >> two sources and should fit within your toi. In general it is > >> preferable to > >> use the method for interaction delay reconstruction for TE > >> estimation, > >> because it allows you to reconstruct the actual delay between your > >> source > >> and target times series. A non-optimal u/interaction delay may > >> cause an > >> underestimation of TE, so it is recommended to use the pipeline for > >> interaction delay reconstruction whenever estimating TE for unknown > >> delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, > >> so it is best to limit the u range to values that are > >> physiologically > >> plausible. > >> > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the sample > >> rate and filters are used to determine the actthrvalue, but I don't > >> actually know the calculation. 7.5 was a rough guess just to test > >> the > >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: > >> You can > >> set the actthrvalue based on the filtering you did prior to TE > >> analysis. If > >> you for example highpass filtered at 10 Hz, you shouldn't find an > >> ACT > >> higher than 30 samples, because you filtered out any components of > >> the > >> signal slower than 10 Hz/30 samples (given your sampling frequency > >> of 300 > >> Hz). So in this scenario the actthrvalue would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm yet > >> to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* PW: > >> The Ragwitz criterion tries to find optimal embedding parameters > >> dim and > >> tau for the data. To do that, the method iteratively takes all > >> possible > >> combinations of dim and tau values that are provided in cfgP.ragdim > >> and > >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations > >> embed > >> the data. To test an embedding, the method builds the embedding > >> vectors > >> from the data; it then tests for each point how well the next point > >> in time > >> can be predicted from the reference point's nearest neighbours. So > >> for each > >> embedded point, the method searches for the nearest neighbours and > >> calculates the average of those nearest neighbours. The difference > >> between > >> the averaged/predicted point and the actual next point is the error > >> of the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested by > >> the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together > >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL > >> will > >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values > >> here are > >> factors that are later multiplied with the ACT to obtain the actual > >> tau. > >> 'repPred' is the number of points that will be used for the local > >> prediction, i.e. the Ragwitz criterion will test the local > >> prediction and > >> calculate the error for the first 100 points in your time series. > >> The two > >> parameters 'flagNei' ans 'sizeNei' below specify the type of > >> neighbour > >> search conducted by the Ragwitz criterion: 'flagNei' tells the > >> method to > >> either conduct a kNN or range search; 'sizeNei' specifies the > >> number of > >> neighbours or the radius to be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' > >> data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject > >> virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.* > >> TRENTOOL seems to handle data output very differently from > >> fieldtrip and > >> I've had trouble thinking through the most logical way to handle > >> the data > >> so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> > >> *For clarification, fileCell is a cell with the name of each > >> condition x > >> subject .mat file, which as I said before is collectively the same > >> as the 3 > >> x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> > >> > >> > >> > >> > >> > >> > >> *At this step I get the following error: Error using > >> transferentropy (line > >> 337) \nTRENTOOL ERROR: not enough data points left after embedding > >> Error in > >> TEgroup_calculate (line 133) [TEresult] = > >> transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate is a > >> pipeline issue* (I noticed the example pipeline in trentool, the > >> manual, > >> and published methods articles all seem to have slightly or > >> significantly > >> different pipeline compositions), *or if the error is* due to ACT, > >> ragwitz optimization, or some other faulty parameterization *on my > >> part > >> due to a lack of understanding of how transfer entropy works on a > >> more > >> theoretical/mathematical level*. If the latter is the case, is > >> there any > >> relatively straightforward way to conceptualize this, or is this > >> something > >> where I'm just going to have to keep reading and rereading until it > >> eventually makes sense? I've already done quite a bit of that and > >> it hasn't > >> pierced my thick skull yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> fieldtrip mailing > >> listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie ldtrip > >> > >> > >> -- > >> ------------------------------------------------------------ > >> > >> 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 > >> > > > > > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > -------------- 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 46, Issue 3 > > **************************************** > > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jingfan.jf at gmail.com Mon Sep 15 19:53:19 2014 From: jingfan.jf at gmail.com (Jing Fan) Date: Mon, 15 Sep 2014 12:53:19 -0500 Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' In-Reply-To: <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> References: <20140910140714.9n2t9bxs008o400c@imap.uni-ulm.de> <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> Message-ID: <000301cfd10d$ef53cba0$cdfb62e0$@gmail.com> Hi Barbara and Jim, I added path your/path/to/fieldtrip/utilities and now it worked. Hope it helps solve the problem. Best, Jing -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) Sent: Monday, September 15, 2014 5:01 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' Dear Barbara, The error seems to be related to a bug that pops up now and then (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a corrupt installation of fieldtrip and/or the need to update fieldtrip. Could you please try downloading the most recent version of fieldtrip and see if the problem persists? For an example of what can be expected from this function see: Esser SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. Best, Jim ----- Oorspronkelijk bericht ----- > Van: "barbara schorr" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 10 september 2014 14:07:14 > Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' > Dear fieldtripers. > > as mentioned in the subject line I would like to anaylse my timelocked > ERP Data with the function ft_globalmeanfield. > > I get the Error: Undefined function or variable 'abort' > Error in ft_globalmeanfield (line84) > if abort > > in the function it says: > > %the abort variable is set to true or false in ft_preamble_inti > if abort > % do not continue function execution in case the outputfile is > present and the user indicated to keep it > return > end > > > I don't understand what this means. I would really appreciate your > help to get this running. > > Also, what is the result when I run this function on my data? (This > method was proposed from a reviewer. I never used it before, so I > don't exactly know what it does and what the result will look like). > > Thank you very much in advance! > > Best, > > Barbara Schorr > > > > > Zitat von 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: Question regarding nonparametric testing for coherence > > differences (Eric Maris) > > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) > > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) > > 4. Re: ft_rejectvisual: removing trials marked as bad > > (Caspar, Emilie) > > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) > > 6. Latest FT version on ftp-server is from three days ago > > (Holger Krause) > > 7. Re: TRENTOOL pipeline help (Max Cantor) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) > > From: "Eric Maris" > > To: , "'FieldTrip discussion list'" > > > > Subject: Re: [FieldTrip] Question regarding nonparametric testing > > for > > coherence differences > > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> > > Content-Type: text/plain; charset="utf-8" > > > > Dear Hwee Ling, > > > > > > > > In the paper you refer to (Maris et al, JNM, 2007), I did not > > perform a > > cluster-based permutation test at the level of the channel pairs. > > Instead, > > all coherences mentioned in the paper are coherence between a single > > EMG > > channel (2 electrodes mounted on the forearm) and all MEG > > electrodes. Thus, > > there are as many EMG-MEG coherences as there are MEG channels (275 > > in our > > lab), and the clustering of these coherences involves the same > > neighbourhood > > structure as the clustering of channel-specific statistics on power > > or > > evoked response. The analysis you propose involves clustering in a > > much more > > complex space, namely the formed by all (MEG,MEG) channel pairs > > (275*275=75625 pairs). In the early days of cluster-based > > permutation > > statistics, I have worked on this problem but did not pursue it > > because the > > resulting clusters are very hard to interpret. > > > > > > > > Best, > > > > > > > > Eric Maris > > > > > > > > > > > > Dear all and Prof Maris, > > > > I'm re-posting this question again, as I didn't get any replies > > previously. > > > > I?m interested to investigate if there are any differences in phase > > synchronization in resting state data at timepoint 2 versus > > timepoint 1. The > > EEG data was collected using 64 EEG channels, resting state, eyes > > opened and > > eyes closed. I?ve arbitrarily segmented the resting state data into > > epochs > > of 2s each, and the epochs with artifacts are excluded completely > > from > > further analyses. I then performed mtmfft to get the fourier > > representation > > of the data, extracted the coherence, and compared the coherence > > difference > > of timepoint 2 versus timepoint 1 of all channels paired with all > > other > > channels. > > > > I figured that if I extract the connectivity analyses without > > specifying the > > channelcmb, I get a 'chan_chan_freq' dimord variable that would > > allow me to > > perform cluster-based statistical analyses. I get an output with > > ?chan_chan? > > dimord variable. However, I was not 100% sure that this is correct, > > hence, I?ve > > inserted my code (see below). It?ll be great if you could tell me if > > what I?m > > doing makes any sense at all. Also, I don?t know how I can plot the > > results > > to see if it make any sense at all. > > > > Also, I checked the values obtained from when I specified > > "cfg.channelcmb" > > and when I did not specify "cfg.channelcmb", I noticed that the > > values were > > somehow different. I would assume that the values to be similar, > > although > > I'm not sure why they would have differences in the values obtained > > from > > specifying "cfg.channelcmb". > > > > This is my code that I've used thus far: > > > > for sub = 1:5 > > > > cfg = []; > > > > cfg.output = 'fourier'; > > > > cfg.channel = {'all'}; > > > > cfg.method = 'mtmfft'; > > > > cfg.keeptrials = 'yes'; > > > > cfg.tapsmofrq = 5; > > > > cfg.foilim = [0 100]; > > > > cfg.taper = 'dpss'; > > > > % find the index for the c200 condition > > > > pre_c200_idx = find(data5.trialinfo == 201); > > > > cfg.trials = pre_c200_idx; > > > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > > > post_c200_idx = find(data5.trialinfo == 200); > > > > cfg.trials = post_c200_idx; > > > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > > > > > cfg = []; > > > > cfg.keeptrials = 'no'; > > > > cfg.channel = {'all'}; > > > > cfg.removemean = 'yes'; > > > > cfg.method = 'coh'; > > > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_pre_c200); > > > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_post_c200); > > > > end > > > > > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat '); > > > > cfg_neighb.method = 'template'; > > > > cfg_neighb.layout = lay; > > > > cfg_neighb.channel = 'all'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, > > sub_HLF_pre_c200coh{1}); > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.neighbours = neighbours; > > > > cfg.channel = 'all'; > > > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > > > cfg.latency = 'all'; > > > > cfg.avgovertime = 'no'; > > > > cfg.avgoverchan = 'no'; > > > > cfg.parameter = 'cohspctrm'; > > > > cfg.method = 'montecarlo'; > > > > cfg.statistic = 'depsamplesT'; > > > > cfg.correctm = 'cluster'; > > > > cfg.tail = 0; > > > > % cfg.clustertail = 0; > > > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 > > frequency > > bands. > > > > cfg.numrandomization = 10000; > > > > cfg.ivar = 2; > > > > cfg.uvar = 1; > > > > > > > > % design matrices > > > > clear design; > > > > design(1,:) = [1:5, 1:5]; > > > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > > > cfg.design = design; > > > > % for theta band > > > > cfg.avgoverfreq = 'yes'; > > > > cfg.frequency = [4 8]; % I also performed the statistics for delta > > (2-4), > > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma > > (30-40), > > and gamma (40-100). > > > > [diffc200_theta_stat] = ft_freqstatistics(cfg, > > sub_HLF_post_c200coh{:}, > > sub_HLF_pre_c200coh{:}); > > > > > > > > When I tried to plot the results, I used this code: > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.layout = 'lay'; > > > > cfg.zlim = [-1 1]; > > > > cfg.alpha = 0.05; > > > > cfg.refchannel = 'all'; > > > > ft_clusterplot(cfg, diffc200_theta_stat); > > > > However, I was not sure how I could plot the results. I get an error > > message > > from Fieldtrip when using ft_clusterplot: > > > > Error using topoplot_common (line 366) > > > > no reference channel is specified > > > > Error in ft_topoplotTFR (line 192) > > > > [cfg] = topoplot_common(cfg, varargin{:}); > > > > Error in ft_clusterplot (line 372) > > > > ft_topoplotTFR(cfgtopo, stat); > > > > > > > > According to your paper in 2007, the topoplot of the results were > > masked by > > the spatio-spectral pattern of the significant clusters. I don't > > know how to > > do this, and I would really appreciate if you can show me how to > > make such a > > plot. > > > > Thank you very much. > > > > Kind regards, > > > > Hweeling > > > > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 2 > > Date: Mon, 8 Sep 2014 21:38:01 +0200 > > From: KatrinH Heimann > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > Dear Joseph, thanks so much, I really appreciate your help. I was > > also > > wandering, if maybe there is another bug in my code. > > Our nets are 128 channels, Hydrocel, but as a colleague of me > > adviced me to > > do so, I also tried the 129 layout. > > My code you find below (without selection of bad channels etc.) > > If you need also the data of two subjects to have a look, let me > > know!!! > > Best and thanks really! > > Katrin > > > > > > subject=input('Which subject do you want to analyse? ','s'); > > > > name = strcat(subject,'.raw'); > > > > subjectnumber=input('Which is the subjectnumber?', 's'); > > > > sb=subjectnumber > > > > %subjectnumber = strcat(subjectnumber, '.txt') > > > > %% > > > > > > cfg = []; > > > > cfg.dataset = name; > > > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > > > cfg.trialdef.eventtype = 'trigger'; > > > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > > trigger > > > > cfg.trialdef.prestim = 0.234; % in seconds > > > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > > observation, but maybe we need less) > > > > cfg = ft_definetrial(cfg); > > > > > > cfg.trl([1:7],:) = []; > > > > > > %change timeline according to constant offset of 16 ms = 8 samples > > (because > > recorded with 500 hz)in > > > > %structure trial > > > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > > > > %change timeline to make the cut the zeropoint > > > > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > > > > > %% preprocess data > > > > cfg.channel = 'all'; > > > > cfg.preproc.detrend = 'yes'; > > > > cfg.preproc.demean = 'yes'; > > > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > > filtered > > > > %(0.1-45) and bad channels have to be replaced!!!! > > > > %cfg.preproc.bpfreq = [6 32]; > > > > % > > > > % > > > > obs_data = ft_preprocessing(cfg); > > > > % > > > > save (strcat(sb,'obs_data') , 'obs_data') > > > > > > %% determining channel neighbours (necessary for Artifact detection) > > > > cfg = []; > > > > cfg.channel = obs_data.label; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.feedback = 'yes'; > > > > lay = ft_prepare_layout(cfg); > > > > > > > > cfg_neighb = []; > > > > cfg_neighb.feedback = 'yes'; > > > > > > cfg_neighb.method = 'triangulation'; > > > > cfg_neighb.layout = 'GSN128.sfp'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > > > > > %% Preparing neighbours for channel repair - but bad channel info > > in!!! > > > > > > % cfg_neighb = []; > > > > % cfg_neighb.feedback = 'yes'; > > > > % cfg_neighb.method = 'triangulation'; > > > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > % Interpolate and put into new data structure > > > > cfg = []; > > > > cfg.badchannel = {}; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.method = 'nearest'; > > > > cfg.neighbours = neighbours; > > > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > > > > % Check reconstruction > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > % dat1=obs_data; > > > > % dat2=obs_data_channelrepaired; > > > > % > > > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > > > % y=dat2.trial{1}(62,:); > > > > % plot(x);hold on;plot(y,'r'); > > > > % > > > > % x=dat1.trial{1}(72,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > % > > > > % x=dat1.trial{1}(75,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > %% artifact rejection/trial inspection - throw out electrode jumps > > etc. > > > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > > according to > > channels interpolated %% 128-number of interp. channels) > > > > > > > > cfg = []; > > > > cfg.channel = {'all'}; > > > > cfg.numcomponent = 128 > > > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > > > save (strcat(sb,'comp_all') , 'comp') > > > > > > %% > > > > cfg = []; > > > > cfg.viewmode = 'component'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='some'; > > > > cfg.layout = 'GSN128.sfp'; > > > > ft_databrowser(cfg,comp); > > > > > > %% poweranalysis components > > > > cfg = []; > > > > cfg.output = 'pow'; > > > > cfg.channel = 'all';%compute the power spectrum in all ICs > > > > cfg.method = 'mtmfft'; > > > > cfg.taper = 'hanning'; > > > > cfg.foi = 0:0.2:50; > > > > obs_freq = ft_freqanalysis(cfg, comp); > > > > > > %And you can plot the spectra: > > > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > nsubplots = 16; > > > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > > decimals, type > > doc subplot > > > > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > > > tot = Nfigs*nsubplots; > > > > > > rptvect = 1:size(comp.topo,1); > > > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > > > > for r=1:size(rptvect,1); > > > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 > > 1]);%full > > screen > > > > k=0; > > > > for j=1:size(rptvect,2); > > > > if~(rptvect(r,j)==0); > > > > k=k+1; > > > > cfg=[]; > > > > cfg.channel = rptvect(r,j); > > > > cfg.ylim =[0 500] > > > > cfg.xlim =[0 50] > > > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > > > end > > > > end > > > > end > > > > > > %For the IC topos you'll follow the same logic as above but with: > > > > > > figure > > > > cfg = []; > > > > cfg.component = [1:20]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [21:40]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [41:60]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [61:80]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > > > > > > > > > %% Seperate observation conditions > > > > > > name1= strcat(num2str(sb),'_90.xls'); > > > > list1=xlsread (name1) > > > > > > > > > > > > name2= strcat(num2str(sb),'_180.xls'); > > > > list2=xlsread (name2) > > > > > > > > % > > > > > > cfg = [] > > > > cfg.trials = [list1] > > > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > cfg = [] > > > > cfg.trials = [list2] > > > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > %%PIPELINE FOR obs90 > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128; > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > > obs90_data); > > > > > > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > > > > > > %% Artifacts - final detection > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > > > > %% plot it > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > > > > > > > > > %% PIPELINE FOR obs180 > > > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128 > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > > obs180_data); > > > > > > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > > > > > > %% Artifacts final 180 > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > > > > %% plot 180 ERP > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs180_data_ERP) > > > > > > %% plot both ERPs > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > cfg.showlabels = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > > > > %% plot difference wave > > > > > > difference = obs180_data_ERP; % copy one of the > > structures > > > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute > > the > > difference ERP > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, difference) > > > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > > > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI > >> data. A couple things. First of all, exactly which net do you use? > >> If > >> they are 129-channel, there is still the question of whether they > >> are the > >> Hydrocel or the older geodesic nets. Regardless, that shouldn't > >> cause an > >> error like this. Could you send me the file you are trying to > >> process and > >> the script you are using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < > >> diezmartini at gmail.com> wrote: > >> > >> Which nets do you use? I use EGI. I tried both the ones you mention > >> and > >> they didn't work. It was hard to find that exact one online but it > >> was the > >> only file that actually worked. > >> > >> > >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >> > >> wrote: > >> > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. > >>> Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one > >>> > >>>> I use > >>>> > >>>> > >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < > >>>> katrinheimann at gmail.com> wrote: > >>>> > >>>>> Dear all, my problems seem neverending. This time however i > >>>>> really need > >>>>> help. > >>>>> I implemented a pipeline for ERPs. All works now, > >>>>> trialdefinition, > >>>>> preprocessing, channelreplacement, ica, componentrejection, > >>>>> final > >>>>> artifactdetection, timelock of the single subject data. However, > >>>>> when I > >>>>> wanna compute the grandaverage of the single subjects I get the > >>>>> following > >>>>> error message: > >>>>> > >>>>> computing average of avg over 19 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 3 MB > >>>>> computing average of avg over 2 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_prepare_layout" took 0 seconds and required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_topoplotER" took 0 seconds and required the > >>>>> additional > >>>>> allocation of an estimated 0 MB > >>>>> > >>>>> Furthermore in the plot of the significant clusters, the > >>>>> channelnames > >>>>> are mixed up (do not correspond to my net) > >>>>> > >>>>> > >>>>> I guess that there is a problem with the layout I use. > >>>>> Here the code that I use > >>>>> > >>>>> %For generating the layout (also in the single subjects): > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = obs_data.label; > >>>>> > >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>>>> > >>>>> cfg.feedback = 'yes'; > >>>>> > >>>>> lay = ft_prepare_layout(cfg); > >>>>> > >>>>> > >>>>> cfg_neighb = []; > >>>>> > >>>>> cfg_neighb.feedback = 'yes'; > >>>>> > >>>>> cfg_neighb.method = 'triangulation'; > >>>>> > >>>>> cfg_neighb.layout = lay; > >>>>> > >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>>>> > >>>>> > >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>>>> > >>>>> > >>>>> %For computing the grand average > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = 'all'; > >>>>> > >>>>> cfg.latency = 'all'; > >>>>> > >>>>> cfg.parameter = 'avg'; > >>>>> > >>>>> cfg.keepindividual = 'no' > >>>>> > >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>>>> > >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>>>> > >>>>> % "{:}" means to use data from all elements of the variable > >>>>> > >>>>> > >>>>> For plotting the significant clusters > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.style = 'blank'; > >>>>> > >>>>> cfg.layout = lay; > >>>>> > >>>>> cfg.channellabels = 'yes'; > >>>>> > >>>>> cfg.highlight = 'labels'; > >>>>> > >>>>> cfg.highlightchannel = find(stat.mask); > >>>>> > >>>>> cfg.comment = 'no'; > >>>>> > >>>>> figure; ft_topoplotER(cfg, GA_90) > >>>>> > >>>>> title('Nonparametric: significant with cluster multiple > >>>>> comparison > >>>>> correction') > >>>>> > >>>>> > >>>>> Do you have ANY idea to this? I am really completely > >>>>> helpless.... > >>>>> > >>>>> thanks and best > >>>>> > >>>>> Katrin > >>>>> > >>>>> _______________________________________________ > >>>>> 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 > >>> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> > >> ---------------------------------------------------------------------------- ---- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.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: > > > > > > ------------------------------ > > > > Message: 3 > > Date: Mon, 08 Sep 2014 21:55:44 -0400 > > From: Joseph Dien > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> > > Content-Type: text/plain; charset="windows-1252" > > > > yes, please do send me the data. > > > > Thanks! > > > > Joe > > > > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann > > wrote: > > > >> Dear Joseph, thanks so much, I really appreciate your help. I was > >> also wandering, if maybe there is another bug in my code. > >> Our nets are 128 channels, Hydrocel, but as a colleague of me > >> adviced me to do so, I also tried the 129 layout. > >> My code you find below (without selection of bad channels etc.) > >> If you need also the data of two subjects to have a look, let me > >> know!!! > >> Best and thanks really! > >> Katrin > >> > >> > >> > >> subject=input('Which subject do you want to analyse? ','s'); > >> > >> name = strcat(subject,'.raw'); > >> > >> subjectnumber=input('Which is the subjectnumber?', 's'); > >> > >> sb=subjectnumber > >> > >> %subjectnumber = strcat(subjectnumber, '.txt') > >> > >> %% > >> > >> > >> > >> cfg = []; > >> > >> cfg.dataset = name; > >> > >> cfg.trialfun = 'ft_trialfun_general'; % this is the default > >> > >> cfg.trialdef.eventtype = 'trigger'; > >> > >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > >> trigger > >> > >> cfg.trialdef.prestim = 0.234; % in seconds > >> > >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > >> observation, but maybe we need less) > >> > >> cfg = ft_definetrial(cfg); > >> > >> > >> > >> cfg.trl([1:7],:) = []; > >> > >> > >> > >> %change timeline according to constant offset of 16 ms = 8 samples > >> (because recorded with 500 hz)in > >> > >> %structure trial > >> > >> cfg.trl(:,3)=cfg.trl(:,3)-8 > >> > >> > >> > >> %change timeline to make the cut the zeropoint > >> > >> > >> > >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; > >> > >> > >> > >> > >> > >> %% preprocess data > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.detrend = 'yes'; > >> > >> cfg.preproc.demean = 'yes'; > >> > >> cfg.preproc.baselinewindow = [-2.1 -2.0] > >> > >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > >> filtered > >> > >> %(0.1-45) and bad channels have to be replaced!!!! > >> > >> %cfg.preproc.bpfreq = [6 32]; > >> > >> % > >> > >> % > >> > >> obs_data = ft_preprocessing(cfg); > >> > >> % > >> > >> save (strcat(sb,'obs_data') , 'obs_data') > >> > >> > >> > >> %% determining channel neighbours (necessary for Artifact > >> detection) > >> > >> cfg = []; > >> > >> cfg.channel = obs_data.label; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.feedback = 'yes'; > >> > >> lay = ft_prepare_layout(cfg); > >> > >> > >> cfg_neighb = []; > >> > >> cfg_neighb.feedback = 'yes'; > >> > >> > >> > >> cfg_neighb.method = 'triangulation'; > >> > >> cfg_neighb.layout = 'GSN128.sfp'; > >> > >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> obs_data.elec = ft_read_sens('GSN128.sfp'); > >> > >> > >> > >> %% Artifacts - to detect bad channels - is not saved!!! > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs_data_try = ft_rejectvisual(cfg, obs_data); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_try = ft_rejectartifact (cfg,obs_data); > >> > >> > >> > >> > >> > >> %% Preparing neighbours for channel repair - but bad channel info > >> in!!! > >> > >> > >> > >> % cfg_neighb = []; > >> > >> % cfg_neighb.feedback = 'yes'; > >> > >> % cfg_neighb.method = 'triangulation'; > >> > >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > >> > >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> % Interpolate and put into new data structure > >> > >> cfg = []; > >> > >> cfg.badchannel = {}; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.method = 'nearest'; > >> > >> cfg.neighbours = neighbours; > >> > >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >> > >> > >> > >> % Check reconstruction > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> % dat1=obs_data; > >> > >> % dat2=obs_data_channelrepaired; > >> > >> % > >> > >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > >> > >> % y=dat2.trial{1}(62,:); > >> > >> % plot(x);hold on;plot(y,'r'); > >> > >> % > >> > >> % x=dat1.trial{1}(72,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> % > >> > >> % x=dat1.trial{1}(75,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> %% artifact rejection/trial inspection - throw out electrode jumps > >> etc. > >> > >> > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > >> according to channels interpolated %% 128-number of interp. > >> channels) > >> > >> > >> cfg = []; > >> > >> cfg.channel = {'all'}; > >> > >> cfg.numcomponent = 128 > >> > >> comp = ft_componentanalysis(cfg,obs_data_clean1); > >> > >> save (strcat(sb,'comp_all') , 'comp') > >> > >> > >> > >> %% > >> > >> cfg = []; > >> > >> cfg.viewmode = 'component'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='some'; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> ft_databrowser(cfg,comp); > >> > >> > >> > >> %% poweranalysis components > >> > >> cfg = []; > >> > >> cfg.output = 'pow'; > >> > >> cfg.channel = 'all';%compute the power spectrum in all ICs > >> > >> cfg.method = 'mtmfft'; > >> > >> cfg.taper = 'hanning'; > >> > >> cfg.foi = 0:0.2:50; > >> > >> obs_freq = ft_freqanalysis(cfg, comp); > >> > >> > >> > >> %And you can plot the spectra: > >> > >> > >> > >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > >> > >> nsubplots = 16; > >> > >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > >> decimals, type doc subplot > >> > >> > >> > >> Nfigs = ceil(size(comp.topo,1)/nsubplots); > >> > >> tot = Nfigs*nsubplots; > >> > >> > >> > >> rptvect = 1:size(comp.topo,1); > >> > >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > >> > >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; > >> > >> > >> > >> for r=1:size(rptvect,1); > >> > >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 > >> 1]);%full screen > >> > >> k=0; > >> > >> for j=1:size(rptvect,2); > >> > >> if~(rptvect(r,j)==0); > >> > >> k=k+1; > >> > >> cfg=[]; > >> > >> cfg.channel = rptvect(r,j); > >> > >> cfg.ylim =[0 500] > >> > >> cfg.xlim =[0 50] > >> > >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > >> > >> end > >> > >> end > >> > >> end > >> > >> > >> > >> %For the IC topos you'll follow the same logic as above but with: > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [1:20]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [21:40]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [41:60]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [61:80]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% Seperate observation conditions > >> > >> > >> > >> name1= strcat(num2str(sb),'_90.xls'); > >> > >> list1=xlsread (name1) > >> > >> > >> > >> name2= strcat(num2str(sb),'_180.xls'); > >> > >> list2=xlsread (name2) > >> > >> > >> % > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list1] > >> > >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list2] > >> > >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> %%PIPELINE FOR obs90 > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128; > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> > >> > >> comp_1 = ft_componentanalysis(cfg, obs90_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > >> obs90_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts - final detection > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs90_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > >> > >> > >> > >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > >> > >> > >> > >> %% plot it > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% PIPELINE FOR obs180 > >> > >> > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128 > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> comp_2 = ft_componentanalysis(cfg, obs180_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > >> obs180_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts final 180 > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs180_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > >> > >> > >> > >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > >> > >> > >> > >> %% plot 180 ERP > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs180_data_ERP) > >> > >> > >> > >> %% plot both ERPs > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> cfg.showlabels = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > >> > >> > >> > >> %% plot difference wave > >> > >> > >> > >> difference = obs180_data_ERP; % copy one of > >> the structures > >> > >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % > >> compute the difference ERP > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, difference) > >> > >> > >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI data. A couple things. First of all, exactly which net do > >> you use? If they are 129-channel, there is still the question of > >> whether they are the Hydrocel or the older geodesic nets. > >> Regardless, that shouldn't cause an error like this. Could you > >> send me the file you are trying to process and the script you are > >> using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini > >> wrote: > >> > >>> Which nets do you use? I use EGI. I tried both the ones you > >>> mention and they didn't work. It was hard to find that exact one > >>> online but it was the only file that actually worked. > >>> > >>> > >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >>> wrote: > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one I use > >>> > >>> > >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > >>> wrote: > >>> Dear all, my problems seem neverending. This time however i really > >>> need help. > >>> I implemented a pipeline for ERPs. All works now, trialdefinition, > >>> preprocessing, channelreplacement, ica, componentrejection, final > >>> artifactdetection, timelock of the single subject data. However, > >>> when I wanna compute the grandaverage of the single subjects I get > >>> the following error message: > >>> > >>> computing average of avg over 19 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 3 MB > >>> computing average of avg over 2 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 0 MB > >>> the call to "ft_prepare_layout" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> the call to "ft_topoplotER" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> > >>> Furthermore in the plot of the significant clusters, the > >>> channelnames are mixed up (do not correspond to my net) > >>> > >>> > >>> I guess that there is a problem with the layout I use. > >>> Here the code that I use > >>> > >>> %For generating the layout (also in the single subjects): > >>> cfg = []; > >>> > >>> cfg.channel = obs_data.label; > >>> > >>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>> > >>> cfg.feedback = 'yes'; > >>> > >>> lay = ft_prepare_layout(cfg); > >>> > >>> > >>> cfg_neighb = []; > >>> > >>> cfg_neighb.feedback = 'yes'; > >>> > >>> cfg_neighb.method = 'triangulation'; > >>> > >>> cfg_neighb.layout = lay; > >>> > >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>> > >>> > >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>> > >>> > >>> > >>> %For computing the grand average > >>> > >>> cfg = []; > >>> > >>> cfg.channel = 'all'; > >>> > >>> cfg.latency = 'all'; > >>> > >>> cfg.parameter = 'avg'; > >>> > >>> cfg.keepindividual = 'no' > >>> > >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>> > >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>> > >>> % "{:}" means to use data from all elements of the variable > >>> > >>> > >>> For plotting the significant clusters > >>> > >>> cfg = []; > >>> > >>> cfg.style = 'blank'; > >>> > >>> cfg.layout = lay; > >>> > >>> cfg.channellabels = 'yes'; > >>> > >>> cfg.highlight = 'labels'; > >>> > >>> cfg.highlightchannel = find(stat.mask); > >>> > >>> cfg.comment = 'no'; > >>> > >>> figure; ft_topoplotER(cfg, GA_90) > >>> > >>> title('Nonparametric: significant with cluster multiple comparison > >>> correction') > >>> > >>> > >>> > >>> Do you have ANY idea to this? I am really completely helpless.... > >>> > >>> thanks and best > >>> > >>> Katrin > >>> > >>> > >>> _______________________________________________ > >>> 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 > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> ---------------------------------------------------------------------------- ---- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.com > >> > >> > >> _______________________________________________ > >> 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 > > > > ---------------------------------------------------------------------------- ---- > > > > Joseph Dien, PhD > > Research Associate > > Cognitive Neurology > > The Johns Hopkins University School of Medicine > > > > Lab E-mail: jdien1 at jhmi.edu > > Private E-mail: jdien07 at mac.com > > Office Phone: 410-614-3115 > > Cell Phone: 202-297-8117 > > Fax: 410-955-0188 > > http://joedien.com > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 4 > > Date: Tue, 9 Sep 2014 06:37:13 +0000 > > From: "Caspar, Emilie" > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > > bad > > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi Ashley, > > > > Maybe the mistake is you did not integrate in your script the > > command to save the rejection. Normally, with the following command, > > you will see in the Matlab Window that artifacts are correctly > > rejected after the "quit" button. > > > > clean_data = ft_rejectvisual(cfg, interpoldata); > > cfg.artfctdef.reject = 'complete'; > > cfg.artfctdef.feedback = 'yes'; > > cleandata = ft_rejectartifact(cfg,clean_data); > > > > Emilie > > > > > > > > > > > > Le 3 sept. 2014 ? 11:58, Ashley Greene > > > a ?crit : > > > > Hello, > > > > I have used the rejectvisual function in attempt to remove bad > > trials, but after marking them and pressing the quit button, > > although the command window states that the selected trials have > > been removed, there is no obvious change in the data; all of the > > trials are still intact. Have I overlooked something? > > > > Thanks, > > > > Ashley > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 5 > > Date: Tue, 09 Sep 2014 14:16:20 +0200 > > From: Patricia Wollstadt > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: <540EEF94.9080601 at gmx.de> > > Content-Type: text/plain; charset="windows-1252" > > > > Hello Max, > > > > I added a few comments to the questions regarding individual > > parameters > > below. To address the general problem of TRENTOOL telling you, that > > there are not enough sample points in your data: From what I can see > > in > > your script, you probably don't have enough data points in each time > > series to robustly estimate TE. You analyze 800 ms of data sampled > > at > > 300 Hz, which gives you 240 samples per time series. Can you maybe > > avoid > > downsampling to 300 Hz and downsample to 600 Hz instead? Or could > > you > > analyze a longer time window of interest? > > Note that you also 'lose' data to embedding and the interaction > > delay: > > The first point that can be used for TE estimation is at max. > > embedding > > length + max. interaction delay in samples. For example: max. > > embedding > > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the > > max > > interaction delay of 30 ms = 9 samples. In this example, you would > > be > > left with 240 - 29 samples for TE estimation per trial. There is > > also > > the possibility to estimate time resolved TE/TE for shorter time > > windows > > of interest (see section 4.4 in the manual); however, this method > > requires the use of a GPU for TE estimation. > > > > I would further recommend to use the new pipeline for group > > statistics > > described in the manual in section 4.5 (the function > > 'TEgroup_calculate' > > is deprecated). The new pipeline allows you to reconstruct the > > interaction delay and uses the following functions (see also > > comments in > > the script): > > > > TEgroup_prepare -> prepares all data sets (all subjects/all > > conditions) for group analysis (this means finding common embedding > > parameters such that estimates are not biased between groups) > > InteractionDelayReconstruction_calculate -> estimates TE for > > individual data sets and all assumed interaction delays u > > InteractionDelayReconstruction_analyze -> reconstructs the > > interaction delay by selecting the u that maximizes TE for each > > channel > > TEgroup_stats -> calculate group statistics using a permutation test > > > > I can send you an example script for group TE analysis using this > > pipeline to get you started. I hope this helps you to get the group > > analysis running. Just write again if you're having trouble setting > > up > > the pipeline or something is not clear about the parameters/my > > comments. > > > > Best, > > Patricia > > > > > > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not > >> 100% sure if it is appropriate to ask questions about it here, but > >> to > >> the best of my knowledge they do not have a mailing list and I saw > >> a > >> few trentool questions in the archives, so I'm going to assume it's > >> ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present > >> in the pipeline. Sorry in advance for the long post! Any help would > >> be > >> greatly appreciated as I'm a bit over my head on this but I think > >> I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data > >> that was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi is > >> in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within the toi, but beyond that are there any benefits to it being > >> earlier or later?* PW: The predictiontime_u is in milliseconds and > >> the > >> toi is in seconds. The prediction time is the assumed interaction > >> delay between your two sources and should fit within your toi. In > >> general it is preferable to use the method for interaction delay > >> reconstruction for TE estimation, because it allows you to > >> reconstruct > >> the actual delay between your source and target times series. A > >> non-optimal u/interaction delay may cause an underestimation of TE, > >> so > >> it is recommended to use the pipeline for interaction delay > >> reconstruction whenever estimating TE for unknown delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, so it is best to limit the u range to values that are > >> physiologically plausible. > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the > >> sample rate and filters are used to determine the actthrvalue, but > >> I > >> don't actually know the calculation. 7.5 was a rough guess just to > >> test the pipeline. I'm also uncertain of what minnrtrials should > >> be.* > >> PW: You can set the actthrvalue based on the filtering you did > >> prior > >> to TE analysis. If you for example highpass filtered at 10 Hz, you > >> shouldn't find an ACT higher than 30 samples, because you filtered > >> out > >> any components of the signal slower than 10 Hz/30 samples (given > >> your > >> sampling frequency of 300 Hz). So in this scenario the actthrvalue > >> would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> * > >> * > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm > >> yet to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* > >> PW: The Ragwitz criterion tries to find optimal embedding > >> parameters > >> dim and tau for the data. To do that, the method iteratively takes > >> all > >> possible combinations of dim and tau values that are provided in > >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well > >> these > >> combinations embed the data. To test an embedding, the method > >> builds > >> the embedding vectors from the data; it then tests for each point > >> how > >> well the next point in time can be predicted from the reference > >> point's nearest neighbours. So for each embedded point, the method > >> searches for the nearest neighbours and calculates the average of > >> those nearest neighbours. The difference between the > >> averaged/predicted point and the actual next point is the error of > >> the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested > >> by the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together with 'ragtausteps' specifies the tau values to be tested > >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, > >> that > >> the values here are factors that are later multiplied with the ACT > >> to > >> obtain the actual tau. 'repPred' is the number of points that will > >> be > >> used for the local prediction, i.e. the Ragwitz criterion will test > >> the local prediction and calculate the error for the first 100 > >> points > >> in your time series. The two parameters 'flagNei' ans 'sizeNei' > >> below > >> specify the type of neighbour search conducted by the Ragwitz > >> criterion: 'flagNei' tells the method to either conduct a kNN or > >> range > >> search; 'sizeNei' specifies the number of neighbours or the radius > >> to > >> be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> * > >> * > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> * > >> * > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.*TRENTOOL seems to handle data output very differently > >> from > >> fieldtrip and I've had trouble thinking through the most logical > >> way > >> to handle the data so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> * > >> * > >> *For clarification, fileCell is a cell with the name of each > >> condition > >> x subject .mat file, which as I said before is collectively the > >> same > >> as the 3 x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> * > >> * > >> *At this step I get the following error: > >> > >> Error using transferentropy (line 337) > >> \nTRENTOOL ERROR: not enough data points left after embedding > >> > >> Error in TEgroup_calculate (line 133) > >> [TEresult] = transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate > >> is a pipeline issue* (I noticed the example pipeline in trentool, > >> the > >> manual, and published methods articles all seem to have slightly or > >> significantly different pipeline compositions), *or if the error > >> is* > >> due to ACT, ragwitz optimization, or some other faulty > >> parameterization *on my part due to a lack of understanding of how > >> transfer entropy works on a more theoretical/mathematical level*. > >> If > >> the latter is the case, is there any relatively straightforward way > >> to > >> conceptualize this, or is this something where I'm just going to > >> have > >> to keep reading and rereading until it eventually makes sense? I've > >> already done quite a bit of that and it hasn't pierced my thick > >> skull > >> yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> 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: > > > > > > ------------------------------ > > > > Message: 6 > > Date: Tue, 9 Sep 2014 15:21:20 +0200 > > From: Holger Krause > > To: FieldTrip discussion list > > Subject: [FieldTrip] Latest FT version on ftp-server is from three > > days ago > > Message-ID: > > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> > > Content-Type: text/plain; charset="us-ascii" > > > > Dear developers, > > > > Could you please check the process for creation/publication of > > zip-files on > > the FTP server? The latest file I can find there is > > fieldtrip-20140906.zip. > > > > Thanks in advance, > > > > Holger > > > > > > ------------------------------ > > > > Message: 7 > > Date: Tue, 9 Sep 2014 09:19:55 -0400 > > From: Max Cantor > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > This is immensely helpful, thank you. I was very confused about why > > some > > versions of the pipeline I saw were using group calculate and others > > were > > using interaction delay reconstruction and what that meant, and I > > think I > > have a more clear idea of what the different steps of the pipeline > > are > > doing. There are still a few things I'm a bit confused about though > > in > > terms of the pipeline. For instance, whether or not I need to do > > TEprepare > > before group prepare, and if I need to do graph analysis (which I'm > > not > > sure I fully understand but also haven't looked deeply into) before > > group > > stats. > > > > If you don't mind me taking you up on your offer, I think seeing > > your > > example script might help clarify some of these issues. > > > > Thank you! > > > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > > Patricia.Wollstadt at gmx.de> wrote: > > > >> Hello Max, > >> > >> I added a few comments to the questions regarding individual > >> parameters > >> below. To address the general problem of TRENTOOL telling you, that > >> there > >> are not enough sample points in your data: From what I can see in > >> your > >> script, you probably don't have enough data points in each time > >> series to > >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, > >> which > >> gives you 240 samples per time series. Can you maybe avoid > >> downsampling to > >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a > >> longer time > >> window of interest? > >> Note that you also 'lose' data to embedding and the interaction > >> delay: The > >> first point that can be used for TE estimation is at max. embedding > >> length > >> + max. interaction delay in samples. For example: max. embedding > >> length = > >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max > >> interaction > >> delay of 30 ms = 9 samples. In this example, you would be left with > >> 240 - > >> 29 samples for TE estimation per trial. There is also the > >> possibility to > >> estimate time resolved TE/TE for shorter time windows of interest > >> (see > >> section 4.4 in the manual); however, this method requires the use > >> of a GPU > >> for TE estimation. > >> > >> I would further recommend to use the new pipeline for group > >> statistics > >> described in the manual in section 4.5 (the function > >> 'TEgroup_calculate' is > >> deprecated). The new pipeline allows you to reconstruct the > >> interaction > >> delay and uses the following functions (see also comments in the > >> script): > >> > >> TEgroup_prepare -> prepares all data sets (all subjects/all > >> conditions) > >> for group analysis (this means finding common embedding parameters > >> such > >> that estimates are not biased between groups) > >> InteractionDelayReconstruction_calculate -> estimates TE for > >> individual data sets and all assumed interaction delays u > >> InteractionDelayReconstruction_analyze -> reconstructs the > >> interaction delay by selecting the u that maximizes TE for each > >> channel > >> TEgroup_stats -> calculate group statistics using a permutation > >> test > >> > >> I can send you an example script for group TE analysis using this > >> pipeline > >> to get you started. I hope this helps you to get the group analysis > >> running. Just write again if you're having trouble setting up the > >> pipeline > >> or something is not clear about the parameters/my comments. > >> > >> Best, > >> Patricia > >> > >> > >> > >> > >> On 09/04/2014 08:30 PM, Max Cantor wrote: > >> > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not 100% > >> sure if it is appropriate to ask questions about it here, but to > >> the best > >> of my knowledge they do not have a mailing list and I saw a few > >> trentool > >> questions in the archives, so I'm going to assume it's ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present in > >> the pipeline. Sorry in advance for the long post! Any help would be > >> greatly > >> appreciated as I'm a bit over my head on this but I think I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data that > >> was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi > >> is in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within > >> the toi, but beyond that are there any benefits to it being earlier > >> or > >> later?* PW: The predictiontime_u is in milliseconds and the toi is > >> in > >> seconds. The prediction time is the assumed interaction delay > >> between your > >> two sources and should fit within your toi. In general it is > >> preferable to > >> use the method for interaction delay reconstruction for TE > >> estimation, > >> because it allows you to reconstruct the actual delay between your > >> source > >> and target times series. A non-optimal u/interaction delay may > >> cause an > >> underestimation of TE, so it is recommended to use the pipeline for > >> interaction delay reconstruction whenever estimating TE for unknown > >> delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, > >> so it is best to limit the u range to values that are > >> physiologically > >> plausible. > >> > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the sample > >> rate and filters are used to determine the actthrvalue, but I don't > >> actually know the calculation. 7.5 was a rough guess just to test > >> the > >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: > >> You can > >> set the actthrvalue based on the filtering you did prior to TE > >> analysis. If > >> you for example highpass filtered at 10 Hz, you shouldn't find an > >> ACT > >> higher than 30 samples, because you filtered out any components of > >> the > >> signal slower than 10 Hz/30 samples (given your sampling frequency > >> of 300 > >> Hz). So in this scenario the actthrvalue would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm yet > >> to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* PW: > >> The Ragwitz criterion tries to find optimal embedding parameters > >> dim and > >> tau for the data. To do that, the method iteratively takes all > >> possible > >> combinations of dim and tau values that are provided in cfgP.ragdim > >> and > >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations > >> embed > >> the data. To test an embedding, the method builds the embedding > >> vectors > >> from the data; it then tests for each point how well the next point > >> in time > >> can be predicted from the reference point's nearest neighbours. So > >> for each > >> embedded point, the method searches for the nearest neighbours and > >> calculates the average of those nearest neighbours. The difference > >> between > >> the averaged/predicted point and the actual next point is the error > >> of the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested by > >> the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together > >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL > >> will > >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values > >> here are > >> factors that are later multiplied with the ACT to obtain the actual > >> tau. > >> 'repPred' is the number of points that will be used for the local > >> prediction, i.e. the Ragwitz criterion will test the local > >> prediction and > >> calculate the error for the first 100 points in your time series. > >> The two > >> parameters 'flagNei' ans 'sizeNei' below specify the type of > >> neighbour > >> search conducted by the Ragwitz criterion: 'flagNei' tells the > >> method to > >> either conduct a kNN or range search; 'sizeNei' specifies the > >> number of > >> neighbours or the radius to be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' > >> data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject > >> virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.* > >> TRENTOOL seems to handle data output very differently from > >> fieldtrip and > >> I've had trouble thinking through the most logical way to handle > >> the data > >> so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> > >> *For clarification, fileCell is a cell with the name of each > >> condition x > >> subject .mat file, which as I said before is collectively the same > >> as the 3 > >> x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> > >> > >> > >> > >> > >> > >> > >> *At this step I get the following error: Error using > >> transferentropy (line > >> 337) \nTRENTOOL ERROR: not enough data points left after embedding > >> Error in > >> TEgroup_calculate (line 133) [TEresult] = > >> transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate is a > >> pipeline issue* (I noticed the example pipeline in trentool, the > >> manual, > >> and published methods articles all seem to have slightly or > >> significantly > >> different pipeline compositions), *or if the error is* due to ACT, > >> ragwitz optimization, or some other faulty parameterization *on my > >> part > >> due to a lack of understanding of how transfer entropy works on a > >> more > >> theoretical/mathematical level*. If the latter is the case, is > >> there any > >> relatively straightforward way to conceptualize this, or is this > >> something > >> where I'm just going to have to keep reading and rereading until it > >> eventually makes sense? I've already done quite a bit of that and > >> it hasn't > >> pierced my thick skull yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> fieldtrip mailing > >> listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie ldtrip > >> > >> > >> -- > >> ------------------------------------------------------------ > >> > >> 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 > >> > > > > > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > -------------- 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 46, Issue 3 > > **************************************** > > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gamaliel.ghu at gmail.com Tue Sep 16 06:49:37 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Tue, 16 Sep 2014 01:49:37 -0300 Subject: [FieldTrip] dipole simulation on head model Message-ID: Hi all I followed the tips above to simulate a dipole source on my own head model generated from MRIs. However, using information from: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit I could not simulate anything. Only one image is blank. The code I am using is as follows: cfg = []; cfg.vol = vol; % See above cfg.elec = elec; % See above cfg.dip.pos = [0 0 0]; cfg.dip.mom = [2 2 2]; % Note, it Should be transposed cfg.dip.frequency = 10; cfg.ntrials = 10; cfg.triallength = 1; % seconds cfg.fsample = 25; % Hz raw1 = ft_dipolesimulation (cfg); ft_timelockanalysis avg1 = ([], raw1); plot (avg1.time, avg1.avg); % Plot the timecourse where: vol = ft_prepare_headmodel volumes generated from the segmentation of my resonances. and ft_read_sens elec = ('standard_1020.elc'); to run the script the result is a blank image. and Matlab tells me the following: using headmodel specified in the configuration using electrodes specified in the configuration Determining source compartment (1) projecting electrodes on skin surface electrode and system combine combining transfer matrix computing simulated data computing simulated trial data for 10 RMS value of simulated data is NaN the call to "ft_dipolesimulation" took 4 seconds the input is raw Data with 97 channels and 10 trials Warning: the data does not Contain a definition trial > In utilities \ private \ warning_once at 158 In utilities \ private \ fixsampleinfo at 66 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 Warning: sampleinfo by reconstructing Assuming That the trials are consecutive segments of a continuous recording > In utilities \ private \ warning_once at 158 In utilities \ private \ fixsampleinfo at 79 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 averaging trials trial averaging 10 of 10 the call to "ft_timelockanalysis" took 1 seconds I hope you can help greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Tue Sep 16 08:07:19 2014 From: a.stolk8 at gmail.com (a.stolk) Date: Tue, 16 Sep 2014 08:07:19 +0200 Subject: [FieldTrip] dipole simulation on head model Message-ID: Hi Gamaliel, can you try avg = ft_timelockanalysis([], raw1);  Instead of ft_timelockanalysis avg1 = ([], raw1);  Hope this helps, arjen -------- Oorspronkelijk bericht -------- Van: gamaliel huerta urrea Datum: Aan: fieldtrip at science.ru.nl Onderwerp: [FieldTrip] dipole simulation on head model Hi all I followed the tips above to simulate a dipole source on my own head model generated from MRIs. However, using information from:  http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit I could not simulate anything. Only one image is blank. The code I am using is as follows:  cfg = [];  cfg.vol = vol; % See above  cfg.elec = elec; % See above  cfg.dip.pos = [0 0 0];  cfg.dip.mom = [2 2 2]; % Note, it Should be transposed  cfg.dip.frequency = 10;  cfg.ntrials = 10;  cfg.triallength = 1; % seconds  cfg.fsample = 25; % Hz  raw1 = ft_dipolesimulation (cfg);  ft_timelockanalysis avg1 = ([], raw1);  plot (avg1.time, avg1.avg); % Plot the timecourse  where:  vol = ft_prepare_headmodel volumes generated from the segmentation of my resonances.  and  ft_read_sens elec = ('standard_1020.elc');  to run the script the result is a blank image.  and Matlab tells me the following:  using headmodel specified in the configuration  using electrodes specified in the configuration  Determining source compartment (1)  projecting electrodes on skin surface  electrode and system combine combining transfer matrix  computing simulated data  computing simulated trial data for 10  RMS value of simulated data is NaN  the call to "ft_dipolesimulation" took 4 seconds  the input is raw Data with 97 channels and 10 trials  Warning: the data does not Contain a definition trial  > In utilities \ private \ warning_once at 158     In utilities \ private \ fixsampleinfo at 66     In ft_datatype_raw at 157     In ft_checkdata at 224     In ft_timelockanalysis at 105     In codgen at 50  Warning: sampleinfo by reconstructing Assuming That the trials are consecutive segments of  a continuous recording  > In utilities \ private \ warning_once at 158     In utilities \ private \ fixsampleinfo at 79     In ft_datatype_raw at 157     In ft_checkdata at 224     In ft_timelockanalysis at 105     In codgen at 50  averaging trials  trial averaging 10 of 10  the call to "ft_timelockanalysis" took 1 seconds  I hope you can help  greetings -- Gamaliel Huerta Ingeniería Civil Biomédica Universidad de Valparaíso -------------- next part -------------- An HTML attachment was scrubbed... URL: From Holger.Krause at med.uni-duesseldorf.de Tue Sep 16 11:35:30 2014 From: Holger.Krause at med.uni-duesseldorf.de (Holger Krause) Date: Tue, 16 Sep 2014 11:35:30 +0200 Subject: [FieldTrip] Latest FT version on ftp-server is from three days ago In-Reply-To: <201409091521.22589.Holger.Krause@med.uni-duesseldorf.de> Message-ID: <201409161135.32594.Holger.Krause@med.uni-duesseldorf.de> Hi! Again, same situation as last week :-( The latest file I can find on the FTP server is fieldtrip-20140913.zip. Thanks for taking care of this issue, 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 r.oostenveld at donders.ru.nl Tue Sep 16 12:15:11 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 16 Sep 2014 12:15:11 +0200 Subject: [FieldTrip] Latest FT version on ftp-server is from three days ago In-Reply-To: <201409161135.32594.Holger.Krause@med.uni-duesseldorf.de> References: <201409161135.32594.Holger.Krause@med.uni-duesseldorf.de> Message-ID: <4C0CDFB7-782E-49C1-9659-B85ABB918486@donders.ru.nl> Hi Holger, Thanks for notifying. We had a server crash a few days ago. One of the consequences seems to have been that the automatic svn update script blocked. I did a cleanup and the automatic releases on the ftp should start coming again. Note that alternative ways to access the code are explained on http://fieldtrip.fcdonders.nl/faq/i_would_like_an_automatic_daily_updated_version_of_the_code_can_i_get_access_to_the_cvs_or_snv_server best regards, Robert On 16 Sep 2014, at 11:35, Holger Krause wrote: > Hi! > > Again, same situation as last week :-( The latest file I can find on the FTP > server is fieldtrip-20140913.zip. > > Thanks for taking care of this issue, > > 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 gauthierb.ens at gmail.com Tue Sep 16 14:27:15 2014 From: gauthierb.ens at gmail.com (Baptiste Gauthier) Date: Tue, 16 Sep 2014 14:27:15 +0200 Subject: [FieldTrip] difference in raw time sample values for .fif files read by fieldtrip vs mne-python Message-ID: Dear fieldtrippers, I recently observed that reading a raw neuromag .fif file with fieldtrip and mne-python (with default settings for both) give exactly the same events separated by the same time (which is good!) but with a different time offset: the zero-point definition for the recording differ between the two softwares. I hypothesize that this difference comes from the convention adopted: fieldtrip would use the "record raw" trigger as a zero-point and mne the "start" trigger that occur earlier (i.e. you can follow the signal but it will be not saved in the file), but I'm not perfectly sure. As someone already observed this difference? It's harmless because it doesn't affect relative timing of the event but become problematic to transfer recoded events trl from fieldtrip to mne-python with a time-sample matching strategy. Best, Baptiste -- Baptiste Gauthier Postdoctoral Research Fellow INSERM-CEA Cognitive Neuroimaging unit CEA/SAC/DSV/DRM/Neurospin center Bât 145, Point Courier 156 F-91191 Gif-sur-Yvette Cedex FRANCE -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.gerhold at gmail.com Tue Sep 16 17:03:33 2014 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Tue, 16 Sep 2014 17:03:33 +0200 Subject: [FieldTrip] ft_connectivityanalysis vs MATLAB Message-ID: Hi, I've compared the non-parametric calculation of the coherence spectrum using ft_connectivityanalysis to mscohere (MATLAB). The FT function provides inflated coherence values in comparison to the MATLAB function. I've also referenced this to a implementation of the original calculation which equates to the MATLAB output. Any advice would be appreciated. Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.gerhold at gmail.com Tue Sep 16 17:16:00 2014 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Tue, 16 Sep 2014 17:16:00 +0200 Subject: [FieldTrip] ft_connectivity_pdc Message-ID: When computing pdc in FT, line 67 of ft_connectivity_pdc appears to invert the spectral transfer func. When inverting I received the following error: Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 6.358859e-18. Will this impact on the final spectrum calculated by the method. If so, is there a possible workaround/solution? Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From gamaliel.ghu at gmail.com Tue Sep 16 19:20:36 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Tue, 16 Sep 2014 14:20:36 -0300 Subject: [FieldTrip] dipole simulation on head model Message-ID: Hi all I followed the tips above to simulate a dipole source on my own head model generated from MRIs. However, using information from: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit I could not simulate anything. Only one image is blank. The code I am using is as follows: cfg = []; cfg.vol = vol; % See above cfg.elec = elec; % See above cfg.dip.pos = [0 0 0]; cfg.dip.mom = [2 2 2]; % Note, it Should be transposed cfg.dip.frequency = 10; cfg.ntrials = 10; cfg.triallength = 1; % seconds cfg.fsample = 25; % Hz raw1 = ft_dipolesimulation (cfg); avg1 = ft_timelockanalysis([], raw1); plot (avg1.time, avg1.avg); % Plot the timecourse where: vol = ft_prepare_headmodel volumes generated from the segmentation of my resonances. and ft_read_sens elec = ('standard_1020.elc'); to run the script the result is a blank image. and Matlab tells me the following: using headmodel specified in the configuration using electrodes specified in the configuration Determining source compartment (1) projecting electrodes on skin surface electrode and system combine combining transfer matrix computing simulated data computing simulated trial data for 10 RMS value of simulated data is NaN the call to "ft_dipolesimulation" took 4 seconds the input is raw Data with 97 channels and 10 trials Warning: the data does not Contain a definition trial >* In utilities \ private \ warning_once at 158 * In utilities \ private \ fixsampleinfo at 66 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 Warning: sampleinfo by reconstructing Assuming That the trials are consecutive segments of a continuous recording >* In utilities \ private \ warning_once at 158 * In utilities \ private \ fixsampleinfo at 79 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 averaging trials trial averaging 10 of 10 the call to "ft_timelockanalysis" took 1 seconds I hope you can help greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.lalancette at sickkids.ca Tue Sep 16 20:42:21 2014 From: marc.lalancette at sickkids.ca (Marc Lalancette) Date: Tue, 16 Sep 2014 18:42:21 +0000 Subject: [FieldTrip] MEG lead field units Message-ID: <2A2B6A5B8C4C174CBCCE0B45E548DEB229FBB67F@SKMBXX01.sickkids.ca> Hello Fieldtrippies, Regarding a question I asked some months ago about the physical units of the lead field in Fieldtrip, I wanted to share the fact that I was wrong, and that it might be good to either document this in the code and possibly to add a factor. When using 'cm' units, the lead field is in Wb/cm^2/(A*m) = 1e4 T/Am = 1e2 T/(A*cm). I started to realize my original assumption was wrong while working on my Biomag poster since I was getting very low SNR values (around 1) for typical source and system parameters. So I looked closer at the single sphere code and my own old spherical forward solution code, and here is where the extra factor comes in: Skipping to the last step, my formula is: B = UnitConversion * (1e-7) * ( (QxrQ/F - (QxrQ * rv') * GradF/F^2) * SensorOrient' ); The second factor is the constant mu0/(4*pi) = 10^-7 Wb/Am. Assuming a source (Q) in units of Am and distances in cm, the complicated bit has units of Am*cm/cm^3. Thus without the first factor, B would have units of Wb/cm^2 = 1e4 T, and so I was using UnitConversion = 1e4 in my code, to get B in Tesla. If we don't put in a specific source amplitude (as in Fieldtrip), and still using UnitConversion, then B would be in T/(Am). I guess units can be different than 'cm' though, so the factor would have to take that into account. Note that the single shell forward solution gives the same units as single sphere and would need the same factor. I haven't looked at other forward methods. I also haven't verified if this is correctly dealt with when obtaining reconstructed source amplitudes, say with a beamformer. Cheers, Marc Lalancette Lab Research Project Manager The Hospital for Sick Children, Toronto, Canada ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. -------------- next part -------------- An HTML attachment was scrubbed... URL: From barbara.schorr at uni-ulm.de Wed Sep 17 11:22:19 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Wed, 17 Sep 2014 11:22:19 +0200 Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable In-Reply-To: References: Message-ID: <20140917112219.crkxv6dgoo0skccc@imap.uni-ulm.de> Dear Jim, I now downloaded the newest fieldtrip version but I still get the same error messag. Is there anything else I need to know? Thanks a lot! Best, Barbara Zitat von 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: ft_rejectvisual: removing trials marked as bad (Ashley Greene) > 2. Read only EEG data from combined MEG/EEG ctf file (Tobias Trame) > 3. Re: ft_globalmeanfield : Undefined function of variable > 'abort' (Herring, J.D. (Jim)) > 4. using ft_megplanar with sinle-trial TFRs (Fr?d?ric Roux) > 5. dipole simulation on head model (gamaliel huerta urrea) > 6. Re: dipole simulation on head model (Tzvetan Popov) > 7. Re: ft_globalmeanfield : Undefined function of variable > 'abort' (Jing Fan) > 8. Re: ft_globalmeanfield : Undefined function of variable > 'abort' (Jing Fan) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 12 Sep 2014 21:39:43 +0900 > From: Ashley Greene > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > bad > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi Emilie, > > Thanks!! I, of course, completely overlooked that. > > Ashley > > On Tue, Sep 9, 2014 at 3:37 PM, Caspar, Emilie wrote: > >> Hi Ashley, >> >> Maybe the mistake is you did not integrate in your script the command to >> save the rejection. Normally, with the following command, you will see in >> the Matlab Window that artifacts are correctly rejected after the "quit" >> button. >> >> clean_data = ft_rejectvisual(cfg, interpoldata); >> cfg.artfctdef.reject = 'complete'; >> cfg.artfctdef.feedback = 'yes'; >> cleandata = ft_rejectartifact(cfg,clean_data); >> >> Emilie >> >> >> >> >> >> Le 3 sept. 2014 ? 11:58, Ashley Greene a ?crit : >> >> Hello, >> >> I have used the rejectvisual function in attempt to remove bad trials, >> but after marking them and pressing the quit button, although the command >> window states that the selected trials have been removed, there is no >> obvious change in the data; all of the trials are still intact. Have I >> overlooked something? >> >> Thanks, >> >> Ashley >> _______________________________________________ >> 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: > > > ------------------------------ > > Message: 2 > Date: Fri, 12 Sep 2014 18:23:17 +0200 (CEST) > From: Tobias Trame > To: > Subject: [FieldTrip] Read only EEG data from combined MEG/EEG ctf file > Message-ID: > > > Content-Type: text/plain; charset=us-ascii > > Hi everybody! > > I'm trying to read only the EEG data from a combined MEG/EEG ctf > file in order > to create leadfields later on, but the function "ft_read_sens" just returns > the gradiometer information in a 'grad' field. It searches for an > 'elec'-field > in the header of the data which is not present. Is there a configuration to > get the EEG-elecrodes by using "ft_read_sens"? > > My first attempt was to write the EEG-Information from the header by hand > using the following code: > > hdr = ft_read_header('subject.ds', 'headerformat', 'ctf_ds'); > elec.elecpos = [hdr.orig.eeg.pos]'; > elec.chanpos = [hdr.orig.eeg.pos]'; > elec.label = {hdr.orig.eeg.name}'; > elec.type = 'eeg'; > elec.unit = 'cm'; > > But now I get a similar problem if I want to create leadfields from timelock > data. After doing the timelock analysis using > > timelock_data = ft_timelockanalysis(cfg, mydata); > > the structure timelock_data contains just a 'grad' and no 'elec' > field so that > ft_prepare_leadfield(cfg, timelock_data) always ignores the EEG-elecrodes and > tries to use the gradiometes - even if I put the electrodes defined > above into > cfg.elec. > > Thanks for any suggestions! > > Tobias > > > ------------------------------ > > Message: 3 > Date: Mon, 15 Sep 2014 12:01:02 +0200 (CEST) > From: "Herring, J.D. (Jim)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of > variable 'abort' > Message-ID: > <2103383764.4690548.1410775262514.JavaMail.root at draco.zimbra.ru.nl> > Content-Type: text/plain; charset=utf-8 > > Dear Barbara, > > The error seems to be related to a bug that pops up now and then > (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be > due to a corrupt installation of fieldtrip and/or the need to update > fieldtrip. > > Could you please try downloading the most recent version of > fieldtrip and see if the problem persists? > > For an example of what can be expected from this function see: Esser > SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A > direct demonstration of cortical LTP in humans: a combined TMS/EEG > study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. > PubMed PMID: 16464689. > > Best, > > Jim > > > ----- Oorspronkelijk bericht ----- >> Van: "barbara schorr" >> Aan: fieldtrip at science.ru.nl >> Verzonden: Woensdag 10 september 2014 14:07:14 >> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of >> variable 'abort' >> Dear fieldtripers. >> >> as mentioned in the subject line I would like to anaylse my timelocked >> ERP Data with the function ft_globalmeanfield. >> >> I get the Error: Undefined function or variable 'abort' >> Error in ft_globalmeanfield (line84) >> if abort >> >> in the function it says: >> >> %the abort variable is set to true or false in ft_preamble_inti >> if abort >> % do not continue function execution in case the outputfile is >> present and the user indicated to keep it >> return >> end >> >> >> I don't understand what this means. I would really appreciate your >> help to get this running. >> >> Also, what is the result when I run this function on my data? (This >> method was proposed from a reviewer. I never used it before, so I >> don't exactly know what it does and what the result will look like). >> >> Thank you very much in advance! >> >> Best, >> >> Barbara Schorr >> >> >> >> >> Zitat von 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: Question regarding nonparametric testing for coherence >> > differences (Eric Maris) >> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >> > 4. Re: ft_rejectvisual: removing trials marked as bad >> > (Caspar, Emilie) >> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >> > 6. Latest FT version on ftp-server is from three days ago >> > (Holger Krause) >> > 7. Re: TRENTOOL pipeline help (Max Cantor) >> > >> > >> > ---------------------------------------------------------------------- >> > >> > Message: 1 >> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >> > From: "Eric Maris" >> > To: , "'FieldTrip discussion list'" >> > >> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >> > for >> > coherence differences >> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Hwee Ling, >> > >> > >> > >> > In the paper you refer to (Maris et al, JNM, 2007), I did not >> > perform a >> > cluster-based permutation test at the level of the channel pairs. >> > Instead, >> > all coherences mentioned in the paper are coherence between a single >> > EMG >> > channel (2 electrodes mounted on the forearm) and all MEG >> > electrodes. Thus, >> > there are as many EMG-MEG coherences as there are MEG channels (275 >> > in our >> > lab), and the clustering of these coherences involves the same >> > neighbourhood >> > structure as the clustering of channel-specific statistics on power >> > or >> > evoked response. The analysis you propose involves clustering in a >> > much more >> > complex space, namely the formed by all (MEG,MEG) channel pairs >> > (275*275=75625 pairs). In the early days of cluster-based >> > permutation >> > statistics, I have worked on this problem but did not pursue it >> > because the >> > resulting clusters are very hard to interpret. >> > >> > >> > >> > Best, >> > >> > >> > >> > Eric Maris >> > >> > >> > >> > >> > >> > Dear all and Prof Maris, >> > >> > I'm re-posting this question again, as I didn't get any replies >> > previously. >> > >> > I?m interested to investigate if there are any differences in phase >> > synchronization in resting state data at timepoint 2 versus >> > timepoint 1. The >> > EEG data was collected using 64 EEG channels, resting state, eyes >> > opened and >> > eyes closed. I?ve arbitrarily segmented the resting state data into >> > epochs >> > of 2s each, and the epochs with artifacts are excluded completely >> > from >> > further analyses. I then performed mtmfft to get the fourier >> > representation >> > of the data, extracted the coherence, and compared the coherence >> > difference >> > of timepoint 2 versus timepoint 1 of all channels paired with all >> > other >> > channels. >> > >> > I figured that if I extract the connectivity analyses without >> > specifying the >> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >> > allow me to >> > perform cluster-based statistical analyses. I get an output with >> > ?chan_chan? >> > dimord variable. However, I was not 100% sure that this is correct, >> > hence, I?ve >> > inserted my code (see below). It?ll be great if you could tell me if >> > what I?m >> > doing makes any sense at all. Also, I don?t know how I can plot the >> > results >> > to see if it make any sense at all. >> > >> > Also, I checked the values obtained from when I specified >> > "cfg.channelcmb" >> > and when I did not specify "cfg.channelcmb", I noticed that the >> > values were >> > somehow different. I would assume that the values to be similar, >> > although >> > I'm not sure why they would have differences in the values obtained >> > from >> > specifying "cfg.channelcmb". >> > >> > This is my code that I've used thus far: >> > >> > for sub = 1:5 >> > >> > cfg = []; >> > >> > cfg.output = 'fourier'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.keeptrials = 'yes'; >> > >> > cfg.tapsmofrq = 5; >> > >> > cfg.foilim = [0 100]; >> > >> > cfg.taper = 'dpss'; >> > >> > % find the index for the c200 condition >> > >> > pre_c200_idx = find(data5.trialinfo == 201); >> > >> > cfg.trials = pre_c200_idx; >> > >> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >> > >> > post_c200_idx = find(data5.trialinfo == 200); >> > >> > cfg.trials = post_c200_idx; >> > >> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >> > >> > >> > >> > cfg = []; >> > >> > cfg.keeptrials = 'no'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.removemean = 'yes'; >> > >> > cfg.method = 'coh'; >> > >> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_pre_c200); >> > >> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_post_c200); >> > >> > end >> > >> > >> > >> > >> load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); >> > >> > cfg_neighb.method = 'template'; >> > >> > cfg_neighb.layout = lay; >> > >> > cfg_neighb.channel = 'all'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, >> > sub_HLF_pre_c200coh{1}); >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.neighbours = neighbours; >> > >> > cfg.channel = 'all'; >> > >> > cfg.channelcmb = {cfg.channel, cfg.channel}; >> > >> > cfg.latency = 'all'; >> > >> > cfg.avgovertime = 'no'; >> > >> > cfg.avgoverchan = 'no'; >> > >> > cfg.parameter = 'cohspctrm'; >> > >> > cfg.method = 'montecarlo'; >> > >> > cfg.statistic = 'depsamplesT'; >> > >> > cfg.correctm = 'cluster'; >> > >> > cfg.tail = 0; >> > >> > % cfg.clustertail = 0; >> > >> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >> > frequency >> > bands. >> > >> > cfg.numrandomization = 10000; >> > >> > cfg.ivar = 2; >> > >> > cfg.uvar = 1; >> > >> > >> > >> > % design matrices >> > >> > clear design; >> > >> > design(1,:) = [1:5, 1:5]; >> > >> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >> > >> > cfg.design = design; >> > >> > % for theta band >> > >> > cfg.avgoverfreq = 'yes'; >> > >> > cfg.frequency = [4 8]; % I also performed the statistics for delta >> > (2-4), >> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >> > (30-40), >> > and gamma (40-100). >> > >> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >> > sub_HLF_post_c200coh{:}, >> > sub_HLF_pre_c200coh{:}); >> > >> > >> > >> > When I tried to plot the results, I used this code: >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.layout = 'lay'; >> > >> > cfg.zlim = [-1 1]; >> > >> > cfg.alpha = 0.05; >> > >> > cfg.refchannel = 'all'; >> > >> > ft_clusterplot(cfg, diffc200_theta_stat); >> > >> > However, I was not sure how I could plot the results. I get an error >> > message >> > from Fieldtrip when using ft_clusterplot: >> > >> > Error using topoplot_common (line 366) >> > >> > no reference channel is specified >> > >> > Error in ft_topoplotTFR (line 192) >> > >> > [cfg] = topoplot_common(cfg, varargin{:}); >> > >> > Error in ft_clusterplot (line 372) >> > >> > ft_topoplotTFR(cfgtopo, stat); >> > >> > >> > >> > According to your paper in 2007, the topoplot of the results were >> > masked by >> > the spatio-spectral pattern of the significant clusters. I don't >> > know how to >> > do this, and I would really appreciate if you can show me how to >> > make such a >> > plot. >> > >> > Thank you very much. >> > >> > Kind regards, >> > >> > Hweeling >> > >> > >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > >> >> > >> > ------------------------------ >> > >> > Message: 2 >> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >> > From: KatrinH Heimann >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Joseph, thanks so much, I really appreciate your help. I was >> > also >> > wandering, if maybe there is another bug in my code. >> > Our nets are 128 channels, Hydrocel, but as a colleague of me >> > adviced me to >> > do so, I also tried the 129 layout. >> > My code you find below (without selection of bad channels etc.) >> > If you need also the data of two subjects to have a look, let me >> > know!!! >> > Best and thanks really! >> > Katrin >> > >> > >> > subject=input('Which subject do you want to analyse? ','s'); >> > >> > name = strcat(subject,'.raw'); >> > >> > subjectnumber=input('Which is the subjectnumber?', 's'); >> > >> > sb=subjectnumber >> > >> > %subjectnumber = strcat(subjectnumber, '.txt') >> > >> > %% >> > >> > >> > cfg = []; >> > >> > cfg.dataset = name; >> > >> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >> > >> > cfg.trialdef.eventtype = 'trigger'; >> > >> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> > trigger >> > >> > cfg.trialdef.prestim = 0.234; % in seconds >> > >> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> > observation, but maybe we need less) >> > >> > cfg = ft_definetrial(cfg); >> > >> > >> > cfg.trl([1:7],:) = []; >> > >> > >> > %change timeline according to constant offset of 16 ms = 8 samples >> > (because >> > recorded with 500 hz)in >> > >> > %structure trial >> > >> > cfg.trl(:,3)=cfg.trl(:,3)-8 >> > >> > >> > %change timeline to make the cut the zeropoint >> > >> > >> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> > >> > >> > >> > %% preprocess data >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.detrend = 'yes'; >> > >> > cfg.preproc.demean = 'yes'; >> > >> > cfg.preproc.baselinewindow = [-2.1 -2.0] >> > >> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> > filtered >> > >> > %(0.1-45) and bad channels have to be replaced!!!! >> > >> > %cfg.preproc.bpfreq = [6 32]; >> > >> > % >> > >> > % >> > >> > obs_data = ft_preprocessing(cfg); >> > >> > % >> > >> > save (strcat(sb,'obs_data') , 'obs_data') >> > >> > >> > %% determining channel neighbours (necessary for Artifact detection) >> > >> > cfg = []; >> > >> > cfg.channel = obs_data.label; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.feedback = 'yes'; >> > >> > lay = ft_prepare_layout(cfg); >> > >> > >> > >> > cfg_neighb = []; >> > >> > cfg_neighb.feedback = 'yes'; >> > >> > >> > cfg_neighb.method = 'triangulation'; >> > >> > cfg_neighb.layout = 'GSN128.sfp'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > obs_data.elec = ft_read_sens('GSN128.sfp'); >> > >> > >> > %% Artifacts - to detect bad channels - is not saved!!! >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs_data_try = ft_rejectvisual(cfg, obs_data); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_try = ft_rejectartifact (cfg,obs_data); >> > >> > >> > >> > %% Preparing neighbours for channel repair - but bad channel info >> > in!!! >> > >> > >> > % cfg_neighb = []; >> > >> > % cfg_neighb.feedback = 'yes'; >> > >> > % cfg_neighb.method = 'triangulation'; >> > >> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> > >> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > % Interpolate and put into new data structure >> > >> > cfg = []; >> > >> > cfg.badchannel = {}; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.method = 'nearest'; >> > >> > cfg.neighbours = neighbours; >> > >> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> > >> > >> > % Check reconstruction >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > % dat1=obs_data; >> > >> > % dat2=obs_data_channelrepaired; >> > >> > % >> > >> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> > >> > % y=dat2.trial{1}(62,:); >> > >> > % plot(x);hold on;plot(y,'r'); >> > >> > % >> > >> > % x=dat1.trial{1}(72,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > % >> > >> > % x=dat1.trial{1}(75,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > %% artifact rejection/trial inspection - throw out electrode jumps >> > etc. >> > >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> > according to >> > channels interpolated %% 128-number of interp. channels) >> > >> > >> > >> > cfg = []; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.numcomponent = 128 >> > >> > comp = ft_componentanalysis(cfg,obs_data_clean1); >> > >> > save (strcat(sb,'comp_all') , 'comp') >> > >> > >> > %% >> > >> > cfg = []; >> > >> > cfg.viewmode = 'component'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='some'; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > ft_databrowser(cfg,comp); >> > >> > >> > %% poweranalysis components >> > >> > cfg = []; >> > >> > cfg.output = 'pow'; >> > >> > cfg.channel = 'all';%compute the power spectrum in all ICs >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.taper = 'hanning'; >> > >> > cfg.foi = 0:0.2:50; >> > >> > obs_freq = ft_freqanalysis(cfg, comp); >> > >> > >> > %And you can plot the spectra: >> > >> > >> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> > >> > nsubplots = 16; >> > >> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> > decimals, type >> > doc subplot >> > >> > >> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >> > >> > tot = Nfigs*nsubplots; >> > >> > >> > rptvect = 1:size(comp.topo,1); >> > >> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> > >> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> > >> > >> > for r=1:size(rptvect,1); >> > >> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> > 1]);%full >> > screen >> > >> > k=0; >> > >> > for j=1:size(rptvect,2); >> > >> > if~(rptvect(r,j)==0); >> > >> > k=k+1; >> > >> > cfg=[]; >> > >> > cfg.channel = rptvect(r,j); >> > >> > cfg.ylim =[0 500] >> > >> > cfg.xlim =[0 50] >> > >> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> > >> > end >> > >> > end >> > >> > end >> > >> > >> > %For the IC topos you'll follow the same logic as above but with: >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [1:20]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [21:40]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [41:60]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [61:80]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > >> > >> > >> > >> > %% Seperate observation conditions >> > >> > >> > name1= strcat(num2str(sb),'_90.xls'); >> > >> > list1=xlsread (name1) >> > >> > >> > >> > >> > >> > name2= strcat(num2str(sb),'_180.xls'); >> > >> > list2=xlsread (name2) >> > >> > >> > >> > % >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list1] >> > >> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list2] >> > >> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > %%PIPELINE FOR obs90 >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128; >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > >> > comp_1 = ft_componentanalysis(cfg, obs90_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> > obs90_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts - final detection >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs90_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> > >> > >> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> > >> > >> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> > >> > >> > %% plot it >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP) >> > >> > >> > >> > >> > >> > >> > >> > %% PIPELINE FOR obs180 >> > >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128 >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > comp_2 = ft_componentanalysis(cfg, obs180_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> > obs180_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts final 180 >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs180_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> > >> > >> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> > >> > >> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> > >> > >> > %% plot 180 ERP >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs180_data_ERP) >> > >> > >> > %% plot both ERPs >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > cfg.showlabels = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> > >> > >> > %% plot difference wave >> > >> > >> > difference = obs180_data_ERP; % copy one of the >> > structures >> > >> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >> > the >> > difference ERP >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, difference) >> > >> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> > >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI >> >> data. A couple things. First of all, exactly which net do you use? >> >> If >> >> they are 129-channel, there is still the question of whether they >> >> are the >> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >> >> cause an >> >> error like this. Could you send me the file you are trying to >> >> process and >> >> the script you are using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >> >> diezmartini at gmail.com> wrote: >> >> >> >> Which nets do you use? I use EGI. I tried both the ones you mention >> >> and >> >> they didn't work. It was hard to find that exact one online but it >> >> was the >> >> only file that actually worked. >> >> >> >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >> >> >> wrote: >> >> >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. >> >>> Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one >> >>> >> >>>> I use >> >>>> >> >>>> >> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >> >>>> katrinheimann at gmail.com> wrote: >> >>>> >> >>>>> Dear all, my problems seem neverending. This time however i >> >>>>> really need >> >>>>> help. >> >>>>> I implemented a pipeline for ERPs. All works now, >> >>>>> trialdefinition, >> >>>>> preprocessing, channelreplacement, ica, componentrejection, >> >>>>> final >> >>>>> artifactdetection, timelock of the single subject data. However, >> >>>>> when I >> >>>>> wanna compute the grandaverage of the single subjects I get the >> >>>>> following >> >>>>> error message: >> >>>>> >> >>>>> computing average of avg over 19 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 3 MB >> >>>>> computing average of avg over 2 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >> >>>>> additional >> >>>>> allocation of an estimated 0 MB >> >>>>> >> >>>>> Furthermore in the plot of the significant clusters, the >> >>>>> channelnames >> >>>>> are mixed up (do not correspond to my net) >> >>>>> >> >>>>> >> >>>>> I guess that there is a problem with the layout I use. >> >>>>> Here the code that I use >> >>>>> >> >>>>> %For generating the layout (also in the single subjects): >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = obs_data.label; >> >>>>> >> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>>> >> >>>>> cfg.feedback = 'yes'; >> >>>>> >> >>>>> lay = ft_prepare_layout(cfg); >> >>>>> >> >>>>> >> >>>>> cfg_neighb = []; >> >>>>> >> >>>>> cfg_neighb.feedback = 'yes'; >> >>>>> >> >>>>> cfg_neighb.method = 'triangulation'; >> >>>>> >> >>>>> cfg_neighb.layout = lay; >> >>>>> >> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>>> >> >>>>> >> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>>>> >> >>>>> >> >>>>> %For computing the grand average >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = 'all'; >> >>>>> >> >>>>> cfg.latency = 'all'; >> >>>>> >> >>>>> cfg.parameter = 'avg'; >> >>>>> >> >>>>> cfg.keepindividual = 'no' >> >>>>> >> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>>>> >> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>>>> >> >>>>> % "{:}" means to use data from all elements of the variable >> >>>>> >> >>>>> >> >>>>> For plotting the significant clusters >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.style = 'blank'; >> >>>>> >> >>>>> cfg.layout = lay; >> >>>>> >> >>>>> cfg.channellabels = 'yes'; >> >>>>> >> >>>>> cfg.highlight = 'labels'; >> >>>>> >> >>>>> cfg.highlightchannel = find(stat.mask); >> >>>>> >> >>>>> cfg.comment = 'no'; >> >>>>> >> >>>>> figure; ft_topoplotER(cfg, GA_90) >> >>>>> >> >>>>> title('Nonparametric: significant with cluster multiple >> >>>>> comparison >> >>>>> correction') >> >>>>> >> >>>>> >> >>>>> Do you have ANY idea to this? I am really completely >> >>>>> helpless.... >> >>>>> >> >>>>> thanks and best >> >>>>> >> >>>>> Katrin >> >>>>> >> >>>>> _______________________________________________ >> >>>>> 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 >> >>> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> >> >> >> -------------------------------------------------------------------------------- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.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: >> > >> >> > >> > ------------------------------ >> > >> > Message: 3 >> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >> > From: Joseph Dien >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > yes, please do send me the data. >> > >> > Thanks! >> > >> > Joe >> > >> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >> > wrote: >> > >> >> Dear Joseph, thanks so much, I really appreciate your help. I was >> >> also wandering, if maybe there is another bug in my code. >> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >> >> adviced me to do so, I also tried the 129 layout. >> >> My code you find below (without selection of bad channels etc.) >> >> If you need also the data of two subjects to have a look, let me >> >> know!!! >> >> Best and thanks really! >> >> Katrin >> >> >> >> >> >> >> >> subject=input('Which subject do you want to analyse? ','s'); >> >> >> >> name = strcat(subject,'.raw'); >> >> >> >> subjectnumber=input('Which is the subjectnumber?', 's'); >> >> >> >> sb=subjectnumber >> >> >> >> %subjectnumber = strcat(subjectnumber, '.txt') >> >> >> >> %% >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.dataset = name; >> >> >> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> >> >> >> cfg.trialdef.eventtype = 'trigger'; >> >> >> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> >> trigger >> >> >> >> cfg.trialdef.prestim = 0.234; % in seconds >> >> >> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> >> observation, but maybe we need less) >> >> >> >> cfg = ft_definetrial(cfg); >> >> >> >> >> >> >> >> cfg.trl([1:7],:) = []; >> >> >> >> >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> >> (because recorded with 500 hz)in >> >> >> >> %structure trial >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >> >> >> >> >> >> >> >> %change timeline to make the cut the zeropoint >> >> >> >> >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> >> >> >> >> >> >> >> >> >> >> >> %% preprocess data >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.detrend = 'yes'; >> >> >> >> cfg.preproc.demean = 'yes'; >> >> >> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >> >> >> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> >> filtered >> >> >> >> %(0.1-45) and bad channels have to be replaced!!!! >> >> >> >> %cfg.preproc.bpfreq = [6 32]; >> >> >> >> % >> >> >> >> % >> >> >> >> obs_data = ft_preprocessing(cfg); >> >> >> >> % >> >> >> >> save (strcat(sb,'obs_data') , 'obs_data') >> >> >> >> >> >> >> >> %% determining channel neighbours (necessary for Artifact >> >> detection) >> >> >> >> cfg = []; >> >> >> >> cfg.channel = obs_data.label; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.feedback = 'yes'; >> >> >> >> lay = ft_prepare_layout(cfg); >> >> >> >> >> >> cfg_neighb = []; >> >> >> >> cfg_neighb.feedback = 'yes'; >> >> >> >> >> >> >> >> cfg_neighb.method = 'triangulation'; >> >> >> >> cfg_neighb.layout = 'GSN128.sfp'; >> >> >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >> >> >> >> >> >> >> >> %% Artifacts - to detect bad channels - is not saved!!! >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Preparing neighbours for channel repair - but bad channel info >> >> in!!! >> >> >> >> >> >> >> >> % cfg_neighb = []; >> >> >> >> % cfg_neighb.feedback = 'yes'; >> >> >> >> % cfg_neighb.method = 'triangulation'; >> >> >> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> >> >> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> % Interpolate and put into new data structure >> >> >> >> cfg = []; >> >> >> >> cfg.badchannel = {}; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.method = 'nearest'; >> >> >> >> cfg.neighbours = neighbours; >> >> >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> >> >> >> >> >> % Check reconstruction >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> % dat1=obs_data; >> >> >> >> % dat2=obs_data_channelrepaired; >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> >> >> >> % y=dat2.trial{1}(62,:); >> >> >> >> % plot(x);hold on;plot(y,'r'); >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(72,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(75,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> %% artifact rejection/trial inspection - throw out electrode jumps >> >> etc. >> >> >> >> >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> >> according to channels interpolated %% 128-number of interp. >> >> channels) >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.channel = {'all'}; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >> >> >> >> save (strcat(sb,'comp_all') , 'comp') >> >> >> >> >> >> >> >> %% >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'component'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='some'; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> ft_databrowser(cfg,comp); >> >> >> >> >> >> >> >> %% poweranalysis components >> >> >> >> cfg = []; >> >> >> >> cfg.output = 'pow'; >> >> >> >> cfg.channel = 'all';%compute the power spectrum in all ICs >> >> >> >> cfg.method = 'mtmfft'; >> >> >> >> cfg.taper = 'hanning'; >> >> >> >> cfg.foi = 0:0.2:50; >> >> >> >> obs_freq = ft_freqanalysis(cfg, comp); >> >> >> >> >> >> >> >> %And you can plot the spectra: >> >> >> >> >> >> >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> >> >> nsubplots = 16; >> >> >> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> >> decimals, type doc subplot >> >> >> >> >> >> >> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >> >> >> >> tot = Nfigs*nsubplots; >> >> >> >> >> >> >> >> rptvect = 1:size(comp.topo,1); >> >> >> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> >> >> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> >> >> >> >> >> >> >> for r=1:size(rptvect,1); >> >> >> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> >> 1]);%full screen >> >> >> >> k=0; >> >> >> >> for j=1:size(rptvect,2); >> >> >> >> if~(rptvect(r,j)==0); >> >> >> >> k=k+1; >> >> >> >> cfg=[]; >> >> >> >> cfg.channel = rptvect(r,j); >> >> >> >> cfg.ylim =[0 500] >> >> >> >> cfg.xlim =[0 50] >> >> >> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> >> >> >> end >> >> >> >> end >> >> >> >> end >> >> >> >> >> >> >> >> %For the IC topos you'll follow the same logic as above but with: >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [1:20]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [21:40]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [41:60]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [61:80]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Seperate observation conditions >> >> >> >> >> >> >> >> name1= strcat(num2str(sb),'_90.xls'); >> >> >> >> list1=xlsread (name1) >> >> >> >> >> >> >> >> name2= strcat(num2str(sb),'_180.xls'); >> >> >> >> list2=xlsread (name2) >> >> >> >> >> >> % >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list1] >> >> >> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list2] >> >> >> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> %%PIPELINE FOR obs90 >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128; >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> >> >> >> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> >> obs90_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts - final detection >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> >> >> >> >> >> >> >> %% plot it >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% PIPELINE FOR obs180 >> >> >> >> >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> >> obs180_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts final 180 >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> >> >> >> >> >> >> >> %% plot 180 ERP >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot both ERPs >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> cfg.showlabels = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot difference wave >> >> >> >> >> >> >> >> difference = obs180_data_ERP; % copy one of >> >> the structures >> >> >> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >> >> compute the difference ERP >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, difference) >> >> >> >> >> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI data. A couple things. First of all, exactly which net do >> >> you use? If they are 129-channel, there is still the question of >> >> whether they are the Hydrocel or the older geodesic nets. >> >> Regardless, that shouldn't cause an error like this. Could you >> >> send me the file you are trying to process and the script you are >> >> using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >> >> wrote: >> >> >> >>> Which nets do you use? I use EGI. I tried both the ones you >> >>> mention and they didn't work. It was hard to find that exact one >> >>> online but it was the only file that actually worked. >> >>> >> >>> >> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one I use >> >>> >> >>> >> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear all, my problems seem neverending. This time however i really >> >>> need help. >> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >> >>> preprocessing, channelreplacement, ica, componentrejection, final >> >>> artifactdetection, timelock of the single subject data. However, >> >>> when I wanna compute the grandaverage of the single subjects I get >> >>> the following error message: >> >>> >> >>> computing average of avg over 19 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 3 MB >> >>> computing average of avg over 2 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 0 MB >> >>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> the call to "ft_topoplotER" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> >> >>> Furthermore in the plot of the significant clusters, the >> >>> channelnames are mixed up (do not correspond to my net) >> >>> >> >>> >> >>> I guess that there is a problem with the layout I use. >> >>> Here the code that I use >> >>> >> >>> %For generating the layout (also in the single subjects): >> >>> cfg = []; >> >>> >> >>> cfg.channel = obs_data.label; >> >>> >> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>> >> >>> cfg.feedback = 'yes'; >> >>> >> >>> lay = ft_prepare_layout(cfg); >> >>> >> >>> >> >>> cfg_neighb = []; >> >>> >> >>> cfg_neighb.feedback = 'yes'; >> >>> >> >>> cfg_neighb.method = 'triangulation'; >> >>> >> >>> cfg_neighb.layout = lay; >> >>> >> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>> >> >>> >> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>> >> >>> >> >>> >> >>> %For computing the grand average >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.channel = 'all'; >> >>> >> >>> cfg.latency = 'all'; >> >>> >> >>> cfg.parameter = 'avg'; >> >>> >> >>> cfg.keepindividual = 'no' >> >>> >> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>> >> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>> >> >>> % "{:}" means to use data from all elements of the variable >> >>> >> >>> >> >>> For plotting the significant clusters >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.style = 'blank'; >> >>> >> >>> cfg.layout = lay; >> >>> >> >>> cfg.channellabels = 'yes'; >> >>> >> >>> cfg.highlight = 'labels'; >> >>> >> >>> cfg.highlightchannel = find(stat.mask); >> >>> >> >>> cfg.comment = 'no'; >> >>> >> >>> figure; ft_topoplotER(cfg, GA_90) >> >>> >> >>> title('Nonparametric: significant with cluster multiple comparison >> >>> correction') >> >>> >> >>> >> >>> >> >>> Do you have ANY idea to this? I am really completely helpless.... >> >>> >> >>> thanks and best >> >>> >> >>> Katrin >> >>> >> >>> >> >>> _______________________________________________ >> >>> 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 >> >>> >> >>> _______________________________________________ >> >>> fieldtrip mailing list >> >>> fieldtrip at donders.ru.nl >> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> -------------------------------------------------------------------------------- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.com >> >> >> >> >> >> _______________________________________________ >> >> 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 >> > >> > >> -------------------------------------------------------------------------------- >> > >> > Joseph Dien, PhD >> > Research Associate >> > Cognitive Neurology >> > The Johns Hopkins University School of Medicine >> > >> > Lab E-mail: jdien1 at jhmi.edu >> > Private E-mail: jdien07 at mac.com >> > Office Phone: 410-614-3115 >> > Cell Phone: 202-297-8117 >> > Fax: 410-955-0188 >> > http://joedien.com >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > >> >> > >> > ------------------------------ >> > >> > Message: 4 >> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >> > From: "Caspar, Emilie" >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >> > bad >> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >> > Content-Type: text/plain; charset="iso-8859-1" >> > >> > Hi Ashley, >> > >> > Maybe the mistake is you did not integrate in your script the >> > command to save the rejection. Normally, with the following command, >> > you will see in the Matlab Window that artifacts are correctly >> > rejected after the "quit" button. >> > >> > clean_data = ft_rejectvisual(cfg, interpoldata); >> > cfg.artfctdef.reject = 'complete'; >> > cfg.artfctdef.feedback = 'yes'; >> > cleandata = ft_rejectartifact(cfg,clean_data); >> > >> > Emilie >> > >> > >> > >> > >> > >> > Le 3 sept. 2014 ? 11:58, Ashley Greene >> > > a ?crit : >> > >> > Hello, >> > >> > I have used the rejectvisual function in attempt to remove bad >> > trials, but after marking them and pressing the quit button, >> > although the command window states that the selected trials have >> > been removed, there is no obvious change in the data; all of the >> > trials are still intact. Have I overlooked something? >> > >> > Thanks, >> > >> > Ashley >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > >> >> > >> > ------------------------------ >> > >> > Message: 5 >> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >> > From: Patricia Wollstadt >> > To: fieldtrip at science.ru.nl >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: <540EEF94.9080601 at gmx.de> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > Hello Max, >> > >> > I added a few comments to the questions regarding individual >> > parameters >> > below. To address the general problem of TRENTOOL telling you, that >> > there are not enough sample points in your data: From what I can see >> > in >> > your script, you probably don't have enough data points in each time >> > series to robustly estimate TE. You analyze 800 ms of data sampled >> > at >> > 300 Hz, which gives you 240 samples per time series. Can you maybe >> > avoid >> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >> > you >> > analyze a longer time window of interest? >> > Note that you also 'lose' data to embedding and the interaction >> > delay: >> > The first point that can be used for TE estimation is at max. >> > embedding >> > length + max. interaction delay in samples. For example: max. >> > embedding >> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >> > max >> > interaction delay of 30 ms = 9 samples. In this example, you would >> > be >> > left with 240 - 29 samples for TE estimation per trial. There is >> > also >> > the possibility to estimate time resolved TE/TE for shorter time >> > windows >> > of interest (see section 4.4 in the manual); however, this method >> > requires the use of a GPU for TE estimation. >> > >> > I would further recommend to use the new pipeline for group >> > statistics >> > described in the manual in section 4.5 (the function >> > 'TEgroup_calculate' >> > is deprecated). The new pipeline allows you to reconstruct the >> > interaction delay and uses the following functions (see also >> > comments in >> > the script): >> > >> > TEgroup_prepare -> prepares all data sets (all subjects/all >> > conditions) for group analysis (this means finding common embedding >> > parameters such that estimates are not biased between groups) >> > InteractionDelayReconstruction_calculate -> estimates TE for >> > individual data sets and all assumed interaction delays u >> > InteractionDelayReconstruction_analyze -> reconstructs the >> > interaction delay by selecting the u that maximizes TE for each >> > channel >> > TEgroup_stats -> calculate group statistics using a permutation test >> > >> > I can send you an example script for group TE analysis using this >> > pipeline to get you started. I hope this helps you to get the group >> > analysis running. Just write again if you're having trouble setting >> > up >> > the pipeline or something is not clear about the parameters/my >> > comments. >> > >> > Best, >> > Patricia >> > >> > >> > >> > >> > On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not >> >> 100% sure if it is appropriate to ask questions about it here, but >> >> to >> >> the best of my knowledge they do not have a mailing list and I saw >> >> a >> >> few trentool questions in the archives, so I'm going to assume it's >> >> ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present >> >> in the pipeline. Sorry in advance for the long post! Any help would >> >> be >> >> greatly appreciated as I'm a bit over my head on this but I think >> >> I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data >> >> that was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi is >> >> in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within the toi, but beyond that are there any benefits to it being >> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >> >> the >> >> toi is in seconds. The prediction time is the assumed interaction >> >> delay between your two sources and should fit within your toi. In >> >> general it is preferable to use the method for interaction delay >> >> reconstruction for TE estimation, because it allows you to >> >> reconstruct >> >> the actual delay between your source and target times series. A >> >> non-optimal u/interaction delay may cause an underestimation of TE, >> >> so >> >> it is recommended to use the pipeline for interaction delay >> >> reconstruction whenever estimating TE for unknown delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, so it is best to limit the u range to values that are >> >> physiologically plausible. >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the >> >> sample rate and filters are used to determine the actthrvalue, but >> >> I >> >> don't actually know the calculation. 7.5 was a rough guess just to >> >> test the pipeline. I'm also uncertain of what minnrtrials should >> >> be.* >> >> PW: You can set the actthrvalue based on the filtering you did >> >> prior >> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >> >> shouldn't find an ACT higher than 30 samples, because you filtered >> >> out >> >> any components of the signal slower than 10 Hz/30 samples (given >> >> your >> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >> >> would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> * >> >> * >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm >> >> yet to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* >> >> PW: The Ragwitz criterion tries to find optimal embedding >> >> parameters >> >> dim and tau for the data. To do that, the method iteratively takes >> >> all >> >> possible combinations of dim and tau values that are provided in >> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >> >> these >> >> combinations embed the data. To test an embedding, the method >> >> builds >> >> the embedding vectors from the data; it then tests for each point >> >> how >> >> well the next point in time can be predicted from the reference >> >> point's nearest neighbours. So for each embedded point, the method >> >> searches for the nearest neighbours and calculates the average of >> >> those nearest neighbours. The difference between the >> >> averaged/predicted point and the actual next point is the error of >> >> the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested >> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together with 'ragtausteps' specifies the tau values to be tested >> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >> >> that >> >> the values here are factors that are later multiplied with the ACT >> >> to >> >> obtain the actual tau. 'repPred' is the number of points that will >> >> be >> >> used for the local prediction, i.e. the Ragwitz criterion will test >> >> the local prediction and calculate the error for the first 100 >> >> points >> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >> >> below >> >> specify the type of neighbour search conducted by the Ragwitz >> >> criterion: 'flagNei' tells the method to either conduct a kNN or >> >> range >> >> search; 'sizeNei' specifies the number of neighbours or the radius >> >> to >> >> be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> * >> >> * >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> * >> >> * >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.*TRENTOOL seems to handle data output very differently >> >> from >> >> fieldtrip and I've had trouble thinking through the most logical >> >> way >> >> to handle the data so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> * >> >> * >> >> *For clarification, fileCell is a cell with the name of each >> >> condition >> >> x subject .mat file, which as I said before is collectively the >> >> same >> >> as the 3 x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> * >> >> * >> >> *At this step I get the following error: >> >> >> >> Error using transferentropy (line 337) >> >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> >> >> Error in TEgroup_calculate (line 133) >> >> [TEresult] = transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate >> >> is a pipeline issue* (I noticed the example pipeline in trentool, >> >> the >> >> manual, and published methods articles all seem to have slightly or >> >> significantly different pipeline compositions), *or if the error >> >> is* >> >> due to ACT, ragwitz optimization, or some other faulty >> >> parameterization *on my part due to a lack of understanding of how >> >> transfer entropy works on a more theoretical/mathematical level*. >> >> If >> >> the latter is the case, is there any relatively straightforward way >> >> to >> >> conceptualize this, or is this something where I'm just going to >> >> have >> >> to keep reading and rereading until it eventually makes sense? I've >> >> already done quite a bit of that and it hasn't pierced my thick >> >> skull >> >> yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> 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: >> > >> >> > >> > ------------------------------ >> > >> > Message: 6 >> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >> > From: Holger Krause >> > To: FieldTrip discussion list >> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >> > days ago >> > Message-ID: >> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >> > Content-Type: text/plain; charset="us-ascii" >> > >> > Dear developers, >> > >> > Could you please check the process for creation/publication of >> > zip-files on >> > the FTP server? The latest file I can find there is >> > fieldtrip-20140906.zip. >> > >> > Thanks in advance, >> > >> > Holger >> > >> > >> > ------------------------------ >> > >> > Message: 7 >> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >> > From: Max Cantor >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > This is immensely helpful, thank you. I was very confused about why >> > some >> > versions of the pipeline I saw were using group calculate and others >> > were >> > using interaction delay reconstruction and what that meant, and I >> > think I >> > have a more clear idea of what the different steps of the pipeline >> > are >> > doing. There are still a few things I'm a bit confused about though >> > in >> > terms of the pipeline. For instance, whether or not I need to do >> > TEprepare >> > before group prepare, and if I need to do graph analysis (which I'm >> > not >> > sure I fully understand but also haven't looked deeply into) before >> > group >> > stats. >> > >> > If you don't mind me taking you up on your offer, I think seeing >> > your >> > example script might help clarify some of these issues. >> > >> > Thank you! >> > >> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >> > Patricia.Wollstadt at gmx.de> wrote: >> > >> >> Hello Max, >> >> >> >> I added a few comments to the questions regarding individual >> >> parameters >> >> below. To address the general problem of TRENTOOL telling you, that >> >> there >> >> are not enough sample points in your data: From what I can see in >> >> your >> >> script, you probably don't have enough data points in each time >> >> series to >> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >> >> which >> >> gives you 240 samples per time series. Can you maybe avoid >> >> downsampling to >> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >> >> longer time >> >> window of interest? >> >> Note that you also 'lose' data to embedding and the interaction >> >> delay: The >> >> first point that can be used for TE estimation is at max. embedding >> >> length >> >> + max. interaction delay in samples. For example: max. embedding >> >> length = >> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >> >> interaction >> >> delay of 30 ms = 9 samples. In this example, you would be left with >> >> 240 - >> >> 29 samples for TE estimation per trial. There is also the >> >> possibility to >> >> estimate time resolved TE/TE for shorter time windows of interest >> >> (see >> >> section 4.4 in the manual); however, this method requires the use >> >> of a GPU >> >> for TE estimation. >> >> >> >> I would further recommend to use the new pipeline for group >> >> statistics >> >> described in the manual in section 4.5 (the function >> >> 'TEgroup_calculate' is >> >> deprecated). The new pipeline allows you to reconstruct the >> >> interaction >> >> delay and uses the following functions (see also comments in the >> >> script): >> >> >> >> TEgroup_prepare -> prepares all data sets (all subjects/all >> >> conditions) >> >> for group analysis (this means finding common embedding parameters >> >> such >> >> that estimates are not biased between groups) >> >> InteractionDelayReconstruction_calculate -> estimates TE for >> >> individual data sets and all assumed interaction delays u >> >> InteractionDelayReconstruction_analyze -> reconstructs the >> >> interaction delay by selecting the u that maximizes TE for each >> >> channel >> >> TEgroup_stats -> calculate group statistics using a permutation >> >> test >> >> >> >> I can send you an example script for group TE analysis using this >> >> pipeline >> >> to get you started. I hope this helps you to get the group analysis >> >> running. Just write again if you're having trouble setting up the >> >> pipeline >> >> or something is not clear about the parameters/my comments. >> >> >> >> Best, >> >> Patricia >> >> >> >> >> >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not 100% >> >> sure if it is appropriate to ask questions about it here, but to >> >> the best >> >> of my knowledge they do not have a mailing list and I saw a few >> >> trentool >> >> questions in the archives, so I'm going to assume it's ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present in >> >> the pipeline. Sorry in advance for the long post! Any help would be >> >> greatly >> >> appreciated as I'm a bit over my head on this but I think I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data that >> >> was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi >> >> is in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within >> >> the toi, but beyond that are there any benefits to it being earlier >> >> or >> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >> >> in >> >> seconds. The prediction time is the assumed interaction delay >> >> between your >> >> two sources and should fit within your toi. In general it is >> >> preferable to >> >> use the method for interaction delay reconstruction for TE >> >> estimation, >> >> because it allows you to reconstruct the actual delay between your >> >> source >> >> and target times series. A non-optimal u/interaction delay may >> >> cause an >> >> underestimation of TE, so it is recommended to use the pipeline for >> >> interaction delay reconstruction whenever estimating TE for unknown >> >> delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, >> >> so it is best to limit the u range to values that are >> >> physiologically >> >> plausible. >> >> >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the sample >> >> rate and filters are used to determine the actthrvalue, but I don't >> >> actually know the calculation. 7.5 was a rough guess just to test >> >> the >> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >> >> You can >> >> set the actthrvalue based on the filtering you did prior to TE >> >> analysis. If >> >> you for example highpass filtered at 10 Hz, you shouldn't find an >> >> ACT >> >> higher than 30 samples, because you filtered out any components of >> >> the >> >> signal slower than 10 Hz/30 samples (given your sampling frequency >> >> of 300 >> >> Hz). So in this scenario the actthrvalue would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm yet >> >> to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* PW: >> >> The Ragwitz criterion tries to find optimal embedding parameters >> >> dim and >> >> tau for the data. To do that, the method iteratively takes all >> >> possible >> >> combinations of dim and tau values that are provided in cfgP.ragdim >> >> and >> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >> >> embed >> >> the data. To test an embedding, the method builds the embedding >> >> vectors >> >> from the data; it then tests for each point how well the next point >> >> in time >> >> can be predicted from the reference point's nearest neighbours. So >> >> for each >> >> embedded point, the method searches for the nearest neighbours and >> >> calculates the average of those nearest neighbours. The difference >> >> between >> >> the averaged/predicted point and the actual next point is the error >> >> of the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested by >> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together >> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >> >> will >> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >> >> here are >> >> factors that are later multiplied with the ACT to obtain the actual >> >> tau. >> >> 'repPred' is the number of points that will be used for the local >> >> prediction, i.e. the Ragwitz criterion will test the local >> >> prediction and >> >> calculate the error for the first 100 points in your time series. >> >> The two >> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >> >> neighbour >> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >> >> method to >> >> either conduct a kNN or range search; 'sizeNei' specifies the >> >> number of >> >> neighbours or the radius to be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' >> >> data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject >> >> virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.* >> >> TRENTOOL seems to handle data output very differently from >> >> fieldtrip and >> >> I've had trouble thinking through the most logical way to handle >> >> the data >> >> so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> >> >> *For clarification, fileCell is a cell with the name of each >> >> condition x >> >> subject .mat file, which as I said before is collectively the same >> >> as the 3 >> >> x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> *At this step I get the following error: Error using >> >> transferentropy (line >> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in >> >> TEgroup_calculate (line 133) [TEresult] = >> >> transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate is a >> >> pipeline issue* (I noticed the example pipeline in trentool, the >> >> manual, >> >> and published methods articles all seem to have slightly or >> >> significantly >> >> different pipeline compositions), *or if the error is* due to ACT, >> >> ragwitz optimization, or some other faulty parameterization *on my >> >> part >> >> due to a lack of understanding of how transfer entropy works on a >> >> more >> >> theoretical/mathematical level*. If the latter is the case, is >> >> there any >> >> relatively straightforward way to conceptualize this, or is this >> >> something >> >> where I'm just going to have to keep reading and rereading until it >> >> eventually makes sense? I've already done quite a bit of that and >> >> it hasn't >> >> pierced my thick skull yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing >> >> >> listfieldtrip at donders.ru.nlhttp://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 >> >> >> > >> > >> > >> > -- >> > Max Cantor >> > Lab Manager >> > Computational Neurolinguistics Lab >> > University of Michigan >> > -------------- 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 46, Issue 3 >> > **************************************** >> > >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jim Herring, MSc. > Neuronal Oscillations Group > Centre for Cognitive Neuroimaging > Donders Institute for Brain, Cognition and Behaviour > Radboud University Nijmegen > > > ------------------------------ > > Message: 4 > Date: Mon, 15 Sep 2014 12:09:24 +0200 (CEST) > From: Fr?d?ric Roux > To: FieldTrip discussion list > Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs > Message-ID: <867006743.3066178.1410775764568.JavaMail.root at bcbl.eu> > Content-Type: text/plain; charset=utf-8 > > Dear all, > > my question relates to the computation of combined planar gradients > using the ft_combineplanar function. > > Our data has been recorded with an Elekta Neuromag 306 channel system, > and I would like to know if it is "safe" to compute combined gradients > before calling ft_freqstatistics, if the input data contains single > trial TFRs. > > The reason why I am asking is because in the documentation of the > function it says > % Use as > % [data] = ft_combineplanar(cfg, data) > % where data contains an averaged planar gradient (either ERF or TFR). > > However, the following tutorial suggests that this can be safely applied if > the input data contains TFRs which have been computed with the > cfg.keeptrials = 'yes' option: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > > I am bit confused as both information (the fieldtrip documentation > and the tutorial) > seem to contradict each other. > > The 2 options that are see are: > > 1) compute TFRs with cfg.keeptrials = 'yes', then call > ft_frestatistics, then call ft_combineplanar > by using the output of ft_freqstatistics as input for the > ft_combineplanar function. > 2) compute TFRs with cfg.keeptrials = 'yes', then call > ft_combineplanar, then call ft_freqstatistics > > Could anyone with experience on this issue please let me know what > the best way > to proceed would be? > > Fred > --------------------------------------------------------------------------- > > > > > ------------------------------ > > Message: 5 > Date: Mon, 15 Sep 2014 13:12:38 -0300 > From: gamaliel huerta urrea > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] dipole simulation on head model > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > hi all > > I hope you can help my problem. > > I have generated a model of head fieldtrip, and now I need to simulate > sources at different positions within the crust generated. I followed the > tutorial head model generation for EEG. However I have not found > information on how to simulate a source. Any help would be welcome. > > Thank you > greetings > > -- > *Gamaliel Huerta* > *Ingenier?a Civil Biom?dica* > *Universidad de Valpara?so* > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 6 > Date: Mon, 15 Sep 2014 18:38:26 +0200 > From: Tzvetan Popov > To: FieldTrip discussion list > Subject: Re: [FieldTrip] dipole simulation on head model > Message-ID: <6677301D-D72C-4C12-BC84-779D5E4DF8F3 at uni-konstanz.de> > Content-Type: text/plain; charset="iso-8859-1" > > > Dear Gamaliel, > you might try something like this: > > http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit > > good luck > tzvetan > > Am 15.09.2014 um 18:12 schrieb gamaliel huerta urrea > : > >> hi all >> >> I hope you can help my problem. >> >> I have generated a model of head fieldtrip, and now I need to >> simulate sources at different positions within the crust generated. >> I followed the tutorial head model generation for EEG. However I >> have not found information on how to simulate a source. Any help >> would be welcome. >> >> Thank you >> greetings >> >> -- >> Gamaliel Huerta >> Ingenier?a Civil Biom?dica >> Universidad de Valpara?so >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 7 > Date: Mon, 15 Sep 2014 12:40:41 -0500 > From: "Jing Fan" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of > variable 'abort' > Message-ID: <000001cfd10c$2b7786a0$826693e0$@gmail.com> > Content-Type: text/plain; charset="us-ascii" > > Hi Jim, > > I download the latest .zip file from FTP. > I received the same error message when calling function ft_definetrial(cfg). > It seems to me that ft_preamble init command will go to script ft_preamble.m > instead of ft_preamble_init.m. > Any help to resolve this issue will be appreciated. > > Best, > Jing > > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) > Sent: Monday, September 15, 2014 5:01 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable > 'abort' > > Dear Barbara, > > The error seems to be related to a bug that pops up now and then > (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a > corrupt installation of fieldtrip and/or the need to update fieldtrip. > > Could you please try downloading the most recent version of fieldtrip and > see if the problem persists? > > For an example of what can be expected from this function see: Esser SK, > Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct > demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res > Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. > > Best, > > Jim > > > ----- Oorspronkelijk bericht ----- >> Van: "barbara schorr" >> Aan: fieldtrip at science.ru.nl >> Verzonden: Woensdag 10 september 2014 14:07:14 >> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable > 'abort' >> Dear fieldtripers. >> >> as mentioned in the subject line I would like to anaylse my timelocked >> ERP Data with the function ft_globalmeanfield. >> >> I get the Error: Undefined function or variable 'abort' >> Error in ft_globalmeanfield (line84) >> if abort >> >> in the function it says: >> >> %the abort variable is set to true or false in ft_preamble_inti >> if abort >> % do not continue function execution in case the outputfile is >> present and the user indicated to keep it >> return >> end >> >> >> I don't understand what this means. I would really appreciate your >> help to get this running. >> >> Also, what is the result when I run this function on my data? (This >> method was proposed from a reviewer. I never used it before, so I >> don't exactly know what it does and what the result will look like). >> >> Thank you very much in advance! >> >> Best, >> >> Barbara Schorr >> >> >> >> >> Zitat von 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: Question regarding nonparametric testing for coherence >> > differences (Eric Maris) >> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >> > 4. Re: ft_rejectvisual: removing trials marked as bad >> > (Caspar, Emilie) >> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >> > 6. Latest FT version on ftp-server is from three days ago >> > (Holger Krause) >> > 7. Re: TRENTOOL pipeline help (Max Cantor) >> > >> > >> > ---------------------------------------------------------------------- >> > >> > Message: 1 >> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >> > From: "Eric Maris" >> > To: , "'FieldTrip discussion list'" >> > >> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >> > for >> > coherence differences >> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Hwee Ling, >> > >> > >> > >> > In the paper you refer to (Maris et al, JNM, 2007), I did not >> > perform a >> > cluster-based permutation test at the level of the channel pairs. >> > Instead, >> > all coherences mentioned in the paper are coherence between a single >> > EMG >> > channel (2 electrodes mounted on the forearm) and all MEG >> > electrodes. Thus, >> > there are as many EMG-MEG coherences as there are MEG channels (275 >> > in our >> > lab), and the clustering of these coherences involves the same >> > neighbourhood >> > structure as the clustering of channel-specific statistics on power >> > or >> > evoked response. The analysis you propose involves clustering in a >> > much more >> > complex space, namely the formed by all (MEG,MEG) channel pairs >> > (275*275=75625 pairs). In the early days of cluster-based >> > permutation >> > statistics, I have worked on this problem but did not pursue it >> > because the >> > resulting clusters are very hard to interpret. >> > >> > >> > >> > Best, >> > >> > >> > >> > Eric Maris >> > >> > >> > >> > >> > >> > Dear all and Prof Maris, >> > >> > I'm re-posting this question again, as I didn't get any replies >> > previously. >> > >> > I?m interested to investigate if there are any differences in phase >> > synchronization in resting state data at timepoint 2 versus >> > timepoint 1. The >> > EEG data was collected using 64 EEG channels, resting state, eyes >> > opened and >> > eyes closed. I?ve arbitrarily segmented the resting state data into >> > epochs >> > of 2s each, and the epochs with artifacts are excluded completely >> > from >> > further analyses. I then performed mtmfft to get the fourier >> > representation >> > of the data, extracted the coherence, and compared the coherence >> > difference >> > of timepoint 2 versus timepoint 1 of all channels paired with all >> > other >> > channels. >> > >> > I figured that if I extract the connectivity analyses without >> > specifying the >> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >> > allow me to >> > perform cluster-based statistical analyses. I get an output with >> > ?chan_chan? >> > dimord variable. However, I was not 100% sure that this is correct, >> > hence, I?ve >> > inserted my code (see below). It?ll be great if you could tell me if >> > what I?m >> > doing makes any sense at all. Also, I don?t know how I can plot the >> > results >> > to see if it make any sense at all. >> > >> > Also, I checked the values obtained from when I specified >> > "cfg.channelcmb" >> > and when I did not specify "cfg.channelcmb", I noticed that the >> > values were >> > somehow different. I would assume that the values to be similar, >> > although >> > I'm not sure why they would have differences in the values obtained >> > from >> > specifying "cfg.channelcmb". >> > >> > This is my code that I've used thus far: >> > >> > for sub = 1:5 >> > >> > cfg = []; >> > >> > cfg.output = 'fourier'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.keeptrials = 'yes'; >> > >> > cfg.tapsmofrq = 5; >> > >> > cfg.foilim = [0 100]; >> > >> > cfg.taper = 'dpss'; >> > >> > % find the index for the c200 condition >> > >> > pre_c200_idx = find(data5.trialinfo == 201); >> > >> > cfg.trials = pre_c200_idx; >> > >> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >> > >> > post_c200_idx = find(data5.trialinfo == 200); >> > >> > cfg.trials = post_c200_idx; >> > >> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >> > >> > >> > >> > cfg = []; >> > >> > cfg.keeptrials = 'no'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.removemean = 'yes'; >> > >> > cfg.method = 'coh'; >> > >> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_pre_c200); >> > >> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_post_c200); >> > >> > end >> > >> > >> > >> > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat > '); >> > >> > cfg_neighb.method = 'template'; >> > >> > cfg_neighb.layout = lay; >> > >> > cfg_neighb.channel = 'all'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, >> > sub_HLF_pre_c200coh{1}); >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.neighbours = neighbours; >> > >> > cfg.channel = 'all'; >> > >> > cfg.channelcmb = {cfg.channel, cfg.channel}; >> > >> > cfg.latency = 'all'; >> > >> > cfg.avgovertime = 'no'; >> > >> > cfg.avgoverchan = 'no'; >> > >> > cfg.parameter = 'cohspctrm'; >> > >> > cfg.method = 'montecarlo'; >> > >> > cfg.statistic = 'depsamplesT'; >> > >> > cfg.correctm = 'cluster'; >> > >> > cfg.tail = 0; >> > >> > % cfg.clustertail = 0; >> > >> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >> > frequency >> > bands. >> > >> > cfg.numrandomization = 10000; >> > >> > cfg.ivar = 2; >> > >> > cfg.uvar = 1; >> > >> > >> > >> > % design matrices >> > >> > clear design; >> > >> > design(1,:) = [1:5, 1:5]; >> > >> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >> > >> > cfg.design = design; >> > >> > % for theta band >> > >> > cfg.avgoverfreq = 'yes'; >> > >> > cfg.frequency = [4 8]; % I also performed the statistics for delta >> > (2-4), >> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >> > (30-40), >> > and gamma (40-100). >> > >> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >> > sub_HLF_post_c200coh{:}, >> > sub_HLF_pre_c200coh{:}); >> > >> > >> > >> > When I tried to plot the results, I used this code: >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.layout = 'lay'; >> > >> > cfg.zlim = [-1 1]; >> > >> > cfg.alpha = 0.05; >> > >> > cfg.refchannel = 'all'; >> > >> > ft_clusterplot(cfg, diffc200_theta_stat); >> > >> > However, I was not sure how I could plot the results. I get an error >> > message >> > from Fieldtrip when using ft_clusterplot: >> > >> > Error using topoplot_common (line 366) >> > >> > no reference channel is specified >> > >> > Error in ft_topoplotTFR (line 192) >> > >> > [cfg] = topoplot_common(cfg, varargin{:}); >> > >> > Error in ft_clusterplot (line 372) >> > >> > ft_topoplotTFR(cfgtopo, stat); >> > >> > >> > >> > According to your paper in 2007, the topoplot of the results were >> > masked by >> > the spatio-spectral pattern of the significant clusters. I don't >> > know how to >> > do this, and I would really appreciate if you can show me how to >> > make such a >> > plot. >> > >> > Thank you very much. >> > >> > Kind regards, >> > >> > Hweeling >> > >> > >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 280/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 2 >> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >> > From: KatrinH Heimann >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Joseph, thanks so much, I really appreciate your help. I was >> > also >> > wandering, if maybe there is another bug in my code. >> > Our nets are 128 channels, Hydrocel, but as a colleague of me >> > adviced me to >> > do so, I also tried the 129 layout. >> > My code you find below (without selection of bad channels etc.) >> > If you need also the data of two subjects to have a look, let me >> > know!!! >> > Best and thanks really! >> > Katrin >> > >> > >> > subject=input('Which subject do you want to analyse? ','s'); >> > >> > name = strcat(subject,'.raw'); >> > >> > subjectnumber=input('Which is the subjectnumber?', 's'); >> > >> > sb=subjectnumber >> > >> > %subjectnumber = strcat(subjectnumber, '.txt') >> > >> > %% >> > >> > >> > cfg = []; >> > >> > cfg.dataset = name; >> > >> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >> > >> > cfg.trialdef.eventtype = 'trigger'; >> > >> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> > trigger >> > >> > cfg.trialdef.prestim = 0.234; % in seconds >> > >> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> > observation, but maybe we need less) >> > >> > cfg = ft_definetrial(cfg); >> > >> > >> > cfg.trl([1:7],:) = []; >> > >> > >> > %change timeline according to constant offset of 16 ms = 8 samples >> > (because >> > recorded with 500 hz)in >> > >> > %structure trial >> > >> > cfg.trl(:,3)=cfg.trl(:,3)-8 >> > >> > >> > %change timeline to make the cut the zeropoint >> > >> > >> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> > >> > >> > >> > %% preprocess data >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.detrend = 'yes'; >> > >> > cfg.preproc.demean = 'yes'; >> > >> > cfg.preproc.baselinewindow = [-2.1 -2.0] >> > >> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> > filtered >> > >> > %(0.1-45) and bad channels have to be replaced!!!! >> > >> > %cfg.preproc.bpfreq = [6 32]; >> > >> > % >> > >> > % >> > >> > obs_data = ft_preprocessing(cfg); >> > >> > % >> > >> > save (strcat(sb,'obs_data') , 'obs_data') >> > >> > >> > %% determining channel neighbours (necessary for Artifact detection) >> > >> > cfg = []; >> > >> > cfg.channel = obs_data.label; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.feedback = 'yes'; >> > >> > lay = ft_prepare_layout(cfg); >> > >> > >> > >> > cfg_neighb = []; >> > >> > cfg_neighb.feedback = 'yes'; >> > >> > >> > cfg_neighb.method = 'triangulation'; >> > >> > cfg_neighb.layout = 'GSN128.sfp'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > obs_data.elec = ft_read_sens('GSN128.sfp'); >> > >> > >> > %% Artifacts - to detect bad channels - is not saved!!! >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs_data_try = ft_rejectvisual(cfg, obs_data); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_try = ft_rejectartifact (cfg,obs_data); >> > >> > >> > >> > %% Preparing neighbours for channel repair - but bad channel info >> > in!!! >> > >> > >> > % cfg_neighb = []; >> > >> > % cfg_neighb.feedback = 'yes'; >> > >> > % cfg_neighb.method = 'triangulation'; >> > >> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> > >> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > % Interpolate and put into new data structure >> > >> > cfg = []; >> > >> > cfg.badchannel = {}; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.method = 'nearest'; >> > >> > cfg.neighbours = neighbours; >> > >> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> > >> > >> > % Check reconstruction >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > % dat1=obs_data; >> > >> > % dat2=obs_data_channelrepaired; >> > >> > % >> > >> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> > >> > % y=dat2.trial{1}(62,:); >> > >> > % plot(x);hold on;plot(y,'r'); >> > >> > % >> > >> > % x=dat1.trial{1}(72,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > % >> > >> > % x=dat1.trial{1}(75,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > %% artifact rejection/trial inspection - throw out electrode jumps >> > etc. >> > >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> > according to >> > channels interpolated %% 128-number of interp. channels) >> > >> > >> > >> > cfg = []; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.numcomponent = 128 >> > >> > comp = ft_componentanalysis(cfg,obs_data_clean1); >> > >> > save (strcat(sb,'comp_all') , 'comp') >> > >> > >> > %% >> > >> > cfg = []; >> > >> > cfg.viewmode = 'component'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='some'; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > ft_databrowser(cfg,comp); >> > >> > >> > %% poweranalysis components >> > >> > cfg = []; >> > >> > cfg.output = 'pow'; >> > >> > cfg.channel = 'all';%compute the power spectrum in all ICs >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.taper = 'hanning'; >> > >> > cfg.foi = 0:0.2:50; >> > >> > obs_freq = ft_freqanalysis(cfg, comp); >> > >> > >> > %And you can plot the spectra: >> > >> > >> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> > >> > nsubplots = 16; >> > >> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> > decimals, type >> > doc subplot >> > >> > >> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >> > >> > tot = Nfigs*nsubplots; >> > >> > >> > rptvect = 1:size(comp.topo,1); >> > >> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> > >> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> > >> > >> > for r=1:size(rptvect,1); >> > >> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> > 1]);%full >> > screen >> > >> > k=0; >> > >> > for j=1:size(rptvect,2); >> > >> > if~(rptvect(r,j)==0); >> > >> > k=k+1; >> > >> > cfg=[]; >> > >> > cfg.channel = rptvect(r,j); >> > >> > cfg.ylim =[0 500] >> > >> > cfg.xlim =[0 50] >> > >> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> > >> > end >> > >> > end >> > >> > end >> > >> > >> > %For the IC topos you'll follow the same logic as above but with: >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [1:20]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [21:40]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [41:60]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [61:80]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > >> > >> > >> > >> > %% Seperate observation conditions >> > >> > >> > name1= strcat(num2str(sb),'_90.xls'); >> > >> > list1=xlsread (name1) >> > >> > >> > >> > >> > >> > name2= strcat(num2str(sb),'_180.xls'); >> > >> > list2=xlsread (name2) >> > >> > >> > >> > % >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list1] >> > >> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list2] >> > >> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > %%PIPELINE FOR obs90 >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128; >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > >> > comp_1 = ft_componentanalysis(cfg, obs90_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> > obs90_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts - final detection >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs90_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> > >> > >> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> > >> > >> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> > >> > >> > %% plot it >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP) >> > >> > >> > >> > >> > >> > >> > >> > %% PIPELINE FOR obs180 >> > >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128 >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > comp_2 = ft_componentanalysis(cfg, obs180_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> > obs180_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts final 180 >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs180_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> > >> > >> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> > >> > >> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> > >> > >> > %% plot 180 ERP >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs180_data_ERP) >> > >> > >> > %% plot both ERPs >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > cfg.showlabels = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> > >> > >> > %% plot difference wave >> > >> > >> > difference = obs180_data_ERP; % copy one of the >> > structures >> > >> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >> > the >> > difference ERP >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, difference) >> > >> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> > >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI >> >> data. A couple things. First of all, exactly which net do you use? >> >> If >> >> they are 129-channel, there is still the question of whether they >> >> are the >> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >> >> cause an >> >> error like this. Could you send me the file you are trying to >> >> process and >> >> the script you are using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >> >> diezmartini at gmail.com> wrote: >> >> >> >> Which nets do you use? I use EGI. I tried both the ones you mention >> >> and >> >> they didn't work. It was hard to find that exact one online but it >> >> was the >> >> only file that actually worked. >> >> >> >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >> >> >> wrote: >> >> >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. >> >>> Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one >> >>> >> >>>> I use >> >>>> >> >>>> >> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >> >>>> katrinheimann at gmail.com> wrote: >> >>>> >> >>>>> Dear all, my problems seem neverending. This time however i >> >>>>> really need >> >>>>> help. >> >>>>> I implemented a pipeline for ERPs. All works now, >> >>>>> trialdefinition, >> >>>>> preprocessing, channelreplacement, ica, componentrejection, >> >>>>> final >> >>>>> artifactdetection, timelock of the single subject data. However, >> >>>>> when I >> >>>>> wanna compute the grandaverage of the single subjects I get the >> >>>>> following >> >>>>> error message: >> >>>>> >> >>>>> computing average of avg over 19 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 3 MB >> >>>>> computing average of avg over 2 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >> >>>>> additional >> >>>>> allocation of an estimated 0 MB >> >>>>> >> >>>>> Furthermore in the plot of the significant clusters, the >> >>>>> channelnames >> >>>>> are mixed up (do not correspond to my net) >> >>>>> >> >>>>> >> >>>>> I guess that there is a problem with the layout I use. >> >>>>> Here the code that I use >> >>>>> >> >>>>> %For generating the layout (also in the single subjects): >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = obs_data.label; >> >>>>> >> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>>> >> >>>>> cfg.feedback = 'yes'; >> >>>>> >> >>>>> lay = ft_prepare_layout(cfg); >> >>>>> >> >>>>> >> >>>>> cfg_neighb = []; >> >>>>> >> >>>>> cfg_neighb.feedback = 'yes'; >> >>>>> >> >>>>> cfg_neighb.method = 'triangulation'; >> >>>>> >> >>>>> cfg_neighb.layout = lay; >> >>>>> >> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>>> >> >>>>> >> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>>>> >> >>>>> >> >>>>> %For computing the grand average >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = 'all'; >> >>>>> >> >>>>> cfg.latency = 'all'; >> >>>>> >> >>>>> cfg.parameter = 'avg'; >> >>>>> >> >>>>> cfg.keepindividual = 'no' >> >>>>> >> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>>>> >> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>>>> >> >>>>> % "{:}" means to use data from all elements of the variable >> >>>>> >> >>>>> >> >>>>> For plotting the significant clusters >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.style = 'blank'; >> >>>>> >> >>>>> cfg.layout = lay; >> >>>>> >> >>>>> cfg.channellabels = 'yes'; >> >>>>> >> >>>>> cfg.highlight = 'labels'; >> >>>>> >> >>>>> cfg.highlightchannel = find(stat.mask); >> >>>>> >> >>>>> cfg.comment = 'no'; >> >>>>> >> >>>>> figure; ft_topoplotER(cfg, GA_90) >> >>>>> >> >>>>> title('Nonparametric: significant with cluster multiple >> >>>>> comparison >> >>>>> correction') >> >>>>> >> >>>>> >> >>>>> Do you have ANY idea to this? I am really completely >> >>>>> helpless.... >> >>>>> >> >>>>> thanks and best >> >>>>> >> >>>>> Katrin >> >>>>> >> >>>>> _______________________________________________ >> >>>>> 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 >> >>> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> >> >> > ---------------------------------------------------------------------------- > ---- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.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: >> > > b61/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 3 >> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >> > From: Joseph Dien >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > yes, please do send me the data. >> > >> > Thanks! >> > >> > Joe >> > >> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >> > wrote: >> > >> >> Dear Joseph, thanks so much, I really appreciate your help. I was >> >> also wandering, if maybe there is another bug in my code. >> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >> >> adviced me to do so, I also tried the 129 layout. >> >> My code you find below (without selection of bad channels etc.) >> >> If you need also the data of two subjects to have a look, let me >> >> know!!! >> >> Best and thanks really! >> >> Katrin >> >> >> >> >> >> >> >> subject=input('Which subject do you want to analyse? ','s'); >> >> >> >> name = strcat(subject,'.raw'); >> >> >> >> subjectnumber=input('Which is the subjectnumber?', 's'); >> >> >> >> sb=subjectnumber >> >> >> >> %subjectnumber = strcat(subjectnumber, '.txt') >> >> >> >> %% >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.dataset = name; >> >> >> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> >> >> >> cfg.trialdef.eventtype = 'trigger'; >> >> >> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> >> trigger >> >> >> >> cfg.trialdef.prestim = 0.234; % in seconds >> >> >> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> >> observation, but maybe we need less) >> >> >> >> cfg = ft_definetrial(cfg); >> >> >> >> >> >> >> >> cfg.trl([1:7],:) = []; >> >> >> >> >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> >> (because recorded with 500 hz)in >> >> >> >> %structure trial >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >> >> >> >> >> >> >> >> %change timeline to make the cut the zeropoint >> >> >> >> >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> >> >> >> >> >> >> >> >> >> >> >> %% preprocess data >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.detrend = 'yes'; >> >> >> >> cfg.preproc.demean = 'yes'; >> >> >> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >> >> >> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> >> filtered >> >> >> >> %(0.1-45) and bad channels have to be replaced!!!! >> >> >> >> %cfg.preproc.bpfreq = [6 32]; >> >> >> >> % >> >> >> >> % >> >> >> >> obs_data = ft_preprocessing(cfg); >> >> >> >> % >> >> >> >> save (strcat(sb,'obs_data') , 'obs_data') >> >> >> >> >> >> >> >> %% determining channel neighbours (necessary for Artifact >> >> detection) >> >> >> >> cfg = []; >> >> >> >> cfg.channel = obs_data.label; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.feedback = 'yes'; >> >> >> >> lay = ft_prepare_layout(cfg); >> >> >> >> >> >> cfg_neighb = []; >> >> >> >> cfg_neighb.feedback = 'yes'; >> >> >> >> >> >> >> >> cfg_neighb.method = 'triangulation'; >> >> >> >> cfg_neighb.layout = 'GSN128.sfp'; >> >> >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >> >> >> >> >> >> >> >> %% Artifacts - to detect bad channels - is not saved!!! >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Preparing neighbours for channel repair - but bad channel info >> >> in!!! >> >> >> >> >> >> >> >> % cfg_neighb = []; >> >> >> >> % cfg_neighb.feedback = 'yes'; >> >> >> >> % cfg_neighb.method = 'triangulation'; >> >> >> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> >> >> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> % Interpolate and put into new data structure >> >> >> >> cfg = []; >> >> >> >> cfg.badchannel = {}; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.method = 'nearest'; >> >> >> >> cfg.neighbours = neighbours; >> >> >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> >> >> >> >> >> % Check reconstruction >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> % dat1=obs_data; >> >> >> >> % dat2=obs_data_channelrepaired; >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> >> >> >> % y=dat2.trial{1}(62,:); >> >> >> >> % plot(x);hold on;plot(y,'r'); >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(72,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(75,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> %% artifact rejection/trial inspection - throw out electrode jumps >> >> etc. >> >> >> >> >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> >> according to channels interpolated %% 128-number of interp. >> >> channels) >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.channel = {'all'}; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >> >> >> >> save (strcat(sb,'comp_all') , 'comp') >> >> >> >> >> >> >> >> %% >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'component'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='some'; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> ft_databrowser(cfg,comp); >> >> >> >> >> >> >> >> %% poweranalysis components >> >> >> >> cfg = []; >> >> >> >> cfg.output = 'pow'; >> >> >> >> cfg.channel = 'all';%compute the power spectrum in all ICs >> >> >> >> cfg.method = 'mtmfft'; >> >> >> >> cfg.taper = 'hanning'; >> >> >> >> cfg.foi = 0:0.2:50; >> >> >> >> obs_freq = ft_freqanalysis(cfg, comp); >> >> >> >> >> >> >> >> %And you can plot the spectra: >> >> >> >> >> >> >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> >> >> nsubplots = 16; >> >> >> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> >> decimals, type doc subplot >> >> >> >> >> >> >> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >> >> >> >> tot = Nfigs*nsubplots; >> >> >> >> >> >> >> >> rptvect = 1:size(comp.topo,1); >> >> >> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> >> >> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> >> >> >> >> >> >> >> for r=1:size(rptvect,1); >> >> >> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> >> 1]);%full screen >> >> >> >> k=0; >> >> >> >> for j=1:size(rptvect,2); >> >> >> >> if~(rptvect(r,j)==0); >> >> >> >> k=k+1; >> >> >> >> cfg=[]; >> >> >> >> cfg.channel = rptvect(r,j); >> >> >> >> cfg.ylim =[0 500] >> >> >> >> cfg.xlim =[0 50] >> >> >> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> >> >> >> end >> >> >> >> end >> >> >> >> end >> >> >> >> >> >> >> >> %For the IC topos you'll follow the same logic as above but with: >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [1:20]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [21:40]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [41:60]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [61:80]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Seperate observation conditions >> >> >> >> >> >> >> >> name1= strcat(num2str(sb),'_90.xls'); >> >> >> >> list1=xlsread (name1) >> >> >> >> >> >> >> >> name2= strcat(num2str(sb),'_180.xls'); >> >> >> >> list2=xlsread (name2) >> >> >> >> >> >> % >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list1] >> >> >> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list2] >> >> >> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> %%PIPELINE FOR obs90 >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128; >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> >> >> >> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> >> obs90_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts - final detection >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> >> >> >> >> >> >> >> %% plot it >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% PIPELINE FOR obs180 >> >> >> >> >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> >> obs180_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts final 180 >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> >> >> >> >> >> >> >> %% plot 180 ERP >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot both ERPs >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> cfg.showlabels = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot difference wave >> >> >> >> >> >> >> >> difference = obs180_data_ERP; % copy one of >> >> the structures >> >> >> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >> >> compute the difference ERP >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, difference) >> >> >> >> >> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI data. A couple things. First of all, exactly which net do >> >> you use? If they are 129-channel, there is still the question of >> >> whether they are the Hydrocel or the older geodesic nets. >> >> Regardless, that shouldn't cause an error like this. Could you >> >> send me the file you are trying to process and the script you are >> >> using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >> >> wrote: >> >> >> >>> Which nets do you use? I use EGI. I tried both the ones you >> >>> mention and they didn't work. It was hard to find that exact one >> >>> online but it was the only file that actually worked. >> >>> >> >>> >> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one I use >> >>> >> >>> >> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear all, my problems seem neverending. This time however i really >> >>> need help. >> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >> >>> preprocessing, channelreplacement, ica, componentrejection, final >> >>> artifactdetection, timelock of the single subject data. However, >> >>> when I wanna compute the grandaverage of the single subjects I get >> >>> the following error message: >> >>> >> >>> computing average of avg over 19 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 3 MB >> >>> computing average of avg over 2 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 0 MB >> >>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> the call to "ft_topoplotER" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> >> >>> Furthermore in the plot of the significant clusters, the >> >>> channelnames are mixed up (do not correspond to my net) >> >>> >> >>> >> >>> I guess that there is a problem with the layout I use. >> >>> Here the code that I use >> >>> >> >>> %For generating the layout (also in the single subjects): >> >>> cfg = []; >> >>> >> >>> cfg.channel = obs_data.label; >> >>> >> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>> >> >>> cfg.feedback = 'yes'; >> >>> >> >>> lay = ft_prepare_layout(cfg); >> >>> >> >>> >> >>> cfg_neighb = []; >> >>> >> >>> cfg_neighb.feedback = 'yes'; >> >>> >> >>> cfg_neighb.method = 'triangulation'; >> >>> >> >>> cfg_neighb.layout = lay; >> >>> >> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>> >> >>> >> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>> >> >>> >> >>> >> >>> %For computing the grand average >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.channel = 'all'; >> >>> >> >>> cfg.latency = 'all'; >> >>> >> >>> cfg.parameter = 'avg'; >> >>> >> >>> cfg.keepindividual = 'no' >> >>> >> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>> >> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>> >> >>> % "{:}" means to use data from all elements of the variable >> >>> >> >>> >> >>> For plotting the significant clusters >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.style = 'blank'; >> >>> >> >>> cfg.layout = lay; >> >>> >> >>> cfg.channellabels = 'yes'; >> >>> >> >>> cfg.highlight = 'labels'; >> >>> >> >>> cfg.highlightchannel = find(stat.mask); >> >>> >> >>> cfg.comment = 'no'; >> >>> >> >>> figure; ft_topoplotER(cfg, GA_90) >> >>> >> >>> title('Nonparametric: significant with cluster multiple comparison >> >>> correction') >> >>> >> >>> >> >>> >> >>> Do you have ANY idea to this? I am really completely helpless.... >> >>> >> >>> thanks and best >> >>> >> >>> Katrin >> >>> >> >>> >> >>> _______________________________________________ >> >>> 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 >> >>> >> >>> _______________________________________________ >> >>> fieldtrip mailing list >> >>> fieldtrip at donders.ru.nl >> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> > ---------------------------------------------------------------------------- > ---- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.com >> >> >> >> >> >> _______________________________________________ >> >> 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 >> > >> > > ---------------------------------------------------------------------------- > ---- >> > >> > Joseph Dien, PhD >> > Research Associate >> > Cognitive Neurology >> > The Johns Hopkins University School of Medicine >> > >> > Lab E-mail: jdien1 at jhmi.edu >> > Private E-mail: jdien07 at mac.com >> > Office Phone: 410-614-3115 >> > Cell Phone: 202-297-8117 >> > Fax: 410-955-0188 >> > http://joedien.com >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > ad2/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 4 >> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >> > From: "Caspar, Emilie" >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >> > bad >> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >> > Content-Type: text/plain; charset="iso-8859-1" >> > >> > Hi Ashley, >> > >> > Maybe the mistake is you did not integrate in your script the >> > command to save the rejection. Normally, with the following command, >> > you will see in the Matlab Window that artifacts are correctly >> > rejected after the "quit" button. >> > >> > clean_data = ft_rejectvisual(cfg, interpoldata); >> > cfg.artfctdef.reject = 'complete'; >> > cfg.artfctdef.feedback = 'yes'; >> > cleandata = ft_rejectartifact(cfg,clean_data); >> > >> > Emilie >> > >> > >> > >> > >> > >> > Le 3 sept. 2014 ? 11:58, Ashley Greene >> > > a ?crit : >> > >> > Hello, >> > >> > I have used the rejectvisual function in attempt to remove bad >> > trials, but after marking them and pressing the quit button, >> > although the command window states that the selected trials have >> > been removed, there is no obvious change in the data; all of the >> > trials are still intact. Have I overlooked something? >> > >> > Thanks, >> > >> > Ashley >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 985/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 5 >> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >> > From: Patricia Wollstadt >> > To: fieldtrip at science.ru.nl >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: <540EEF94.9080601 at gmx.de> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > Hello Max, >> > >> > I added a few comments to the questions regarding individual >> > parameters >> > below. To address the general problem of TRENTOOL telling you, that >> > there are not enough sample points in your data: From what I can see >> > in >> > your script, you probably don't have enough data points in each time >> > series to robustly estimate TE. You analyze 800 ms of data sampled >> > at >> > 300 Hz, which gives you 240 samples per time series. Can you maybe >> > avoid >> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >> > you >> > analyze a longer time window of interest? >> > Note that you also 'lose' data to embedding and the interaction >> > delay: >> > The first point that can be used for TE estimation is at max. >> > embedding >> > length + max. interaction delay in samples. For example: max. >> > embedding >> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >> > max >> > interaction delay of 30 ms = 9 samples. In this example, you would >> > be >> > left with 240 - 29 samples for TE estimation per trial. There is >> > also >> > the possibility to estimate time resolved TE/TE for shorter time >> > windows >> > of interest (see section 4.4 in the manual); however, this method >> > requires the use of a GPU for TE estimation. >> > >> > I would further recommend to use the new pipeline for group >> > statistics >> > described in the manual in section 4.5 (the function >> > 'TEgroup_calculate' >> > is deprecated). The new pipeline allows you to reconstruct the >> > interaction delay and uses the following functions (see also >> > comments in >> > the script): >> > >> > TEgroup_prepare -> prepares all data sets (all subjects/all >> > conditions) for group analysis (this means finding common embedding >> > parameters such that estimates are not biased between groups) >> > InteractionDelayReconstruction_calculate -> estimates TE for >> > individual data sets and all assumed interaction delays u >> > InteractionDelayReconstruction_analyze -> reconstructs the >> > interaction delay by selecting the u that maximizes TE for each >> > channel >> > TEgroup_stats -> calculate group statistics using a permutation test >> > >> > I can send you an example script for group TE analysis using this >> > pipeline to get you started. I hope this helps you to get the group >> > analysis running. Just write again if you're having trouble setting >> > up >> > the pipeline or something is not clear about the parameters/my >> > comments. >> > >> > Best, >> > Patricia >> > >> > >> > >> > >> > On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not >> >> 100% sure if it is appropriate to ask questions about it here, but >> >> to >> >> the best of my knowledge they do not have a mailing list and I saw >> >> a >> >> few trentool questions in the archives, so I'm going to assume it's >> >> ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present >> >> in the pipeline. Sorry in advance for the long post! Any help would >> >> be >> >> greatly appreciated as I'm a bit over my head on this but I think >> >> I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data >> >> that was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi is >> >> in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within the toi, but beyond that are there any benefits to it being >> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >> >> the >> >> toi is in seconds. The prediction time is the assumed interaction >> >> delay between your two sources and should fit within your toi. In >> >> general it is preferable to use the method for interaction delay >> >> reconstruction for TE estimation, because it allows you to >> >> reconstruct >> >> the actual delay between your source and target times series. A >> >> non-optimal u/interaction delay may cause an underestimation of TE, >> >> so >> >> it is recommended to use the pipeline for interaction delay >> >> reconstruction whenever estimating TE for unknown delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, so it is best to limit the u range to values that are >> >> physiologically plausible. >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the >> >> sample rate and filters are used to determine the actthrvalue, but >> >> I >> >> don't actually know the calculation. 7.5 was a rough guess just to >> >> test the pipeline. I'm also uncertain of what minnrtrials should >> >> be.* >> >> PW: You can set the actthrvalue based on the filtering you did >> >> prior >> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >> >> shouldn't find an ACT higher than 30 samples, because you filtered >> >> out >> >> any components of the signal slower than 10 Hz/30 samples (given >> >> your >> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >> >> would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> * >> >> * >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm >> >> yet to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* >> >> PW: The Ragwitz criterion tries to find optimal embedding >> >> parameters >> >> dim and tau for the data. To do that, the method iteratively takes >> >> all >> >> possible combinations of dim and tau values that are provided in >> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >> >> these >> >> combinations embed the data. To test an embedding, the method >> >> builds >> >> the embedding vectors from the data; it then tests for each point >> >> how >> >> well the next point in time can be predicted from the reference >> >> point's nearest neighbours. So for each embedded point, the method >> >> searches for the nearest neighbours and calculates the average of >> >> those nearest neighbours. The difference between the >> >> averaged/predicted point and the actual next point is the error of >> >> the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested >> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together with 'ragtausteps' specifies the tau values to be tested >> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >> >> that >> >> the values here are factors that are later multiplied with the ACT >> >> to >> >> obtain the actual tau. 'repPred' is the number of points that will >> >> be >> >> used for the local prediction, i.e. the Ragwitz criterion will test >> >> the local prediction and calculate the error for the first 100 >> >> points >> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >> >> below >> >> specify the type of neighbour search conducted by the Ragwitz >> >> criterion: 'flagNei' tells the method to either conduct a kNN or >> >> range >> >> search; 'sizeNei' specifies the number of neighbours or the radius >> >> to >> >> be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> * >> >> * >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> * >> >> * >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.*TRENTOOL seems to handle data output very differently >> >> from >> >> fieldtrip and I've had trouble thinking through the most logical >> >> way >> >> to handle the data so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> * >> >> * >> >> *For clarification, fileCell is a cell with the name of each >> >> condition >> >> x subject .mat file, which as I said before is collectively the >> >> same >> >> as the 3 x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> * >> >> * >> >> *At this step I get the following error: >> >> >> >> Error using transferentropy (line 337) >> >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> >> >> Error in TEgroup_calculate (line 133) >> >> [TEresult] = transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate >> >> is a pipeline issue* (I noticed the example pipeline in trentool, >> >> the >> >> manual, and published methods articles all seem to have slightly or >> >> significantly different pipeline compositions), *or if the error >> >> is* >> >> due to ACT, ragwitz optimization, or some other faulty >> >> parameterization *on my part due to a lack of understanding of how >> >> transfer entropy works on a more theoretical/mathematical level*. >> >> If >> >> the latter is the case, is there any relatively straightforward way >> >> to >> >> conceptualize this, or is this something where I'm just going to >> >> have >> >> to keep reading and rereading until it eventually makes sense? I've >> >> already done quite a bit of that and it hasn't pierced my thick >> >> skull >> >> yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> 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: >> > > 97f/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 6 >> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >> > From: Holger Krause >> > To: FieldTrip discussion list >> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >> > days ago >> > Message-ID: >> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >> > Content-Type: text/plain; charset="us-ascii" >> > >> > Dear developers, >> > >> > Could you please check the process for creation/publication of >> > zip-files on >> > the FTP server? The latest file I can find there is >> > fieldtrip-20140906.zip. >> > >> > Thanks in advance, >> > >> > Holger >> > >> > >> > ------------------------------ >> > >> > Message: 7 >> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >> > From: Max Cantor >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > This is immensely helpful, thank you. I was very confused about why >> > some >> > versions of the pipeline I saw were using group calculate and others >> > were >> > using interaction delay reconstruction and what that meant, and I >> > think I >> > have a more clear idea of what the different steps of the pipeline >> > are >> > doing. There are still a few things I'm a bit confused about though >> > in >> > terms of the pipeline. For instance, whether or not I need to do >> > TEprepare >> > before group prepare, and if I need to do graph analysis (which I'm >> > not >> > sure I fully understand but also haven't looked deeply into) before >> > group >> > stats. >> > >> > If you don't mind me taking you up on your offer, I think seeing >> > your >> > example script might help clarify some of these issues. >> > >> > Thank you! >> > >> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >> > Patricia.Wollstadt at gmx.de> wrote: >> > >> >> Hello Max, >> >> >> >> I added a few comments to the questions regarding individual >> >> parameters >> >> below. To address the general problem of TRENTOOL telling you, that >> >> there >> >> are not enough sample points in your data: From what I can see in >> >> your >> >> script, you probably don't have enough data points in each time >> >> series to >> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >> >> which >> >> gives you 240 samples per time series. Can you maybe avoid >> >> downsampling to >> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >> >> longer time >> >> window of interest? >> >> Note that you also 'lose' data to embedding and the interaction >> >> delay: The >> >> first point that can be used for TE estimation is at max. embedding >> >> length >> >> + max. interaction delay in samples. For example: max. embedding >> >> length = >> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >> >> interaction >> >> delay of 30 ms = 9 samples. In this example, you would be left with >> >> 240 - >> >> 29 samples for TE estimation per trial. There is also the >> >> possibility to >> >> estimate time resolved TE/TE for shorter time windows of interest >> >> (see >> >> section 4.4 in the manual); however, this method requires the use >> >> of a GPU >> >> for TE estimation. >> >> >> >> I would further recommend to use the new pipeline for group >> >> statistics >> >> described in the manual in section 4.5 (the function >> >> 'TEgroup_calculate' is >> >> deprecated). The new pipeline allows you to reconstruct the >> >> interaction >> >> delay and uses the following functions (see also comments in the >> >> script): >> >> >> >> TEgroup_prepare -> prepares all data sets (all subjects/all >> >> conditions) >> >> for group analysis (this means finding common embedding parameters >> >> such >> >> that estimates are not biased between groups) >> >> InteractionDelayReconstruction_calculate -> estimates TE for >> >> individual data sets and all assumed interaction delays u >> >> InteractionDelayReconstruction_analyze -> reconstructs the >> >> interaction delay by selecting the u that maximizes TE for each >> >> channel >> >> TEgroup_stats -> calculate group statistics using a permutation >> >> test >> >> >> >> I can send you an example script for group TE analysis using this >> >> pipeline >> >> to get you started. I hope this helps you to get the group analysis >> >> running. Just write again if you're having trouble setting up the >> >> pipeline >> >> or something is not clear about the parameters/my comments. >> >> >> >> Best, >> >> Patricia >> >> >> >> >> >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not 100% >> >> sure if it is appropriate to ask questions about it here, but to >> >> the best >> >> of my knowledge they do not have a mailing list and I saw a few >> >> trentool >> >> questions in the archives, so I'm going to assume it's ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present in >> >> the pipeline. Sorry in advance for the long post! Any help would be >> >> greatly >> >> appreciated as I'm a bit over my head on this but I think I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data that >> >> was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi >> >> is in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within >> >> the toi, but beyond that are there any benefits to it being earlier >> >> or >> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >> >> in >> >> seconds. The prediction time is the assumed interaction delay >> >> between your >> >> two sources and should fit within your toi. In general it is >> >> preferable to >> >> use the method for interaction delay reconstruction for TE >> >> estimation, >> >> because it allows you to reconstruct the actual delay between your >> >> source >> >> and target times series. A non-optimal u/interaction delay may >> >> cause an >> >> underestimation of TE, so it is recommended to use the pipeline for >> >> interaction delay reconstruction whenever estimating TE for unknown >> >> delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, >> >> so it is best to limit the u range to values that are >> >> physiologically >> >> plausible. >> >> >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the sample >> >> rate and filters are used to determine the actthrvalue, but I don't >> >> actually know the calculation. 7.5 was a rough guess just to test >> >> the >> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >> >> You can >> >> set the actthrvalue based on the filtering you did prior to TE >> >> analysis. If >> >> you for example highpass filtered at 10 Hz, you shouldn't find an >> >> ACT >> >> higher than 30 samples, because you filtered out any components of >> >> the >> >> signal slower than 10 Hz/30 samples (given your sampling frequency >> >> of 300 >> >> Hz). So in this scenario the actthrvalue would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm yet >> >> to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* PW: >> >> The Ragwitz criterion tries to find optimal embedding parameters >> >> dim and >> >> tau for the data. To do that, the method iteratively takes all >> >> possible >> >> combinations of dim and tau values that are provided in cfgP.ragdim >> >> and >> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >> >> embed >> >> the data. To test an embedding, the method builds the embedding >> >> vectors >> >> from the data; it then tests for each point how well the next point >> >> in time >> >> can be predicted from the reference point's nearest neighbours. So >> >> for each >> >> embedded point, the method searches for the nearest neighbours and >> >> calculates the average of those nearest neighbours. The difference >> >> between >> >> the averaged/predicted point and the actual next point is the error >> >> of the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested by >> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together >> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >> >> will >> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >> >> here are >> >> factors that are later multiplied with the ACT to obtain the actual >> >> tau. >> >> 'repPred' is the number of points that will be used for the local >> >> prediction, i.e. the Ragwitz criterion will test the local >> >> prediction and >> >> calculate the error for the first 100 points in your time series. >> >> The two >> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >> >> neighbour >> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >> >> method to >> >> either conduct a kNN or range search; 'sizeNei' specifies the >> >> number of >> >> neighbours or the radius to be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' >> >> data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject >> >> virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.* >> >> TRENTOOL seems to handle data output very differently from >> >> fieldtrip and >> >> I've had trouble thinking through the most logical way to handle >> >> the data >> >> so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> >> >> *For clarification, fileCell is a cell with the name of each >> >> condition x >> >> subject .mat file, which as I said before is collectively the same >> >> as the 3 >> >> x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> *At this step I get the following error: Error using >> >> transferentropy (line >> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in >> >> TEgroup_calculate (line 133) [TEresult] = >> >> transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate is a >> >> pipeline issue* (I noticed the example pipeline in trentool, the >> >> manual, >> >> and published methods articles all seem to have slightly or >> >> significantly >> >> different pipeline compositions), *or if the error is* due to ACT, >> >> ragwitz optimization, or some other faulty parameterization *on my >> >> part >> >> due to a lack of understanding of how transfer entropy works on a >> >> more >> >> theoretical/mathematical level*. If the latter is the case, is >> >> there any >> >> relatively straightforward way to conceptualize this, or is this >> >> something >> >> where I'm just going to have to keep reading and rereading until it >> >> eventually makes sense? I've already done quite a bit of that and >> >> it hasn't >> >> pierced my thick skull yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing >> >> > listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie > ldtrip >> >> >> >> >> >> -- >> >> ------------------------------------------------------------ >> >> >> >> 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 >> >> >> > >> > >> > >> > -- >> > Max Cantor >> > Lab Manager >> > Computational Neurolinguistics Lab >> > University of Michigan >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 024/attachment.html> >> > >> > ------------------------------ >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > End of fieldtrip Digest, Vol 46, Issue 3 >> > **************************************** >> > >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jim Herring, MSc. > Neuronal Oscillations Group > Centre for Cognitive Neuroimaging > Donders Institute for Brain, Cognition and Behaviour > Radboud University Nijmegen > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > ------------------------------ > > Message: 8 > Date: Mon, 15 Sep 2014 12:53:19 -0500 > From: "Jing Fan" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of > variable 'abort' > Message-ID: <000301cfd10d$ef53cba0$cdfb62e0$@gmail.com> > Content-Type: text/plain; charset="us-ascii" > > Hi Barbara and Jim, > > I added path your/path/to/fieldtrip/utilities and now it worked. > Hope it helps solve the problem. > > Best, > Jing > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) > Sent: Monday, September 15, 2014 5:01 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable > 'abort' > > Dear Barbara, > > The error seems to be related to a bug that pops up now and then > (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a > corrupt installation of fieldtrip and/or the need to update fieldtrip. > > Could you please try downloading the most recent version of fieldtrip and > see if the problem persists? > > For an example of what can be expected from this function see: Esser SK, > Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct > demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res > Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. > > Best, > > Jim > > > ----- Oorspronkelijk bericht ----- >> Van: "barbara schorr" >> Aan: fieldtrip at science.ru.nl >> Verzonden: Woensdag 10 september 2014 14:07:14 >> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable > 'abort' >> Dear fieldtripers. >> >> as mentioned in the subject line I would like to anaylse my timelocked >> ERP Data with the function ft_globalmeanfield. >> >> I get the Error: Undefined function or variable 'abort' >> Error in ft_globalmeanfield (line84) >> if abort >> >> in the function it says: >> >> %the abort variable is set to true or false in ft_preamble_inti >> if abort >> % do not continue function execution in case the outputfile is >> present and the user indicated to keep it >> return >> end >> >> >> I don't understand what this means. I would really appreciate your >> help to get this running. >> >> Also, what is the result when I run this function on my data? (This >> method was proposed from a reviewer. I never used it before, so I >> don't exactly know what it does and what the result will look like). >> >> Thank you very much in advance! >> >> Best, >> >> Barbara Schorr >> >> >> >> >> Zitat von 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: Question regarding nonparametric testing for coherence >> > differences (Eric Maris) >> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >> > 4. Re: ft_rejectvisual: removing trials marked as bad >> > (Caspar, Emilie) >> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >> > 6. Latest FT version on ftp-server is from three days ago >> > (Holger Krause) >> > 7. Re: TRENTOOL pipeline help (Max Cantor) >> > >> > >> > ---------------------------------------------------------------------- >> > >> > Message: 1 >> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >> > From: "Eric Maris" >> > To: , "'FieldTrip discussion list'" >> > >> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >> > for >> > coherence differences >> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Hwee Ling, >> > >> > >> > >> > In the paper you refer to (Maris et al, JNM, 2007), I did not >> > perform a >> > cluster-based permutation test at the level of the channel pairs. >> > Instead, >> > all coherences mentioned in the paper are coherence between a single >> > EMG >> > channel (2 electrodes mounted on the forearm) and all MEG >> > electrodes. Thus, >> > there are as many EMG-MEG coherences as there are MEG channels (275 >> > in our >> > lab), and the clustering of these coherences involves the same >> > neighbourhood >> > structure as the clustering of channel-specific statistics on power >> > or >> > evoked response. The analysis you propose involves clustering in a >> > much more >> > complex space, namely the formed by all (MEG,MEG) channel pairs >> > (275*275=75625 pairs). In the early days of cluster-based >> > permutation >> > statistics, I have worked on this problem but did not pursue it >> > because the >> > resulting clusters are very hard to interpret. >> > >> > >> > >> > Best, >> > >> > >> > >> > Eric Maris >> > >> > >> > >> > >> > >> > Dear all and Prof Maris, >> > >> > I'm re-posting this question again, as I didn't get any replies >> > previously. >> > >> > I?m interested to investigate if there are any differences in phase >> > synchronization in resting state data at timepoint 2 versus >> > timepoint 1. The >> > EEG data was collected using 64 EEG channels, resting state, eyes >> > opened and >> > eyes closed. I?ve arbitrarily segmented the resting state data into >> > epochs >> > of 2s each, and the epochs with artifacts are excluded completely >> > from >> > further analyses. I then performed mtmfft to get the fourier >> > representation >> > of the data, extracted the coherence, and compared the coherence >> > difference >> > of timepoint 2 versus timepoint 1 of all channels paired with all >> > other >> > channels. >> > >> > I figured that if I extract the connectivity analyses without >> > specifying the >> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >> > allow me to >> > perform cluster-based statistical analyses. I get an output with >> > ?chan_chan? >> > dimord variable. However, I was not 100% sure that this is correct, >> > hence, I?ve >> > inserted my code (see below). It?ll be great if you could tell me if >> > what I?m >> > doing makes any sense at all. Also, I don?t know how I can plot the >> > results >> > to see if it make any sense at all. >> > >> > Also, I checked the values obtained from when I specified >> > "cfg.channelcmb" >> > and when I did not specify "cfg.channelcmb", I noticed that the >> > values were >> > somehow different. I would assume that the values to be similar, >> > although >> > I'm not sure why they would have differences in the values obtained >> > from >> > specifying "cfg.channelcmb". >> > >> > This is my code that I've used thus far: >> > >> > for sub = 1:5 >> > >> > cfg = []; >> > >> > cfg.output = 'fourier'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.keeptrials = 'yes'; >> > >> > cfg.tapsmofrq = 5; >> > >> > cfg.foilim = [0 100]; >> > >> > cfg.taper = 'dpss'; >> > >> > % find the index for the c200 condition >> > >> > pre_c200_idx = find(data5.trialinfo == 201); >> > >> > cfg.trials = pre_c200_idx; >> > >> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >> > >> > post_c200_idx = find(data5.trialinfo == 200); >> > >> > cfg.trials = post_c200_idx; >> > >> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >> > >> > >> > >> > cfg = []; >> > >> > cfg.keeptrials = 'no'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.removemean = 'yes'; >> > >> > cfg.method = 'coh'; >> > >> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_pre_c200); >> > >> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_post_c200); >> > >> > end >> > >> > >> > >> > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat > '); >> > >> > cfg_neighb.method = 'template'; >> > >> > cfg_neighb.layout = lay; >> > >> > cfg_neighb.channel = 'all'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, >> > sub_HLF_pre_c200coh{1}); >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.neighbours = neighbours; >> > >> > cfg.channel = 'all'; >> > >> > cfg.channelcmb = {cfg.channel, cfg.channel}; >> > >> > cfg.latency = 'all'; >> > >> > cfg.avgovertime = 'no'; >> > >> > cfg.avgoverchan = 'no'; >> > >> > cfg.parameter = 'cohspctrm'; >> > >> > cfg.method = 'montecarlo'; >> > >> > cfg.statistic = 'depsamplesT'; >> > >> > cfg.correctm = 'cluster'; >> > >> > cfg.tail = 0; >> > >> > % cfg.clustertail = 0; >> > >> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >> > frequency >> > bands. >> > >> > cfg.numrandomization = 10000; >> > >> > cfg.ivar = 2; >> > >> > cfg.uvar = 1; >> > >> > >> > >> > % design matrices >> > >> > clear design; >> > >> > design(1,:) = [1:5, 1:5]; >> > >> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >> > >> > cfg.design = design; >> > >> > % for theta band >> > >> > cfg.avgoverfreq = 'yes'; >> > >> > cfg.frequency = [4 8]; % I also performed the statistics for delta >> > (2-4), >> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >> > (30-40), >> > and gamma (40-100). >> > >> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >> > sub_HLF_post_c200coh{:}, >> > sub_HLF_pre_c200coh{:}); >> > >> > >> > >> > When I tried to plot the results, I used this code: >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.layout = 'lay'; >> > >> > cfg.zlim = [-1 1]; >> > >> > cfg.alpha = 0.05; >> > >> > cfg.refchannel = 'all'; >> > >> > ft_clusterplot(cfg, diffc200_theta_stat); >> > >> > However, I was not sure how I could plot the results. I get an error >> > message >> > from Fieldtrip when using ft_clusterplot: >> > >> > Error using topoplot_common (line 366) >> > >> > no reference channel is specified >> > >> > Error in ft_topoplotTFR (line 192) >> > >> > [cfg] = topoplot_common(cfg, varargin{:}); >> > >> > Error in ft_clusterplot (line 372) >> > >> > ft_topoplotTFR(cfgtopo, stat); >> > >> > >> > >> > According to your paper in 2007, the topoplot of the results were >> > masked by >> > the spatio-spectral pattern of the significant clusters. I don't >> > know how to >> > do this, and I would really appreciate if you can show me how to >> > make such a >> > plot. >> > >> > Thank you very much. >> > >> > Kind regards, >> > >> > Hweeling >> > >> > >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 280/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 2 >> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >> > From: KatrinH Heimann >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Joseph, thanks so much, I really appreciate your help. I was >> > also >> > wandering, if maybe there is another bug in my code. >> > Our nets are 128 channels, Hydrocel, but as a colleague of me >> > adviced me to >> > do so, I also tried the 129 layout. >> > My code you find below (without selection of bad channels etc.) >> > If you need also the data of two subjects to have a look, let me >> > know!!! >> > Best and thanks really! >> > Katrin >> > >> > >> > subject=input('Which subject do you want to analyse? ','s'); >> > >> > name = strcat(subject,'.raw'); >> > >> > subjectnumber=input('Which is the subjectnumber?', 's'); >> > >> > sb=subjectnumber >> > >> > %subjectnumber = strcat(subjectnumber, '.txt') >> > >> > %% >> > >> > >> > cfg = []; >> > >> > cfg.dataset = name; >> > >> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >> > >> > cfg.trialdef.eventtype = 'trigger'; >> > >> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> > trigger >> > >> > cfg.trialdef.prestim = 0.234; % in seconds >> > >> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> > observation, but maybe we need less) >> > >> > cfg = ft_definetrial(cfg); >> > >> > >> > cfg.trl([1:7],:) = []; >> > >> > >> > %change timeline according to constant offset of 16 ms = 8 samples >> > (because >> > recorded with 500 hz)in >> > >> > %structure trial >> > >> > cfg.trl(:,3)=cfg.trl(:,3)-8 >> > >> > >> > %change timeline to make the cut the zeropoint >> > >> > >> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> > >> > >> > >> > %% preprocess data >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.detrend = 'yes'; >> > >> > cfg.preproc.demean = 'yes'; >> > >> > cfg.preproc.baselinewindow = [-2.1 -2.0] >> > >> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> > filtered >> > >> > %(0.1-45) and bad channels have to be replaced!!!! >> > >> > %cfg.preproc.bpfreq = [6 32]; >> > >> > % >> > >> > % >> > >> > obs_data = ft_preprocessing(cfg); >> > >> > % >> > >> > save (strcat(sb,'obs_data') , 'obs_data') >> > >> > >> > %% determining channel neighbours (necessary for Artifact detection) >> > >> > cfg = []; >> > >> > cfg.channel = obs_data.label; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.feedback = 'yes'; >> > >> > lay = ft_prepare_layout(cfg); >> > >> > >> > >> > cfg_neighb = []; >> > >> > cfg_neighb.feedback = 'yes'; >> > >> > >> > cfg_neighb.method = 'triangulation'; >> > >> > cfg_neighb.layout = 'GSN128.sfp'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > obs_data.elec = ft_read_sens('GSN128.sfp'); >> > >> > >> > %% Artifacts - to detect bad channels - is not saved!!! >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs_data_try = ft_rejectvisual(cfg, obs_data); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_try = ft_rejectartifact (cfg,obs_data); >> > >> > >> > >> > %% Preparing neighbours for channel repair - but bad channel info >> > in!!! >> > >> > >> > % cfg_neighb = []; >> > >> > % cfg_neighb.feedback = 'yes'; >> > >> > % cfg_neighb.method = 'triangulation'; >> > >> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> > >> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > % Interpolate and put into new data structure >> > >> > cfg = []; >> > >> > cfg.badchannel = {}; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.method = 'nearest'; >> > >> > cfg.neighbours = neighbours; >> > >> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> > >> > >> > % Check reconstruction >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > % dat1=obs_data; >> > >> > % dat2=obs_data_channelrepaired; >> > >> > % >> > >> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> > >> > % y=dat2.trial{1}(62,:); >> > >> > % plot(x);hold on;plot(y,'r'); >> > >> > % >> > >> > % x=dat1.trial{1}(72,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > % >> > >> > % x=dat1.trial{1}(75,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > %% artifact rejection/trial inspection - throw out electrode jumps >> > etc. >> > >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> > according to >> > channels interpolated %% 128-number of interp. channels) >> > >> > >> > >> > cfg = []; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.numcomponent = 128 >> > >> > comp = ft_componentanalysis(cfg,obs_data_clean1); >> > >> > save (strcat(sb,'comp_all') , 'comp') >> > >> > >> > %% >> > >> > cfg = []; >> > >> > cfg.viewmode = 'component'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='some'; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > ft_databrowser(cfg,comp); >> > >> > >> > %% poweranalysis components >> > >> > cfg = []; >> > >> > cfg.output = 'pow'; >> > >> > cfg.channel = 'all';%compute the power spectrum in all ICs >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.taper = 'hanning'; >> > >> > cfg.foi = 0:0.2:50; >> > >> > obs_freq = ft_freqanalysis(cfg, comp); >> > >> > >> > %And you can plot the spectra: >> > >> > >> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> > >> > nsubplots = 16; >> > >> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> > decimals, type >> > doc subplot >> > >> > >> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >> > >> > tot = Nfigs*nsubplots; >> > >> > >> > rptvect = 1:size(comp.topo,1); >> > >> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> > >> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> > >> > >> > for r=1:size(rptvect,1); >> > >> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> > 1]);%full >> > screen >> > >> > k=0; >> > >> > for j=1:size(rptvect,2); >> > >> > if~(rptvect(r,j)==0); >> > >> > k=k+1; >> > >> > cfg=[]; >> > >> > cfg.channel = rptvect(r,j); >> > >> > cfg.ylim =[0 500] >> > >> > cfg.xlim =[0 50] >> > >> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> > >> > end >> > >> > end >> > >> > end >> > >> > >> > %For the IC topos you'll follow the same logic as above but with: >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [1:20]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [21:40]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [41:60]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [61:80]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > >> > >> > >> > >> > %% Seperate observation conditions >> > >> > >> > name1= strcat(num2str(sb),'_90.xls'); >> > >> > list1=xlsread (name1) >> > >> > >> > >> > >> > >> > name2= strcat(num2str(sb),'_180.xls'); >> > >> > list2=xlsread (name2) >> > >> > >> > >> > % >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list1] >> > >> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list2] >> > >> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > %%PIPELINE FOR obs90 >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128; >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > >> > comp_1 = ft_componentanalysis(cfg, obs90_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> > obs90_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts - final detection >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs90_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> > >> > >> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> > >> > >> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> > >> > >> > %% plot it >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP) >> > >> > >> > >> > >> > >> > >> > >> > %% PIPELINE FOR obs180 >> > >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128 >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > comp_2 = ft_componentanalysis(cfg, obs180_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> > obs180_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts final 180 >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs180_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> > >> > >> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> > >> > >> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> > >> > >> > %% plot 180 ERP >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs180_data_ERP) >> > >> > >> > %% plot both ERPs >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > cfg.showlabels = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> > >> > >> > %% plot difference wave >> > >> > >> > difference = obs180_data_ERP; % copy one of the >> > structures >> > >> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >> > the >> > difference ERP >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, difference) >> > >> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> > >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI >> >> data. A couple things. First of all, exactly which net do you use? >> >> If >> >> they are 129-channel, there is still the question of whether they >> >> are the >> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >> >> cause an >> >> error like this. Could you send me the file you are trying to >> >> process and >> >> the script you are using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >> >> diezmartini at gmail.com> wrote: >> >> >> >> Which nets do you use? I use EGI. I tried both the ones you mention >> >> and >> >> they didn't work. It was hard to find that exact one online but it >> >> was the >> >> only file that actually worked. >> >> >> >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >> >> >> wrote: >> >> >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. >> >>> Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one >> >>> >> >>>> I use >> >>>> >> >>>> >> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >> >>>> katrinheimann at gmail.com> wrote: >> >>>> >> >>>>> Dear all, my problems seem neverending. This time however i >> >>>>> really need >> >>>>> help. >> >>>>> I implemented a pipeline for ERPs. All works now, >> >>>>> trialdefinition, >> >>>>> preprocessing, channelreplacement, ica, componentrejection, >> >>>>> final >> >>>>> artifactdetection, timelock of the single subject data. However, >> >>>>> when I >> >>>>> wanna compute the grandaverage of the single subjects I get the >> >>>>> following >> >>>>> error message: >> >>>>> >> >>>>> computing average of avg over 19 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 3 MB >> >>>>> computing average of avg over 2 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >> >>>>> additional >> >>>>> allocation of an estimated 0 MB >> >>>>> >> >>>>> Furthermore in the plot of the significant clusters, the >> >>>>> channelnames >> >>>>> are mixed up (do not correspond to my net) >> >>>>> >> >>>>> >> >>>>> I guess that there is a problem with the layout I use. >> >>>>> Here the code that I use >> >>>>> >> >>>>> %For generating the layout (also in the single subjects): >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = obs_data.label; >> >>>>> >> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>>> >> >>>>> cfg.feedback = 'yes'; >> >>>>> >> >>>>> lay = ft_prepare_layout(cfg); >> >>>>> >> >>>>> >> >>>>> cfg_neighb = []; >> >>>>> >> >>>>> cfg_neighb.feedback = 'yes'; >> >>>>> >> >>>>> cfg_neighb.method = 'triangulation'; >> >>>>> >> >>>>> cfg_neighb.layout = lay; >> >>>>> >> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>>> >> >>>>> >> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>>>> >> >>>>> >> >>>>> %For computing the grand average >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = 'all'; >> >>>>> >> >>>>> cfg.latency = 'all'; >> >>>>> >> >>>>> cfg.parameter = 'avg'; >> >>>>> >> >>>>> cfg.keepindividual = 'no' >> >>>>> >> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>>>> >> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>>>> >> >>>>> % "{:}" means to use data from all elements of the variable >> >>>>> >> >>>>> >> >>>>> For plotting the significant clusters >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.style = 'blank'; >> >>>>> >> >>>>> cfg.layout = lay; >> >>>>> >> >>>>> cfg.channellabels = 'yes'; >> >>>>> >> >>>>> cfg.highlight = 'labels'; >> >>>>> >> >>>>> cfg.highlightchannel = find(stat.mask); >> >>>>> >> >>>>> cfg.comment = 'no'; >> >>>>> >> >>>>> figure; ft_topoplotER(cfg, GA_90) >> >>>>> >> >>>>> title('Nonparametric: significant with cluster multiple >> >>>>> comparison >> >>>>> correction') >> >>>>> >> >>>>> >> >>>>> Do you have ANY idea to this? I am really completely >> >>>>> helpless.... >> >>>>> >> >>>>> thanks and best >> >>>>> >> >>>>> Katrin >> >>>>> >> >>>>> _______________________________________________ >> >>>>> 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 >> >>> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> >> >> > ---------------------------------------------------------------------------- > ---- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.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: >> > > b61/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 3 >> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >> > From: Joseph Dien >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > yes, please do send me the data. >> > >> > Thanks! >> > >> > Joe >> > >> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >> > wrote: >> > >> >> Dear Joseph, thanks so much, I really appreciate your help. I was >> >> also wandering, if maybe there is another bug in my code. >> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >> >> adviced me to do so, I also tried the 129 layout. >> >> My code you find below (without selection of bad channels etc.) >> >> If you need also the data of two subjects to have a look, let me >> >> know!!! >> >> Best and thanks really! >> >> Katrin >> >> >> >> >> >> >> >> subject=input('Which subject do you want to analyse? ','s'); >> >> >> >> name = strcat(subject,'.raw'); >> >> >> >> subjectnumber=input('Which is the subjectnumber?', 's'); >> >> >> >> sb=subjectnumber >> >> >> >> %subjectnumber = strcat(subjectnumber, '.txt') >> >> >> >> %% >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.dataset = name; >> >> >> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> >> >> >> cfg.trialdef.eventtype = 'trigger'; >> >> >> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> >> trigger >> >> >> >> cfg.trialdef.prestim = 0.234; % in seconds >> >> >> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> >> observation, but maybe we need less) >> >> >> >> cfg = ft_definetrial(cfg); >> >> >> >> >> >> >> >> cfg.trl([1:7],:) = []; >> >> >> >> >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> >> (because recorded with 500 hz)in >> >> >> >> %structure trial >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >> >> >> >> >> >> >> >> %change timeline to make the cut the zeropoint >> >> >> >> >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> >> >> >> >> >> >> >> >> >> >> >> %% preprocess data >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.detrend = 'yes'; >> >> >> >> cfg.preproc.demean = 'yes'; >> >> >> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >> >> >> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> >> filtered >> >> >> >> %(0.1-45) and bad channels have to be replaced!!!! >> >> >> >> %cfg.preproc.bpfreq = [6 32]; >> >> >> >> % >> >> >> >> % >> >> >> >> obs_data = ft_preprocessing(cfg); >> >> >> >> % >> >> >> >> save (strcat(sb,'obs_data') , 'obs_data') >> >> >> >> >> >> >> >> %% determining channel neighbours (necessary for Artifact >> >> detection) >> >> >> >> cfg = []; >> >> >> >> cfg.channel = obs_data.label; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.feedback = 'yes'; >> >> >> >> lay = ft_prepare_layout(cfg); >> >> >> >> >> >> cfg_neighb = []; >> >> >> >> cfg_neighb.feedback = 'yes'; >> >> >> >> >> >> >> >> cfg_neighb.method = 'triangulation'; >> >> >> >> cfg_neighb.layout = 'GSN128.sfp'; >> >> >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >> >> >> >> >> >> >> >> %% Artifacts - to detect bad channels - is not saved!!! >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Preparing neighbours for channel repair - but bad channel info >> >> in!!! >> >> >> >> >> >> >> >> % cfg_neighb = []; >> >> >> >> % cfg_neighb.feedback = 'yes'; >> >> >> >> % cfg_neighb.method = 'triangulation'; >> >> >> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> >> >> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> % Interpolate and put into new data structure >> >> >> >> cfg = []; >> >> >> >> cfg.badchannel = {}; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.method = 'nearest'; >> >> >> >> cfg.neighbours = neighbours; >> >> >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> >> >> >> >> >> % Check reconstruction >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> % dat1=obs_data; >> >> >> >> % dat2=obs_data_channelrepaired; >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> >> >> >> % y=dat2.trial{1}(62,:); >> >> >> >> % plot(x);hold on;plot(y,'r'); >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(72,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(75,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> %% artifact rejection/trial inspection - throw out electrode jumps >> >> etc. >> >> >> >> >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> >> according to channels interpolated %% 128-number of interp. >> >> channels) >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.channel = {'all'}; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >> >> >> >> save (strcat(sb,'comp_all') , 'comp') >> >> >> >> >> >> >> >> %% >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'component'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='some'; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> ft_databrowser(cfg,comp); >> >> >> >> >> >> >> >> %% poweranalysis components >> >> >> >> cfg = []; >> >> >> >> cfg.output = 'pow'; >> >> >> >> cfg.channel = 'all';%compute the power spectrum in all ICs >> >> >> >> cfg.method = 'mtmfft'; >> >> >> >> cfg.taper = 'hanning'; >> >> >> >> cfg.foi = 0:0.2:50; >> >> >> >> obs_freq = ft_freqanalysis(cfg, comp); >> >> >> >> >> >> >> >> %And you can plot the spectra: >> >> >> >> >> >> >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> >> >> nsubplots = 16; >> >> >> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> >> decimals, type doc subplot >> >> >> >> >> >> >> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >> >> >> >> tot = Nfigs*nsubplots; >> >> >> >> >> >> >> >> rptvect = 1:size(comp.topo,1); >> >> >> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> >> >> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> >> >> >> >> >> >> >> for r=1:size(rptvect,1); >> >> >> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> >> 1]);%full screen >> >> >> >> k=0; >> >> >> >> for j=1:size(rptvect,2); >> >> >> >> if~(rptvect(r,j)==0); >> >> >> >> k=k+1; >> >> >> >> cfg=[]; >> >> >> >> cfg.channel = rptvect(r,j); >> >> >> >> cfg.ylim =[0 500] >> >> >> >> cfg.xlim =[0 50] >> >> >> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> >> >> >> end >> >> >> >> end >> >> >> >> end >> >> >> >> >> >> >> >> %For the IC topos you'll follow the same logic as above but with: >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [1:20]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [21:40]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [41:60]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [61:80]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Seperate observation conditions >> >> >> >> >> >> >> >> name1= strcat(num2str(sb),'_90.xls'); >> >> >> >> list1=xlsread (name1) >> >> >> >> >> >> >> >> name2= strcat(num2str(sb),'_180.xls'); >> >> >> >> list2=xlsread (name2) >> >> >> >> >> >> % >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list1] >> >> >> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list2] >> >> >> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> %%PIPELINE FOR obs90 >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128; >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> >> >> >> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> >> obs90_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts - final detection >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> >> >> >> >> >> >> >> %% plot it >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% PIPELINE FOR obs180 >> >> >> >> >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> >> obs180_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts final 180 >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> >> >> >> >> >> >> >> %% plot 180 ERP >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot both ERPs >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> cfg.showlabels = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot difference wave >> >> >> >> >> >> >> >> difference = obs180_data_ERP; % copy one of >> >> the structures >> >> >> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >> >> compute the difference ERP >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, difference) >> >> >> >> >> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI data. A couple things. First of all, exactly which net do >> >> you use? If they are 129-channel, there is still the question of >> >> whether they are the Hydrocel or the older geodesic nets. >> >> Regardless, that shouldn't cause an error like this. Could you >> >> send me the file you are trying to process and the script you are >> >> using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >> >> wrote: >> >> >> >>> Which nets do you use? I use EGI. I tried both the ones you >> >>> mention and they didn't work. It was hard to find that exact one >> >>> online but it was the only file that actually worked. >> >>> >> >>> >> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one I use >> >>> >> >>> >> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear all, my problems seem neverending. This time however i really >> >>> need help. >> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >> >>> preprocessing, channelreplacement, ica, componentrejection, final >> >>> artifactdetection, timelock of the single subject data. However, >> >>> when I wanna compute the grandaverage of the single subjects I get >> >>> the following error message: >> >>> >> >>> computing average of avg over 19 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 3 MB >> >>> computing average of avg over 2 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 0 MB >> >>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> the call to "ft_topoplotER" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> >> >>> Furthermore in the plot of the significant clusters, the >> >>> channelnames are mixed up (do not correspond to my net) >> >>> >> >>> >> >>> I guess that there is a problem with the layout I use. >> >>> Here the code that I use >> >>> >> >>> %For generating the layout (also in the single subjects): >> >>> cfg = []; >> >>> >> >>> cfg.channel = obs_data.label; >> >>> >> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>> >> >>> cfg.feedback = 'yes'; >> >>> >> >>> lay = ft_prepare_layout(cfg); >> >>> >> >>> >> >>> cfg_neighb = []; >> >>> >> >>> cfg_neighb.feedback = 'yes'; >> >>> >> >>> cfg_neighb.method = 'triangulation'; >> >>> >> >>> cfg_neighb.layout = lay; >> >>> >> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>> >> >>> >> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>> >> >>> >> >>> >> >>> %For computing the grand average >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.channel = 'all'; >> >>> >> >>> cfg.latency = 'all'; >> >>> >> >>> cfg.parameter = 'avg'; >> >>> >> >>> cfg.keepindividual = 'no' >> >>> >> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>> >> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>> >> >>> % "{:}" means to use data from all elements of the variable >> >>> >> >>> >> >>> For plotting the significant clusters >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.style = 'blank'; >> >>> >> >>> cfg.layout = lay; >> >>> >> >>> cfg.channellabels = 'yes'; >> >>> >> >>> cfg.highlight = 'labels'; >> >>> >> >>> cfg.highlightchannel = find(stat.mask); >> >>> >> >>> cfg.comment = 'no'; >> >>> >> >>> figure; ft_topoplotER(cfg, GA_90) >> >>> >> >>> title('Nonparametric: significant with cluster multiple comparison >> >>> correction') >> >>> >> >>> >> >>> >> >>> Do you have ANY idea to this? I am really completely helpless.... >> >>> >> >>> thanks and best >> >>> >> >>> Katrin >> >>> >> >>> >> >>> _______________________________________________ >> >>> 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 >> >>> >> >>> _______________________________________________ >> >>> fieldtrip mailing list >> >>> fieldtrip at donders.ru.nl >> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> > ---------------------------------------------------------------------------- > ---- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.com >> >> >> >> >> >> _______________________________________________ >> >> 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 >> > >> > > ---------------------------------------------------------------------------- > ---- >> > >> > Joseph Dien, PhD >> > Research Associate >> > Cognitive Neurology >> > The Johns Hopkins University School of Medicine >> > >> > Lab E-mail: jdien1 at jhmi.edu >> > Private E-mail: jdien07 at mac.com >> > Office Phone: 410-614-3115 >> > Cell Phone: 202-297-8117 >> > Fax: 410-955-0188 >> > http://joedien.com >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > ad2/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 4 >> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >> > From: "Caspar, Emilie" >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >> > bad >> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >> > Content-Type: text/plain; charset="iso-8859-1" >> > >> > Hi Ashley, >> > >> > Maybe the mistake is you did not integrate in your script the >> > command to save the rejection. Normally, with the following command, >> > you will see in the Matlab Window that artifacts are correctly >> > rejected after the "quit" button. >> > >> > clean_data = ft_rejectvisual(cfg, interpoldata); >> > cfg.artfctdef.reject = 'complete'; >> > cfg.artfctdef.feedback = 'yes'; >> > cleandata = ft_rejectartifact(cfg,clean_data); >> > >> > Emilie >> > >> > >> > >> > >> > >> > Le 3 sept. 2014 ? 11:58, Ashley Greene >> > > a ?crit : >> > >> > Hello, >> > >> > I have used the rejectvisual function in attempt to remove bad >> > trials, but after marking them and pressing the quit button, >> > although the command window states that the selected trials have >> > been removed, there is no obvious change in the data; all of the >> > trials are still intact. Have I overlooked something? >> > >> > Thanks, >> > >> > Ashley >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 985/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 5 >> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >> > From: Patricia Wollstadt >> > To: fieldtrip at science.ru.nl >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: <540EEF94.9080601 at gmx.de> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > Hello Max, >> > >> > I added a few comments to the questions regarding individual >> > parameters >> > below. To address the general problem of TRENTOOL telling you, that >> > there are not enough sample points in your data: From what I can see >> > in >> > your script, you probably don't have enough data points in each time >> > series to robustly estimate TE. You analyze 800 ms of data sampled >> > at >> > 300 Hz, which gives you 240 samples per time series. Can you maybe >> > avoid >> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >> > you >> > analyze a longer time window of interest? >> > Note that you also 'lose' data to embedding and the interaction >> > delay: >> > The first point that can be used for TE estimation is at max. >> > embedding >> > length + max. interaction delay in samples. For example: max. >> > embedding >> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >> > max >> > interaction delay of 30 ms = 9 samples. In this example, you would >> > be >> > left with 240 - 29 samples for TE estimation per trial. There is >> > also >> > the possibility to estimate time resolved TE/TE for shorter time >> > windows >> > of interest (see section 4.4 in the manual); however, this method >> > requires the use of a GPU for TE estimation. >> > >> > I would further recommend to use the new pipeline for group >> > statistics >> > described in the manual in section 4.5 (the function >> > 'TEgroup_calculate' >> > is deprecated). The new pipeline allows you to reconstruct the >> > interaction delay and uses the following functions (see also >> > comments in >> > the script): >> > >> > TEgroup_prepare -> prepares all data sets (all subjects/all >> > conditions) for group analysis (this means finding common embedding >> > parameters such that estimates are not biased between groups) >> > InteractionDelayReconstruction_calculate -> estimates TE for >> > individual data sets and all assumed interaction delays u >> > InteractionDelayReconstruction_analyze -> reconstructs the >> > interaction delay by selecting the u that maximizes TE for each >> > channel >> > TEgroup_stats -> calculate group statistics using a permutation test >> > >> > I can send you an example script for group TE analysis using this >> > pipeline to get you started. I hope this helps you to get the group >> > analysis running. Just write again if you're having trouble setting >> > up >> > the pipeline or something is not clear about the parameters/my >> > comments. >> > >> > Best, >> > Patricia >> > >> > >> > >> > >> > On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not >> >> 100% sure if it is appropriate to ask questions about it here, but >> >> to >> >> the best of my knowledge they do not have a mailing list and I saw >> >> a >> >> few trentool questions in the archives, so I'm going to assume it's >> >> ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present >> >> in the pipeline. Sorry in advance for the long post! Any help would >> >> be >> >> greatly appreciated as I'm a bit over my head on this but I think >> >> I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data >> >> that was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi is >> >> in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within the toi, but beyond that are there any benefits to it being >> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >> >> the >> >> toi is in seconds. The prediction time is the assumed interaction >> >> delay between your two sources and should fit within your toi. In >> >> general it is preferable to use the method for interaction delay >> >> reconstruction for TE estimation, because it allows you to >> >> reconstruct >> >> the actual delay between your source and target times series. A >> >> non-optimal u/interaction delay may cause an underestimation of TE, >> >> so >> >> it is recommended to use the pipeline for interaction delay >> >> reconstruction whenever estimating TE for unknown delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, so it is best to limit the u range to values that are >> >> physiologically plausible. >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the >> >> sample rate and filters are used to determine the actthrvalue, but >> >> I >> >> don't actually know the calculation. 7.5 was a rough guess just to >> >> test the pipeline. I'm also uncertain of what minnrtrials should >> >> be.* >> >> PW: You can set the actthrvalue based on the filtering you did >> >> prior >> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >> >> shouldn't find an ACT higher than 30 samples, because you filtered >> >> out >> >> any components of the signal slower than 10 Hz/30 samples (given >> >> your >> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >> >> would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> * >> >> * >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm >> >> yet to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* >> >> PW: The Ragwitz criterion tries to find optimal embedding >> >> parameters >> >> dim and tau for the data. To do that, the method iteratively takes >> >> all >> >> possible combinations of dim and tau values that are provided in >> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >> >> these >> >> combinations embed the data. To test an embedding, the method >> >> builds >> >> the embedding vectors from the data; it then tests for each point >> >> how >> >> well the next point in time can be predicted from the reference >> >> point's nearest neighbours. So for each embedded point, the method >> >> searches for the nearest neighbours and calculates the average of >> >> those nearest neighbours. The difference between the >> >> averaged/predicted point and the actual next point is the error of >> >> the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested >> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together with 'ragtausteps' specifies the tau values to be tested >> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >> >> that >> >> the values here are factors that are later multiplied with the ACT >> >> to >> >> obtain the actual tau. 'repPred' is the number of points that will >> >> be >> >> used for the local prediction, i.e. the Ragwitz criterion will test >> >> the local prediction and calculate the error for the first 100 >> >> points >> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >> >> below >> >> specify the type of neighbour search conducted by the Ragwitz >> >> criterion: 'flagNei' tells the method to either conduct a kNN or >> >> range >> >> search; 'sizeNei' specifies the number of neighbours or the radius >> >> to >> >> be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> * >> >> * >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> * >> >> * >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.*TRENTOOL seems to handle data output very differently >> >> from >> >> fieldtrip and I've had trouble thinking through the most logical >> >> way >> >> to handle the data so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> * >> >> * >> >> *For clarification, fileCell is a cell with the name of each >> >> condition >> >> x subject .mat file, which as I said before is collectively the >> >> same >> >> as the 3 x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> * >> >> * >> >> *At this step I get the following error: >> >> >> >> Error using transferentropy (line 337) >> >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> >> >> Error in TEgroup_calculate (line 133) >> >> [TEresult] = transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate >> >> is a pipeline issue* (I noticed the example pipeline in trentool, >> >> the >> >> manual, and published methods articles all seem to have slightly or >> >> significantly different pipeline compositions), *or if the error >> >> is* >> >> due to ACT, ragwitz optimization, or some other faulty >> >> parameterization *on my part due to a lack of understanding of how >> >> transfer entropy works on a more theoretical/mathematical level*. >> >> If >> >> the latter is the case, is there any relatively straightforward way >> >> to >> >> conceptualize this, or is this something where I'm just going to >> >> have >> >> to keep reading and rereading until it eventually makes sense? I've >> >> already done quite a bit of that and it hasn't pierced my thick >> >> skull >> >> yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> 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: >> > > 97f/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 6 >> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >> > From: Holger Krause >> > To: FieldTrip discussion list >> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >> > days ago >> > Message-ID: >> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >> > Content-Type: text/plain; charset="us-ascii" >> > >> > Dear developers, >> > >> > Could you please check the process for creation/publication of >> > zip-files on >> > the FTP server? The latest file I can find there is >> > fieldtrip-20140906.zip. >> > >> > Thanks in advance, >> > >> > Holger >> > >> > >> > ------------------------------ >> > >> > Message: 7 >> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >> > From: Max Cantor >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > This is immensely helpful, thank you. I was very confused about why >> > some >> > versions of the pipeline I saw were using group calculate and others >> > were >> > using interaction delay reconstruction and what that meant, and I >> > think I >> > have a more clear idea of what the different steps of the pipeline >> > are >> > doing. There are still a few things I'm a bit confused about though >> > in >> > terms of the pipeline. For instance, whether or not I need to do >> > TEprepare >> > before group prepare, and if I need to do graph analysis (which I'm >> > not >> > sure I fully understand but also haven't looked deeply into) before >> > group >> > stats. >> > >> > If you don't mind me taking you up on your offer, I think seeing >> > your >> > example script might help clarify some of these issues. >> > >> > Thank you! >> > >> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >> > Patricia.Wollstadt at gmx.de> wrote: >> > >> >> Hello Max, >> >> >> >> I added a few comments to the questions regarding individual >> >> parameters >> >> below. To address the general problem of TRENTOOL telling you, that >> >> there >> >> are not enough sample points in your data: From what I can see in >> >> your >> >> script, you probably don't have enough data points in each time >> >> series to >> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >> >> which >> >> gives you 240 samples per time series. Can you maybe avoid >> >> downsampling to >> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >> >> longer time >> >> window of interest? >> >> Note that you also 'lose' data to embedding and the interaction >> >> delay: The >> >> first point that can be used for TE estimation is at max. embedding >> >> length >> >> + max. interaction delay in samples. For example: max. embedding >> >> length = >> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >> >> interaction >> >> delay of 30 ms = 9 samples. In this example, you would be left with >> >> 240 - >> >> 29 samples for TE estimation per trial. There is also the >> >> possibility to >> >> estimate time resolved TE/TE for shorter time windows of interest >> >> (see >> >> section 4.4 in the manual); however, this method requires the use >> >> of a GPU >> >> for TE estimation. >> >> >> >> I would further recommend to use the new pipeline for group >> >> statistics >> >> described in the manual in section 4.5 (the function >> >> 'TEgroup_calculate' is >> >> deprecated). The new pipeline allows you to reconstruct the >> >> interaction >> >> delay and uses the following functions (see also comments in the >> >> script): >> >> >> >> TEgroup_prepare -> prepares all data sets (all subjects/all >> >> conditions) >> >> for group analysis (this means finding common embedding parameters >> >> such >> >> that estimates are not biased between groups) >> >> InteractionDelayReconstruction_calculate -> estimates TE for >> >> individual data sets and all assumed interaction delays u >> >> InteractionDelayReconstruction_analyze -> reconstructs the >> >> interaction delay by selecting the u that maximizes TE for each >> >> channel >> >> TEgroup_stats -> calculate group statistics using a permutation >> >> test >> >> >> >> I can send you an example script for group TE analysis using this >> >> pipeline >> >> to get you started. I hope this helps you to get the group analysis >> >> running. Just write again if you're having trouble setting up the >> >> pipeline >> >> or something is not clear about the parameters/my comments. >> >> >> >> Best, >> >> Patricia >> >> >> >> >> >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not 100% >> >> sure if it is appropriate to ask questions about it here, but to >> >> the best >> >> of my knowledge they do not have a mailing list and I saw a few >> >> trentool >> >> questions in the archives, so I'm going to assume it's ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present in >> >> the pipeline. Sorry in advance for the long post! Any help would be >> >> greatly >> >> appreciated as I'm a bit over my head on this but I think I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data that >> >> was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi >> >> is in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within >> >> the toi, but beyond that are there any benefits to it being earlier >> >> or >> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >> >> in >> >> seconds. The prediction time is the assumed interaction delay >> >> between your >> >> two sources and should fit within your toi. In general it is >> >> preferable to >> >> use the method for interaction delay reconstruction for TE >> >> estimation, >> >> because it allows you to reconstruct the actual delay between your >> >> source >> >> and target times series. A non-optimal u/interaction delay may >> >> cause an >> >> underestimation of TE, so it is recommended to use the pipeline for >> >> interaction delay reconstruction whenever estimating TE for unknown >> >> delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, >> >> so it is best to limit the u range to values that are >> >> physiologically >> >> plausible. >> >> >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the sample >> >> rate and filters are used to determine the actthrvalue, but I don't >> >> actually know the calculation. 7.5 was a rough guess just to test >> >> the >> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >> >> You can >> >> set the actthrvalue based on the filtering you did prior to TE >> >> analysis. If >> >> you for example highpass filtered at 10 Hz, you shouldn't find an >> >> ACT >> >> higher than 30 samples, because you filtered out any components of >> >> the >> >> signal slower than 10 Hz/30 samples (given your sampling frequency >> >> of 300 >> >> Hz). So in this scenario the actthrvalue would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm yet >> >> to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* PW: >> >> The Ragwitz criterion tries to find optimal embedding parameters >> >> dim and >> >> tau for the data. To do that, the method iteratively takes all >> >> possible >> >> combinations of dim and tau values that are provided in cfgP.ragdim >> >> and >> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >> >> embed >> >> the data. To test an embedding, the method builds the embedding >> >> vectors >> >> from the data; it then tests for each point how well the next point >> >> in time >> >> can be predicted from the reference point's nearest neighbours. So >> >> for each >> >> embedded point, the method searches for the nearest neighbours and >> >> calculates the average of those nearest neighbours. The difference >> >> between >> >> the averaged/predicted point and the actual next point is the error >> >> of the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested by >> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together >> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >> >> will >> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >> >> here are >> >> factors that are later multiplied with the ACT to obtain the actual >> >> tau. >> >> 'repPred' is the number of points that will be used for the local >> >> prediction, i.e. the Ragwitz criterion will test the local >> >> prediction and >> >> calculate the error for the first 100 points in your time series. >> >> The two >> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >> >> neighbour >> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >> >> method to >> >> either conduct a kNN or range search; 'sizeNei' specifies the >> >> number of >> >> neighbours or the radius to be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' >> >> data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject >> >> virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.* >> >> TRENTOOL seems to handle data output very differently from >> >> fieldtrip and >> >> I've had trouble thinking through the most logical way to handle >> >> the data >> >> so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> >> >> *For clarification, fileCell is a cell with the name of each >> >> condition x >> >> subject .mat file, which as I said before is collectively the same >> >> as the 3 >> >> x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> *At this step I get the following error: Error using >> >> transferentropy (line >> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in >> >> TEgroup_calculate (line 133) [TEresult] = >> >> transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate is a >> >> pipeline issue* (I noticed the example pipeline in trentool, the >> >> manual, >> >> and published methods articles all seem to have slightly or >> >> significantly >> >> different pipeline compositions), *or if the error is* due to ACT, >> >> ragwitz optimization, or some other faulty parameterization *on my >> >> part >> >> due to a lack of understanding of how transfer entropy works on a >> >> more >> >> theoretical/mathematical level*. If the latter is the case, is >> >> there any >> >> relatively straightforward way to conceptualize this, or is this >> >> something >> >> where I'm just going to have to keep reading and rereading until it >> >> eventually makes sense? I've already done quite a bit of that and >> >> it hasn't >> >> pierced my thick skull yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing >> >> > listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie > ldtrip >> >> >> >> >> >> -- >> >> ------------------------------------------------------------ >> >> >> >> 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 >> >> >> > >> > >> > >> > -- >> > Max Cantor >> > Lab Manager >> > Computational Neurolinguistics Lab >> > University of Michigan >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 024/attachment.html> >> > >> > ------------------------------ >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > End of fieldtrip Digest, Vol 46, Issue 3 >> > **************************************** >> > >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jim Herring, MSc. > Neuronal Oscillations Group > Centre for Cognitive Neuroimaging > Donders Institute for Brain, Cognition and Behaviour > Radboud University Nijmegen > _______________________________________________ > 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 > > End of fieldtrip Digest, Vol 46, Issue 5 > **************************************** > Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From barbara.schorr at uni-ulm.de Wed Sep 17 12:13:04 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Wed, 17 Sep 2014 12:13:04 +0200 Subject: [FieldTrip] ft_globalmeanfield works In-Reply-To: References: Message-ID: <20140917121304.oegwu3yyo4004s8c@imap.uni-ulm.de> Dear Jim, I found the problem. I still had an older Fieldtrip version on my computer and this interfered somehow. I deleted that version and now it works. Best, Barbara Zitat von 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. dipole simulation on head model (gamaliel huerta urrea) > 2. Re: dipole simulation on head model (a.stolk) > 3. Re: Latest FT version on ftp-server is from three days ago > (Holger Krause) > 4. Re: Latest FT version on ftp-server is from three days ago > (Robert Oostenveld) > 5. difference in raw time sample values for .fif files read by > fieldtrip vs mne-python (Baptiste Gauthier) > 6. ft_connectivityanalysis vs MATLAB (Matt Gerhold) > 7. ft_connectivity_pdc (Matt Gerhold) > 8. dipole simulation on head model (gamaliel huerta urrea) > 9. Re: MEG lead field units (Marc Lalancette) > 10. Re: ft_globalmeanfield : Undefined function of variable > (barbara.schorr at uni-ulm.de) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 16 Sep 2014 01:49:37 -0300 > From: gamaliel huerta urrea > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] dipole simulation on head model > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi all > > I followed the tips above to simulate a dipole source on my own head model > generated from MRIs. However, using information from: > > http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit > > I could not simulate anything. Only one image is blank. The code I am using > is as follows: > > cfg = []; > cfg.vol = vol; % See above > cfg.elec = elec; % See above > cfg.dip.pos = [0 0 0]; > cfg.dip.mom = [2 2 2]; % Note, it Should be transposed > cfg.dip.frequency = 10; > cfg.ntrials = 10; > cfg.triallength = 1; % seconds > cfg.fsample = 25; % Hz > raw1 = ft_dipolesimulation (cfg); > ft_timelockanalysis avg1 = ([], raw1); > plot (avg1.time, avg1.avg); % Plot the timecourse > > where: > > vol = ft_prepare_headmodel volumes generated from the segmentation of my > resonances. > > and > > ft_read_sens elec = ('standard_1020.elc'); > > to run the script the result is a blank image. > > and Matlab tells me the following: > > using headmodel specified in the configuration > using electrodes specified in the configuration > Determining source compartment (1) > projecting electrodes on skin surface > electrode and system combine combining transfer matrix > computing simulated data > computing simulated trial data for 10 > > RMS value of simulated data is NaN > the call to "ft_dipolesimulation" took 4 seconds > the input is raw Data with 97 channels and 10 trials > Warning: the data does not Contain a definition trial >> In utilities \ private \ warning_once at 158 > In utilities \ private \ fixsampleinfo at 66 > In ft_datatype_raw at 157 > In ft_checkdata at 224 > In ft_timelockanalysis at 105 > In codgen at 50 > Warning: sampleinfo by reconstructing Assuming That the trials are > consecutive segments of > a continuous recording >> In utilities \ private \ warning_once at 158 > In utilities \ private \ fixsampleinfo at 79 > In ft_datatype_raw at 157 > In ft_checkdata at 224 > In ft_timelockanalysis at 105 > In codgen at 50 > averaging trials > trial averaging 10 of 10 > > the call to "ft_timelockanalysis" took 1 seconds > > > I hope you can help > > > greetings > -- > *Gamaliel Huerta* > *Ingenier?a Civil Biom?dica* > *Universidad de Valpara?so* > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 2 > Date: Tue, 16 Sep 2014 08:07:19 +0200 > From: "a.stolk" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] dipole simulation on head model > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi Gamaliel, can you try > avg = ft_timelockanalysis([], raw1);? > Instead of > ft_timelockanalysis avg1 = ([], raw1);? > Hope this helps, arjen > > > > -------- Oorspronkelijk bericht -------- > Van: gamaliel huerta urrea > Datum: > Aan: fieldtrip at science.ru.nl > Onderwerp: [FieldTrip] dipole simulation on head model > > > Hi all > > I followed the tips above to simulate a dipole source on my own head > model generated from MRIs. However, using information from:? > > http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit > > I could not simulate anything. Only one image is blank. The code I > am using is as follows:? > > cfg = [];? > cfg.vol = vol; % See above? > cfg.elec = elec; % See above? > cfg.dip.pos = [0 0 0];? > cfg.dip.mom = [2 2 2]; % Note, it Should be transposed? > cfg.dip.frequency = 10;? > cfg.ntrials = 10;? > cfg.triallength = 1; % seconds? > cfg.fsample = 25; % Hz? > raw1 = ft_dipolesimulation (cfg);? > ft_timelockanalysis avg1 = ([], raw1);? > plot (avg1.time, avg1.avg); % Plot the timecourse? > > where:? > > vol = ft_prepare_headmodel volumes generated from the segmentation > of my resonances.? > > and? > > ft_read_sens elec = ('standard_1020.elc');? > > to run the script the result is a blank image.? > > and Matlab tells me the following:? > > using headmodel specified in the configuration? > using electrodes specified in the configuration? > Determining source compartment (1)? > projecting electrodes on skin surface? > electrode and system combine combining transfer matrix? > computing simulated data? > computing simulated trial data for 10? > > RMS value of simulated data is NaN? > the call to "ft_dipolesimulation" took 4 seconds? > the input is raw Data with 97 channels and 10 trials? > Warning: the data does not Contain a definition trial? >> In utilities \ private \ warning_once at 158? > ? ?In utilities \ private \ fixsampleinfo at 66? > ? ?In ft_datatype_raw at 157? > ? ?In ft_checkdata at 224? > ? ?In ft_timelockanalysis at 105? > ? ?In codgen at 50? > Warning: sampleinfo by reconstructing Assuming That the trials are > consecutive segments of? > a continuous recording? >> In utilities \ private \ warning_once at 158? > ? ?In utilities \ private \ fixsampleinfo at 79? > ? ?In ft_datatype_raw at 157? > ? ?In ft_checkdata at 224? > ? ?In ft_timelockanalysis at 105? > ? ?In codgen at 50? > averaging trials? > trial averaging 10 of 10? > > the call to "ft_timelockanalysis" took 1 seconds? > > > I hope you can help? > > > greetings > -- > Gamaliel Huerta > Ingenier?a Civil Biom?dica > Universidad de Valpara?so > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 3 > Date: Tue, 16 Sep 2014 11:35:30 +0200 > From: Holger Krause > To: > Subject: Re: [FieldTrip] Latest FT version on ftp-server is from three > days ago > Message-ID: <201409161135.32594.Holger.Krause at med.uni-duesseldorf.de> > Content-Type: text/plain; charset="iso-8859-15" > > Hi! > > Again, same situation as last week :-( The latest file I can find on the FTP > server is fieldtrip-20140913.zip. > > Thanks for taking care of this issue, > > 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 > > > > ------------------------------ > > Message: 4 > Date: Tue, 16 Sep 2014 12:15:11 +0200 > From: Robert Oostenveld > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Latest FT version on ftp-server is from three > days ago > Message-ID: <4C0CDFB7-782E-49C1-9659-B85ABB918486 at donders.ru.nl> > Content-Type: text/plain; charset=iso-8859-1 > > Hi Holger, > > Thanks for notifying. We had a server crash a few days ago. One of > the consequences seems to have been that the automatic svn update > script blocked. I did a cleanup and the automatic releases on the > ftp should start coming again. Note that alternative ways to access > the code are explained on > http://fieldtrip.fcdonders.nl/faq/i_would_like_an_automatic_daily_updated_version_of_the_code_can_i_get_access_to_the_cvs_or_snv_server > > best regards, > Robert > > > > On 16 Sep 2014, at 11:35, Holger Krause > wrote: > >> Hi! >> >> Again, same situation as last week :-( The latest file I can find on the FTP >> server is fieldtrip-20140913.zip. >> >> Thanks for taking care of this issue, >> >> 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 > > > > > ------------------------------ > > Message: 5 > Date: Tue, 16 Sep 2014 14:27:15 +0200 > From: Baptiste Gauthier > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] difference in raw time sample values for .fif > files read by fieldtrip vs mne-python > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Dear fieldtrippers, > > I recently observed that reading a raw neuromag .fif file with fieldtrip > and mne-python (with default settings for both) give exactly the same > events separated by the same time (which is good!) but with a different > time offset: the zero-point definition for the recording differ between the > two softwares. I hypothesize that this difference comes from the convention > adopted: fieldtrip would use the "record raw" trigger as a zero-point and > mne the "start" trigger that occur earlier (i.e. you can follow the signal > but it will be not saved in the file), but I'm not perfectly sure. > > As someone already observed this difference? > It's harmless because it doesn't affect relative timing of the event but > become problematic to transfer recoded events trl from fieldtrip to > mne-python with a time-sample matching strategy. > > Best, > > Baptiste > > -- > Baptiste Gauthier > Postdoctoral Research Fellow > > INSERM-CEA Cognitive Neuroimaging unit > CEA/SAC/DSV/DRM/Neurospin center > B?t 145, Point Courier 156 > F-91191 Gif-sur-Yvette Cedex FRANCE > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 6 > Date: Tue, 16 Sep 2014 17:03:33 +0200 > From: Matt Gerhold > To: fieldtrip at science.ru.nl, fieldtrip-request at science.ru.nl > Subject: [FieldTrip] ft_connectivityanalysis vs MATLAB > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi, > > I've compared the non-parametric calculation of the coherence spectrum > using ft_connectivityanalysis to mscohere (MATLAB). The FT function > provides inflated coherence values in comparison to the MATLAB function. > I've also referenced this to a implementation of the original calculation > which equates to the MATLAB output. Any advice would be appreciated. > > Matthew > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 7 > Date: Tue, 16 Sep 2014 17:16:00 +0200 > From: Matt Gerhold > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] ft_connectivity_pdc > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > When computing pdc in FT, line 67 of ft_connectivity_pdc appears to invert > the spectral transfer func. When inverting I received the following error: > > Warning: Matrix is close to singular or badly scaled. Results may be > inaccurate. RCOND = 6.358859e-18. > > Will this impact on the final spectrum calculated by the method. If so, is > there a possible workaround/solution? > > Matthew > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 8 > Date: Tue, 16 Sep 2014 14:20:36 -0300 > From: gamaliel huerta urrea > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] dipole simulation on head model > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi all > > I followed the tips above to simulate a dipole source on my own head > model generated from MRIs. However, using information from: > http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit > > I could not simulate anything. Only one image is blank. The code I am > using is as follows: > > cfg = []; > cfg.vol = vol; % See above > cfg.elec = elec; % See above > cfg.dip.pos = [0 0 0]; > cfg.dip.mom = [2 2 2]; % Note, it Should be transposed > cfg.dip.frequency = 10; > cfg.ntrials = 10; > cfg.triallength = 1; % seconds > cfg.fsample = 25; % Hz > raw1 = ft_dipolesimulation (cfg); > avg1 = ft_timelockanalysis([], raw1); > > plot (avg1.time, avg1.avg); % Plot the timecourse > > where: > > vol = ft_prepare_headmodel volumes generated from the segmentation of > my resonances. > > and > > ft_read_sens elec = ('standard_1020.elc'); > > to run the script the result is a blank image. > > and Matlab tells me the following: > > using headmodel specified in the configuration > using electrodes specified in the configuration > Determining source compartment (1) > projecting electrodes on skin surface > electrode and system combine combining transfer matrix > computing simulated data > computing simulated trial data for 10 > > RMS value of simulated data is NaN > the call to "ft_dipolesimulation" took 4 seconds > the input is raw Data with 97 channels and 10 trials > Warning: the data does not Contain a definition trial >> * In utilities \ private \ warning_once at 158 > * In utilities \ private \ fixsampleinfo at 66 > In ft_datatype_raw at 157 > In ft_checkdata at 224 > In ft_timelockanalysis at 105 > In codgen at 50 > Warning: sampleinfo by reconstructing Assuming That the trials are > consecutive segments of > a continuous recording >> * In utilities \ private \ warning_once at 158 > * In utilities \ private \ fixsampleinfo at 79 > In ft_datatype_raw at 157 > In ft_checkdata at 224 > In ft_timelockanalysis at 105 > In codgen at 50 > averaging trials > trial averaging 10 of 10 > > the call to "ft_timelockanalysis" took 1 seconds > > > I hope you can help > > > greetings > > -- > *Gamaliel Huerta* > *Ingenier?a Civil Biom?dica* > *Universidad de Valpara?so* > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 9 > Date: Tue, 16 Sep 2014 18:42:21 +0000 > From: Marc Lalancette > To: "fieldtrip at science.ru.nl" > Subject: Re: [FieldTrip] MEG lead field units > Message-ID: > <2A2B6A5B8C4C174CBCCE0B45E548DEB229FBB67F at SKMBXX01.sickkids.ca> > Content-Type: text/plain; charset="us-ascii" > > Hello Fieldtrippies, > > Regarding a question I asked some months ago about the physical > units of the lead field in Fieldtrip, I wanted to share the fact > that I was wrong, and that it might be good to either document this > in the code and possibly to add a factor. When using 'cm' units, > the lead field is in Wb/cm^2/(A*m) = 1e4 T/Am = 1e2 T/(A*cm). I > started to realize my original assumption was wrong while working on > my Biomag poster since I was getting very low SNR values (around 1) > for typical source and system parameters. So I looked closer at > the single sphere code and my own old spherical forward solution > code, and here is where the extra factor comes in: > > Skipping to the last step, my formula is: > B = UnitConversion * (1e-7) * ( (QxrQ/F - (QxrQ * rv') * GradF/F^2) > * SensorOrient' ); > The second factor is the constant mu0/(4*pi) = 10^-7 Wb/Am. > Assuming a source (Q) in units of Am and distances in cm, the > complicated bit has units of Am*cm/cm^3. > Thus without the first factor, B would have units of Wb/cm^2 = 1e4 > T, and so I was using UnitConversion = 1e4 in my code, to get B in > Tesla. If we don't put in a specific source amplitude (as in > Fieldtrip), and still using UnitConversion, then B would be in T/(Am). > > I guess units can be different than 'cm' though, so the factor would > have to take that into account. Note that the single shell forward > solution gives the same units as single sphere and would need the > same factor. I haven't looked at other forward methods. I also > haven't verified if this is correctly dealt with when obtaining > reconstructed source amplitudes, say with a beamformer. > > Cheers, > Marc Lalancette > Lab Research Project Manager > The Hospital for Sick Children, Toronto, Canada > > > > > ________________________________ > > This e-mail may contain confidential, personal and/or health > information(information which may be subject to legal restrictions > on use, retention and/or disclosure) for the sole use of the > intended recipient. Any review or distribution by anyone other than > the person for whom it was originally intended is strictly > prohibited. If you have received this e-mail in error, please > contact the sender and delete all copies. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 10 > Date: Wed, 17 Sep 2014 11:22:19 +0200 > From: barbara.schorr at uni-ulm.de > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of > variable > Message-ID: <20140917112219.crkxv6dgoo0skccc at imap.uni-ulm.de> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > Dear Jim, > > I now downloaded the newest fieldtrip version but I still get the same > error messag. Is there anything else I need to know? > > Thanks a lot! > > Best, > Barbara > > > Zitat von 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: ft_rejectvisual: removing trials marked as bad (Ashley Greene) >> 2. Read only EEG data from combined MEG/EEG ctf file (Tobias Trame) >> 3. Re: ft_globalmeanfield : Undefined function of variable >> 'abort' (Herring, J.D. (Jim)) >> 4. using ft_megplanar with sinle-trial TFRs (Fr?d?ric Roux) >> 5. dipole simulation on head model (gamaliel huerta urrea) >> 6. Re: dipole simulation on head model (Tzvetan Popov) >> 7. Re: ft_globalmeanfield : Undefined function of variable >> 'abort' (Jing Fan) >> 8. Re: ft_globalmeanfield : Undefined function of variable >> 'abort' (Jing Fan) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Fri, 12 Sep 2014 21:39:43 +0900 >> From: Ashley Greene >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >> bad >> Message-ID: >> >> Content-Type: text/plain; charset="utf-8" >> >> Hi Emilie, >> >> Thanks!! I, of course, completely overlooked that. >> >> Ashley >> >> On Tue, Sep 9, 2014 at 3:37 PM, Caspar, Emilie wrote: >> >>> Hi Ashley, >>> >>> Maybe the mistake is you did not integrate in your script the command to >>> save the rejection. Normally, with the following command, you will see in >>> the Matlab Window that artifacts are correctly rejected after the "quit" >>> button. >>> >>> clean_data = ft_rejectvisual(cfg, interpoldata); >>> cfg.artfctdef.reject = 'complete'; >>> cfg.artfctdef.feedback = 'yes'; >>> cleandata = ft_rejectartifact(cfg,clean_data); >>> >>> Emilie >>> >>> >>> >>> >>> >>> Le 3 sept. 2014 ? 11:58, Ashley Greene a ?crit : >>> >>> Hello, >>> >>> I have used the rejectvisual function in attempt to remove bad trials, >>> but after marking them and pressing the quit button, although the command >>> window states that the selected trials have been removed, there is no >>> obvious change in the data; all of the trials are still intact. Have I >>> overlooked something? >>> >>> Thanks, >>> >>> Ashley >>> _______________________________________________ >>> 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: >> >> >> ------------------------------ >> >> Message: 2 >> Date: Fri, 12 Sep 2014 18:23:17 +0200 (CEST) >> From: Tobias Trame >> To: >> Subject: [FieldTrip] Read only EEG data from combined MEG/EEG ctf file >> Message-ID: >> >> >> Content-Type: text/plain; charset=us-ascii >> >> Hi everybody! >> >> I'm trying to read only the EEG data from a combined MEG/EEG ctf >> file in order >> to create leadfields later on, but the function "ft_read_sens" just returns >> the gradiometer information in a 'grad' field. It searches for an >> 'elec'-field >> in the header of the data which is not present. Is there a configuration to >> get the EEG-elecrodes by using "ft_read_sens"? >> >> My first attempt was to write the EEG-Information from the header by hand >> using the following code: >> >> hdr = ft_read_header('subject.ds', 'headerformat', 'ctf_ds'); >> elec.elecpos = [hdr.orig.eeg.pos]'; >> elec.chanpos = [hdr.orig.eeg.pos]'; >> elec.label = {hdr.orig.eeg.name}'; >> elec.type = 'eeg'; >> elec.unit = 'cm'; >> >> But now I get a similar problem if I want to create leadfields from timelock >> data. After doing the timelock analysis using >> >> timelock_data = ft_timelockanalysis(cfg, mydata); >> >> the structure timelock_data contains just a 'grad' and no 'elec' >> field so that >> ft_prepare_leadfield(cfg, timelock_data) always ignores the >> EEG-elecrodes and >> tries to use the gradiometes - even if I put the electrodes defined >> above into >> cfg.elec. >> >> Thanks for any suggestions! >> >> Tobias >> >> >> ------------------------------ >> >> Message: 3 >> Date: Mon, 15 Sep 2014 12:01:02 +0200 (CEST) >> From: "Herring, J.D. (Jim)" >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of >> variable 'abort' >> Message-ID: >> <2103383764.4690548.1410775262514.JavaMail.root at draco.zimbra.ru.nl> >> Content-Type: text/plain; charset=utf-8 >> >> Dear Barbara, >> >> The error seems to be related to a bug that pops up now and then >> (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be >> due to a corrupt installation of fieldtrip and/or the need to update >> fieldtrip. >> >> Could you please try downloading the most recent version of >> fieldtrip and see if the problem persists? >> >> For an example of what can be expected from this function see: Esser >> SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A >> direct demonstration of cortical LTP in humans: a combined TMS/EEG >> study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. >> PubMed PMID: 16464689. >> >> Best, >> >> Jim >> >> >> ----- Oorspronkelijk bericht ----- >>> Van: "barbara schorr" >>> Aan: fieldtrip at science.ru.nl >>> Verzonden: Woensdag 10 september 2014 14:07:14 >>> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of >>> variable 'abort' >>> Dear fieldtripers. >>> >>> as mentioned in the subject line I would like to anaylse my timelocked >>> ERP Data with the function ft_globalmeanfield. >>> >>> I get the Error: Undefined function or variable 'abort' >>> Error in ft_globalmeanfield (line84) >>> if abort >>> >>> in the function it says: >>> >>> %the abort variable is set to true or false in ft_preamble_inti >>> if abort >>> % do not continue function execution in case the outputfile is >>> present and the user indicated to keep it >>> return >>> end >>> >>> >>> I don't understand what this means. I would really appreciate your >>> help to get this running. >>> >>> Also, what is the result when I run this function on my data? (This >>> method was proposed from a reviewer. I never used it before, so I >>> don't exactly know what it does and what the result will look like). >>> >>> Thank you very much in advance! >>> >>> Best, >>> >>> Barbara Schorr >>> >>> >>> >>> >>> Zitat von 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: Question regarding nonparametric testing for coherence >>> > differences (Eric Maris) >>> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >>> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >>> > 4. Re: ft_rejectvisual: removing trials marked as bad >>> > (Caspar, Emilie) >>> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >>> > 6. Latest FT version on ftp-server is from three days ago >>> > (Holger Krause) >>> > 7. Re: TRENTOOL pipeline help (Max Cantor) >>> > >>> > >>> > ---------------------------------------------------------------------- >>> > >>> > Message: 1 >>> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >>> > From: "Eric Maris" >>> > To: , "'FieldTrip discussion list'" >>> > >>> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >>> > for >>> > coherence differences >>> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Hwee Ling, >>> > >>> > >>> > >>> > In the paper you refer to (Maris et al, JNM, 2007), I did not >>> > perform a >>> > cluster-based permutation test at the level of the channel pairs. >>> > Instead, >>> > all coherences mentioned in the paper are coherence between a single >>> > EMG >>> > channel (2 electrodes mounted on the forearm) and all MEG >>> > electrodes. Thus, >>> > there are as many EMG-MEG coherences as there are MEG channels (275 >>> > in our >>> > lab), and the clustering of these coherences involves the same >>> > neighbourhood >>> > structure as the clustering of channel-specific statistics on power >>> > or >>> > evoked response. The analysis you propose involves clustering in a >>> > much more >>> > complex space, namely the formed by all (MEG,MEG) channel pairs >>> > (275*275=75625 pairs). In the early days of cluster-based >>> > permutation >>> > statistics, I have worked on this problem but did not pursue it >>> > because the >>> > resulting clusters are very hard to interpret. >>> > >>> > >>> > >>> > Best, >>> > >>> > >>> > >>> > Eric Maris >>> > >>> > >>> > >>> > >>> > >>> > Dear all and Prof Maris, >>> > >>> > I'm re-posting this question again, as I didn't get any replies >>> > previously. >>> > >>> > I?m interested to investigate if there are any differences in phase >>> > synchronization in resting state data at timepoint 2 versus >>> > timepoint 1. The >>> > EEG data was collected using 64 EEG channels, resting state, eyes >>> > opened and >>> > eyes closed. I?ve arbitrarily segmented the resting state data into >>> > epochs >>> > of 2s each, and the epochs with artifacts are excluded completely >>> > from >>> > further analyses. I then performed mtmfft to get the fourier >>> > representation >>> > of the data, extracted the coherence, and compared the coherence >>> > difference >>> > of timepoint 2 versus timepoint 1 of all channels paired with all >>> > other >>> > channels. >>> > >>> > I figured that if I extract the connectivity analyses without >>> > specifying the >>> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >>> > allow me to >>> > perform cluster-based statistical analyses. I get an output with >>> > ?chan_chan? >>> > dimord variable. However, I was not 100% sure that this is correct, >>> > hence, I?ve >>> > inserted my code (see below). It?ll be great if you could tell me if >>> > what I?m >>> > doing makes any sense at all. Also, I don?t know how I can plot the >>> > results >>> > to see if it make any sense at all. >>> > >>> > Also, I checked the values obtained from when I specified >>> > "cfg.channelcmb" >>> > and when I did not specify "cfg.channelcmb", I noticed that the >>> > values were >>> > somehow different. I would assume that the values to be similar, >>> > although >>> > I'm not sure why they would have differences in the values obtained >>> > from >>> > specifying "cfg.channelcmb". >>> > >>> > This is my code that I've used thus far: >>> > >>> > for sub = 1:5 >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'fourier'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.keeptrials = 'yes'; >>> > >>> > cfg.tapsmofrq = 5; >>> > >>> > cfg.foilim = [0 100]; >>> > >>> > cfg.taper = 'dpss'; >>> > >>> > % find the index for the c200 condition >>> > >>> > pre_c200_idx = find(data5.trialinfo == 201); >>> > >>> > cfg.trials = pre_c200_idx; >>> > >>> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > post_c200_idx = find(data5.trialinfo == 200); >>> > >>> > cfg.trials = post_c200_idx; >>> > >>> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.keeptrials = 'no'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.removemean = 'yes'; >>> > >>> > cfg.method = 'coh'; >>> > >>> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_pre_c200); >>> > >>> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_post_c200); >>> > >>> > end >>> > >>> > >>> > >>> > >>> load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); >>> > >>> > cfg_neighb.method = 'template'; >>> > >>> > cfg_neighb.layout = lay; >>> > >>> > cfg_neighb.channel = 'all'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, >>> > sub_HLF_pre_c200coh{1}); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.channelcmb = {cfg.channel, cfg.channel}; >>> > >>> > cfg.latency = 'all'; >>> > >>> > cfg.avgovertime = 'no'; >>> > >>> > cfg.avgoverchan = 'no'; >>> > >>> > cfg.parameter = 'cohspctrm'; >>> > >>> > cfg.method = 'montecarlo'; >>> > >>> > cfg.statistic = 'depsamplesT'; >>> > >>> > cfg.correctm = 'cluster'; >>> > >>> > cfg.tail = 0; >>> > >>> > % cfg.clustertail = 0; >>> > >>> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >>> > frequency >>> > bands. >>> > >>> > cfg.numrandomization = 10000; >>> > >>> > cfg.ivar = 2; >>> > >>> > cfg.uvar = 1; >>> > >>> > >>> > >>> > % design matrices >>> > >>> > clear design; >>> > >>> > design(1,:) = [1:5, 1:5]; >>> > >>> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >>> > >>> > cfg.design = design; >>> > >>> > % for theta band >>> > >>> > cfg.avgoverfreq = 'yes'; >>> > >>> > cfg.frequency = [4 8]; % I also performed the statistics for delta >>> > (2-4), >>> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >>> > (30-40), >>> > and gamma (40-100). >>> > >>> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >>> > sub_HLF_post_c200coh{:}, >>> > sub_HLF_pre_c200coh{:}); >>> > >>> > >>> > >>> > When I tried to plot the results, I used this code: >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.layout = 'lay'; >>> > >>> > cfg.zlim = [-1 1]; >>> > >>> > cfg.alpha = 0.05; >>> > >>> > cfg.refchannel = 'all'; >>> > >>> > ft_clusterplot(cfg, diffc200_theta_stat); >>> > >>> > However, I was not sure how I could plot the results. I get an error >>> > message >>> > from Fieldtrip when using ft_clusterplot: >>> > >>> > Error using topoplot_common (line 366) >>> > >>> > no reference channel is specified >>> > >>> > Error in ft_topoplotTFR (line 192) >>> > >>> > [cfg] = topoplot_common(cfg, varargin{:}); >>> > >>> > Error in ft_clusterplot (line 372) >>> > >>> > ft_topoplotTFR(cfgtopo, stat); >>> > >>> > >>> > >>> > According to your paper in 2007, the topoplot of the results were >>> > masked by >>> > the spatio-spectral pattern of the significant clusters. I don't >>> > know how to >>> > do this, and I would really appreciate if you can show me how to >>> > make such a >>> > plot. >>> > >>> > Thank you very much. >>> > >>> > Kind regards, >>> > >>> > Hweeling >>> > >>> > >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 2 >>> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >>> > From: KatrinH Heimann >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Joseph, thanks so much, I really appreciate your help. I was >>> > also >>> > wandering, if maybe there is another bug in my code. >>> > Our nets are 128 channels, Hydrocel, but as a colleague of me >>> > adviced me to >>> > do so, I also tried the 129 layout. >>> > My code you find below (without selection of bad channels etc.) >>> > If you need also the data of two subjects to have a look, let me >>> > know!!! >>> > Best and thanks really! >>> > Katrin >>> > >>> > >>> > subject=input('Which subject do you want to analyse? ','s'); >>> > >>> > name = strcat(subject,'.raw'); >>> > >>> > subjectnumber=input('Which is the subjectnumber?', 's'); >>> > >>> > sb=subjectnumber >>> > >>> > %subjectnumber = strcat(subjectnumber, '.txt') >>> > >>> > %% >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.dataset = name; >>> > >>> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> > >>> > cfg.trialdef.eventtype = 'trigger'; >>> > >>> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> > trigger >>> > >>> > cfg.trialdef.prestim = 0.234; % in seconds >>> > >>> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> > observation, but maybe we need less) >>> > >>> > cfg = ft_definetrial(cfg); >>> > >>> > >>> > cfg.trl([1:7],:) = []; >>> > >>> > >>> > %change timeline according to constant offset of 16 ms = 8 samples >>> > (because >>> > recorded with 500 hz)in >>> > >>> > %structure trial >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)-8 >>> > >>> > >>> > %change timeline to make the cut the zeropoint >>> > >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> > >>> > >>> > >>> > %% preprocess data >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.detrend = 'yes'; >>> > >>> > cfg.preproc.demean = 'yes'; >>> > >>> > cfg.preproc.baselinewindow = [-2.1 -2.0] >>> > >>> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> > filtered >>> > >>> > %(0.1-45) and bad channels have to be replaced!!!! >>> > >>> > %cfg.preproc.bpfreq = [6 32]; >>> > >>> > % >>> > >>> > % >>> > >>> > obs_data = ft_preprocessing(cfg); >>> > >>> > % >>> > >>> > save (strcat(sb,'obs_data') , 'obs_data') >>> > >>> > >>> > %% determining channel neighbours (necessary for Artifact detection) >>> > >>> > cfg = []; >>> > >>> > cfg.channel = obs_data.label; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.feedback = 'yes'; >>> > >>> > lay = ft_prepare_layout(cfg); >>> > >>> > >>> > >>> > cfg_neighb = []; >>> > >>> > cfg_neighb.feedback = 'yes'; >>> > >>> > >>> > cfg_neighb.method = 'triangulation'; >>> > >>> > cfg_neighb.layout = 'GSN128.sfp'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > obs_data.elec = ft_read_sens('GSN128.sfp'); >>> > >>> > >>> > %% Artifacts - to detect bad channels - is not saved!!! >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs_data_try = ft_rejectvisual(cfg, obs_data); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_try = ft_rejectartifact (cfg,obs_data); >>> > >>> > >>> > >>> > %% Preparing neighbours for channel repair - but bad channel info >>> > in!!! >>> > >>> > >>> > % cfg_neighb = []; >>> > >>> > % cfg_neighb.feedback = 'yes'; >>> > >>> > % cfg_neighb.method = 'triangulation'; >>> > >>> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> > >>> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > % Interpolate and put into new data structure >>> > >>> > cfg = []; >>> > >>> > cfg.badchannel = {}; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.method = 'nearest'; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> > >>> > >>> > % Check reconstruction >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > % dat1=obs_data; >>> > >>> > % dat2=obs_data_channelrepaired; >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> > >>> > % y=dat2.trial{1}(62,:); >>> > >>> > % plot(x);hold on;plot(y,'r'); >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(72,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(75,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > %% artifact rejection/trial inspection - throw out electrode jumps >>> > etc. >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> > according to >>> > channels interpolated %% 128-number of interp. channels) >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > comp = ft_componentanalysis(cfg,obs_data_clean1); >>> > >>> > save (strcat(sb,'comp_all') , 'comp') >>> > >>> > >>> > %% >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'component'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='some'; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > ft_databrowser(cfg,comp); >>> > >>> > >>> > %% poweranalysis components >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'pow'; >>> > >>> > cfg.channel = 'all';%compute the power spectrum in all ICs >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.taper = 'hanning'; >>> > >>> > cfg.foi = 0:0.2:50; >>> > >>> > obs_freq = ft_freqanalysis(cfg, comp); >>> > >>> > >>> > %And you can plot the spectra: >>> > >>> > >>> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> > >>> > nsubplots = 16; >>> > >>> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> > decimals, type >>> > doc subplot >>> > >>> > >>> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> > >>> > tot = Nfigs*nsubplots; >>> > >>> > >>> > rptvect = 1:size(comp.topo,1); >>> > >>> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> > >>> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> > >>> > >>> > for r=1:size(rptvect,1); >>> > >>> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> > 1]);%full >>> > screen >>> > >>> > k=0; >>> > >>> > for j=1:size(rptvect,2); >>> > >>> > if~(rptvect(r,j)==0); >>> > >>> > k=k+1; >>> > >>> > cfg=[]; >>> > >>> > cfg.channel = rptvect(r,j); >>> > >>> > cfg.ylim =[0 500] >>> > >>> > cfg.xlim =[0 50] >>> > >>> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> > >>> > end >>> > >>> > end >>> > >>> > end >>> > >>> > >>> > %For the IC topos you'll follow the same logic as above but with: >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [1:20]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [21:40]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [41:60]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [61:80]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% Seperate observation conditions >>> > >>> > >>> > name1= strcat(num2str(sb),'_90.xls'); >>> > >>> > list1=xlsread (name1) >>> > >>> > >>> > >>> > >>> > >>> > name2= strcat(num2str(sb),'_180.xls'); >>> > >>> > list2=xlsread (name2) >>> > >>> > >>> > >>> > % >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list1] >>> > >>> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list2] >>> > >>> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > %%PIPELINE FOR obs90 >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128; >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > >>> > comp_1 = ft_componentanalysis(cfg, obs90_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> > obs90_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts - final detection >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs90_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> > >>> > >>> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> > >>> > >>> > %% plot it >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP) >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% PIPELINE FOR obs180 >>> > >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > comp_2 = ft_componentanalysis(cfg, obs180_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> > obs180_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts final 180 >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs180_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> > >>> > >>> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> > >>> > >>> > %% plot 180 ERP >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs180_data_ERP) >>> > >>> > >>> > %% plot both ERPs >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > cfg.showlabels = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> > >>> > >>> > %% plot difference wave >>> > >>> > >>> > difference = obs180_data_ERP; % copy one of the >>> > structures >>> > >>> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >>> > the >>> > difference ERP >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, difference) >>> > >>> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> > >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI >>> >> data. A couple things. First of all, exactly which net do you use? >>> >> If >>> >> they are 129-channel, there is still the question of whether they >>> >> are the >>> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >>> >> cause an >>> >> error like this. Could you send me the file you are trying to >>> >> process and >>> >> the script you are using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >>> >> diezmartini at gmail.com> wrote: >>> >> >>> >> Which nets do you use? I use EGI. I tried both the ones you mention >>> >> and >>> >> they didn't work. It was hard to find that exact one online but it >>> >> was the >>> >> only file that actually worked. >>> >> >>> >> >>> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >> >>> >> wrote: >>> >> >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. >>> >>> Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one >>> >>> >>> >>>> I use >>> >>>> >>> >>>> >>> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>> >>>> katrinheimann at gmail.com> wrote: >>> >>>> >>> >>>>> Dear all, my problems seem neverending. This time however i >>> >>>>> really need >>> >>>>> help. >>> >>>>> I implemented a pipeline for ERPs. All works now, >>> >>>>> trialdefinition, >>> >>>>> preprocessing, channelreplacement, ica, componentrejection, >>> >>>>> final >>> >>>>> artifactdetection, timelock of the single subject data. However, >>> >>>>> when I >>> >>>>> wanna compute the grandaverage of the single subjects I get the >>> >>>>> following >>> >>>>> error message: >>> >>>>> >>> >>>>> computing average of avg over 19 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 3 MB >>> >>>>> computing average of avg over 2 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>>>> additional >>> >>>>> allocation of an estimated 0 MB >>> >>>>> >>> >>>>> Furthermore in the plot of the significant clusters, the >>> >>>>> channelnames >>> >>>>> are mixed up (do not correspond to my net) >>> >>>>> >>> >>>>> >>> >>>>> I guess that there is a problem with the layout I use. >>> >>>>> Here the code that I use >>> >>>>> >>> >>>>> %For generating the layout (also in the single subjects): >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = obs_data.label; >>> >>>>> >>> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>>>> >>> >>>>> cfg.feedback = 'yes'; >>> >>>>> >>> >>>>> lay = ft_prepare_layout(cfg); >>> >>>>> >>> >>>>> >>> >>>>> cfg_neighb = []; >>> >>>>> >>> >>>>> cfg_neighb.feedback = 'yes'; >>> >>>>> >>> >>>>> cfg_neighb.method = 'triangulation'; >>> >>>>> >>> >>>>> cfg_neighb.layout = lay; >>> >>>>> >>> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>>>> >>> >>>>> >>> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>>>> >>> >>>>> >>> >>>>> %For computing the grand average >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = 'all'; >>> >>>>> >>> >>>>> cfg.latency = 'all'; >>> >>>>> >>> >>>>> cfg.parameter = 'avg'; >>> >>>>> >>> >>>>> cfg.keepindividual = 'no' >>> >>>>> >>> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>>>> >>> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>>>> >>> >>>>> % "{:}" means to use data from all elements of the variable >>> >>>>> >>> >>>>> >>> >>>>> For plotting the significant clusters >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.style = 'blank'; >>> >>>>> >>> >>>>> cfg.layout = lay; >>> >>>>> >>> >>>>> cfg.channellabels = 'yes'; >>> >>>>> >>> >>>>> cfg.highlight = 'labels'; >>> >>>>> >>> >>>>> cfg.highlightchannel = find(stat.mask); >>> >>>>> >>> >>>>> cfg.comment = 'no'; >>> >>>>> >>> >>>>> figure; ft_topoplotER(cfg, GA_90) >>> >>>>> >>> >>>>> title('Nonparametric: significant with cluster multiple >>> >>>>> comparison >>> >>>>> correction') >>> >>>>> >>> >>>>> >>> >>>>> Do you have ANY idea to this? I am really completely >>> >>>>> helpless.... >>> >>>>> >>> >>>>> thanks and best >>> >>>>> >>> >>>>> Katrin >>> >>>>> >>> >>>>> _______________________________________________ >>> >>>>> 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 >>> >>> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing list >>> >> fieldtrip at donders.ru.nl >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> >> >>> >> >>> -------------------------------------------------------------------------------- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.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: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 3 >>> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >>> > From: Joseph Dien >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > yes, please do send me the data. >>> > >>> > Thanks! >>> > >>> > Joe >>> > >>> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >>> > wrote: >>> > >>> >> Dear Joseph, thanks so much, I really appreciate your help. I was >>> >> also wandering, if maybe there is another bug in my code. >>> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >>> >> adviced me to do so, I also tried the 129 layout. >>> >> My code you find below (without selection of bad channels etc.) >>> >> If you need also the data of two subjects to have a look, let me >>> >> know!!! >>> >> Best and thanks really! >>> >> Katrin >>> >> >>> >> >>> >> >>> >> subject=input('Which subject do you want to analyse? ','s'); >>> >> >>> >> name = strcat(subject,'.raw'); >>> >> >>> >> subjectnumber=input('Which is the subjectnumber?', 's'); >>> >> >>> >> sb=subjectnumber >>> >> >>> >> %subjectnumber = strcat(subjectnumber, '.txt') >>> >> >>> >> %% >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.dataset = name; >>> >> >>> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> >> >>> >> cfg.trialdef.eventtype = 'trigger'; >>> >> >>> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> >> trigger >>> >> >>> >> cfg.trialdef.prestim = 0.234; % in seconds >>> >> >>> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> >> observation, but maybe we need less) >>> >> >>> >> cfg = ft_definetrial(cfg); >>> >> >>> >> >>> >> >>> >> cfg.trl([1:7],:) = []; >>> >> >>> >> >>> >> >>> >> %change timeline according to constant offset of 16 ms = 8 samples >>> >> (because recorded with 500 hz)in >>> >> >>> >> %structure trial >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >>> >> >>> >> >>> >> >>> >> %change timeline to make the cut the zeropoint >>> >> >>> >> >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% preprocess data >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.detrend = 'yes'; >>> >> >>> >> cfg.preproc.demean = 'yes'; >>> >> >>> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >>> >> >>> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> >> filtered >>> >> >>> >> %(0.1-45) and bad channels have to be replaced!!!! >>> >> >>> >> %cfg.preproc.bpfreq = [6 32]; >>> >> >>> >> % >>> >> >>> >> % >>> >> >>> >> obs_data = ft_preprocessing(cfg); >>> >> >>> >> % >>> >> >>> >> save (strcat(sb,'obs_data') , 'obs_data') >>> >> >>> >> >>> >> >>> >> %% determining channel neighbours (necessary for Artifact >>> >> detection) >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = obs_data.label; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.feedback = 'yes'; >>> >> >>> >> lay = ft_prepare_layout(cfg); >>> >> >>> >> >>> >> cfg_neighb = []; >>> >> >>> >> cfg_neighb.feedback = 'yes'; >>> >> >>> >> >>> >> >>> >> cfg_neighb.method = 'triangulation'; >>> >> >>> >> cfg_neighb.layout = 'GSN128.sfp'; >>> >> >>> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >>> >> >>> >> >>> >> >>> >> %% Artifacts - to detect bad channels - is not saved!!! >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Preparing neighbours for channel repair - but bad channel info >>> >> in!!! >>> >> >>> >> >>> >> >>> >> % cfg_neighb = []; >>> >> >>> >> % cfg_neighb.feedback = 'yes'; >>> >> >>> >> % cfg_neighb.method = 'triangulation'; >>> >> >>> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> >> >>> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> % Interpolate and put into new data structure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.badchannel = {}; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.method = 'nearest'; >>> >> >>> >> cfg.neighbours = neighbours; >>> >> >>> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> >> >>> >> >>> >> >>> >> % Check reconstruction >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> % dat1=obs_data; >>> >> >>> >> % dat2=obs_data_channelrepaired; >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> >> >>> >> % y=dat2.trial{1}(62,:); >>> >> >>> >> % plot(x);hold on;plot(y,'r'); >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(72,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(75,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> %% artifact rejection/trial inspection - throw out electrode jumps >>> >> etc. >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> >> according to channels interpolated %% 128-number of interp. >>> >> channels) >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = {'all'}; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >>> >> >>> >> save (strcat(sb,'comp_all') , 'comp') >>> >> >>> >> >>> >> >>> >> %% >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'component'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='some'; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> ft_databrowser(cfg,comp); >>> >> >>> >> >>> >> >>> >> %% poweranalysis components >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.output = 'pow'; >>> >> >>> >> cfg.channel = 'all';%compute the power spectrum in all ICs >>> >> >>> >> cfg.method = 'mtmfft'; >>> >> >>> >> cfg.taper = 'hanning'; >>> >> >>> >> cfg.foi = 0:0.2:50; >>> >> >>> >> obs_freq = ft_freqanalysis(cfg, comp); >>> >> >>> >> >>> >> >>> >> %And you can plot the spectra: >>> >> >>> >> >>> >> >>> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> >> >>> >> nsubplots = 16; >>> >> >>> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> >> decimals, type doc subplot >>> >> >>> >> >>> >> >>> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> >> >>> >> tot = Nfigs*nsubplots; >>> >> >>> >> >>> >> >>> >> rptvect = 1:size(comp.topo,1); >>> >> >>> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> >> >>> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> >> >>> >> >>> >> >>> >> for r=1:size(rptvect,1); >>> >> >>> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> >> 1]);%full screen >>> >> >>> >> k=0; >>> >> >>> >> for j=1:size(rptvect,2); >>> >> >>> >> if~(rptvect(r,j)==0); >>> >> >>> >> k=k+1; >>> >> >>> >> cfg=[]; >>> >> >>> >> cfg.channel = rptvect(r,j); >>> >> >>> >> cfg.ylim =[0 500] >>> >> >>> >> cfg.xlim =[0 50] >>> >> >>> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> >>> >> >>> >> %For the IC topos you'll follow the same logic as above but with: >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [1:20]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [21:40]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [41:60]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [61:80]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Seperate observation conditions >>> >> >>> >> >>> >> >>> >> name1= strcat(num2str(sb),'_90.xls'); >>> >> >>> >> list1=xlsread (name1) >>> >> >>> >> >>> >> >>> >> name2= strcat(num2str(sb),'_180.xls'); >>> >> >>> >> list2=xlsread (name2) >>> >> >>> >> >>> >> % >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list1] >>> >> >>> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list2] >>> >> >>> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> %%PIPELINE FOR obs90 >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128; >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> >>> >> >>> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> >> obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts - final detection >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot it >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% PIPELINE FOR obs180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> >> obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts final 180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot 180 ERP >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot both ERPs >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> cfg.showlabels = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot difference wave >>> >> >>> >> >>> >> >>> >> difference = obs180_data_ERP; % copy one of >>> >> the structures >>> >> >>> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >>> >> compute the difference ERP >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, difference) >>> >> >>> >> >>> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI data. A couple things. First of all, exactly which net do >>> >> you use? If they are 129-channel, there is still the question of >>> >> whether they are the Hydrocel or the older geodesic nets. >>> >> Regardless, that shouldn't cause an error like this. Could you >>> >> send me the file you are trying to process and the script you are >>> >> using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >>> >> wrote: >>> >> >>> >>> Which nets do you use? I use EGI. I tried both the ones you >>> >>> mention and they didn't work. It was hard to find that exact one >>> >>> online but it was the only file that actually worked. >>> >>> >>> >>> >>> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one I use >>> >>> >>> >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear all, my problems seem neverending. This time however i really >>> >>> need help. >>> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> >>> preprocessing, channelreplacement, ica, componentrejection, final >>> >>> artifactdetection, timelock of the single subject data. However, >>> >>> when I wanna compute the grandaverage of the single subjects I get >>> >>> the following error message: >>> >>> >>> >>> computing average of avg over 19 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 3 MB >>> >>> computing average of avg over 2 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 0 MB >>> >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> >>> >>> Furthermore in the plot of the significant clusters, the >>> >>> channelnames are mixed up (do not correspond to my net) >>> >>> >>> >>> >>> >>> I guess that there is a problem with the layout I use. >>> >>> Here the code that I use >>> >>> >>> >>> %For generating the layout (also in the single subjects): >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = obs_data.label; >>> >>> >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> >>> >>> cfg.feedback = 'yes'; >>> >>> >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> >>> >>> >>> cfg_neighb = []; >>> >>> >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> >>> >>> cfg_neighb.layout = lay; >>> >>> >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> >>> >>> >>> >>> >>> %For computing the grand average >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = 'all'; >>> >>> >>> >>> cfg.latency = 'all'; >>> >>> >>> >>> cfg.parameter = 'avg'; >>> >>> >>> >>> cfg.keepindividual = 'no' >>> >>> >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> >>> >>> >>> For plotting the significant clusters >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.style = 'blank'; >>> >>> >>> >>> cfg.layout = lay; >>> >>> >>> >>> cfg.channellabels = 'yes'; >>> >>> >>> >>> cfg.highlight = 'labels'; >>> >>> >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> >>> >>> cfg.comment = 'no'; >>> >>> >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> >>> correction') >>> >>> >>> >>> >>> >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> >>> >>> thanks and best >>> >>> >>> >>> Katrin >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> 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 >>> >>> >>> >>> _______________________________________________ >>> >>> fieldtrip mailing list >>> >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> -------------------------------------------------------------------------------- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.com >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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 >>> > >>> > >>> -------------------------------------------------------------------------------- >>> > >>> > Joseph Dien, PhD >>> > Research Associate >>> > Cognitive Neurology >>> > The Johns Hopkins University School of Medicine >>> > >>> > Lab E-mail: jdien1 at jhmi.edu >>> > Private E-mail: jdien07 at mac.com >>> > Office Phone: 410-614-3115 >>> > Cell Phone: 202-297-8117 >>> > Fax: 410-955-0188 >>> > http://joedien.com >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 4 >>> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >>> > From: "Caspar, Emilie" >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >>> > bad >>> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >>> > Content-Type: text/plain; charset="iso-8859-1" >>> > >>> > Hi Ashley, >>> > >>> > Maybe the mistake is you did not integrate in your script the >>> > command to save the rejection. Normally, with the following command, >>> > you will see in the Matlab Window that artifacts are correctly >>> > rejected after the "quit" button. >>> > >>> > clean_data = ft_rejectvisual(cfg, interpoldata); >>> > cfg.artfctdef.reject = 'complete'; >>> > cfg.artfctdef.feedback = 'yes'; >>> > cleandata = ft_rejectartifact(cfg,clean_data); >>> > >>> > Emilie >>> > >>> > >>> > >>> > >>> > >>> > Le 3 sept. 2014 ? 11:58, Ashley Greene >>> > > a ?crit : >>> > >>> > Hello, >>> > >>> > I have used the rejectvisual function in attempt to remove bad >>> > trials, but after marking them and pressing the quit button, >>> > although the command window states that the selected trials have >>> > been removed, there is no obvious change in the data; all of the >>> > trials are still intact. Have I overlooked something? >>> > >>> > Thanks, >>> > >>> > Ashley >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 5 >>> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >>> > From: Patricia Wollstadt >>> > To: fieldtrip at science.ru.nl >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: <540EEF94.9080601 at gmx.de> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > Hello Max, >>> > >>> > I added a few comments to the questions regarding individual >>> > parameters >>> > below. To address the general problem of TRENTOOL telling you, that >>> > there are not enough sample points in your data: From what I can see >>> > in >>> > your script, you probably don't have enough data points in each time >>> > series to robustly estimate TE. You analyze 800 ms of data sampled >>> > at >>> > 300 Hz, which gives you 240 samples per time series. Can you maybe >>> > avoid >>> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >>> > you >>> > analyze a longer time window of interest? >>> > Note that you also 'lose' data to embedding and the interaction >>> > delay: >>> > The first point that can be used for TE estimation is at max. >>> > embedding >>> > length + max. interaction delay in samples. For example: max. >>> > embedding >>> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >>> > max >>> > interaction delay of 30 ms = 9 samples. In this example, you would >>> > be >>> > left with 240 - 29 samples for TE estimation per trial. There is >>> > also >>> > the possibility to estimate time resolved TE/TE for shorter time >>> > windows >>> > of interest (see section 4.4 in the manual); however, this method >>> > requires the use of a GPU for TE estimation. >>> > >>> > I would further recommend to use the new pipeline for group >>> > statistics >>> > described in the manual in section 4.5 (the function >>> > 'TEgroup_calculate' >>> > is deprecated). The new pipeline allows you to reconstruct the >>> > interaction delay and uses the following functions (see also >>> > comments in >>> > the script): >>> > >>> > TEgroup_prepare -> prepares all data sets (all subjects/all >>> > conditions) for group analysis (this means finding common embedding >>> > parameters such that estimates are not biased between groups) >>> > InteractionDelayReconstruction_calculate -> estimates TE for >>> > individual data sets and all assumed interaction delays u >>> > InteractionDelayReconstruction_analyze -> reconstructs the >>> > interaction delay by selecting the u that maximizes TE for each >>> > channel >>> > TEgroup_stats -> calculate group statistics using a permutation test >>> > >>> > I can send you an example script for group TE analysis using this >>> > pipeline to get you started. I hope this helps you to get the group >>> > analysis running. Just write again if you're having trouble setting >>> > up >>> > the pipeline or something is not clear about the parameters/my >>> > comments. >>> > >>> > Best, >>> > Patricia >>> > >>> > >>> > >>> > >>> > On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not >>> >> 100% sure if it is appropriate to ask questions about it here, but >>> >> to >>> >> the best of my knowledge they do not have a mailing list and I saw >>> >> a >>> >> few trentool questions in the archives, so I'm going to assume it's >>> >> ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present >>> >> in the pipeline. Sorry in advance for the long post! Any help would >>> >> be >>> >> greatly appreciated as I'm a bit over my head on this but I think >>> >> I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data >>> >> that was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi is >>> >> in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within the toi, but beyond that are there any benefits to it being >>> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >>> >> the >>> >> toi is in seconds. The prediction time is the assumed interaction >>> >> delay between your two sources and should fit within your toi. In >>> >> general it is preferable to use the method for interaction delay >>> >> reconstruction for TE estimation, because it allows you to >>> >> reconstruct >>> >> the actual delay between your source and target times series. A >>> >> non-optimal u/interaction delay may cause an underestimation of TE, >>> >> so >>> >> it is recommended to use the pipeline for interaction delay >>> >> reconstruction whenever estimating TE for unknown delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, so it is best to limit the u range to values that are >>> >> physiologically plausible. >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the >>> >> sample rate and filters are used to determine the actthrvalue, but >>> >> I >>> >> don't actually know the calculation. 7.5 was a rough guess just to >>> >> test the pipeline. I'm also uncertain of what minnrtrials should >>> >> be.* >>> >> PW: You can set the actthrvalue based on the filtering you did >>> >> prior >>> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >>> >> shouldn't find an ACT higher than 30 samples, because you filtered >>> >> out >>> >> any components of the signal slower than 10 Hz/30 samples (given >>> >> your >>> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >>> >> would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> * >>> >> * >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm >>> >> yet to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* >>> >> PW: The Ragwitz criterion tries to find optimal embedding >>> >> parameters >>> >> dim and tau for the data. To do that, the method iteratively takes >>> >> all >>> >> possible combinations of dim and tau values that are provided in >>> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >>> >> these >>> >> combinations embed the data. To test an embedding, the method >>> >> builds >>> >> the embedding vectors from the data; it then tests for each point >>> >> how >>> >> well the next point in time can be predicted from the reference >>> >> point's nearest neighbours. So for each embedded point, the method >>> >> searches for the nearest neighbours and calculates the average of >>> >> those nearest neighbours. The difference between the >>> >> averaged/predicted point and the actual next point is the error of >>> >> the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested >>> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together with 'ragtausteps' specifies the tau values to be tested >>> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >>> >> that >>> >> the values here are factors that are later multiplied with the ACT >>> >> to >>> >> obtain the actual tau. 'repPred' is the number of points that will >>> >> be >>> >> used for the local prediction, i.e. the Ragwitz criterion will test >>> >> the local prediction and calculate the error for the first 100 >>> >> points >>> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >>> >> below >>> >> specify the type of neighbour search conducted by the Ragwitz >>> >> criterion: 'flagNei' tells the method to either conduct a kNN or >>> >> range >>> >> search; 'sizeNei' specifies the number of neighbours or the radius >>> >> to >>> >> be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> * >>> >> * >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> * >>> >> * >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.*TRENTOOL seems to handle data output very differently >>> >> from >>> >> fieldtrip and I've had trouble thinking through the most logical >>> >> way >>> >> to handle the data so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> * >>> >> * >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition >>> >> x subject .mat file, which as I said before is collectively the >>> >> same >>> >> as the 3 x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> * >>> >> * >>> >> *At this step I get the following error: >>> >> >>> >> Error using transferentropy (line 337) >>> >> \nTRENTOOL ERROR: not enough data points left after embedding >>> >> >>> >> Error in TEgroup_calculate (line 133) >>> >> [TEresult] = transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate >>> >> is a pipeline issue* (I noticed the example pipeline in trentool, >>> >> the >>> >> manual, and published methods articles all seem to have slightly or >>> >> significantly different pipeline compositions), *or if the error >>> >> is* >>> >> due to ACT, ragwitz optimization, or some other faulty >>> >> parameterization *on my part due to a lack of understanding of how >>> >> transfer entropy works on a more theoretical/mathematical level*. >>> >> If >>> >> the latter is the case, is there any relatively straightforward way >>> >> to >>> >> conceptualize this, or is this something where I'm just going to >>> >> have >>> >> to keep reading and rereading until it eventually makes sense? I've >>> >> already done quite a bit of that and it hasn't pierced my thick >>> >> skull >>> >> yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 6 >>> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >>> > From: Holger Krause >>> > To: FieldTrip discussion list >>> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >>> > days ago >>> > Message-ID: >>> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >>> > Content-Type: text/plain; charset="us-ascii" >>> > >>> > Dear developers, >>> > >>> > Could you please check the process for creation/publication of >>> > zip-files on >>> > the FTP server? The latest file I can find there is >>> > fieldtrip-20140906.zip. >>> > >>> > Thanks in advance, >>> > >>> > Holger >>> > >>> > >>> > ------------------------------ >>> > >>> > Message: 7 >>> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >>> > From: Max Cantor >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > This is immensely helpful, thank you. I was very confused about why >>> > some >>> > versions of the pipeline I saw were using group calculate and others >>> > were >>> > using interaction delay reconstruction and what that meant, and I >>> > think I >>> > have a more clear idea of what the different steps of the pipeline >>> > are >>> > doing. There are still a few things I'm a bit confused about though >>> > in >>> > terms of the pipeline. For instance, whether or not I need to do >>> > TEprepare >>> > before group prepare, and if I need to do graph analysis (which I'm >>> > not >>> > sure I fully understand but also haven't looked deeply into) before >>> > group >>> > stats. >>> > >>> > If you don't mind me taking you up on your offer, I think seeing >>> > your >>> > example script might help clarify some of these issues. >>> > >>> > Thank you! >>> > >>> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >>> > Patricia.Wollstadt at gmx.de> wrote: >>> > >>> >> Hello Max, >>> >> >>> >> I added a few comments to the questions regarding individual >>> >> parameters >>> >> below. To address the general problem of TRENTOOL telling you, that >>> >> there >>> >> are not enough sample points in your data: From what I can see in >>> >> your >>> >> script, you probably don't have enough data points in each time >>> >> series to >>> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >>> >> which >>> >> gives you 240 samples per time series. Can you maybe avoid >>> >> downsampling to >>> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >>> >> longer time >>> >> window of interest? >>> >> Note that you also 'lose' data to embedding and the interaction >>> >> delay: The >>> >> first point that can be used for TE estimation is at max. embedding >>> >> length >>> >> + max. interaction delay in samples. For example: max. embedding >>> >> length = >>> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >>> >> interaction >>> >> delay of 30 ms = 9 samples. In this example, you would be left with >>> >> 240 - >>> >> 29 samples for TE estimation per trial. There is also the >>> >> possibility to >>> >> estimate time resolved TE/TE for shorter time windows of interest >>> >> (see >>> >> section 4.4 in the manual); however, this method requires the use >>> >> of a GPU >>> >> for TE estimation. >>> >> >>> >> I would further recommend to use the new pipeline for group >>> >> statistics >>> >> described in the manual in section 4.5 (the function >>> >> 'TEgroup_calculate' is >>> >> deprecated). The new pipeline allows you to reconstruct the >>> >> interaction >>> >> delay and uses the following functions (see also comments in the >>> >> script): >>> >> >>> >> TEgroup_prepare -> prepares all data sets (all subjects/all >>> >> conditions) >>> >> for group analysis (this means finding common embedding parameters >>> >> such >>> >> that estimates are not biased between groups) >>> >> InteractionDelayReconstruction_calculate -> estimates TE for >>> >> individual data sets and all assumed interaction delays u >>> >> InteractionDelayReconstruction_analyze -> reconstructs the >>> >> interaction delay by selecting the u that maximizes TE for each >>> >> channel >>> >> TEgroup_stats -> calculate group statistics using a permutation >>> >> test >>> >> >>> >> I can send you an example script for group TE analysis using this >>> >> pipeline >>> >> to get you started. I hope this helps you to get the group analysis >>> >> running. Just write again if you're having trouble setting up the >>> >> pipeline >>> >> or something is not clear about the parameters/my comments. >>> >> >>> >> Best, >>> >> Patricia >>> >> >>> >> >>> >> >>> >> >>> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not 100% >>> >> sure if it is appropriate to ask questions about it here, but to >>> >> the best >>> >> of my knowledge they do not have a mailing list and I saw a few >>> >> trentool >>> >> questions in the archives, so I'm going to assume it's ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present in >>> >> the pipeline. Sorry in advance for the long post! Any help would be >>> >> greatly >>> >> appreciated as I'm a bit over my head on this but I think I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data that >>> >> was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi >>> >> is in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within >>> >> the toi, but beyond that are there any benefits to it being earlier >>> >> or >>> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >>> >> in >>> >> seconds. The prediction time is the assumed interaction delay >>> >> between your >>> >> two sources and should fit within your toi. In general it is >>> >> preferable to >>> >> use the method for interaction delay reconstruction for TE >>> >> estimation, >>> >> because it allows you to reconstruct the actual delay between your >>> >> source >>> >> and target times series. A non-optimal u/interaction delay may >>> >> cause an >>> >> underestimation of TE, so it is recommended to use the pipeline for >>> >> interaction delay reconstruction whenever estimating TE for unknown >>> >> delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, >>> >> so it is best to limit the u range to values that are >>> >> physiologically >>> >> plausible. >>> >> >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the sample >>> >> rate and filters are used to determine the actthrvalue, but I don't >>> >> actually know the calculation. 7.5 was a rough guess just to test >>> >> the >>> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >>> >> You can >>> >> set the actthrvalue based on the filtering you did prior to TE >>> >> analysis. If >>> >> you for example highpass filtered at 10 Hz, you shouldn't find an >>> >> ACT >>> >> higher than 30 samples, because you filtered out any components of >>> >> the >>> >> signal slower than 10 Hz/30 samples (given your sampling frequency >>> >> of 300 >>> >> Hz). So in this scenario the actthrvalue would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm yet >>> >> to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* PW: >>> >> The Ragwitz criterion tries to find optimal embedding parameters >>> >> dim and >>> >> tau for the data. To do that, the method iteratively takes all >>> >> possible >>> >> combinations of dim and tau values that are provided in cfgP.ragdim >>> >> and >>> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >>> >> embed >>> >> the data. To test an embedding, the method builds the embedding >>> >> vectors >>> >> from the data; it then tests for each point how well the next point >>> >> in time >>> >> can be predicted from the reference point's nearest neighbours. So >>> >> for each >>> >> embedded point, the method searches for the nearest neighbours and >>> >> calculates the average of those nearest neighbours. The difference >>> >> between >>> >> the averaged/predicted point and the actual next point is the error >>> >> of the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested by >>> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together >>> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >>> >> will >>> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >>> >> here are >>> >> factors that are later multiplied with the ACT to obtain the actual >>> >> tau. >>> >> 'repPred' is the number of points that will be used for the local >>> >> prediction, i.e. the Ragwitz criterion will test the local >>> >> prediction and >>> >> calculate the error for the first 100 points in your time series. >>> >> The two >>> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >>> >> neighbour >>> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >>> >> method to >>> >> either conduct a kNN or range search; 'sizeNei' specifies the >>> >> number of >>> >> neighbours or the radius to be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' >>> >> data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject >>> >> virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.* >>> >> TRENTOOL seems to handle data output very differently from >>> >> fieldtrip and >>> >> I've had trouble thinking through the most logical way to handle >>> >> the data >>> >> so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition x >>> >> subject .mat file, which as I said before is collectively the same >>> >> as the 3 >>> >> x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> *At this step I get the following error: Error using >>> >> transferentropy (line >>> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >>> >> Error in >>> >> TEgroup_calculate (line 133) [TEresult] = >>> >> transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate is a >>> >> pipeline issue* (I noticed the example pipeline in trentool, the >>> >> manual, >>> >> and published methods articles all seem to have slightly or >>> >> significantly >>> >> different pipeline compositions), *or if the error is* due to ACT, >>> >> ragwitz optimization, or some other faulty parameterization *on my >>> >> part >>> >> due to a lack of understanding of how transfer entropy works on a >>> >> more >>> >> theoretical/mathematical level*. If the latter is the case, is >>> >> there any >>> >> relatively straightforward way to conceptualize this, or is this >>> >> something >>> >> where I'm just going to have to keep reading and rereading until it >>> >> eventually makes sense? I've already done quite a bit of that and >>> >> it hasn't >>> >> pierced my thick skull yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing >>> >> >>> listfieldtrip at donders.ru.nlhttp://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 >>> >> >>> > >>> > >>> > >>> > -- >>> > Max Cantor >>> > Lab Manager >>> > Computational Neurolinguistics Lab >>> > University of Michigan >>> > -------------- 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 46, Issue 3 >>> > **************************************** >>> > >>> >>> >>> >>> Barbara Schorr, MSc >>> Clinical and Biological Psychology >>> University of Ulm >>> Albert-Einstein-Allee 47 >>> 89069 Ulm >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jim Herring, MSc. >> Neuronal Oscillations Group >> Centre for Cognitive Neuroimaging >> Donders Institute for Brain, Cognition and Behaviour >> Radboud University Nijmegen >> >> >> ------------------------------ >> >> Message: 4 >> Date: Mon, 15 Sep 2014 12:09:24 +0200 (CEST) >> From: Fr?d?ric Roux >> To: FieldTrip discussion list >> Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs >> Message-ID: <867006743.3066178.1410775764568.JavaMail.root at bcbl.eu> >> Content-Type: text/plain; charset=utf-8 >> >> Dear all, >> >> my question relates to the computation of combined planar gradients >> using the ft_combineplanar function. >> >> Our data has been recorded with an Elekta Neuromag 306 channel system, >> and I would like to know if it is "safe" to compute combined gradients >> before calling ft_freqstatistics, if the input data contains single >> trial TFRs. >> >> The reason why I am asking is because in the documentation of the >> function it says >> % Use as >> % [data] = ft_combineplanar(cfg, data) >> % where data contains an averaged planar gradient (either ERF or TFR). >> >> However, the following tutorial suggests that this can be safely applied if >> the input data contains TFRs which have been computed with the >> cfg.keeptrials = 'yes' option: >> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >> >> I am bit confused as both information (the fieldtrip documentation >> and the tutorial) >> seem to contradict each other. >> >> The 2 options that are see are: >> >> 1) compute TFRs with cfg.keeptrials = 'yes', then call >> ft_frestatistics, then call ft_combineplanar >> by using the output of ft_freqstatistics as input for the >> ft_combineplanar function. >> 2) compute TFRs with cfg.keeptrials = 'yes', then call >> ft_combineplanar, then call ft_freqstatistics >> >> Could anyone with experience on this issue please let me know what >> the best way >> to proceed would be? >> >> Fred >> --------------------------------------------------------------------------- >> >> >> >> >> ------------------------------ >> >> Message: 5 >> Date: Mon, 15 Sep 2014 13:12:38 -0300 >> From: gamaliel huerta urrea >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] dipole simulation on head model >> Message-ID: >> >> Content-Type: text/plain; charset="utf-8" >> >> hi all >> >> I hope you can help my problem. >> >> I have generated a model of head fieldtrip, and now I need to simulate >> sources at different positions within the crust generated. I followed the >> tutorial head model generation for EEG. However I have not found >> information on how to simulate a source. Any help would be welcome. >> >> Thank you >> greetings >> >> -- >> *Gamaliel Huerta* >> *Ingenier?a Civil Biom?dica* >> *Universidad de Valpara?so* >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> Message: 6 >> Date: Mon, 15 Sep 2014 18:38:26 +0200 >> From: Tzvetan Popov >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] dipole simulation on head model >> Message-ID: <6677301D-D72C-4C12-BC84-779D5E4DF8F3 at uni-konstanz.de> >> Content-Type: text/plain; charset="iso-8859-1" >> >> >> Dear Gamaliel, >> you might try something like this: >> >> http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit >> >> good luck >> tzvetan >> >> Am 15.09.2014 um 18:12 schrieb gamaliel huerta urrea >> : >> >>> hi all >>> >>> I hope you can help my problem. >>> >>> I have generated a model of head fieldtrip, and now I need to >>> simulate sources at different positions within the crust generated. >>> I followed the tutorial head model generation for EEG. However I >>> have not found information on how to simulate a source. Any help >>> would be welcome. >>> >>> Thank you >>> greetings >>> >>> -- >>> Gamaliel Huerta >>> Ingenier?a Civil Biom?dica >>> Universidad de Valpara?so >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> Message: 7 >> Date: Mon, 15 Sep 2014 12:40:41 -0500 >> From: "Jing Fan" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of >> variable 'abort' >> Message-ID: <000001cfd10c$2b7786a0$826693e0$@gmail.com> >> Content-Type: text/plain; charset="us-ascii" >> >> Hi Jim, >> >> I download the latest .zip file from FTP. >> I received the same error message when calling function ft_definetrial(cfg). >> It seems to me that ft_preamble init command will go to script ft_preamble.m >> instead of ft_preamble_init.m. >> Any help to resolve this issue will be appreciated. >> >> Best, >> Jing >> >> >> >> -----Original Message----- >> From: fieldtrip-bounces at science.ru.nl >> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) >> Sent: Monday, September 15, 2014 5:01 AM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable >> 'abort' >> >> Dear Barbara, >> >> The error seems to be related to a bug that pops up now and then >> (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a >> corrupt installation of fieldtrip and/or the need to update fieldtrip. >> >> Could you please try downloading the most recent version of fieldtrip and >> see if the problem persists? >> >> For an example of what can be expected from this function see: Esser SK, >> Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct >> demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res >> Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. >> >> Best, >> >> Jim >> >> >> ----- Oorspronkelijk bericht ----- >>> Van: "barbara schorr" >>> Aan: fieldtrip at science.ru.nl >>> Verzonden: Woensdag 10 september 2014 14:07:14 >>> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable >> 'abort' >>> Dear fieldtripers. >>> >>> as mentioned in the subject line I would like to anaylse my timelocked >>> ERP Data with the function ft_globalmeanfield. >>> >>> I get the Error: Undefined function or variable 'abort' >>> Error in ft_globalmeanfield (line84) >>> if abort >>> >>> in the function it says: >>> >>> %the abort variable is set to true or false in ft_preamble_inti >>> if abort >>> % do not continue function execution in case the outputfile is >>> present and the user indicated to keep it >>> return >>> end >>> >>> >>> I don't understand what this means. I would really appreciate your >>> help to get this running. >>> >>> Also, what is the result when I run this function on my data? (This >>> method was proposed from a reviewer. I never used it before, so I >>> don't exactly know what it does and what the result will look like). >>> >>> Thank you very much in advance! >>> >>> Best, >>> >>> Barbara Schorr >>> >>> >>> >>> >>> Zitat von 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: Question regarding nonparametric testing for coherence >>> > differences (Eric Maris) >>> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >>> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >>> > 4. Re: ft_rejectvisual: removing trials marked as bad >>> > (Caspar, Emilie) >>> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >>> > 6. Latest FT version on ftp-server is from three days ago >>> > (Holger Krause) >>> > 7. Re: TRENTOOL pipeline help (Max Cantor) >>> > >>> > >>> > ---------------------------------------------------------------------- >>> > >>> > Message: 1 >>> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >>> > From: "Eric Maris" >>> > To: , "'FieldTrip discussion list'" >>> > >>> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >>> > for >>> > coherence differences >>> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Hwee Ling, >>> > >>> > >>> > >>> > In the paper you refer to (Maris et al, JNM, 2007), I did not >>> > perform a >>> > cluster-based permutation test at the level of the channel pairs. >>> > Instead, >>> > all coherences mentioned in the paper are coherence between a single >>> > EMG >>> > channel (2 electrodes mounted on the forearm) and all MEG >>> > electrodes. Thus, >>> > there are as many EMG-MEG coherences as there are MEG channels (275 >>> > in our >>> > lab), and the clustering of these coherences involves the same >>> > neighbourhood >>> > structure as the clustering of channel-specific statistics on power >>> > or >>> > evoked response. The analysis you propose involves clustering in a >>> > much more >>> > complex space, namely the formed by all (MEG,MEG) channel pairs >>> > (275*275=75625 pairs). In the early days of cluster-based >>> > permutation >>> > statistics, I have worked on this problem but did not pursue it >>> > because the >>> > resulting clusters are very hard to interpret. >>> > >>> > >>> > >>> > Best, >>> > >>> > >>> > >>> > Eric Maris >>> > >>> > >>> > >>> > >>> > >>> > Dear all and Prof Maris, >>> > >>> > I'm re-posting this question again, as I didn't get any replies >>> > previously. >>> > >>> > I?m interested to investigate if there are any differences in phase >>> > synchronization in resting state data at timepoint 2 versus >>> > timepoint 1. The >>> > EEG data was collected using 64 EEG channels, resting state, eyes >>> > opened and >>> > eyes closed. I?ve arbitrarily segmented the resting state data into >>> > epochs >>> > of 2s each, and the epochs with artifacts are excluded completely >>> > from >>> > further analyses. I then performed mtmfft to get the fourier >>> > representation >>> > of the data, extracted the coherence, and compared the coherence >>> > difference >>> > of timepoint 2 versus timepoint 1 of all channels paired with all >>> > other >>> > channels. >>> > >>> > I figured that if I extract the connectivity analyses without >>> > specifying the >>> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >>> > allow me to >>> > perform cluster-based statistical analyses. I get an output with >>> > ?chan_chan? >>> > dimord variable. However, I was not 100% sure that this is correct, >>> > hence, I?ve >>> > inserted my code (see below). It?ll be great if you could tell me if >>> > what I?m >>> > doing makes any sense at all. Also, I don?t know how I can plot the >>> > results >>> > to see if it make any sense at all. >>> > >>> > Also, I checked the values obtained from when I specified >>> > "cfg.channelcmb" >>> > and when I did not specify "cfg.channelcmb", I noticed that the >>> > values were >>> > somehow different. I would assume that the values to be similar, >>> > although >>> > I'm not sure why they would have differences in the values obtained >>> > from >>> > specifying "cfg.channelcmb". >>> > >>> > This is my code that I've used thus far: >>> > >>> > for sub = 1:5 >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'fourier'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.keeptrials = 'yes'; >>> > >>> > cfg.tapsmofrq = 5; >>> > >>> > cfg.foilim = [0 100]; >>> > >>> > cfg.taper = 'dpss'; >>> > >>> > % find the index for the c200 condition >>> > >>> > pre_c200_idx = find(data5.trialinfo == 201); >>> > >>> > cfg.trials = pre_c200_idx; >>> > >>> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > post_c200_idx = find(data5.trialinfo == 200); >>> > >>> > cfg.trials = post_c200_idx; >>> > >>> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.keeptrials = 'no'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.removemean = 'yes'; >>> > >>> > cfg.method = 'coh'; >>> > >>> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_pre_c200); >>> > >>> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_post_c200); >>> > >>> > end >>> > >>> > >>> > >>> > >> load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat >> '); >>> > >>> > cfg_neighb.method = 'template'; >>> > >>> > cfg_neighb.layout = lay; >>> > >>> > cfg_neighb.channel = 'all'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, >>> > sub_HLF_pre_c200coh{1}); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.channelcmb = {cfg.channel, cfg.channel}; >>> > >>> > cfg.latency = 'all'; >>> > >>> > cfg.avgovertime = 'no'; >>> > >>> > cfg.avgoverchan = 'no'; >>> > >>> > cfg.parameter = 'cohspctrm'; >>> > >>> > cfg.method = 'montecarlo'; >>> > >>> > cfg.statistic = 'depsamplesT'; >>> > >>> > cfg.correctm = 'cluster'; >>> > >>> > cfg.tail = 0; >>> > >>> > % cfg.clustertail = 0; >>> > >>> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >>> > frequency >>> > bands. >>> > >>> > cfg.numrandomization = 10000; >>> > >>> > cfg.ivar = 2; >>> > >>> > cfg.uvar = 1; >>> > >>> > >>> > >>> > % design matrices >>> > >>> > clear design; >>> > >>> > design(1,:) = [1:5, 1:5]; >>> > >>> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >>> > >>> > cfg.design = design; >>> > >>> > % for theta band >>> > >>> > cfg.avgoverfreq = 'yes'; >>> > >>> > cfg.frequency = [4 8]; % I also performed the statistics for delta >>> > (2-4), >>> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >>> > (30-40), >>> > and gamma (40-100). >>> > >>> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >>> > sub_HLF_post_c200coh{:}, >>> > sub_HLF_pre_c200coh{:}); >>> > >>> > >>> > >>> > When I tried to plot the results, I used this code: >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.layout = 'lay'; >>> > >>> > cfg.zlim = [-1 1]; >>> > >>> > cfg.alpha = 0.05; >>> > >>> > cfg.refchannel = 'all'; >>> > >>> > ft_clusterplot(cfg, diffc200_theta_stat); >>> > >>> > However, I was not sure how I could plot the results. I get an error >>> > message >>> > from Fieldtrip when using ft_clusterplot: >>> > >>> > Error using topoplot_common (line 366) >>> > >>> > no reference channel is specified >>> > >>> > Error in ft_topoplotTFR (line 192) >>> > >>> > [cfg] = topoplot_common(cfg, varargin{:}); >>> > >>> > Error in ft_clusterplot (line 372) >>> > >>> > ft_topoplotTFR(cfgtopo, stat); >>> > >>> > >>> > >>> > According to your paper in 2007, the topoplot of the results were >>> > masked by >>> > the spatio-spectral pattern of the significant clusters. I don't >>> > know how to >>> > do this, and I would really appreciate if you can show me how to >>> > make such a >>> > plot. >>> > >>> > Thank you very much. >>> > >>> > Kind regards, >>> > >>> > Hweeling >>> > >>> > >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 280/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 2 >>> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >>> > From: KatrinH Heimann >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Joseph, thanks so much, I really appreciate your help. I was >>> > also >>> > wandering, if maybe there is another bug in my code. >>> > Our nets are 128 channels, Hydrocel, but as a colleague of me >>> > adviced me to >>> > do so, I also tried the 129 layout. >>> > My code you find below (without selection of bad channels etc.) >>> > If you need also the data of two subjects to have a look, let me >>> > know!!! >>> > Best and thanks really! >>> > Katrin >>> > >>> > >>> > subject=input('Which subject do you want to analyse? ','s'); >>> > >>> > name = strcat(subject,'.raw'); >>> > >>> > subjectnumber=input('Which is the subjectnumber?', 's'); >>> > >>> > sb=subjectnumber >>> > >>> > %subjectnumber = strcat(subjectnumber, '.txt') >>> > >>> > %% >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.dataset = name; >>> > >>> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> > >>> > cfg.trialdef.eventtype = 'trigger'; >>> > >>> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> > trigger >>> > >>> > cfg.trialdef.prestim = 0.234; % in seconds >>> > >>> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> > observation, but maybe we need less) >>> > >>> > cfg = ft_definetrial(cfg); >>> > >>> > >>> > cfg.trl([1:7],:) = []; >>> > >>> > >>> > %change timeline according to constant offset of 16 ms = 8 samples >>> > (because >>> > recorded with 500 hz)in >>> > >>> > %structure trial >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)-8 >>> > >>> > >>> > %change timeline to make the cut the zeropoint >>> > >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> > >>> > >>> > >>> > %% preprocess data >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.detrend = 'yes'; >>> > >>> > cfg.preproc.demean = 'yes'; >>> > >>> > cfg.preproc.baselinewindow = [-2.1 -2.0] >>> > >>> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> > filtered >>> > >>> > %(0.1-45) and bad channels have to be replaced!!!! >>> > >>> > %cfg.preproc.bpfreq = [6 32]; >>> > >>> > % >>> > >>> > % >>> > >>> > obs_data = ft_preprocessing(cfg); >>> > >>> > % >>> > >>> > save (strcat(sb,'obs_data') , 'obs_data') >>> > >>> > >>> > %% determining channel neighbours (necessary for Artifact detection) >>> > >>> > cfg = []; >>> > >>> > cfg.channel = obs_data.label; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.feedback = 'yes'; >>> > >>> > lay = ft_prepare_layout(cfg); >>> > >>> > >>> > >>> > cfg_neighb = []; >>> > >>> > cfg_neighb.feedback = 'yes'; >>> > >>> > >>> > cfg_neighb.method = 'triangulation'; >>> > >>> > cfg_neighb.layout = 'GSN128.sfp'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > obs_data.elec = ft_read_sens('GSN128.sfp'); >>> > >>> > >>> > %% Artifacts - to detect bad channels - is not saved!!! >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs_data_try = ft_rejectvisual(cfg, obs_data); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_try = ft_rejectartifact (cfg,obs_data); >>> > >>> > >>> > >>> > %% Preparing neighbours for channel repair - but bad channel info >>> > in!!! >>> > >>> > >>> > % cfg_neighb = []; >>> > >>> > % cfg_neighb.feedback = 'yes'; >>> > >>> > % cfg_neighb.method = 'triangulation'; >>> > >>> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> > >>> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > % Interpolate and put into new data structure >>> > >>> > cfg = []; >>> > >>> > cfg.badchannel = {}; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.method = 'nearest'; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> > >>> > >>> > % Check reconstruction >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > % dat1=obs_data; >>> > >>> > % dat2=obs_data_channelrepaired; >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> > >>> > % y=dat2.trial{1}(62,:); >>> > >>> > % plot(x);hold on;plot(y,'r'); >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(72,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(75,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > %% artifact rejection/trial inspection - throw out electrode jumps >>> > etc. >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> > according to >>> > channels interpolated %% 128-number of interp. channels) >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > comp = ft_componentanalysis(cfg,obs_data_clean1); >>> > >>> > save (strcat(sb,'comp_all') , 'comp') >>> > >>> > >>> > %% >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'component'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='some'; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > ft_databrowser(cfg,comp); >>> > >>> > >>> > %% poweranalysis components >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'pow'; >>> > >>> > cfg.channel = 'all';%compute the power spectrum in all ICs >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.taper = 'hanning'; >>> > >>> > cfg.foi = 0:0.2:50; >>> > >>> > obs_freq = ft_freqanalysis(cfg, comp); >>> > >>> > >>> > %And you can plot the spectra: >>> > >>> > >>> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> > >>> > nsubplots = 16; >>> > >>> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> > decimals, type >>> > doc subplot >>> > >>> > >>> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> > >>> > tot = Nfigs*nsubplots; >>> > >>> > >>> > rptvect = 1:size(comp.topo,1); >>> > >>> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> > >>> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> > >>> > >>> > for r=1:size(rptvect,1); >>> > >>> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> > 1]);%full >>> > screen >>> > >>> > k=0; >>> > >>> > for j=1:size(rptvect,2); >>> > >>> > if~(rptvect(r,j)==0); >>> > >>> > k=k+1; >>> > >>> > cfg=[]; >>> > >>> > cfg.channel = rptvect(r,j); >>> > >>> > cfg.ylim =[0 500] >>> > >>> > cfg.xlim =[0 50] >>> > >>> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> > >>> > end >>> > >>> > end >>> > >>> > end >>> > >>> > >>> > %For the IC topos you'll follow the same logic as above but with: >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [1:20]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [21:40]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [41:60]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [61:80]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% Seperate observation conditions >>> > >>> > >>> > name1= strcat(num2str(sb),'_90.xls'); >>> > >>> > list1=xlsread (name1) >>> > >>> > >>> > >>> > >>> > >>> > name2= strcat(num2str(sb),'_180.xls'); >>> > >>> > list2=xlsread (name2) >>> > >>> > >>> > >>> > % >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list1] >>> > >>> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list2] >>> > >>> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > %%PIPELINE FOR obs90 >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128; >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > >>> > comp_1 = ft_componentanalysis(cfg, obs90_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> > obs90_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts - final detection >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs90_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> > >>> > >>> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> > >>> > >>> > %% plot it >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP) >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% PIPELINE FOR obs180 >>> > >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > comp_2 = ft_componentanalysis(cfg, obs180_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> > obs180_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts final 180 >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs180_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> > >>> > >>> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> > >>> > >>> > %% plot 180 ERP >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs180_data_ERP) >>> > >>> > >>> > %% plot both ERPs >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > cfg.showlabels = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> > >>> > >>> > %% plot difference wave >>> > >>> > >>> > difference = obs180_data_ERP; % copy one of the >>> > structures >>> > >>> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >>> > the >>> > difference ERP >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, difference) >>> > >>> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> > >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI >>> >> data. A couple things. First of all, exactly which net do you use? >>> >> If >>> >> they are 129-channel, there is still the question of whether they >>> >> are the >>> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >>> >> cause an >>> >> error like this. Could you send me the file you are trying to >>> >> process and >>> >> the script you are using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >>> >> diezmartini at gmail.com> wrote: >>> >> >>> >> Which nets do you use? I use EGI. I tried both the ones you mention >>> >> and >>> >> they didn't work. It was hard to find that exact one online but it >>> >> was the >>> >> only file that actually worked. >>> >> >>> >> >>> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >> >>> >> wrote: >>> >> >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. >>> >>> Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one >>> >>> >>> >>>> I use >>> >>>> >>> >>>> >>> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>> >>>> katrinheimann at gmail.com> wrote: >>> >>>> >>> >>>>> Dear all, my problems seem neverending. This time however i >>> >>>>> really need >>> >>>>> help. >>> >>>>> I implemented a pipeline for ERPs. All works now, >>> >>>>> trialdefinition, >>> >>>>> preprocessing, channelreplacement, ica, componentrejection, >>> >>>>> final >>> >>>>> artifactdetection, timelock of the single subject data. However, >>> >>>>> when I >>> >>>>> wanna compute the grandaverage of the single subjects I get the >>> >>>>> following >>> >>>>> error message: >>> >>>>> >>> >>>>> computing average of avg over 19 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 3 MB >>> >>>>> computing average of avg over 2 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>>>> additional >>> >>>>> allocation of an estimated 0 MB >>> >>>>> >>> >>>>> Furthermore in the plot of the significant clusters, the >>> >>>>> channelnames >>> >>>>> are mixed up (do not correspond to my net) >>> >>>>> >>> >>>>> >>> >>>>> I guess that there is a problem with the layout I use. >>> >>>>> Here the code that I use >>> >>>>> >>> >>>>> %For generating the layout (also in the single subjects): >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = obs_data.label; >>> >>>>> >>> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>>>> >>> >>>>> cfg.feedback = 'yes'; >>> >>>>> >>> >>>>> lay = ft_prepare_layout(cfg); >>> >>>>> >>> >>>>> >>> >>>>> cfg_neighb = []; >>> >>>>> >>> >>>>> cfg_neighb.feedback = 'yes'; >>> >>>>> >>> >>>>> cfg_neighb.method = 'triangulation'; >>> >>>>> >>> >>>>> cfg_neighb.layout = lay; >>> >>>>> >>> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>>>> >>> >>>>> >>> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>>>> >>> >>>>> >>> >>>>> %For computing the grand average >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = 'all'; >>> >>>>> >>> >>>>> cfg.latency = 'all'; >>> >>>>> >>> >>>>> cfg.parameter = 'avg'; >>> >>>>> >>> >>>>> cfg.keepindividual = 'no' >>> >>>>> >>> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>>>> >>> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>>>> >>> >>>>> % "{:}" means to use data from all elements of the variable >>> >>>>> >>> >>>>> >>> >>>>> For plotting the significant clusters >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.style = 'blank'; >>> >>>>> >>> >>>>> cfg.layout = lay; >>> >>>>> >>> >>>>> cfg.channellabels = 'yes'; >>> >>>>> >>> >>>>> cfg.highlight = 'labels'; >>> >>>>> >>> >>>>> cfg.highlightchannel = find(stat.mask); >>> >>>>> >>> >>>>> cfg.comment = 'no'; >>> >>>>> >>> >>>>> figure; ft_topoplotER(cfg, GA_90) >>> >>>>> >>> >>>>> title('Nonparametric: significant with cluster multiple >>> >>>>> comparison >>> >>>>> correction') >>> >>>>> >>> >>>>> >>> >>>>> Do you have ANY idea to this? I am really completely >>> >>>>> helpless.... >>> >>>>> >>> >>>>> thanks and best >>> >>>>> >>> >>>>> Katrin >>> >>>>> >>> >>>>> _______________________________________________ >>> >>>>> 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 >>> >>> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing list >>> >> fieldtrip at donders.ru.nl >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> >> >>> >> >> ---------------------------------------------------------------------------- >> ---- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.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: >>> > >> > b61/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 3 >>> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >>> > From: Joseph Dien >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > yes, please do send me the data. >>> > >>> > Thanks! >>> > >>> > Joe >>> > >>> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >>> > wrote: >>> > >>> >> Dear Joseph, thanks so much, I really appreciate your help. I was >>> >> also wandering, if maybe there is another bug in my code. >>> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >>> >> adviced me to do so, I also tried the 129 layout. >>> >> My code you find below (without selection of bad channels etc.) >>> >> If you need also the data of two subjects to have a look, let me >>> >> know!!! >>> >> Best and thanks really! >>> >> Katrin >>> >> >>> >> >>> >> >>> >> subject=input('Which subject do you want to analyse? ','s'); >>> >> >>> >> name = strcat(subject,'.raw'); >>> >> >>> >> subjectnumber=input('Which is the subjectnumber?', 's'); >>> >> >>> >> sb=subjectnumber >>> >> >>> >> %subjectnumber = strcat(subjectnumber, '.txt') >>> >> >>> >> %% >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.dataset = name; >>> >> >>> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> >> >>> >> cfg.trialdef.eventtype = 'trigger'; >>> >> >>> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> >> trigger >>> >> >>> >> cfg.trialdef.prestim = 0.234; % in seconds >>> >> >>> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> >> observation, but maybe we need less) >>> >> >>> >> cfg = ft_definetrial(cfg); >>> >> >>> >> >>> >> >>> >> cfg.trl([1:7],:) = []; >>> >> >>> >> >>> >> >>> >> %change timeline according to constant offset of 16 ms = 8 samples >>> >> (because recorded with 500 hz)in >>> >> >>> >> %structure trial >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >>> >> >>> >> >>> >> >>> >> %change timeline to make the cut the zeropoint >>> >> >>> >> >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% preprocess data >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.detrend = 'yes'; >>> >> >>> >> cfg.preproc.demean = 'yes'; >>> >> >>> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >>> >> >>> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> >> filtered >>> >> >>> >> %(0.1-45) and bad channels have to be replaced!!!! >>> >> >>> >> %cfg.preproc.bpfreq = [6 32]; >>> >> >>> >> % >>> >> >>> >> % >>> >> >>> >> obs_data = ft_preprocessing(cfg); >>> >> >>> >> % >>> >> >>> >> save (strcat(sb,'obs_data') , 'obs_data') >>> >> >>> >> >>> >> >>> >> %% determining channel neighbours (necessary for Artifact >>> >> detection) >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = obs_data.label; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.feedback = 'yes'; >>> >> >>> >> lay = ft_prepare_layout(cfg); >>> >> >>> >> >>> >> cfg_neighb = []; >>> >> >>> >> cfg_neighb.feedback = 'yes'; >>> >> >>> >> >>> >> >>> >> cfg_neighb.method = 'triangulation'; >>> >> >>> >> cfg_neighb.layout = 'GSN128.sfp'; >>> >> >>> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >>> >> >>> >> >>> >> >>> >> %% Artifacts - to detect bad channels - is not saved!!! >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Preparing neighbours for channel repair - but bad channel info >>> >> in!!! >>> >> >>> >> >>> >> >>> >> % cfg_neighb = []; >>> >> >>> >> % cfg_neighb.feedback = 'yes'; >>> >> >>> >> % cfg_neighb.method = 'triangulation'; >>> >> >>> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> >> >>> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> % Interpolate and put into new data structure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.badchannel = {}; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.method = 'nearest'; >>> >> >>> >> cfg.neighbours = neighbours; >>> >> >>> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> >> >>> >> >>> >> >>> >> % Check reconstruction >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> % dat1=obs_data; >>> >> >>> >> % dat2=obs_data_channelrepaired; >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> >> >>> >> % y=dat2.trial{1}(62,:); >>> >> >>> >> % plot(x);hold on;plot(y,'r'); >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(72,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(75,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> %% artifact rejection/trial inspection - throw out electrode jumps >>> >> etc. >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> >> according to channels interpolated %% 128-number of interp. >>> >> channels) >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = {'all'}; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >>> >> >>> >> save (strcat(sb,'comp_all') , 'comp') >>> >> >>> >> >>> >> >>> >> %% >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'component'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='some'; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> ft_databrowser(cfg,comp); >>> >> >>> >> >>> >> >>> >> %% poweranalysis components >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.output = 'pow'; >>> >> >>> >> cfg.channel = 'all';%compute the power spectrum in all ICs >>> >> >>> >> cfg.method = 'mtmfft'; >>> >> >>> >> cfg.taper = 'hanning'; >>> >> >>> >> cfg.foi = 0:0.2:50; >>> >> >>> >> obs_freq = ft_freqanalysis(cfg, comp); >>> >> >>> >> >>> >> >>> >> %And you can plot the spectra: >>> >> >>> >> >>> >> >>> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> >> >>> >> nsubplots = 16; >>> >> >>> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> >> decimals, type doc subplot >>> >> >>> >> >>> >> >>> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> >> >>> >> tot = Nfigs*nsubplots; >>> >> >>> >> >>> >> >>> >> rptvect = 1:size(comp.topo,1); >>> >> >>> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> >> >>> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> >> >>> >> >>> >> >>> >> for r=1:size(rptvect,1); >>> >> >>> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> >> 1]);%full screen >>> >> >>> >> k=0; >>> >> >>> >> for j=1:size(rptvect,2); >>> >> >>> >> if~(rptvect(r,j)==0); >>> >> >>> >> k=k+1; >>> >> >>> >> cfg=[]; >>> >> >>> >> cfg.channel = rptvect(r,j); >>> >> >>> >> cfg.ylim =[0 500] >>> >> >>> >> cfg.xlim =[0 50] >>> >> >>> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> >>> >> >>> >> %For the IC topos you'll follow the same logic as above but with: >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [1:20]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [21:40]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [41:60]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [61:80]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Seperate observation conditions >>> >> >>> >> >>> >> >>> >> name1= strcat(num2str(sb),'_90.xls'); >>> >> >>> >> list1=xlsread (name1) >>> >> >>> >> >>> >> >>> >> name2= strcat(num2str(sb),'_180.xls'); >>> >> >>> >> list2=xlsread (name2) >>> >> >>> >> >>> >> % >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list1] >>> >> >>> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list2] >>> >> >>> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> %%PIPELINE FOR obs90 >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128; >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> >>> >> >>> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> >> obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts - final detection >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot it >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% PIPELINE FOR obs180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> >> obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts final 180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot 180 ERP >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot both ERPs >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> cfg.showlabels = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot difference wave >>> >> >>> >> >>> >> >>> >> difference = obs180_data_ERP; % copy one of >>> >> the structures >>> >> >>> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >>> >> compute the difference ERP >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, difference) >>> >> >>> >> >>> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI data. A couple things. First of all, exactly which net do >>> >> you use? If they are 129-channel, there is still the question of >>> >> whether they are the Hydrocel or the older geodesic nets. >>> >> Regardless, that shouldn't cause an error like this. Could you >>> >> send me the file you are trying to process and the script you are >>> >> using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >>> >> wrote: >>> >> >>> >>> Which nets do you use? I use EGI. I tried both the ones you >>> >>> mention and they didn't work. It was hard to find that exact one >>> >>> online but it was the only file that actually worked. >>> >>> >>> >>> >>> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one I use >>> >>> >>> >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear all, my problems seem neverending. This time however i really >>> >>> need help. >>> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> >>> preprocessing, channelreplacement, ica, componentrejection, final >>> >>> artifactdetection, timelock of the single subject data. However, >>> >>> when I wanna compute the grandaverage of the single subjects I get >>> >>> the following error message: >>> >>> >>> >>> computing average of avg over 19 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 3 MB >>> >>> computing average of avg over 2 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 0 MB >>> >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> >>> >>> Furthermore in the plot of the significant clusters, the >>> >>> channelnames are mixed up (do not correspond to my net) >>> >>> >>> >>> >>> >>> I guess that there is a problem with the layout I use. >>> >>> Here the code that I use >>> >>> >>> >>> %For generating the layout (also in the single subjects): >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = obs_data.label; >>> >>> >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> >>> >>> cfg.feedback = 'yes'; >>> >>> >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> >>> >>> >>> cfg_neighb = []; >>> >>> >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> >>> >>> cfg_neighb.layout = lay; >>> >>> >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> >>> >>> >>> >>> >>> %For computing the grand average >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = 'all'; >>> >>> >>> >>> cfg.latency = 'all'; >>> >>> >>> >>> cfg.parameter = 'avg'; >>> >>> >>> >>> cfg.keepindividual = 'no' >>> >>> >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> >>> >>> >>> For plotting the significant clusters >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.style = 'blank'; >>> >>> >>> >>> cfg.layout = lay; >>> >>> >>> >>> cfg.channellabels = 'yes'; >>> >>> >>> >>> cfg.highlight = 'labels'; >>> >>> >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> >>> >>> cfg.comment = 'no'; >>> >>> >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> >>> correction') >>> >>> >>> >>> >>> >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> >>> >>> thanks and best >>> >>> >>> >>> Katrin >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> 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 >>> >>> >>> >>> _______________________________________________ >>> >>> fieldtrip mailing list >>> >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >> ---------------------------------------------------------------------------- >> ---- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.com >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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 >>> > >>> > >> ---------------------------------------------------------------------------- >> ---- >>> > >>> > Joseph Dien, PhD >>> > Research Associate >>> > Cognitive Neurology >>> > The Johns Hopkins University School of Medicine >>> > >>> > Lab E-mail: jdien1 at jhmi.edu >>> > Private E-mail: jdien07 at mac.com >>> > Office Phone: 410-614-3115 >>> > Cell Phone: 202-297-8117 >>> > Fax: 410-955-0188 >>> > http://joedien.com >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > ad2/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 4 >>> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >>> > From: "Caspar, Emilie" >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >>> > bad >>> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >>> > Content-Type: text/plain; charset="iso-8859-1" >>> > >>> > Hi Ashley, >>> > >>> > Maybe the mistake is you did not integrate in your script the >>> > command to save the rejection. Normally, with the following command, >>> > you will see in the Matlab Window that artifacts are correctly >>> > rejected after the "quit" button. >>> > >>> > clean_data = ft_rejectvisual(cfg, interpoldata); >>> > cfg.artfctdef.reject = 'complete'; >>> > cfg.artfctdef.feedback = 'yes'; >>> > cleandata = ft_rejectartifact(cfg,clean_data); >>> > >>> > Emilie >>> > >>> > >>> > >>> > >>> > >>> > Le 3 sept. 2014 ? 11:58, Ashley Greene >>> > > a ?crit : >>> > >>> > Hello, >>> > >>> > I have used the rejectvisual function in attempt to remove bad >>> > trials, but after marking them and pressing the quit button, >>> > although the command window states that the selected trials have >>> > been removed, there is no obvious change in the data; all of the >>> > trials are still intact. Have I overlooked something? >>> > >>> > Thanks, >>> > >>> > Ashley >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 985/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 5 >>> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >>> > From: Patricia Wollstadt >>> > To: fieldtrip at science.ru.nl >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: <540EEF94.9080601 at gmx.de> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > Hello Max, >>> > >>> > I added a few comments to the questions regarding individual >>> > parameters >>> > below. To address the general problem of TRENTOOL telling you, that >>> > there are not enough sample points in your data: From what I can see >>> > in >>> > your script, you probably don't have enough data points in each time >>> > series to robustly estimate TE. You analyze 800 ms of data sampled >>> > at >>> > 300 Hz, which gives you 240 samples per time series. Can you maybe >>> > avoid >>> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >>> > you >>> > analyze a longer time window of interest? >>> > Note that you also 'lose' data to embedding and the interaction >>> > delay: >>> > The first point that can be used for TE estimation is at max. >>> > embedding >>> > length + max. interaction delay in samples. For example: max. >>> > embedding >>> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >>> > max >>> > interaction delay of 30 ms = 9 samples. In this example, you would >>> > be >>> > left with 240 - 29 samples for TE estimation per trial. There is >>> > also >>> > the possibility to estimate time resolved TE/TE for shorter time >>> > windows >>> > of interest (see section 4.4 in the manual); however, this method >>> > requires the use of a GPU for TE estimation. >>> > >>> > I would further recommend to use the new pipeline for group >>> > statistics >>> > described in the manual in section 4.5 (the function >>> > 'TEgroup_calculate' >>> > is deprecated). The new pipeline allows you to reconstruct the >>> > interaction delay and uses the following functions (see also >>> > comments in >>> > the script): >>> > >>> > TEgroup_prepare -> prepares all data sets (all subjects/all >>> > conditions) for group analysis (this means finding common embedding >>> > parameters such that estimates are not biased between groups) >>> > InteractionDelayReconstruction_calculate -> estimates TE for >>> > individual data sets and all assumed interaction delays u >>> > InteractionDelayReconstruction_analyze -> reconstructs the >>> > interaction delay by selecting the u that maximizes TE for each >>> > channel >>> > TEgroup_stats -> calculate group statistics using a permutation test >>> > >>> > I can send you an example script for group TE analysis using this >>> > pipeline to get you started. I hope this helps you to get the group >>> > analysis running. Just write again if you're having trouble setting >>> > up >>> > the pipeline or something is not clear about the parameters/my >>> > comments. >>> > >>> > Best, >>> > Patricia >>> > >>> > >>> > >>> > >>> > On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not >>> >> 100% sure if it is appropriate to ask questions about it here, but >>> >> to >>> >> the best of my knowledge they do not have a mailing list and I saw >>> >> a >>> >> few trentool questions in the archives, so I'm going to assume it's >>> >> ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present >>> >> in the pipeline. Sorry in advance for the long post! Any help would >>> >> be >>> >> greatly appreciated as I'm a bit over my head on this but I think >>> >> I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data >>> >> that was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi is >>> >> in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within the toi, but beyond that are there any benefits to it being >>> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >>> >> the >>> >> toi is in seconds. The prediction time is the assumed interaction >>> >> delay between your two sources and should fit within your toi. In >>> >> general it is preferable to use the method for interaction delay >>> >> reconstruction for TE estimation, because it allows you to >>> >> reconstruct >>> >> the actual delay between your source and target times series. A >>> >> non-optimal u/interaction delay may cause an underestimation of TE, >>> >> so >>> >> it is recommended to use the pipeline for interaction delay >>> >> reconstruction whenever estimating TE for unknown delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, so it is best to limit the u range to values that are >>> >> physiologically plausible. >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the >>> >> sample rate and filters are used to determine the actthrvalue, but >>> >> I >>> >> don't actually know the calculation. 7.5 was a rough guess just to >>> >> test the pipeline. I'm also uncertain of what minnrtrials should >>> >> be.* >>> >> PW: You can set the actthrvalue based on the filtering you did >>> >> prior >>> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >>> >> shouldn't find an ACT higher than 30 samples, because you filtered >>> >> out >>> >> any components of the signal slower than 10 Hz/30 samples (given >>> >> your >>> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >>> >> would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> * >>> >> * >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm >>> >> yet to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* >>> >> PW: The Ragwitz criterion tries to find optimal embedding >>> >> parameters >>> >> dim and tau for the data. To do that, the method iteratively takes >>> >> all >>> >> possible combinations of dim and tau values that are provided in >>> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >>> >> these >>> >> combinations embed the data. To test an embedding, the method >>> >> builds >>> >> the embedding vectors from the data; it then tests for each point >>> >> how >>> >> well the next point in time can be predicted from the reference >>> >> point's nearest neighbours. So for each embedded point, the method >>> >> searches for the nearest neighbours and calculates the average of >>> >> those nearest neighbours. The difference between the >>> >> averaged/predicted point and the actual next point is the error of >>> >> the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested >>> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together with 'ragtausteps' specifies the tau values to be tested >>> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >>> >> that >>> >> the values here are factors that are later multiplied with the ACT >>> >> to >>> >> obtain the actual tau. 'repPred' is the number of points that will >>> >> be >>> >> used for the local prediction, i.e. the Ragwitz criterion will test >>> >> the local prediction and calculate the error for the first 100 >>> >> points >>> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >>> >> below >>> >> specify the type of neighbour search conducted by the Ragwitz >>> >> criterion: 'flagNei' tells the method to either conduct a kNN or >>> >> range >>> >> search; 'sizeNei' specifies the number of neighbours or the radius >>> >> to >>> >> be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> * >>> >> * >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> * >>> >> * >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.*TRENTOOL seems to handle data output very differently >>> >> from >>> >> fieldtrip and I've had trouble thinking through the most logical >>> >> way >>> >> to handle the data so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> * >>> >> * >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition >>> >> x subject .mat file, which as I said before is collectively the >>> >> same >>> >> as the 3 x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> * >>> >> * >>> >> *At this step I get the following error: >>> >> >>> >> Error using transferentropy (line 337) >>> >> \nTRENTOOL ERROR: not enough data points left after embedding >>> >> >>> >> Error in TEgroup_calculate (line 133) >>> >> [TEresult] = transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate >>> >> is a pipeline issue* (I noticed the example pipeline in trentool, >>> >> the >>> >> manual, and published methods articles all seem to have slightly or >>> >> significantly different pipeline compositions), *or if the error >>> >> is* >>> >> due to ACT, ragwitz optimization, or some other faulty >>> >> parameterization *on my part due to a lack of understanding of how >>> >> transfer entropy works on a more theoretical/mathematical level*. >>> >> If >>> >> the latter is the case, is there any relatively straightforward way >>> >> to >>> >> conceptualize this, or is this something where I'm just going to >>> >> have >>> >> to keep reading and rereading until it eventually makes sense? I've >>> >> already done quite a bit of that and it hasn't pierced my thick >>> >> skull >>> >> yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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: >>> > >> > 97f/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 6 >>> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >>> > From: Holger Krause >>> > To: FieldTrip discussion list >>> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >>> > days ago >>> > Message-ID: >>> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >>> > Content-Type: text/plain; charset="us-ascii" >>> > >>> > Dear developers, >>> > >>> > Could you please check the process for creation/publication of >>> > zip-files on >>> > the FTP server? The latest file I can find there is >>> > fieldtrip-20140906.zip. >>> > >>> > Thanks in advance, >>> > >>> > Holger >>> > >>> > >>> > ------------------------------ >>> > >>> > Message: 7 >>> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >>> > From: Max Cantor >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > This is immensely helpful, thank you. I was very confused about why >>> > some >>> > versions of the pipeline I saw were using group calculate and others >>> > were >>> > using interaction delay reconstruction and what that meant, and I >>> > think I >>> > have a more clear idea of what the different steps of the pipeline >>> > are >>> > doing. There are still a few things I'm a bit confused about though >>> > in >>> > terms of the pipeline. For instance, whether or not I need to do >>> > TEprepare >>> > before group prepare, and if I need to do graph analysis (which I'm >>> > not >>> > sure I fully understand but also haven't looked deeply into) before >>> > group >>> > stats. >>> > >>> > If you don't mind me taking you up on your offer, I think seeing >>> > your >>> > example script might help clarify some of these issues. >>> > >>> > Thank you! >>> > >>> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >>> > Patricia.Wollstadt at gmx.de> wrote: >>> > >>> >> Hello Max, >>> >> >>> >> I added a few comments to the questions regarding individual >>> >> parameters >>> >> below. To address the general problem of TRENTOOL telling you, that >>> >> there >>> >> are not enough sample points in your data: From what I can see in >>> >> your >>> >> script, you probably don't have enough data points in each time >>> >> series to >>> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >>> >> which >>> >> gives you 240 samples per time series. Can you maybe avoid >>> >> downsampling to >>> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >>> >> longer time >>> >> window of interest? >>> >> Note that you also 'lose' data to embedding and the interaction >>> >> delay: The >>> >> first point that can be used for TE estimation is at max. embedding >>> >> length >>> >> + max. interaction delay in samples. For example: max. embedding >>> >> length = >>> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >>> >> interaction >>> >> delay of 30 ms = 9 samples. In this example, you would be left with >>> >> 240 - >>> >> 29 samples for TE estimation per trial. There is also the >>> >> possibility to >>> >> estimate time resolved TE/TE for shorter time windows of interest >>> >> (see >>> >> section 4.4 in the manual); however, this method requires the use >>> >> of a GPU >>> >> for TE estimation. >>> >> >>> >> I would further recommend to use the new pipeline for group >>> >> statistics >>> >> described in the manual in section 4.5 (the function >>> >> 'TEgroup_calculate' is >>> >> deprecated). The new pipeline allows you to reconstruct the >>> >> interaction >>> >> delay and uses the following functions (see also comments in the >>> >> script): >>> >> >>> >> TEgroup_prepare -> prepares all data sets (all subjects/all >>> >> conditions) >>> >> for group analysis (this means finding common embedding parameters >>> >> such >>> >> that estimates are not biased between groups) >>> >> InteractionDelayReconstruction_calculate -> estimates TE for >>> >> individual data sets and all assumed interaction delays u >>> >> InteractionDelayReconstruction_analyze -> reconstructs the >>> >> interaction delay by selecting the u that maximizes TE for each >>> >> channel >>> >> TEgroup_stats -> calculate group statistics using a permutation >>> >> test >>> >> >>> >> I can send you an example script for group TE analysis using this >>> >> pipeline >>> >> to get you started. I hope this helps you to get the group analysis >>> >> running. Just write again if you're having trouble setting up the >>> >> pipeline >>> >> or something is not clear about the parameters/my comments. >>> >> >>> >> Best, >>> >> Patricia >>> >> >>> >> >>> >> >>> >> >>> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not 100% >>> >> sure if it is appropriate to ask questions about it here, but to >>> >> the best >>> >> of my knowledge they do not have a mailing list and I saw a few >>> >> trentool >>> >> questions in the archives, so I'm going to assume it's ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present in >>> >> the pipeline. Sorry in advance for the long post! Any help would be >>> >> greatly >>> >> appreciated as I'm a bit over my head on this but I think I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data that >>> >> was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi >>> >> is in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within >>> >> the toi, but beyond that are there any benefits to it being earlier >>> >> or >>> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >>> >> in >>> >> seconds. The prediction time is the assumed interaction delay >>> >> between your >>> >> two sources and should fit within your toi. In general it is >>> >> preferable to >>> >> use the method for interaction delay reconstruction for TE >>> >> estimation, >>> >> because it allows you to reconstruct the actual delay between your >>> >> source >>> >> and target times series. A non-optimal u/interaction delay may >>> >> cause an >>> >> underestimation of TE, so it is recommended to use the pipeline for >>> >> interaction delay reconstruction whenever estimating TE for unknown >>> >> delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, >>> >> so it is best to limit the u range to values that are >>> >> physiologically >>> >> plausible. >>> >> >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the sample >>> >> rate and filters are used to determine the actthrvalue, but I don't >>> >> actually know the calculation. 7.5 was a rough guess just to test >>> >> the >>> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >>> >> You can >>> >> set the actthrvalue based on the filtering you did prior to TE >>> >> analysis. If >>> >> you for example highpass filtered at 10 Hz, you shouldn't find an >>> >> ACT >>> >> higher than 30 samples, because you filtered out any components of >>> >> the >>> >> signal slower than 10 Hz/30 samples (given your sampling frequency >>> >> of 300 >>> >> Hz). So in this scenario the actthrvalue would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm yet >>> >> to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* PW: >>> >> The Ragwitz criterion tries to find optimal embedding parameters >>> >> dim and >>> >> tau for the data. To do that, the method iteratively takes all >>> >> possible >>> >> combinations of dim and tau values that are provided in cfgP.ragdim >>> >> and >>> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >>> >> embed >>> >> the data. To test an embedding, the method builds the embedding >>> >> vectors >>> >> from the data; it then tests for each point how well the next point >>> >> in time >>> >> can be predicted from the reference point's nearest neighbours. So >>> >> for each >>> >> embedded point, the method searches for the nearest neighbours and >>> >> calculates the average of those nearest neighbours. The difference >>> >> between >>> >> the averaged/predicted point and the actual next point is the error >>> >> of the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested by >>> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together >>> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >>> >> will >>> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >>> >> here are >>> >> factors that are later multiplied with the ACT to obtain the actual >>> >> tau. >>> >> 'repPred' is the number of points that will be used for the local >>> >> prediction, i.e. the Ragwitz criterion will test the local >>> >> prediction and >>> >> calculate the error for the first 100 points in your time series. >>> >> The two >>> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >>> >> neighbour >>> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >>> >> method to >>> >> either conduct a kNN or range search; 'sizeNei' specifies the >>> >> number of >>> >> neighbours or the radius to be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' >>> >> data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject >>> >> virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.* >>> >> TRENTOOL seems to handle data output very differently from >>> >> fieldtrip and >>> >> I've had trouble thinking through the most logical way to handle >>> >> the data >>> >> so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition x >>> >> subject .mat file, which as I said before is collectively the same >>> >> as the 3 >>> >> x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> *At this step I get the following error: Error using >>> >> transferentropy (line >>> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >>> >> Error in >>> >> TEgroup_calculate (line 133) [TEresult] = >>> >> transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate is a >>> >> pipeline issue* (I noticed the example pipeline in trentool, the >>> >> manual, >>> >> and published methods articles all seem to have slightly or >>> >> significantly >>> >> different pipeline compositions), *or if the error is* due to ACT, >>> >> ragwitz optimization, or some other faulty parameterization *on my >>> >> part >>> >> due to a lack of understanding of how transfer entropy works on a >>> >> more >>> >> theoretical/mathematical level*. If the latter is the case, is >>> >> there any >>> >> relatively straightforward way to conceptualize this, or is this >>> >> something >>> >> where I'm just going to have to keep reading and rereading until it >>> >> eventually makes sense? I've already done quite a bit of that and >>> >> it hasn't >>> >> pierced my thick skull yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing >>> >> >> listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie >> ldtrip >>> >> >>> >> >>> >> -- >>> >> ------------------------------------------------------------ >>> >> >>> >> 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 >>> >> >>> > >>> > >>> > >>> > -- >>> > Max Cantor >>> > Lab Manager >>> > Computational Neurolinguistics Lab >>> > University of Michigan >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 024/attachment.html> >>> > >>> > ------------------------------ >>> > >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > End of fieldtrip Digest, Vol 46, Issue 3 >>> > **************************************** >>> > >>> >>> >>> >>> Barbara Schorr, MSc >>> Clinical and Biological Psychology >>> University of Ulm >>> Albert-Einstein-Allee 47 >>> 89069 Ulm >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jim Herring, MSc. >> Neuronal Oscillations Group >> Centre for Cognitive Neuroimaging >> Donders Institute for Brain, Cognition and Behaviour >> Radboud University Nijmegen >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> ------------------------------ >> >> Message: 8 >> Date: Mon, 15 Sep 2014 12:53:19 -0500 >> From: "Jing Fan" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of >> variable 'abort' >> Message-ID: <000301cfd10d$ef53cba0$cdfb62e0$@gmail.com> >> Content-Type: text/plain; charset="us-ascii" >> >> Hi Barbara and Jim, >> >> I added path your/path/to/fieldtrip/utilities and now it worked. >> Hope it helps solve the problem. >> >> Best, >> Jing >> >> -----Original Message----- >> From: fieldtrip-bounces at science.ru.nl >> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) >> Sent: Monday, September 15, 2014 5:01 AM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable >> 'abort' >> >> Dear Barbara, >> >> The error seems to be related to a bug that pops up now and then >> (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a >> corrupt installation of fieldtrip and/or the need to update fieldtrip. >> >> Could you please try downloading the most recent version of fieldtrip and >> see if the problem persists? >> >> For an example of what can be expected from this function see: Esser SK, >> Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct >> demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res >> Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. >> >> Best, >> >> Jim >> >> >> ----- Oorspronkelijk bericht ----- >>> Van: "barbara schorr" >>> Aan: fieldtrip at science.ru.nl >>> Verzonden: Woensdag 10 september 2014 14:07:14 >>> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable >> 'abort' >>> Dear fieldtripers. >>> >>> as mentioned in the subject line I would like to anaylse my timelocked >>> ERP Data with the function ft_globalmeanfield. >>> >>> I get the Error: Undefined function or variable 'abort' >>> Error in ft_globalmeanfield (line84) >>> if abort >>> >>> in the function it says: >>> >>> %the abort variable is set to true or false in ft_preamble_inti >>> if abort >>> % do not continue function execution in case the outputfile is >>> present and the user indicated to keep it >>> return >>> end >>> >>> >>> I don't understand what this means. I would really appreciate your >>> help to get this running. >>> >>> Also, what is the result when I run this function on my data? (This >>> method was proposed from a reviewer. I never used it before, so I >>> don't exactly know what it does and what the result will look like). >>> >>> Thank you very much in advance! >>> >>> Best, >>> >>> Barbara Schorr >>> >>> >>> >>> >>> Zitat von 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: Question regarding nonparametric testing for coherence >>> > differences (Eric Maris) >>> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >>> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >>> > 4. Re: ft_rejectvisual: removing trials marked as bad >>> > (Caspar, Emilie) >>> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >>> > 6. Latest FT version on ftp-server is from three days ago >>> > (Holger Krause) >>> > 7. Re: TRENTOOL pipeline help (Max Cantor) >>> > >>> > >>> > ---------------------------------------------------------------------- >>> > >>> > Message: 1 >>> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >>> > From: "Eric Maris" >>> > To: , "'FieldTrip discussion list'" >>> > >>> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >>> > for >>> > coherence differences >>> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Hwee Ling, >>> > >>> > >>> > >>> > In the paper you refer to (Maris et al, JNM, 2007), I did not >>> > perform a >>> > cluster-based permutation test at the level of the channel pairs. >>> > Instead, >>> > all coherences mentioned in the paper are coherence between a single >>> > EMG >>> > channel (2 electrodes mounted on the forearm) and all MEG >>> > electrodes. Thus, >>> > there are as many EMG-MEG coherences as there are MEG channels (275 >>> > in our >>> > lab), and the clustering of these coherences involves the same >>> > neighbourhood >>> > structure as the clustering of channel-specific statistics on power >>> > or >>> > evoked response. The analysis you propose involves clustering in a >>> > much more >>> > complex space, namely the formed by all (MEG,MEG) channel pairs >>> > (275*275=75625 pairs). In the early days of cluster-based >>> > permutation >>> > statistics, I have worked on this problem but did not pursue it >>> > because the >>> > resulting clusters are very hard to interpret. >>> > >>> > >>> > >>> > Best, >>> > >>> > >>> > >>> > Eric Maris >>> > >>> > >>> > >>> > >>> > >>> > Dear all and Prof Maris, >>> > >>> > I'm re-posting this question again, as I didn't get any replies >>> > previously. >>> > >>> > I?m interested to investigate if there are any differences in phase >>> > synchronization in resting state data at timepoint 2 versus >>> > timepoint 1. The >>> > EEG data was collected using 64 EEG channels, resting state, eyes >>> > opened and >>> > eyes closed. I?ve arbitrarily segmented the resting state data into >>> > epochs >>> > of 2s each, and the epochs with artifacts are excluded completely >>> > from >>> > further analyses. I then performed mtmfft to get the fourier >>> > representation >>> > of the data, extracted the coherence, and compared the coherence >>> > difference >>> > of timepoint 2 versus timepoint 1 of all channels paired with all >>> > other >>> > channels. >>> > >>> > I figured that if I extract the connectivity analyses without >>> > specifying the >>> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >>> > allow me to >>> > perform cluster-based statistical analyses. I get an output with >>> > ?chan_chan? >>> > dimord variable. However, I was not 100% sure that this is correct, >>> > hence, I?ve >>> > inserted my code (see below). It?ll be great if you could tell me if >>> > what I?m >>> > doing makes any sense at all. Also, I don?t know how I can plot the >>> > results >>> > to see if it make any sense at all. >>> > >>> > Also, I checked the values obtained from when I specified >>> > "cfg.channelcmb" >>> > and when I did not specify "cfg.channelcmb", I noticed that the >>> > values were >>> > somehow different. I would assume that the values to be similar, >>> > although >>> > I'm not sure why they would have differences in the values obtained >>> > from >>> > specifying "cfg.channelcmb". >>> > >>> > This is my code that I've used thus far: >>> > >>> > for sub = 1:5 >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'fourier'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.keeptrials = 'yes'; >>> > >>> > cfg.tapsmofrq = 5; >>> > >>> > cfg.foilim = [0 100]; >>> > >>> > cfg.taper = 'dpss'; >>> > >>> > % find the index for the c200 condition >>> > >>> > pre_c200_idx = find(data5.trialinfo == 201); >>> > >>> > cfg.trials = pre_c200_idx; >>> > >>> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > post_c200_idx = find(data5.trialinfo == 200); >>> > >>> > cfg.trials = post_c200_idx; >>> > >>> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.keeptrials = 'no'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.removemean = 'yes'; >>> > >>> > cfg.method = 'coh'; >>> > >>> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_pre_c200); >>> > >>> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_post_c200); >>> > >>> > end >>> > >>> > >>> > >>> > >> load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat >> '); >>> > >>> > cfg_neighb.method = 'template'; >>> > >>> > cfg_neighb.layout = lay; >>> > >>> > cfg_neighb.channel = 'all'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, >>> > sub_HLF_pre_c200coh{1}); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.channelcmb = {cfg.channel, cfg.channel}; >>> > >>> > cfg.latency = 'all'; >>> > >>> > cfg.avgovertime = 'no'; >>> > >>> > cfg.avgoverchan = 'no'; >>> > >>> > cfg.parameter = 'cohspctrm'; >>> > >>> > cfg.method = 'montecarlo'; >>> > >>> > cfg.statistic = 'depsamplesT'; >>> > >>> > cfg.correctm = 'cluster'; >>> > >>> > cfg.tail = 0; >>> > >>> > % cfg.clustertail = 0; >>> > >>> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >>> > frequency >>> > bands. >>> > >>> > cfg.numrandomization = 10000; >>> > >>> > cfg.ivar = 2; >>> > >>> > cfg.uvar = 1; >>> > >>> > >>> > >>> > % design matrices >>> > >>> > clear design; >>> > >>> > design(1,:) = [1:5, 1:5]; >>> > >>> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >>> > >>> > cfg.design = design; >>> > >>> > % for theta band >>> > >>> > cfg.avgoverfreq = 'yes'; >>> > >>> > cfg.frequency = [4 8]; % I also performed the statistics for delta >>> > (2-4), >>> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >>> > (30-40), >>> > and gamma (40-100). >>> > >>> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >>> > sub_HLF_post_c200coh{:}, >>> > sub_HLF_pre_c200coh{:}); >>> > >>> > >>> > >>> > When I tried to plot the results, I used this code: >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.layout = 'lay'; >>> > >>> > cfg.zlim = [-1 1]; >>> > >>> > cfg.alpha = 0.05; >>> > >>> > cfg.refchannel = 'all'; >>> > >>> > ft_clusterplot(cfg, diffc200_theta_stat); >>> > >>> > However, I was not sure how I could plot the results. I get an error >>> > message >>> > from Fieldtrip when using ft_clusterplot: >>> > >>> > Error using topoplot_common (line 366) >>> > >>> > no reference channel is specified >>> > >>> > Error in ft_topoplotTFR (line 192) >>> > >>> > [cfg] = topoplot_common(cfg, varargin{:}); >>> > >>> > Error in ft_clusterplot (line 372) >>> > >>> > ft_topoplotTFR(cfgtopo, stat); >>> > >>> > >>> > >>> > According to your paper in 2007, the topoplot of the results were >>> > masked by >>> > the spatio-spectral pattern of the significant clusters. I don't >>> > know how to >>> > do this, and I would really appreciate if you can show me how to >>> > make such a >>> > plot. >>> > >>> > Thank you very much. >>> > >>> > Kind regards, >>> > >>> > Hweeling >>> > >>> > >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 280/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 2 >>> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >>> > From: KatrinH Heimann >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Joseph, thanks so much, I really appreciate your help. I was >>> > also >>> > wandering, if maybe there is another bug in my code. >>> > Our nets are 128 channels, Hydrocel, but as a colleague of me >>> > adviced me to >>> > do so, I also tried the 129 layout. >>> > My code you find below (without selection of bad channels etc.) >>> > If you need also the data of two subjects to have a look, let me >>> > know!!! >>> > Best and thanks really! >>> > Katrin >>> > >>> > >>> > subject=input('Which subject do you want to analyse? ','s'); >>> > >>> > name = strcat(subject,'.raw'); >>> > >>> > subjectnumber=input('Which is the subjectnumber?', 's'); >>> > >>> > sb=subjectnumber >>> > >>> > %subjectnumber = strcat(subjectnumber, '.txt') >>> > >>> > %% >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.dataset = name; >>> > >>> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> > >>> > cfg.trialdef.eventtype = 'trigger'; >>> > >>> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> > trigger >>> > >>> > cfg.trialdef.prestim = 0.234; % in seconds >>> > >>> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> > observation, but maybe we need less) >>> > >>> > cfg = ft_definetrial(cfg); >>> > >>> > >>> > cfg.trl([1:7],:) = []; >>> > >>> > >>> > %change timeline according to constant offset of 16 ms = 8 samples >>> > (because >>> > recorded with 500 hz)in >>> > >>> > %structure trial >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)-8 >>> > >>> > >>> > %change timeline to make the cut the zeropoint >>> > >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> > >>> > >>> > >>> > %% preprocess data >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.detrend = 'yes'; >>> > >>> > cfg.preproc.demean = 'yes'; >>> > >>> > cfg.preproc.baselinewindow = [-2.1 -2.0] >>> > >>> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> > filtered >>> > >>> > %(0.1-45) and bad channels have to be replaced!!!! >>> > >>> > %cfg.preproc.bpfreq = [6 32]; >>> > >>> > % >>> > >>> > % >>> > >>> > obs_data = ft_preprocessing(cfg); >>> > >>> > % >>> > >>> > save (strcat(sb,'obs_data') , 'obs_data') >>> > >>> > >>> > %% determining channel neighbours (necessary for Artifact detection) >>> > >>> > cfg = []; >>> > >>> > cfg.channel = obs_data.label; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.feedback = 'yes'; >>> > >>> > lay = ft_prepare_layout(cfg); >>> > >>> > >>> > >>> > cfg_neighb = []; >>> > >>> > cfg_neighb.feedback = 'yes'; >>> > >>> > >>> > cfg_neighb.method = 'triangulation'; >>> > >>> > cfg_neighb.layout = 'GSN128.sfp'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > obs_data.elec = ft_read_sens('GSN128.sfp'); >>> > >>> > >>> > %% Artifacts - to detect bad channels - is not saved!!! >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs_data_try = ft_rejectvisual(cfg, obs_data); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_try = ft_rejectartifact (cfg,obs_data); >>> > >>> > >>> > >>> > %% Preparing neighbours for channel repair - but bad channel info >>> > in!!! >>> > >>> > >>> > % cfg_neighb = []; >>> > >>> > % cfg_neighb.feedback = 'yes'; >>> > >>> > % cfg_neighb.method = 'triangulation'; >>> > >>> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> > >>> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > % Interpolate and put into new data structure >>> > >>> > cfg = []; >>> > >>> > cfg.badchannel = {}; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.method = 'nearest'; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> > >>> > >>> > % Check reconstruction >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > % dat1=obs_data; >>> > >>> > % dat2=obs_data_channelrepaired; >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> > >>> > % y=dat2.trial{1}(62,:); >>> > >>> > % plot(x);hold on;plot(y,'r'); >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(72,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(75,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > %% artifact rejection/trial inspection - throw out electrode jumps >>> > etc. >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> > according to >>> > channels interpolated %% 128-number of interp. channels) >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > comp = ft_componentanalysis(cfg,obs_data_clean1); >>> > >>> > save (strcat(sb,'comp_all') , 'comp') >>> > >>> > >>> > %% >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'component'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='some'; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > ft_databrowser(cfg,comp); >>> > >>> > >>> > %% poweranalysis components >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'pow'; >>> > >>> > cfg.channel = 'all';%compute the power spectrum in all ICs >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.taper = 'hanning'; >>> > >>> > cfg.foi = 0:0.2:50; >>> > >>> > obs_freq = ft_freqanalysis(cfg, comp); >>> > >>> > >>> > %And you can plot the spectra: >>> > >>> > >>> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> > >>> > nsubplots = 16; >>> > >>> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> > decimals, type >>> > doc subplot >>> > >>> > >>> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> > >>> > tot = Nfigs*nsubplots; >>> > >>> > >>> > rptvect = 1:size(comp.topo,1); >>> > >>> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> > >>> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> > >>> > >>> > for r=1:size(rptvect,1); >>> > >>> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> > 1]);%full >>> > screen >>> > >>> > k=0; >>> > >>> > for j=1:size(rptvect,2); >>> > >>> > if~(rptvect(r,j)==0); >>> > >>> > k=k+1; >>> > >>> > cfg=[]; >>> > >>> > cfg.channel = rptvect(r,j); >>> > >>> > cfg.ylim =[0 500] >>> > >>> > cfg.xlim =[0 50] >>> > >>> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> > >>> > end >>> > >>> > end >>> > >>> > end >>> > >>> > >>> > %For the IC topos you'll follow the same logic as above but with: >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [1:20]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [21:40]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [41:60]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [61:80]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% Seperate observation conditions >>> > >>> > >>> > name1= strcat(num2str(sb),'_90.xls'); >>> > >>> > list1=xlsread (name1) >>> > >>> > >>> > >>> > >>> > >>> > name2= strcat(num2str(sb),'_180.xls'); >>> > >>> > list2=xlsread (name2) >>> > >>> > >>> > >>> > % >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list1] >>> > >>> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list2] >>> > >>> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > %%PIPELINE FOR obs90 >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128; >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > >>> > comp_1 = ft_componentanalysis(cfg, obs90_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> > obs90_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts - final detection >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs90_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> > >>> > >>> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> > >>> > >>> > %% plot it >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP) >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% PIPELINE FOR obs180 >>> > >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > comp_2 = ft_componentanalysis(cfg, obs180_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> > obs180_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts final 180 >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs180_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> > >>> > >>> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> > >>> > >>> > %% plot 180 ERP >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs180_data_ERP) >>> > >>> > >>> > %% plot both ERPs >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > cfg.showlabels = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> > >>> > >>> > %% plot difference wave >>> > >>> > >>> > difference = obs180_data_ERP; % copy one of the >>> > structures >>> > >>> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >>> > the >>> > difference ERP >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, difference) >>> > >>> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> > >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI >>> >> data. A couple things. First of all, exactly which net do you use? >>> >> If >>> >> they are 129-channel, there is still the question of whether they >>> >> are the >>> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >>> >> cause an >>> >> error like this. Could you send me the file you are trying to >>> >> process and >>> >> the script you are using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >>> >> diezmartini at gmail.com> wrote: >>> >> >>> >> Which nets do you use? I use EGI. I tried both the ones you mention >>> >> and >>> >> they didn't work. It was hard to find that exact one online but it >>> >> was the >>> >> only file that actually worked. >>> >> >>> >> >>> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >> >>> >> wrote: >>> >> >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. >>> >>> Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one >>> >>> >>> >>>> I use >>> >>>> >>> >>>> >>> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>> >>>> katrinheimann at gmail.com> wrote: >>> >>>> >>> >>>>> Dear all, my problems seem neverending. This time however i >>> >>>>> really need >>> >>>>> help. >>> >>>>> I implemented a pipeline for ERPs. All works now, >>> >>>>> trialdefinition, >>> >>>>> preprocessing, channelreplacement, ica, componentrejection, >>> >>>>> final >>> >>>>> artifactdetection, timelock of the single subject data. However, >>> >>>>> when I >>> >>>>> wanna compute the grandaverage of the single subjects I get the >>> >>>>> following >>> >>>>> error message: >>> >>>>> >>> >>>>> computing average of avg over 19 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 3 MB >>> >>>>> computing average of avg over 2 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>>>> additional >>> >>>>> allocation of an estimated 0 MB >>> >>>>> >>> >>>>> Furthermore in the plot of the significant clusters, the >>> >>>>> channelnames >>> >>>>> are mixed up (do not correspond to my net) >>> >>>>> >>> >>>>> >>> >>>>> I guess that there is a problem with the layout I use. >>> >>>>> Here the code that I use >>> >>>>> >>> >>>>> %For generating the layout (also in the single subjects): >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = obs_data.label; >>> >>>>> >>> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>>>> >>> >>>>> cfg.feedback = 'yes'; >>> >>>>> >>> >>>>> lay = ft_prepare_layout(cfg); >>> >>>>> >>> >>>>> >>> >>>>> cfg_neighb = []; >>> >>>>> >>> >>>>> cfg_neighb.feedback = 'yes'; >>> >>>>> >>> >>>>> cfg_neighb.method = 'triangulation'; >>> >>>>> >>> >>>>> cfg_neighb.layout = lay; >>> >>>>> >>> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>>>> >>> >>>>> >>> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>>>> >>> >>>>> >>> >>>>> %For computing the grand average >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = 'all'; >>> >>>>> >>> >>>>> cfg.latency = 'all'; >>> >>>>> >>> >>>>> cfg.parameter = 'avg'; >>> >>>>> >>> >>>>> cfg.keepindividual = 'no' >>> >>>>> >>> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>>>> >>> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>>>> >>> >>>>> % "{:}" means to use data from all elements of the variable >>> >>>>> >>> >>>>> >>> >>>>> For plotting the significant clusters >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.style = 'blank'; >>> >>>>> >>> >>>>> cfg.layout = lay; >>> >>>>> >>> >>>>> cfg.channellabels = 'yes'; >>> >>>>> >>> >>>>> cfg.highlight = 'labels'; >>> >>>>> >>> >>>>> cfg.highlightchannel = find(stat.mask); >>> >>>>> >>> >>>>> cfg.comment = 'no'; >>> >>>>> >>> >>>>> figure; ft_topoplotER(cfg, GA_90) >>> >>>>> >>> >>>>> title('Nonparametric: significant with cluster multiple >>> >>>>> comparison >>> >>>>> correction') >>> >>>>> >>> >>>>> >>> >>>>> Do you have ANY idea to this? I am really completely >>> >>>>> helpless.... >>> >>>>> >>> >>>>> thanks and best >>> >>>>> >>> >>>>> Katrin >>> >>>>> >>> >>>>> _______________________________________________ >>> >>>>> 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 >>> >>> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing list >>> >> fieldtrip at donders.ru.nl >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> >> >>> >> >> ---------------------------------------------------------------------------- >> ---- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.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: >>> > >> > b61/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 3 >>> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >>> > From: Joseph Dien >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > yes, please do send me the data. >>> > >>> > Thanks! >>> > >>> > Joe >>> > >>> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >>> > wrote: >>> > >>> >> Dear Joseph, thanks so much, I really appreciate your help. I was >>> >> also wandering, if maybe there is another bug in my code. >>> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >>> >> adviced me to do so, I also tried the 129 layout. >>> >> My code you find below (without selection of bad channels etc.) >>> >> If you need also the data of two subjects to have a look, let me >>> >> know!!! >>> >> Best and thanks really! >>> >> Katrin >>> >> >>> >> >>> >> >>> >> subject=input('Which subject do you want to analyse? ','s'); >>> >> >>> >> name = strcat(subject,'.raw'); >>> >> >>> >> subjectnumber=input('Which is the subjectnumber?', 's'); >>> >> >>> >> sb=subjectnumber >>> >> >>> >> %subjectnumber = strcat(subjectnumber, '.txt') >>> >> >>> >> %% >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.dataset = name; >>> >> >>> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> >> >>> >> cfg.trialdef.eventtype = 'trigger'; >>> >> >>> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> >> trigger >>> >> >>> >> cfg.trialdef.prestim = 0.234; % in seconds >>> >> >>> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> >> observation, but maybe we need less) >>> >> >>> >> cfg = ft_definetrial(cfg); >>> >> >>> >> >>> >> >>> >> cfg.trl([1:7],:) = []; >>> >> >>> >> >>> >> >>> >> %change timeline according to constant offset of 16 ms = 8 samples >>> >> (because recorded with 500 hz)in >>> >> >>> >> %structure trial >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >>> >> >>> >> >>> >> >>> >> %change timeline to make the cut the zeropoint >>> >> >>> >> >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% preprocess data >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.detrend = 'yes'; >>> >> >>> >> cfg.preproc.demean = 'yes'; >>> >> >>> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >>> >> >>> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> >> filtered >>> >> >>> >> %(0.1-45) and bad channels have to be replaced!!!! >>> >> >>> >> %cfg.preproc.bpfreq = [6 32]; >>> >> >>> >> % >>> >> >>> >> % >>> >> >>> >> obs_data = ft_preprocessing(cfg); >>> >> >>> >> % >>> >> >>> >> save (strcat(sb,'obs_data') , 'obs_data') >>> >> >>> >> >>> >> >>> >> %% determining channel neighbours (necessary for Artifact >>> >> detection) >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = obs_data.label; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.feedback = 'yes'; >>> >> >>> >> lay = ft_prepare_layout(cfg); >>> >> >>> >> >>> >> cfg_neighb = []; >>> >> >>> >> cfg_neighb.feedback = 'yes'; >>> >> >>> >> >>> >> >>> >> cfg_neighb.method = 'triangulation'; >>> >> >>> >> cfg_neighb.layout = 'GSN128.sfp'; >>> >> >>> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >>> >> >>> >> >>> >> >>> >> %% Artifacts - to detect bad channels - is not saved!!! >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Preparing neighbours for channel repair - but bad channel info >>> >> in!!! >>> >> >>> >> >>> >> >>> >> % cfg_neighb = []; >>> >> >>> >> % cfg_neighb.feedback = 'yes'; >>> >> >>> >> % cfg_neighb.method = 'triangulation'; >>> >> >>> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> >> >>> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> % Interpolate and put into new data structure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.badchannel = {}; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.method = 'nearest'; >>> >> >>> >> cfg.neighbours = neighbours; >>> >> >>> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> >> >>> >> >>> >> >>> >> % Check reconstruction >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> % dat1=obs_data; >>> >> >>> >> % dat2=obs_data_channelrepaired; >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> >> >>> >> % y=dat2.trial{1}(62,:); >>> >> >>> >> % plot(x);hold on;plot(y,'r'); >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(72,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(75,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> %% artifact rejection/trial inspection - throw out electrode jumps >>> >> etc. >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> >> according to channels interpolated %% 128-number of interp. >>> >> channels) >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = {'all'}; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >>> >> >>> >> save (strcat(sb,'comp_all') , 'comp') >>> >> >>> >> >>> >> >>> >> %% >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'component'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='some'; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> ft_databrowser(cfg,comp); >>> >> >>> >> >>> >> >>> >> %% poweranalysis components >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.output = 'pow'; >>> >> >>> >> cfg.channel = 'all';%compute the power spectrum in all ICs >>> >> >>> >> cfg.method = 'mtmfft'; >>> >> >>> >> cfg.taper = 'hanning'; >>> >> >>> >> cfg.foi = 0:0.2:50; >>> >> >>> >> obs_freq = ft_freqanalysis(cfg, comp); >>> >> >>> >> >>> >> >>> >> %And you can plot the spectra: >>> >> >>> >> >>> >> >>> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> >> >>> >> nsubplots = 16; >>> >> >>> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> >> decimals, type doc subplot >>> >> >>> >> >>> >> >>> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> >> >>> >> tot = Nfigs*nsubplots; >>> >> >>> >> >>> >> >>> >> rptvect = 1:size(comp.topo,1); >>> >> >>> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> >> >>> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> >> >>> >> >>> >> >>> >> for r=1:size(rptvect,1); >>> >> >>> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> >> 1]);%full screen >>> >> >>> >> k=0; >>> >> >>> >> for j=1:size(rptvect,2); >>> >> >>> >> if~(rptvect(r,j)==0); >>> >> >>> >> k=k+1; >>> >> >>> >> cfg=[]; >>> >> >>> >> cfg.channel = rptvect(r,j); >>> >> >>> >> cfg.ylim =[0 500] >>> >> >>> >> cfg.xlim =[0 50] >>> >> >>> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> >>> >> >>> >> %For the IC topos you'll follow the same logic as above but with: >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [1:20]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [21:40]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [41:60]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [61:80]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Seperate observation conditions >>> >> >>> >> >>> >> >>> >> name1= strcat(num2str(sb),'_90.xls'); >>> >> >>> >> list1=xlsread (name1) >>> >> >>> >> >>> >> >>> >> name2= strcat(num2str(sb),'_180.xls'); >>> >> >>> >> list2=xlsread (name2) >>> >> >>> >> >>> >> % >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list1] >>> >> >>> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list2] >>> >> >>> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> %%PIPELINE FOR obs90 >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128; >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> >>> >> >>> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> >> obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts - final detection >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot it >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% PIPELINE FOR obs180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> >> obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts final 180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot 180 ERP >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot both ERPs >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> cfg.showlabels = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot difference wave >>> >> >>> >> >>> >> >>> >> difference = obs180_data_ERP; % copy one of >>> >> the structures >>> >> >>> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >>> >> compute the difference ERP >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, difference) >>> >> >>> >> >>> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI data. A couple things. First of all, exactly which net do >>> >> you use? If they are 129-channel, there is still the question of >>> >> whether they are the Hydrocel or the older geodesic nets. >>> >> Regardless, that shouldn't cause an error like this. Could you >>> >> send me the file you are trying to process and the script you are >>> >> using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >>> >> wrote: >>> >> >>> >>> Which nets do you use? I use EGI. I tried both the ones you >>> >>> mention and they didn't work. It was hard to find that exact one >>> >>> online but it was the only file that actually worked. >>> >>> >>> >>> >>> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one I use >>> >>> >>> >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear all, my problems seem neverending. This time however i really >>> >>> need help. >>> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> >>> preprocessing, channelreplacement, ica, componentrejection, final >>> >>> artifactdetection, timelock of the single subject data. However, >>> >>> when I wanna compute the grandaverage of the single subjects I get >>> >>> the following error message: >>> >>> >>> >>> computing average of avg over 19 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 3 MB >>> >>> computing average of avg over 2 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 0 MB >>> >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> >>> >>> Furthermore in the plot of the significant clusters, the >>> >>> channelnames are mixed up (do not correspond to my net) >>> >>> >>> >>> >>> >>> I guess that there is a problem with the layout I use. >>> >>> Here the code that I use >>> >>> >>> >>> %For generating the layout (also in the single subjects): >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = obs_data.label; >>> >>> >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> >>> >>> cfg.feedback = 'yes'; >>> >>> >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> >>> >>> >>> cfg_neighb = []; >>> >>> >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> >>> >>> cfg_neighb.layout = lay; >>> >>> >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> >>> >>> >>> >>> >>> %For computing the grand average >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = 'all'; >>> >>> >>> >>> cfg.latency = 'all'; >>> >>> >>> >>> cfg.parameter = 'avg'; >>> >>> >>> >>> cfg.keepindividual = 'no' >>> >>> >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> >>> >>> >>> For plotting the significant clusters >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.style = 'blank'; >>> >>> >>> >>> cfg.layout = lay; >>> >>> >>> >>> cfg.channellabels = 'yes'; >>> >>> >>> >>> cfg.highlight = 'labels'; >>> >>> >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> >>> >>> cfg.comment = 'no'; >>> >>> >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> >>> correction') >>> >>> >>> >>> >>> >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> >>> >>> thanks and best >>> >>> >>> >>> Katrin >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> 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 >>> >>> >>> >>> _______________________________________________ >>> >>> fieldtrip mailing list >>> >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >> ---------------------------------------------------------------------------- >> ---- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.com >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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 >>> > >>> > >> ---------------------------------------------------------------------------- >> ---- >>> > >>> > Joseph Dien, PhD >>> > Research Associate >>> > Cognitive Neurology >>> > The Johns Hopkins University School of Medicine >>> > >>> > Lab E-mail: jdien1 at jhmi.edu >>> > Private E-mail: jdien07 at mac.com >>> > Office Phone: 410-614-3115 >>> > Cell Phone: 202-297-8117 >>> > Fax: 410-955-0188 >>> > http://joedien.com >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > ad2/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 4 >>> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >>> > From: "Caspar, Emilie" >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >>> > bad >>> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >>> > Content-Type: text/plain; charset="iso-8859-1" >>> > >>> > Hi Ashley, >>> > >>> > Maybe the mistake is you did not integrate in your script the >>> > command to save the rejection. Normally, with the following command, >>> > you will see in the Matlab Window that artifacts are correctly >>> > rejected after the "quit" button. >>> > >>> > clean_data = ft_rejectvisual(cfg, interpoldata); >>> > cfg.artfctdef.reject = 'complete'; >>> > cfg.artfctdef.feedback = 'yes'; >>> > cleandata = ft_rejectartifact(cfg,clean_data); >>> > >>> > Emilie >>> > >>> > >>> > >>> > >>> > >>> > Le 3 sept. 2014 ? 11:58, Ashley Greene >>> > > a ?crit : >>> > >>> > Hello, >>> > >>> > I have used the rejectvisual function in attempt to remove bad >>> > trials, but after marking them and pressing the quit button, >>> > although the command window states that the selected trials have >>> > been removed, there is no obvious change in the data; all of the >>> > trials are still intact. Have I overlooked something? >>> > >>> > Thanks, >>> > >>> > Ashley >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 985/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 5 >>> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >>> > From: Patricia Wollstadt >>> > To: fieldtrip at science.ru.nl >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: <540EEF94.9080601 at gmx.de> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > Hello Max, >>> > >>> > I added a few comments to the questions regarding individual >>> > parameters >>> > below. To address the general problem of TRENTOOL telling you, that >>> > there are not enough sample points in your data: From what I can see >>> > in >>> > your script, you probably don't have enough data points in each time >>> > series to robustly estimate TE. You analyze 800 ms of data sampled >>> > at >>> > 300 Hz, which gives you 240 samples per time series. Can you maybe >>> > avoid >>> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >>> > you >>> > analyze a longer time window of interest? >>> > Note that you also 'lose' data to embedding and the interaction >>> > delay: >>> > The first point that can be used for TE estimation is at max. >>> > embedding >>> > length + max. interaction delay in samples. For example: max. >>> > embedding >>> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >>> > max >>> > interaction delay of 30 ms = 9 samples. In this example, you would >>> > be >>> > left with 240 - 29 samples for TE estimation per trial. There is >>> > also >>> > the possibility to estimate time resolved TE/TE for shorter time >>> > windows >>> > of interest (see section 4.4 in the manual); however, this method >>> > requires the use of a GPU for TE estimation. >>> > >>> > I would further recommend to use the new pipeline for group >>> > statistics >>> > described in the manual in section 4.5 (the function >>> > 'TEgroup_calculate' >>> > is deprecated). The new pipeline allows you to reconstruct the >>> > interaction delay and uses the following functions (see also >>> > comments in >>> > the script): >>> > >>> > TEgroup_prepare -> prepares all data sets (all subjects/all >>> > conditions) for group analysis (this means finding common embedding >>> > parameters such that estimates are not biased between groups) >>> > InteractionDelayReconstruction_calculate -> estimates TE for >>> > individual data sets and all assumed interaction delays u >>> > InteractionDelayReconstruction_analyze -> reconstructs the >>> > interaction delay by selecting the u that maximizes TE for each >>> > channel >>> > TEgroup_stats -> calculate group statistics using a permutation test >>> > >>> > I can send you an example script for group TE analysis using this >>> > pipeline to get you started. I hope this helps you to get the group >>> > analysis running. Just write again if you're having trouble setting >>> > up >>> > the pipeline or something is not clear about the parameters/my >>> > comments. >>> > >>> > Best, >>> > Patricia >>> > >>> > >>> > >>> > >>> > On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not >>> >> 100% sure if it is appropriate to ask questions about it here, but >>> >> to >>> >> the best of my knowledge they do not have a mailing list and I saw >>> >> a >>> >> few trentool questions in the archives, so I'm going to assume it's >>> >> ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present >>> >> in the pipeline. Sorry in advance for the long post! Any help would >>> >> be >>> >> greatly appreciated as I'm a bit over my head on this but I think >>> >> I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data >>> >> that was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi is >>> >> in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within the toi, but beyond that are there any benefits to it being >>> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >>> >> the >>> >> toi is in seconds. The prediction time is the assumed interaction >>> >> delay between your two sources and should fit within your toi. In >>> >> general it is preferable to use the method for interaction delay >>> >> reconstruction for TE estimation, because it allows you to >>> >> reconstruct >>> >> the actual delay between your source and target times series. A >>> >> non-optimal u/interaction delay may cause an underestimation of TE, >>> >> so >>> >> it is recommended to use the pipeline for interaction delay >>> >> reconstruction whenever estimating TE for unknown delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, so it is best to limit the u range to values that are >>> >> physiologically plausible. >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the >>> >> sample rate and filters are used to determine the actthrvalue, but >>> >> I >>> >> don't actually know the calculation. 7.5 was a rough guess just to >>> >> test the pipeline. I'm also uncertain of what minnrtrials should >>> >> be.* >>> >> PW: You can set the actthrvalue based on the filtering you did >>> >> prior >>> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >>> >> shouldn't find an ACT higher than 30 samples, because you filtered >>> >> out >>> >> any components of the signal slower than 10 Hz/30 samples (given >>> >> your >>> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >>> >> would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> * >>> >> * >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm >>> >> yet to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* >>> >> PW: The Ragwitz criterion tries to find optimal embedding >>> >> parameters >>> >> dim and tau for the data. To do that, the method iteratively takes >>> >> all >>> >> possible combinations of dim and tau values that are provided in >>> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >>> >> these >>> >> combinations embed the data. To test an embedding, the method >>> >> builds >>> >> the embedding vectors from the data; it then tests for each point >>> >> how >>> >> well the next point in time can be predicted from the reference >>> >> point's nearest neighbours. So for each embedded point, the method >>> >> searches for the nearest neighbours and calculates the average of >>> >> those nearest neighbours. The difference between the >>> >> averaged/predicted point and the actual next point is the error of >>> >> the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested >>> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together with 'ragtausteps' specifies the tau values to be tested >>> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >>> >> that >>> >> the values here are factors that are later multiplied with the ACT >>> >> to >>> >> obtain the actual tau. 'repPred' is the number of points that will >>> >> be >>> >> used for the local prediction, i.e. the Ragwitz criterion will test >>> >> the local prediction and calculate the error for the first 100 >>> >> points >>> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >>> >> below >>> >> specify the type of neighbour search conducted by the Ragwitz >>> >> criterion: 'flagNei' tells the method to either conduct a kNN or >>> >> range >>> >> search; 'sizeNei' specifies the number of neighbours or the radius >>> >> to >>> >> be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> * >>> >> * >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> * >>> >> * >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.*TRENTOOL seems to handle data output very differently >>> >> from >>> >> fieldtrip and I've had trouble thinking through the most logical >>> >> way >>> >> to handle the data so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> * >>> >> * >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition >>> >> x subject .mat file, which as I said before is collectively the >>> >> same >>> >> as the 3 x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> * >>> >> * >>> >> *At this step I get the following error: >>> >> >>> >> Error using transferentropy (line 337) >>> >> \nTRENTOOL ERROR: not enough data points left after embedding >>> >> >>> >> Error in TEgroup_calculate (line 133) >>> >> [TEresult] = transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate >>> >> is a pipeline issue* (I noticed the example pipeline in trentool, >>> >> the >>> >> manual, and published methods articles all seem to have slightly or >>> >> significantly different pipeline compositions), *or if the error >>> >> is* >>> >> due to ACT, ragwitz optimization, or some other faulty >>> >> parameterization *on my part due to a lack of understanding of how >>> >> transfer entropy works on a more theoretical/mathematical level*. >>> >> If >>> >> the latter is the case, is there any relatively straightforward way >>> >> to >>> >> conceptualize this, or is this something where I'm just going to >>> >> have >>> >> to keep reading and rereading until it eventually makes sense? I've >>> >> already done quite a bit of that and it hasn't pierced my thick >>> >> skull >>> >> yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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: >>> > >> > 97f/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 6 >>> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >>> > From: Holger Krause >>> > To: FieldTrip discussion list >>> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >>> > days ago >>> > Message-ID: >>> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >>> > Content-Type: text/plain; charset="us-ascii" >>> > >>> > Dear developers, >>> > >>> > Could you please check the process for creation/publication of >>> > zip-files on >>> > the FTP server? The latest file I can find there is >>> > fieldtrip-20140906.zip. >>> > >>> > Thanks in advance, >>> > >>> > Holger >>> > >>> > >>> > ------------------------------ >>> > >>> > Message: 7 >>> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >>> > From: Max Cantor >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > This is immensely helpful, thank you. I was very confused about why >>> > some >>> > versions of the pipeline I saw were using group calculate and others >>> > were >>> > using interaction delay reconstruction and what that meant, and I >>> > think I >>> > have a more clear idea of what the different steps of the pipeline >>> > are >>> > doing. There are still a few things I'm a bit confused about though >>> > in >>> > terms of the pipeline. For instance, whether or not I need to do >>> > TEprepare >>> > before group prepare, and if I need to do graph analysis (which I'm >>> > not >>> > sure I fully understand but also haven't looked deeply into) before >>> > group >>> > stats. >>> > >>> > If you don't mind me taking you up on your offer, I think seeing >>> > your >>> > example script might help clarify some of these issues. >>> > >>> > Thank you! >>> > >>> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >>> > Patricia.Wollstadt at gmx.de> wrote: >>> > >>> >> Hello Max, >>> >> >>> >> I added a few comments to the questions regarding individual >>> >> parameters >>> >> below. To address the general problem of TRENTOOL telling you, that >>> >> there >>> >> are not enough sample points in your data: From what I can see in >>> >> your >>> >> script, you probably don't have enough data points in each time >>> >> series to >>> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >>> >> which >>> >> gives you 240 samples per time series. Can you maybe avoid >>> >> downsampling to >>> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >>> >> longer time >>> >> window of interest? >>> >> Note that you also 'lose' data to embedding and the interaction >>> >> delay: The >>> >> first point that can be used for TE estimation is at max. embedding >>> >> length >>> >> + max. interaction delay in samples. For example: max. embedding >>> >> length = >>> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >>> >> interaction >>> >> delay of 30 ms = 9 samples. In this example, you would be left with >>> >> 240 - >>> >> 29 samples for TE estimation per trial. There is also the >>> >> possibility to >>> >> estimate time resolved TE/TE for shorter time windows of interest >>> >> (see >>> >> section 4.4 in the manual); however, this method requires the use >>> >> of a GPU >>> >> for TE estimation. >>> >> >>> >> I would further recommend to use the new pipeline for group >>> >> statistics >>> >> described in the manual in section 4.5 (the function >>> >> 'TEgroup_calculate' is >>> >> deprecated). The new pipeline allows you to reconstruct the >>> >> interaction >>> >> delay and uses the following functions (see also comments in the >>> >> script): >>> >> >>> >> TEgroup_prepare -> prepares all data sets (all subjects/all >>> >> conditions) >>> >> for group analysis (this means finding common embedding parameters >>> >> such >>> >> that estimates are not biased between groups) >>> >> InteractionDelayReconstruction_calculate -> estimates TE for >>> >> individual data sets and all assumed interaction delays u >>> >> InteractionDelayReconstruction_analyze -> reconstructs the >>> >> interaction delay by selecting the u that maximizes TE for each >>> >> channel >>> >> TEgroup_stats -> calculate group statistics using a permutation >>> >> test >>> >> >>> >> I can send you an example script for group TE analysis using this >>> >> pipeline >>> >> to get you started. I hope this helps you to get the group analysis >>> >> running. Just write again if you're having trouble setting up the >>> >> pipeline >>> >> or something is not clear about the parameters/my comments. >>> >> >>> >> Best, >>> >> Patricia >>> >> >>> >> >>> >> >>> >> >>> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not 100% >>> >> sure if it is appropriate to ask questions about it here, but to >>> >> the best >>> >> of my knowledge they do not have a mailing list and I saw a few >>> >> trentool >>> >> questions in the archives, so I'm going to assume it's ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present in >>> >> the pipeline. Sorry in advance for the long post! Any help would be >>> >> greatly >>> >> appreciated as I'm a bit over my head on this but I think I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data that >>> >> was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi >>> >> is in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within >>> >> the toi, but beyond that are there any benefits to it being earlier >>> >> or >>> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >>> >> in >>> >> seconds. The prediction time is the assumed interaction delay >>> >> between your >>> >> two sources and should fit within your toi. In general it is >>> >> preferable to >>> >> use the method for interaction delay reconstruction for TE >>> >> estimation, >>> >> because it allows you to reconstruct the actual delay between your >>> >> source >>> >> and target times series. A non-optimal u/interaction delay may >>> >> cause an >>> >> underestimation of TE, so it is recommended to use the pipeline for >>> >> interaction delay reconstruction whenever estimating TE for unknown >>> >> delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, >>> >> so it is best to limit the u range to values that are >>> >> physiologically >>> >> plausible. >>> >> >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the sample >>> >> rate and filters are used to determine the actthrvalue, but I don't >>> >> actually know the calculation. 7.5 was a rough guess just to test >>> >> the >>> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >>> >> You can >>> >> set the actthrvalue based on the filtering you did prior to TE >>> >> analysis. If >>> >> you for example highpass filtered at 10 Hz, you shouldn't find an >>> >> ACT >>> >> higher than 30 samples, because you filtered out any components of >>> >> the >>> >> signal slower than 10 Hz/30 samples (given your sampling frequency >>> >> of 300 >>> >> Hz). So in this scenario the actthrvalue would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm yet >>> >> to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* PW: >>> >> The Ragwitz criterion tries to find optimal embedding parameters >>> >> dim and >>> >> tau for the data. To do that, the method iteratively takes all >>> >> possible >>> >> combinations of dim and tau values that are provided in cfgP.ragdim >>> >> and >>> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >>> >> embed >>> >> the data. To test an embedding, the method builds the embedding >>> >> vectors >>> >> from the data; it then tests for each point how well the next point >>> >> in time >>> >> can be predicted from the reference point's nearest neighbours. So >>> >> for each >>> >> embedded point, the method searches for the nearest neighbours and >>> >> calculates the average of those nearest neighbours. The difference >>> >> between >>> >> the averaged/predicted point and the actual next point is the error >>> >> of the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested by >>> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together >>> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >>> >> will >>> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >>> >> here are >>> >> factors that are later multiplied with the ACT to obtain the actual >>> >> tau. >>> >> 'repPred' is the number of points that will be used for the local >>> >> prediction, i.e. the Ragwitz criterion will test the local >>> >> prediction and >>> >> calculate the error for the first 100 points in your time series. >>> >> The two >>> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >>> >> neighbour >>> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >>> >> method to >>> >> either conduct a kNN or range search; 'sizeNei' specifies the >>> >> number of >>> >> neighbours or the radius to be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' >>> >> data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject >>> >> virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.* >>> >> TRENTOOL seems to handle data output very differently from >>> >> fieldtrip and >>> >> I've had trouble thinking through the most logical way to handle >>> >> the data >>> >> so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition x >>> >> subject .mat file, which as I said before is collectively the same >>> >> as the 3 >>> >> x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> *At this step I get the following error: Error using >>> >> transferentropy (line >>> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >>> >> Error in >>> >> TEgroup_calculate (line 133) [TEresult] = >>> >> transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate is a >>> >> pipeline issue* (I noticed the example pipeline in trentool, the >>> >> manual, >>> >> and published methods articles all seem to have slightly or >>> >> significantly >>> >> different pipeline compositions), *or if the error is* due to ACT, >>> >> ragwitz optimization, or some other faulty parameterization *on my >>> >> part >>> >> due to a lack of understanding of how transfer entropy works on a >>> >> more >>> >> theoretical/mathematical level*. If the latter is the case, is >>> >> there any >>> >> relatively straightforward way to conceptualize this, or is this >>> >> something >>> >> where I'm just going to have to keep reading and rereading until it >>> >> eventually makes sense? I've already done quite a bit of that and >>> >> it hasn't >>> >> pierced my thick skull yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing >>> >> >> listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie >> ldtrip >>> >> >>> >> >>> >> -- >>> >> ------------------------------------------------------------ >>> >> >>> >> 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 >>> >> >>> > >>> > >>> > >>> > -- >>> > Max Cantor >>> > Lab Manager >>> > Computational Neurolinguistics Lab >>> > University of Michigan >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 024/attachment.html> >>> > >>> > ------------------------------ >>> > >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > End of fieldtrip Digest, Vol 46, Issue 3 >>> > **************************************** >>> > >>> >>> >>> >>> Barbara Schorr, MSc >>> Clinical and Biological Psychology >>> University of Ulm >>> Albert-Einstein-Allee 47 >>> 89069 Ulm >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jim Herring, MSc. >> Neuronal Oscillations Group >> Centre for Cognitive Neuroimaging >> Donders Institute for Brain, Cognition and Behaviour >> Radboud University Nijmegen >> _______________________________________________ >> 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 >> >> End of fieldtrip Digest, Vol 46, Issue 5 >> **************************************** >> > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 46, Issue 6 > **************************************** > Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From hweeling.lee at gmail.com Thu Sep 18 14:30:16 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 18 Sep 2014 14:30:16 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity Message-ID: Dear all, I've got a question regarding extracting pairwise phase consistency of individual trials for each subject. Using the connectivity analyses tutorial as a reference, I extracted the PPC using the fourier information from the mtmfft (dpss taper). Here's an example of my code: cfg = []; cfg.output = 'fourier'; cfg.channel = {'all'}; cfg.method = 'mtmfft'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 5; % find the index for the c200 condition pre_c200_idx = find(data8.trialinfo == 200); cfg.trials = pre_c200_idx; cfg.foilim = [0 100]; % either the full range of frequencies (data2.hdr.Fs/2) or up to 100 Hz cfg.taper = 'dpss'; HLF_pre_c200 = ft_freqanalysis(cfg, data8); The PPC is extracted using this code: cfg = []; cfg.trials = 'all'; cfg.keeptrials = 'yes'; cfg.channel = {'all'}; cfg.removemean = 'yes'; cfg.method = 'wppc'; cfg.channelcmb = {cfg.channel, cfg.channel}; HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); Although I've specified to keep individual trials, my output is still a 'chan_freq' dimord variable. It does not contain any individual trial PPC information. Is there a way to extract the connectivity for individual trials? Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Thu Sep 18 15:32:54 2014 From: roeysc at gmail.com (Roey Schurr) Date: Thu, 18 Sep 2014 16:32:54 +0300 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: References: Message-ID: Dear Hweeling, Unfortunately I am not yet familiar with the PPC measure, but I guess that being a pairwise phase *consistancy* measure, it is defined over a set of trials, and can not be calculated for any individual trial (like coherence, or PLV)? Just quickly reading through "The pairwise phase consistency: A bias-free measure of rhythmic neuronal synchronization" (Vinck et al., 2010), this seems to be the case. Hope this helps, roey On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee wrote: > Dear all, > > I've got a question regarding extracting pairwise phase consistency of > individual trials for each subject. > > Using the connectivity analyses tutorial as a reference, I extracted the > PPC using the fourier information from the mtmfft (dpss taper). > > Here's an example of my code: > > cfg = []; > cfg.output = 'fourier'; > cfg.channel = {'all'}; > cfg.method = 'mtmfft'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 5; > > % find the index for the c200 condition > pre_c200_idx = find(data8.trialinfo == 200); > > cfg.trials = pre_c200_idx; > cfg.foilim = [0 100]; % either the full range of frequencies > (data2.hdr.Fs/2) or up to 100 Hz > cfg.taper = 'dpss'; > HLF_pre_c200 = ft_freqanalysis(cfg, data8); > > The PPC is extracted using this code: > > cfg = []; > cfg.trials = 'all'; > cfg.keeptrials = 'yes'; > cfg.channel = {'all'}; > cfg.removemean = 'yes'; > > cfg.method = 'wppc'; > cfg.channelcmb = {cfg.channel, cfg.channel}; > > HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); > > Although I've specified to keep individual trials, my output is still a > 'chan_freq' dimord variable. It does not contain any individual trial PPC > information. Is there a way to extract the connectivity for individual > trials? > > Thanks. > > Cheers, > Hweeling > > > _______________________________________________ > 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 julian.keil at gmail.com Thu Sep 18 16:23:15 2014 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 18 Sep 2014 16:23:15 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: References: Message-ID: Dear Hweeling, if you're looking for a single trial measure of phase relationship, you might want to have a look at the attached papers. In both papers, single trial phase relationship between cortical sources is described as the phase difference subtracted from the mean phase difference (i.e. Take the phase difference between two channels, average over trials and take the difference between the single trial phase difference and the mean phase difference). I hope thais goes into the right direction of what you're asking for. Good luck. Julian Keil, J., Müller, N., Hartmann, T., & Weisz, N. (2014). Prestimulus beta power and phase synchrony influence the sound-induced flash illusion. Cerebral Cortex, 24(5), 1278–1288. doi:10.1093/cercor/bhs409 Hanslmayr, S., Aslan, A., Staudigl, T., Klimesch, W., Herrmann, C. S., & Bäuml, K.-H. (2007). Prestimulus oscillations predict visual perception performance between and within subjects. NeuroImage, 37(4), 1465–1473. doi:10.1016/j.neuroimage.2007.07.011 ******************** 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 18.09.2014 um 15:32 schrieb Roey Schurr: > Dear Hweeling, > > Unfortunately I am not yet familiar with the PPC measure, but I guess that being a pairwise phase consistancy measure, it is defined over a set of trials, and can not be calculated for any individual trial (like coherence, or PLV)? > > Just quickly reading through "The pairwise phase consistency: A bias-free measure of rhythmic neuronal synchronization" (Vinck et al., 2010), this seems to be the case. > > Hope this helps, > roey > > On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee wrote: > Dear all, > > I've got a question regarding extracting pairwise phase consistency of individual trials for each subject. > > Using the connectivity analyses tutorial as a reference, I extracted the PPC using the fourier information from the mtmfft (dpss taper). > > Here's an example of my code: > > cfg = []; > cfg.output = 'fourier'; > cfg.channel = {'all'}; > cfg.method = 'mtmfft'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 5; > > % find the index for the c200 condition > pre_c200_idx = find(data8.trialinfo == 200); > > cfg.trials = pre_c200_idx; > cfg.foilim = [0 100]; % either the full range of frequencies (data2.hdr.Fs/2) or up to 100 Hz > cfg.taper = 'dpss'; > HLF_pre_c200 = ft_freqanalysis(cfg, data8); > > The PPC is extracted using this code: > > cfg = []; > cfg.trials = 'all'; > cfg.keeptrials = 'yes'; > cfg.channel = {'all'}; > cfg.removemean = 'yes'; > > cfg.method = 'wppc'; > cfg.channelcmb = {cfg.channel, cfg.channel}; > > HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); > > Although I've specified to keep individual trials, my output is still a 'chan_freq' dimord variable. It does not contain any individual trial PPC information. Is there a way to extract the connectivity for individual trials? > > Thanks. > > Cheers, > Hweeling > > > _______________________________________________ > 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 tobias.staudigl at uni-konstanz.de Thu Sep 18 16:39:58 2014 From: tobias.staudigl at uni-konstanz.de (Tobias Staudigl) Date: Thu, 18 Sep 2014 16:39:58 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: References: Message-ID: <541AEEBE.9090503@uni-konstanz.de> Dear Hweeling, I agree with Roey that coherence/PLV cannot be calculated for individual trials. However, you could try to use the deviation (in each single trial) from the mean phase as an approximation. Good luck! Tobias Am 18.09.2014 15:32, schrieb Roey Schurr: > Dear Hweeling, > > Unfortunately I am not yet familiar with the PPC measure, but I guess > that being a pairwise phase *consistancy* measure, it is defined over > a set of trials, and can not be calculated for any individual trial > (like coherence, or PLV)? > > Just quickly reading through "The pairwise phase consistency: A > bias-free measure of rhythmic neuronal synchronization" (Vinck et al., > 2010), this seems to be the case. > > Hope this helps, > roey > > On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee > wrote: > > Dear all, > > I've got a question regarding extracting pairwise phase > consistency of individual trials for each subject. > > Using the connectivity analyses tutorial as a reference, I > extracted the PPC using the fourier information from the mtmfft > (dpss taper). > > Here's an example of my code: > > cfg = []; > cfg.output = 'fourier'; > cfg.channel = {'all'}; > cfg.method = 'mtmfft'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 5; > % find the index for the c200 condition > pre_c200_idx = find(data8.trialinfo == 200); > cfg.trials = pre_c200_idx; > cfg.foilim = [0 100]; % either the full range of > frequencies (data2.hdr.Fs/2) or up to 100 Hz > cfg.taper = 'dpss'; > HLF_pre_c200 = ft_freqanalysis(cfg, data8); > > The PPC is extracted using this code: > > cfg = []; > cfg.trials = 'all'; > cfg.keeptrials = 'yes'; > cfg.channel = {'all'}; > cfg.removemean = 'yes'; > cfg.method = 'wppc'; > cfg.channelcmb = {cfg.channel, cfg.channel}; > HLF_pre_c200wppc = ft_connectivityanalysis(cfg, > HLF_pre_c200); > > Although I've specified to keep individual trials, my output is > still a 'chan_freq' dimord variable. It does not contain any > individual trial PPC information. Is there a way to extract the > connectivity for individual trials? > > Thanks. > > Cheers, > Hweeling > > > _______________________________________________ > 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 -- Dr. Tobias Staudigl Fachbereich Psychologie - ZPR Postfach ZPR 78457 Konstanz ZPR, Haus 12 Tel.: +49 (0)7531 / 88 - 5703 -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Thu Sep 18 19:36:40 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Thu, 18 Sep 2014 19:36:40 +0200 (CEST) Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs In-Reply-To: <867006743.3066178.1410775764568.JavaMail.root@bcbl.eu> Message-ID: <533541797.8928620.1411061800427.JavaMail.root@sculptor.zimbra.ru.nl> Hi Fred, Thank you for let us know this documentation discrepancy now corrected (https://code.google.com/p/fieldtrip/source/detail?r=9813) Regarding your question, if you're computing induced TFR (power estimates for each single-trial) the cfg.combinemethod='sum' (default) method in ft_combineplanar will sum the vertical and horizontal components of each channel. As power is positive (squared), 1) and 2) options will ended up in the same result (although 2) simplifies the channel representation). Might be you already knew it but you can use fieldtrip functions to test these type of questions and figure out yourself (see tfr.png figure, second and third rows): http://fieldtrip.fcdonders.nl/example/combineplanar_pipelineorder Above I made a simulation that basically tested you question. In addition, I also simulate ERFs asking the very same question. I know you did not ask for it but as the ft_combineplanar documentation did not clarify this issue, I took the chance to test it. You'll see that with ERFs the order of the ft_combineplanar call in the pipeline matters (see erf.png figure and the wiki example url above). The reason is because ft_combineplanar ('sum' method) for raw and timelock time of data, squares the vertical and the horizontal planar components (nonlinear transformation). Then, for ERF computations, one should first compute single-trial average first and the compute the megplanar/combineplanar. This is very important because the alternative (combine planar at single trial and then average) is not an ERF: ft_combineplanar will square the signal and random noise (plus time jittered components) will be (positively) added to the grand-mean (wont be cancelled by the negative components of the signal, as ERF approach assumes). I hope it helps. best, Diego ----- Original Message ----- > From: "Frédéric Roux" > To: "FieldTrip discussion list" > Sent: Monday, 15 September, 2014 12:09:24 PM > Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs > Dear all, > > my question relates to the computation of combined planar gradients > using the ft_combineplanar function. > > Our data has been recorded with an Elekta Neuromag 306 channel system, > and I would like to know if it is "safe" to compute combined gradients > before calling ft_freqstatistics, if the input data contains single > trial TFRs. > > The reason why I am asking is because in the documentation of the > function it says > % Use as > % [data] = ft_combineplanar(cfg, data) > % where data contains an averaged planar gradient (either ERF or TFR). > > However, the following tutorial suggests that this can be safely > applied if > the input data contains TFRs which have been computed with the > cfg.keeptrials = 'yes' option: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > > I am bit confused as both information (the fieldtrip documentation and > the tutorial) > seem to contradict each other. > > The 2 options that are see are: > > 1) compute TFRs with cfg.keeptrials = 'yes', then call > ft_frestatistics, then call ft_combineplanar > by using the output of ft_freqstatistics as input for the > ft_combineplanar function. > 2) compute TFRs with cfg.keeptrials = 'yes', then call > ft_combineplanar, then call ft_freqstatistics > > Could anyone with experience on this issue please let me know what the > best way > to proceed would be? > > 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/ -------------- next part -------------- A non-text attachment was scrubbed... Name: tfr.png Type: image/png Size: 40910 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: erf.png Type: image/png Size: 65168 bytes Desc: not available URL: From v.piai.research at gmail.com Fri Sep 19 01:13:14 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 18 Sep 2014 16:13:14 -0700 Subject: [FieldTrip] weird topo: due to missing sensors? and [Reference to non-existent field 'chanori'] Message-ID: <541B670A.7070902@gmail.com> Hello FT-ers, I was wondering whether anyone has an idea of what could be going on in this topo of the group-averaged ERF (difference between 2 conditions, planar gradient). At first I thought that could be muscle activity, but that pattern seems to hold regardless of the time window I choose (and besides when I plot the EMG of some facial muscles, they don't differ from each other...). What I noted now is that different sensors were excluded for different participants around those areas so I'm suspecting that the missing sensors are causing the problem (because of the way the data is interpolated for plotting?). I tried different options in ft_topoplot but all my attempts were in vain. Next, I tried using ft_channelrepair. I assumed that the correct order of processing steps would be to repair channels first, and then calculate planar gradients after. If I follow that procedure, I get the following error when running ft_megplanar (FT version 20140518): Reference to non-existent field 'chanori'. Error in ft_megplanar (line 242) chanposnans = any(isnan(sens.chanpos(:))) || any(isnan(sens.chanori(:))); If anyone could shed some light on these issues, it would be great! Thanks a lot, Vitoria -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hjahgfhc.png Type: image/png Size: 14934 bytes Desc: not available URL: From stephen.whitmarsh at gmail.com Fri Sep 19 09:03:18 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 19 Sep 2014 09:03:18 +0200 Subject: [FieldTrip] weird topo: due to missing sensors? and [Reference to non-existent field 'chanori'] In-Reply-To: <541B670A.7070902@gmail.com> References: <541B670A.7070902@gmail.com> Message-ID: Hi Vitoria, Yes, I guess it might be the missing channels somehow. Concerning the missing chanori; I think you throw away more than just the data when you remove a channel, and when you restore it later on, things like the orientation, location etc. is not in the data anymore. I would therefor never throw away a channel, but rather fix it, to avoid these kinds of problems. Anyway, I think you can solve it by copying the .grad structure from an earier point (before having removed channels) into the data after fixing. If this doesn't solve the topo problem, have you tried dividing the difference by the sum of the conditions or otherwise normalizing the difference for each subject? E.g. (Condition A - B) / (Condition A + B). Good luck! STephen On 19 September 2014 01:13, Vitoria Piai wrote: > Hello FT-ers, > > I was wondering whether anyone has an idea of what could be going on in > this topo of the group-averaged ERF (difference between 2 conditions, > planar gradient). At first I thought that could be muscle activity, but > that pattern seems to hold regardless of the time window I choose (and > besides when I plot the EMG of some facial muscles, they don't differ from > each other...). > What I noted now is that different sensors were excluded for different > participants around those areas so I'm suspecting that the missing sensors > are causing the problem (because of the way the data is interpolated for > plotting?). > > > I tried different options in ft_topoplot but all my attempts were in vain. > Next, I tried using ft_channelrepair. I assumed that the correct order of > processing steps would be to repair channels first, and then calculate > planar gradients after. If I follow that procedure, I get the following > error when running ft_megplanar (FT version 20140518): > Reference to non-existent field 'chanori'. > > Error in ft_megplanar (line 242) > chanposnans = any(isnan(sens.chanpos(:))) || any(isnan(sens.chanori(:))); > > If anyone could shed some light on these issues, it would be great! > Thanks a lot, > Vitoria > > _______________________________________________ > 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: hjahgfhc.png Type: image/png Size: 14934 bytes Desc: not available URL: From spa268 at nyu.edu Fri Sep 19 10:59:51 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Fri, 19 Sep 2014 12:59:51 +0400 Subject: [FieldTrip] Choosing a subset of sensors with a uniform distribution over the head Message-ID: Hello, I am trying to plot a multiplot of MEG sensors over the head, but since I have over 200 sensors I don't want to plot them all (it becomes more or less illegible; see http://i.imgur.com/lT93i2T.png). What I would like to do is take half or even a third of the channels, and plot them at double or triple the size, as in http://i.imgur.com/6wcrNFS.png (which I created by just plotting the even-numbered channels). As you can see from this image, simply selecting the even-numbered channels in my array doesn't give a nice symmetrical or uniform distribution. Is there any way (for example, somehow using the neighbours structure) to decimate the channels or to otherwise choose a subset of channels that is uniformly distributed over the head? Thank you very much, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Sep 19 12:15:31 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 19 Sep 2014 12:15:31 +0200 Subject: [FieldTrip] Choosing a subset of sensors with a uniform distribution over the head In-Reply-To: References: Message-ID: <541C0243.5020001@donders.ru.nl> Hi Stephen, there is no predfine FieldTrip way for this. You could try to this via the neighbour template. If you know that the neighbours are well defined and only the nearest neighbours are defined as neighbours (the triangulation method might do that), you can loop through the neighbour definition, and throw out all neighbours of channel i from the neighbour definition, something like: > for i=1:numel(neighbs) > > % find all neighbouring channels of channel i > neighbbix = match_str(neighbs(i).neighblabel, {neighb(:).label}); > > % throw them out > neighb(neighbidx) = []; > > end what you end up with is a neighbour structure with all channels that are not adjacent to one another, i.e. a reduced number of channels. Not sure if this works, but you might give it a try. Best, Jörn On 9/19/2014 10:59 AM, Stephen Politzer-Ahles wrote: > Hello, > > I am trying to plot a multiplot of MEG sensors over the head, but > since I have over 200 sensors I don't want to plot them all (it > becomes more or less illegible; see http://i.imgur.com/lT93i2T.png). > What I would like to do is take half or even a third of the channels, > and plot them at double or triple the size, as in > http://i.imgur.com/6wcrNFS.png (which I created by just plotting the > even-numbered channels). As you can see from this image, simply > selecting the even-numbered channels in my array doesn't give a nice > symmetrical or uniform distribution. Is there any way (for example, > somehow using the neighbours structure) to decimate the channels or to > otherwise choose a subset of channels that is uniformly distributed > over the head? > > Thank you very much, > Steve > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > _______________________________________________ > 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 N.Jain at tudelft.nl Fri Sep 19 16:16:55 2014 From: N.Jain at tudelft.nl (Nishant Jain) Date: Fri, 19 Sep 2014 14:16:55 +0000 Subject: [FieldTrip] Making Layout from Digitizer file Message-ID: <664C5D9FB00A6046B7E9E6EAB9A7EBE2103DB670@SRV384.tudelft.net> Hello, I have a .res digitizer file with 3D electrode positions of a non-standard BioSemi cap. To make a layout, I thought to use ft_prepare_layout. One of the options with that function is to make a structure of the electrode positions, which is possible since I can have the 3D coordinates on MATLAB. However, there is no information on the format of the cfg structure required by this function. I tried making a cfg.elec which contains a 160x3 matrix, but it gives me errors. How can I use the 3D position data to construct a layout? Best regards, Nishant Jain PhD candidate, 4D EEG Project. TU Delft / Department of Biomechatronics & Biorobotics Mekelweg 2 2628 CD Delft E n.jain at tudelft.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Fri Sep 19 16:50:58 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Fri, 19 Sep 2014 16:50:58 +0200 Subject: [FieldTrip] Problem redefining trials with different event as zero point Message-ID: Dear Fieldtrippers, I would like to redefine my trials using another event as zero point. So I defined trials on a certain event and preprocessed them. All trials also contain another event. Now I want to redefine them using this other event as zero point and cutting 1 sec before and 1 sec after. I tried simply using the definetrial function again: cfg = [] cfg.dataset= strcat(sb,'mov_ica_cleaned.mat') cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'resp' cfg.trialdef.prestim = -1 cfg.trialdef.poststim = 1 mov_data_small = ft_definetrial(cfg) But then I get the error message Error using ft_read_header (line 1833) unsupported header format (matlab) Error in ft_trialfun_general (line 71) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); Error in ft_definetrial (line 169) [trl, event] = feval(cfg.trialfun, cfg); Somebody able to help me? Thanks and best Katrin >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Fri Sep 19 23:31:12 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Fri, 19 Sep 2014 17:31:12 -0400 Subject: [FieldTrip] Problem redefining trials with different event as zero point In-Reply-To: References: Message-ID: Hi Katrin, Perhaps you should be using the ft_redefinetrial instead. Best, Raquel On Fri, Sep 19, 2014 at 10:50 AM, KatrinH Heimann wrote: > Dear Fieldtrippers, > > I would like to redefine my trials using another event as zero point. So I > defined trials on a certain event and preprocessed them. All trials also > contain another event. Now I want to redefine them using this other event > as zero point and cutting 1 sec before and 1 sec after. > I tried simply using the definetrial function again: > > cfg = [] > > cfg.dataset= strcat(sb,'mov_ica_cleaned.mat') > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 'resp' > > cfg.trialdef.prestim = -1 > > cfg.trialdef.poststim = 1 > > > > mov_data_small = ft_definetrial(cfg) > > > > But then I get the error message > > Error using ft_read_header (line 1833) > unsupported header format (matlab) > > Error in ft_trialfun_general (line 71) > hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); > > Error in ft_definetrial (line 169) > [trl, event] = feval(cfg.trialfun, cfg); > > > Somebody able to help me? > > Thanks and best > Katrin > > >> > > _______________________________________________ > 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 gamaliel.ghu at gmail.com Sat Sep 20 07:10:14 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Sat, 20 Sep 2014 02:10:14 -0300 Subject: [FieldTrip] problem in dipole simulation Message-ID: Hi all I followed the tips above to simulate a dipole source on my own head model generated from MRIs. However, using information from:http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit I could not simulate anything. Only one image is blank. The code I am using is as follows: cfg = []; cfg.vol = vol; % See above cfg.elec = elec; % See above cfg.dip.pos = [0 0 0]; cfg.dip.mom = [2 2 2]; % Note, it Should be transposed cfg.dip.frequency = 10; cfg.ntrials = 10; cfg.triallength = 1; % seconds cfg.fsample = 25; % Hz raw1 = ft_dipolesimulation (cfg); avg1 = ft_timelockanalysis([], raw1); plot (avg1.time, avg1.avg); % Plot the timecourse where: vol = ft_prepare_headmodel volumes generated from the segmentation of my resonances. and ft_read_sens elec = ('standard_1020.elc'); to run the script the result is a blank image. and Matlab tells me the following: using headmodel specified in the configuration using electrodes specified in the configuration Determining source compartment (1) projecting electrodes on skin surface electrode and system combine combining transfer matrix computing simulated data computing simulated trial data for 10 RMS value of simulated data is NaN the call to "ft_dipolesimulation" took 4 seconds the input is raw Data with 97 channels and 10 trials Warning: the data does not Contain a definition trial >** In utilities \ private \ warning_once at 158 ** In utilities \ private \ fixsampleinfo at 66 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 Warning: sampleinfo by reconstructing Assuming That the trials are consecutive segments of a continuous recording >** In utilities \ private \ warning_once at 158 ** In utilities \ private \ fixsampleinfo at 79 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 averaging trials trial averaging 10 of 10 the call to "ft_timelockanalysis" took 1 seconds I hope you can help greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Sun Sep 21 14:19:16 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Sun, 21 Sep 2014 14:19:16 +0200 Subject: [FieldTrip] Fwd: Real-time Functional Imaging and Neurofeedback conference In-Reply-To: References: Message-ID: <29946EDE-11E8-40BA-B103-BB8B0DC02D6F@donders.ru.nl> On 21 Sep 2014, at 10:10, Blefari Maria Laura wrote: > Dear all, > > We are very glad to announce that the abstract submission for the Real-time Functional Imaging and Neurofeedback (rtFIN) conference is now open! > > The conference would be held in Gainesville (Florida, USA) during 12-13 February, 2015. > > You may find all relevant information regarding conference, registration and abstract submission here:http://reg.conferences.dce.ufl.edu/rtFIN. > > Note that the abstracts are due on or before October 17th, 2014. The format of the abstract is similar to that of the Society for Neuroscience (2300 characters). > > We are looking forward to seeing you all in Gainesville in February! > > > Best regards, your co-organizers, > > > Ranganatha Sitaram, University of Florida > Maria Laura Blefari, Swiss Federal Institute of Technology Lausanne > Sven Haller, University of Geneva > Jarrod Lewis-Peacock, University of Texas at Austin > Frank Scharnowski, University of Geneva > Luke Stoeckel, Harvard University / National Institutes of Health > James Sulzer, University of Texas at Austin > Nikolaus Weiskopf, University College London -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Mon Sep 22 10:32:07 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 22 Sep 2014 10:32:07 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: <541AEEBE.9090503@uni-konstanz.de> References: <541AEEBE.9090503@uni-konstanz.de> Message-ID: Dear Roey, Julian and Tobias, Thanks for the feedback. Given your suggestions, I now intend to try to calculate the deviation of single trials from the mean phase difference (PLV). Pardon my ignorance, however, I still experience some problems with calculating plv for single trials. Using this code to extract PLV: cfg = []; cfg.trials = 'all'; cfg.keeptrials = 'yes'; cfg.channel = {'all'}; cfg.removemean = 'yes'; cfg.method = 'plv'; cfg.channelcmb = {cfg.channel, cfg.channel}; HLF_pre_c200plv = ft_connectivityanalysis(cfg, HLF_pre_c200); Although I've specified to keep individual trials, ft_connectivityanalysis still show averaged PLV across trials for the output. Could anyone of you, or someone else, kindly highlight my mistake in my calculation? Thank you very much! Best wishes, Hweeling On 18 September 2014 16:39, Tobias Staudigl wrote: > Dear Hweeling, > > I agree with Roey that coherence/PLV cannot be calculated for individual > trials. > However, you could try to use the deviation (in each single trial) from > the mean phase as an approximation. > > Good luck! > Tobias > > > > Am 18.09.2014 15:32, schrieb Roey Schurr: > > Dear Hweeling, > > Unfortunately I am not yet familiar with the PPC measure, but I guess > that being a pairwise phase *consistancy* measure, it is defined over a > set of trials, and can not be calculated for any individual trial (like > coherence, or PLV)? > > Just quickly reading through "The pairwise phase consistency: A > bias-free measure of rhythmic neuronal synchronization" (Vinck et al., > 2010), this seems to be the case. > > Hope this helps, > roey > > On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee > wrote: > >> Dear all, >> >> I've got a question regarding extracting pairwise phase consistency of >> individual trials for each subject. >> >> Using the connectivity analyses tutorial as a reference, I extracted >> the PPC using the fourier information from the mtmfft (dpss taper). >> >> Here's an example of my code: >> >> cfg = []; >> cfg.output = 'fourier'; >> cfg.channel = {'all'}; >> cfg.method = 'mtmfft'; >> cfg.keeptrials = 'yes'; >> cfg.tapsmofrq = 5; >> >> % find the index for the c200 condition >> pre_c200_idx = find(data8.trialinfo == 200); >> >> cfg.trials = pre_c200_idx; >> cfg.foilim = [0 100]; % either the full range of frequencies >> (data2.hdr.Fs/2) or up to 100 Hz >> cfg.taper = 'dpss'; >> HLF_pre_c200 = ft_freqanalysis(cfg, data8); >> >> The PPC is extracted using this code: >> >> cfg = []; >> cfg.trials = 'all'; >> cfg.keeptrials = 'yes'; >> cfg.channel = {'all'}; >> cfg.removemean = 'yes'; >> >> cfg.method = 'wppc'; >> cfg.channelcmb = {cfg.channel, cfg.channel}; >> >> HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); >> >> Although I've specified to keep individual trials, my output is still a >> 'chan_freq' dimord variable. It does not contain any individual trial PPC >> information. Is there a way to extract the connectivity for individual >> trials? >> >> Thanks. >> >> Cheers, >> Hweeling >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Dr. Tobias Staudigl > Fachbereich Psychologie - ZPR > Postfach ZPR > 78457 Konstanz > ZPR, Haus 12 > Tel.: +49 (0)7531 / 88 - 5703 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ================================================= 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 julian.keil at gmail.com Mon Sep 22 11:09:29 2014 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 22 Sep 2014 11:09:29 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: References: <541AEEBE.9090503@uni-konstanz.de> Message-ID: <85CB4B7D-8FA5-4FE7-9DE1-CDBC5E01FA07@gmail.com> Dear Hweeling, sorry to have been so unclear. Unfortunately, you'll have to leave the prepared field trip code a bit to compute the phase deviance. What you'll want to do is: 1. Compute the Phase for all channels and trials: Do a mtmfft with ft_freqanalysis and take the angle 2. For each trial, compute the phase difference between all channels: Use the circa_dist-function from the CircStat-Toolbox (Ask Google for the link) 3. For each combination, compute the mean over trials: Use the circa_mean function from the above mentioned toolbox 4. For each combination, compute the deviance from the mean Again, circa_dist is your friend here. Again, PLV or Coherence don't work on the single trial level, thus ft_connectivityanalysis will not work for you. Good Luck, Julian Am 22.09.2014 um 10:32 schrieb Hwee Ling Lee: > Dear Roey, Julian and Tobias, > > Thanks for the feedback. > > Given your suggestions, I now intend to try to calculate the deviation of single trials from the mean phase difference (PLV). Pardon my ignorance, however, I still experience some problems with calculating plv for single trials. > > Using this code to extract PLV: > > cfg = []; > cfg.trials = 'all'; > cfg.keeptrials = 'yes'; > cfg.channel = {'all'}; > cfg.removemean = 'yes'; > cfg.method = 'plv'; > cfg.channelcmb = {cfg.channel, cfg.channel}; > HLF_pre_c200plv = ft_connectivityanalysis(cfg, HLF_pre_c200); > > Although I've specified to keep individual trials, ft_connectivityanalysis still show averaged PLV across trials for the output. Could anyone of you, or someone else, kindly highlight my mistake in my calculation? > > Thank you very much! > > Best wishes, > Hweeling > > > > On 18 September 2014 16:39, Tobias Staudigl wrote: > Dear Hweeling, > > I agree with Roey that coherence/PLV cannot be calculated for individual trials. > However, you could try to use the deviation (in each single trial) from the mean phase as an approximation. > > Good luck! > Tobias > > > > Am 18.09.2014 15:32, schrieb Roey Schurr: >> Dear Hweeling, >> >> Unfortunately I am not yet familiar with the PPC measure, but I guess that being a pairwise phase consistancy measure, it is defined over a set of trials, and can not be calculated for any individual trial (like coherence, or PLV)? >> >> Just quickly reading through "The pairwise phase consistency: A bias-free measure of rhythmic neuronal synchronization" (Vinck et al., 2010), this seems to be the case. >> >> Hope this helps, >> roey >> >> On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee wrote: >> Dear all, >> >> I've got a question regarding extracting pairwise phase consistency of individual trials for each subject. >> >> Using the connectivity analyses tutorial as a reference, I extracted the PPC using the fourier information from the mtmfft (dpss taper). >> >> Here's an example of my code: >> >> cfg = []; >> cfg.output = 'fourier'; >> cfg.channel = {'all'}; >> cfg.method = 'mtmfft'; >> cfg.keeptrials = 'yes'; >> cfg.tapsmofrq = 5; >> >> % find the index for the c200 condition >> pre_c200_idx = find(data8.trialinfo == 200); >> >> cfg.trials = pre_c200_idx; >> cfg.foilim = [0 100]; % either the full range of frequencies (data2.hdr.Fs/2) or up to 100 Hz >> cfg.taper = 'dpss'; >> HLF_pre_c200 = ft_freqanalysis(cfg, data8); >> >> The PPC is extracted using this code: >> >> cfg = []; >> cfg.trials = 'all'; >> cfg.keeptrials = 'yes'; >> cfg.channel = {'all'}; >> cfg.removemean = 'yes'; >> >> cfg.method = 'wppc'; >> cfg.channelcmb = {cfg.channel, cfg.channel}; >> >> HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); >> >> Although I've specified to keep individual trials, my output is still a 'chan_freq' dimord variable. It does not contain any individual trial PPC information. Is there a way to extract the connectivity for individual trials? >> >> Thanks. >> >> Cheers, >> Hweeling >> >> >> _______________________________________________ >> 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 > > > -- > Dr. Tobias Staudigl > Fachbereich Psychologie - ZPR > Postfach ZPR > 78457 Konstanz > ZPR, Haus 12 > Tel.: +49 (0)7531 / 88 - 5703 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > ================================================= > 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 tzvetan.popov at uni-konstanz.de Mon Sep 22 11:22:14 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 22 Sep 2014 11:22:14 +0200 Subject: [FieldTrip] Making Layout from Digitizer file In-Reply-To: <664C5D9FB00A6046B7E9E6EAB9A7EBE2103DB670@SRV384.tudelft.net> References: <664C5D9FB00A6046B7E9E6EAB9A7EBE2103DB670@SRV384.tudelft.net> Message-ID: <9E29C938-1CFC-4639-8727-085E8889D3C6@uni-konstanz.de> Hi Nishant, > However, there is no information on the format of the cfg structure required by this function. I tried making a cfg.elec which contains a 160x3 matrix, but it gives me errors. > > How can I use the 3D position data to construct a layout? could you try some of the steps explained here http://fieldtrip.fcdonders.nl/tutorial/layout It sounds like this is what you need. best tzvetan -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at psych.ru.nl Mon Sep 22 12:44:11 2014 From: s.vanpelt at psych.ru.nl (Stan van Pelt) Date: Mon, 22 Sep 2014 12:44:11 +0200 (CEST) Subject: [FieldTrip] leadfields MNI-coordinates Message-ID: <035901cfd652$2557ff20$7007fd60$@vanpelt@psych.ru.nl> Dear FieldTrippers, For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to compute leadfields at specific (MNI-)coordinates in the brain. I am trying to find out how that is most easily done using FieldTrip - The most intuitive way seems to me to warp the MNI template to the individual's brain (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_indi vidual_head_space_that_are_all_aligned_in_mni_space) , and then apply the warping parameters to the ROI's MNI-coordinates, and enter the subsequent CTF-coordinates into ft_prepare_leadfield. However, I am not sure where exactly I can find these parameters, and how to apply them. Are these the ones in [gridsrc].params (output ft_sourcemodel)? - Alternatively, should I run ft_volumenormalise to warp the brain to MNI-space, and then inversely apply the warping parameters to the ROI's MNI-coordinates? Again, where can I find the warping parameters in this case, and how should they be applied? Best, Stan - Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Centre for Cognition Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Sep 22 13:19:38 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 22 Sep 2014 13:19:38 +0200 Subject: [FieldTrip] leadfields MNI-coordinates In-Reply-To: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> References: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Hi Stan, Have a look at this recent thread on the list (4 messages, Tom and me, this is the starting message): http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008362.html I think that might help you. Groetjes, Eelke On 22 September 2014 12:44, Stan van Pelt wrote: > Dear FieldTrippers, > > > > For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to compute > leadfields at specific (MNI-)coordinates in the brain. I am trying to find > out how that is most easily done using FieldTrip > > > > - The most intuitive way seems to me to warp the MNI template to the > individual’s brain > (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) > , and then apply the warping parameters to the ROI’s MNI-coordinates, and > enter the subsequent CTF-coordinates into ft_prepare_leadfield. However, I > am not sure where exactly I can find these parameters, and how to apply > them. Are these the ones in [gridsrc].params (output ft_sourcemodel)? > > - Alternatively, should I run ft_volumenormalise to warp the brain to > MNI-space, and then inversely apply the warping parameters to the ROI’s > MNI-coordinates? Again, where can I find the warping parameters in this > case, and how should they be applied? > > > > Best, > > Stan > > > > - > Stan van Pelt, PhD > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > Montessorilaan 3, B.01.34 > 6525 HR Nijmegen, the Netherlands > tel: +31 24 3616288 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From agreene24 at gmail.com Mon Sep 22 15:27:43 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Mon, 22 Sep 2014 22:27:43 +0900 Subject: [FieldTrip] denoise_pca error Message-ID: Hello all, I hope someone will be able to help with this. I'm trying to run the denoise_pca function on data after preprocessing, but I continue to get the following error: Error using ./ Matrix dimensions must agree. Error in ft_denoise_pca (line 193) s1 = s./max(s(:)); Could it be due to the use of the default for refchannel? Forgive me for asking such simple questions, but how do I go about choosing the reference channel? Do I just choose the cleanest channel from that particular set of preprocessed data? Thanks in advance, Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gamaliel.ghu at gmail.com Mon Sep 22 16:32:21 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Mon, 22 Sep 2014 11:32:21 -0300 Subject: [FieldTrip] Questions about matrix lead field Message-ID: Hi Experts My problem is as follows: I need generate a 3D head model from a resonance, then co register this head model with 10-20 electrode system to create my lead field matrix. According to the tutorial: "Creating a volume conduction model of the head for source reconstruction of EEG-data" I have generated head model but I do not have the lead field correctly done, because I do not know that function gives me the coregistration with the electrode system and tutorial only goes to show the volume generated with the electrodes on the surface. Finally I need is to know how I can co-register my head model with my electrode system to generate my lead field matrix. I also need to know how into matrix can I simulate dipole sources for then perform analysis of source reverse. I hope you can help greetings Bless -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.braukmann at donders.ru.nl Mon Sep 22 16:43:19 2014 From: r.braukmann at donders.ru.nl (Ricarda Braukmann) Date: Mon, 22 Sep 2014 16:43:19 +0200 Subject: [FieldTrip] Reading in .bdf files Message-ID: Hi everyone, I have a question regarding reading in Biosemi .bdf files. I followed the example on the ft website to read in a .bdf file, and - although it does not give an error- , the data looks very odd. In the ft_databrowser for example the vertical scale is [ -178000 178000 ] which seems very werid to me. I tried re-referencing the data, like in the example, using channel 'EXG5', but this did not help. Is there anyone who has experience with reading in biosemi files who could give me some advice? It would also be great if someone could explain to me what these EXG channels are exactly. I have for now turned to converting the .bdf file to .edf file (using the converter from www.biosemi.com/download/ ). Then the data looks normal, but it created some other issues with my markers and I would rather not use the converted files. More than anything, I am very curious what is going on with the original file, so any help is much appreciated! Thanks in advance! Ricarda -- Ricarda Braukmann, MSc PhD student Radboud University Medical Centre & Baby Research Center Donders Institute for Brain, Cognition and Behaviour, Centre for Neuroscience & Centre for Cognition Room B.01.22 Phone: +31 (0) 24 36 12652 Email: r.braukmann at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Mon Sep 22 16:49:59 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Mon, 22 Sep 2014 16:49:59 +0200 Subject: [FieldTrip] (no subject) Message-ID: Dear all, I encounter a strange problem using ft_databrowser for artifact detection. Basically I can't see all channels anymore, because the distance between the single channels is so wide that some get out of the window. I did not have this problem before. The only thing I changed until it worked is that I added a filter (before I filtered the data in another program). Did somebody encounter this problem before? thanks and best Katrin Below my (simple) code. cfg = []; cfg.dataset = name; cfg.trialfun = 'ft_trialfun_general'; cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'stim'; cfg.trialdef.prestim = 0.216; % in seconds cfg.trialdef.poststim = 7.284; % in seconds (whole time of video observation plus resynch phase) cfg = ft_definetrial(cfg); cfg.channel = 'all'; cfg.preproc.detrend = 'yes'; cfg.preproc.demean = 'yes'; cfg.preproc.baselinewindow = [-2.1 -2.0] cfg.preproc.bpfilter = 'yes'; cfg.preproc.bpfreq = [0.1 45]; % % obs_data = ft_preprocessing(cfg); cfg = []; cfg.viewmode = 'vertical'; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs_data); obs_data_try = ft_rejectartifact (cfg,obs_data); -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at psych.ru.nl Mon Sep 22 17:12:33 2014 From: s.vanpelt at psych.ru.nl (Stan van Pelt) Date: Mon, 22 Sep 2014 17:12:33 +0200 (CEST) Subject: [FieldTrip] leadfields MNI-coordinates In-Reply-To: References: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: <03a401cfd677$a2538ab0$e6faa010$@vanpelt@psych.ru.nl> Hi Eelke, Thanks a lot, I seem to have missed that thread, very informative! However, I seem not able yet to do the inverse warping, from MNI-coordinates to CTF-coordinates. - First I do mri_realign_mni=ft_volumenormalise([],mri_realign) - This gives me the transformation/normalization parameters from ctf->mni - As an example, I apply them to a random coordinate, here [3 5 6]: mnipos=ft_warp_apply(mri_realign_mni.params,ft_warp_apply(mri_realign_mni.initial,[3 5 6]),'individual2sn') - This gives me mni-coordinates -6.0652 -21.7174 -57.2273 - But how can I do the reverse? - If I do round(ft_warp_apply(pinv(mri_realign_mni.transform),mnipos)) I don't get [3 5 6] - It seems to me I should do something like ctfpos=ft_warp_apply(pinv(mri_realign_mni.params, mnipos),mnipos,'individual2sn') or so, but I am not getting it right... Best, Stan -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Eelke Spaak Sent: maandag 22 september 2014 13:20 To: FieldTrip discussion list Subject: Re: [FieldTrip] leadfields MNI-coordinates Hi Stan, Have a look at this recent thread on the list (4 messages, Tom and me, this is the starting message): http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008362.html I think that might help you. Groetjes, Eelke On 22 September 2014 12:44, Stan van Pelt wrote: > Dear FieldTrippers, > > > > For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to > compute leadfields at specific (MNI-)coordinates in the brain. I am > trying to find out how that is most easily done using FieldTrip > > > > - The most intuitive way seems to me to warp the MNI template to the > individual’s brain > (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_ > individual_head_space_that_are_all_aligned_in_mni_space) > , and then apply the warping parameters to the ROI’s MNI-coordinates, > and enter the subsequent CTF-coordinates into ft_prepare_leadfield. > However, I am not sure where exactly I can find these parameters, and > how to apply them. Are these the ones in [gridsrc].params (output > ft_sourcemodel)? > > - Alternatively, should I run ft_volumenormalise to warp the brain to > MNI-space, and then inversely apply the warping parameters to the > ROI’s MNI-coordinates? Again, where can I find the warping parameters > in this case, and how should they be applied? > > > > Best, > > Stan > > > > - > Stan van Pelt, PhD > Donders Institute for Brain, Cognition and Behaviour Centre for > Cognition Montessorilaan 3, B.01.34 > 6525 HR Nijmegen, the Netherlands > tel: +31 24 3616288 > > > _______________________________________________ > 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 tzvetan.popov at uni-konstanz.de Mon Sep 22 17:14:32 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 22 Sep 2014 17:14:32 +0200 Subject: [FieldTrip] Questions about matrix lead field In-Reply-To: References: Message-ID: Hi Gamaliel, > Hi Experts > > My problem is as follows: > > I need generate a 3D head model from a resonance, then co register this head model with 10-20 electrode system to create my lead field matrix. this will work if you have the 3D position of the electrodes. > According to the tutorial: > > "Creating a volume conduction model of the head for source reconstruction of EEG-data" > > I have generated head model but I do not have the lead field correctly done, because I do not know that function gives me the coregistration with the electrode system and tutorial only goes to show the volume generated with the electrodes on the surface. see here how to co-register the electrodes (scroll down to the bottom of the page): http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg?s[]=coregister&s[]=electrodes please note that using the search field with search terms “coregister electrodes” leads you to this page ;-). Also check the help of the function ft_electroderealign > > Finally I need is to know how I can co-register my head model with my electrode system to generate my lead field matrix. see above > I also need to know how into matrix can I simulate dipole sources for then perform analysis of source reverse. simulating a dipole is usually done with ft_dipolesimulation. Also the first part of this recently introduced FAQ gives you an example how to do this: http://fieldtrip.fcdonders.nl/example/combineplanar_pipelineorder?s[]=planar&s[]=gradient good luck tzvetan > > I hope you can help > > > greetings > > Bless > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 gamaliel.ghu at gmail.com Mon Sep 22 21:34:03 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Mon, 22 Sep 2014 16:34:03 -0300 Subject: [FieldTrip] Questions about matrix lead field Message-ID: *According to:* *"I need generate a 3D head model from a resonance, then co register this head model with 10-20 electrode system to create my lead field matrix. *this will work if you have the 3D position of the electrodes". I have only the patient MRIs, but no 3D positions of electrodes, just know that the system used in the acquisition is the 10-20 system with a number of fixed electrodes . Can i make my matrix Leadfield electrode using a template as standard_1020.elc? Regards -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Sep 23 07:21:38 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 23 Sep 2014 07:21:38 +0200 Subject: [FieldTrip] leadfields MNI-coordinates In-Reply-To: <03a401cfd677$a2538ab0$e6faa010$@vanpelt@psych.ru.nl> References: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> <03a401cfd677$a2538ab0$e6faa010$@vanpelt@psych.ru.nl> Message-ID: Hi Stan, Part of the solution you’re looking for probably lies in the fact that both the forward and inverse warp are non-linear transformations (when the volumetric normalization is done with cfg.nonlinear = ‘yes’). In other words, the inverse warp cannot be achieved by a simple linear transformation (i.e. the (p)inv of a xxx.transform matrix). Fortunately, ft_warp_apply supports both ft_warp_apply(params, pos, ‘individual2sn’), and ft_warp_apply(params, pos, ‘sn2individual’). The latter aims to achieve the inverse warp you’re looking for. Probably you need to then also still apply the inverse of mri_realign_mni.initial. Best, JM On Sep 22, 2014, at 5:12 PM, Stan van Pelt wrote: > Hi Eelke, > > Thanks a lot, I seem to have missed that thread, very informative! > However, I seem not able yet to do the inverse warping, from MNI-coordinates > to CTF-coordinates. > > - First I do > mri_realign_mni=ft_volumenormalise([],mri_realign) > > - This gives me the transformation/normalization parameters from ctf->mni > - As an example, I apply them to a random coordinate, here [3 5 6]: > mnipos=ft_warp_apply(mri_realign_mni.params,ft_warp_apply(mri_realign_mni.initial,[3 > 5 6]),'individual2sn') > > - This gives me mni-coordinates -6.0652 -21.7174 -57.2273 > - But how can I do the reverse? > - If I do > round(ft_warp_apply(pinv(mri_realign_mni.transform),mnipos)) > I don't get [3 5 6] > > - It seems to me I should do something like > ctfpos=ft_warp_apply(pinv(mri_realign_mni.params, > mnipos),mnipos,'individual2sn') > or so, but I am not getting it right... > > Best, > Stan > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Eelke Spaak > Sent: maandag 22 september 2014 13:20 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] leadfields MNI-coordinates > > Hi Stan, > > Have a look at this recent thread on the list (4 messages, Tom and me, this > is the starting message): > http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008362.html > I think that might help you. > > Groetjes, > Eelke > > On 22 September 2014 12:44, Stan van Pelt wrote: >> Dear FieldTrippers, >> >> >> >> For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to >> compute leadfields at specific (MNI-)coordinates in the brain. I am >> trying to find out how that is most easily done using FieldTrip >> >> >> >> - The most intuitive way seems to me to warp the MNI template to the >> individual’s brain >> (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_ >> individual_head_space_that_are_all_aligned_in_mni_space) >> , and then apply the warping parameters to the ROI’s MNI-coordinates, >> and enter the subsequent CTF-coordinates into ft_prepare_leadfield. >> However, I am not sure where exactly I can find these parameters, and >> how to apply them. Are these the ones in [gridsrc].params (output >> ft_sourcemodel)? >> >> - Alternatively, should I run ft_volumenormalise to warp the brain to >> MNI-space, and then inversely apply the warping parameters to the >> ROI’s MNI-coordinates? Again, where can I find the warping parameters >> in this case, and how should they be applied? >> >> >> >> Best, >> >> Stan >> >> >> >> - >> Stan van Pelt, PhD >> Donders Institute for Brain, Cognition and Behaviour Centre for >> Cognition Montessorilaan 3, B.01.34 >> 6525 HR Nijmegen, the Netherlands >> tel: +31 24 3616288 >> >> >> _______________________________________________ >> 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 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 Tue Sep 23 07:31:14 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 23 Sep 2014 07:31:14 +0200 Subject: [FieldTrip] denoise_pca error In-Reply-To: References: Message-ID: <3A35A4D9-0586-4E5F-AD0F-D07985BEA275@donders.ru.nl> Hi Ashley, Since your e-mail did not contain any background information with respect to the acquisition system you are using, I cannot be really to-the-point in my answer. Ft_denoise_pca has been designed to operate on 1) MEG data, that 2) has been acquired on a system that has external reference channels. I don’t know what reference channel you specified, but it seems you didn’t, and the function probably indeed defaulted to a value that caused the selection to be empty or so. But again, without additional info it’s hard to tell. Best and good luck, Jan-Mathijs On Sep 22, 2014, at 3:27 PM, Ashley Greene wrote: > Hello all, > > I hope someone will be able to help with this. I'm trying to run the denoise_pca function on data after preprocessing, but I continue to get the following error: > > Error using ./ > Matrix dimensions must agree. > > Error in ft_denoise_pca (line 193) > s1 = s./max(s(:)); > > Could it be due to the use of the default for refchannel? Forgive me for asking such simple questions, but how do I go about choosing the reference channel? Do I just choose the cleanest channel from that particular set of preprocessed data? > > Thanks in advance, > > Ashley > _______________________________________________ > 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 tzvetan.popov at uni-konstanz.de Tue Sep 23 09:52:24 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Tue, 23 Sep 2014 09:52:24 +0200 Subject: [FieldTrip] Questions about matrix lead field In-Reply-To: References: Message-ID: <1A0A6C2B-E384-45DE-81D4-1D90B91C3FFD@uni-konstanz.de> Hi, > According to: > "I need generate a 3D head model from a resonance, then co register this head model with 10-20 electrode system to create my lead field matrix. > this will work if you have the 3D position of the electrodes". > > I have only the patient MRIs, but no 3D positions of electrodes, just know that the system used in the acquisition is the 10-20 system with a number of fixed electrodes . Can i make my matrix Leadfield electrode using a template as standard_1020.elc? yes, yet on the expense of accuracy. See for instance here: http://journal.frontiersin.org/Journal/10.3389/fnins.2014.00042/full best tzvetan > > Regards > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 s.vanpelt at psych.ru.nl Tue Sep 23 09:55:22 2014 From: s.vanpelt at psych.ru.nl (Stan van Pelt) Date: Tue, 23 Sep 2014 09:55:22 +0200 (CEST) Subject: [FieldTrip] leadfields MNI-coordinates In-Reply-To: References: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> <03a401cfd677$a2538ab0$e6faa010$@vanpelt@psych.ru.nl> Message-ID: <042201cfd703$bab76a90$30263fb0$@vanpelt@psych.ru.nl> Hi Jan-Mathijs, Thanks, this indeed did the trick! Ergo, forward warping of coordinates 'pos' work like this: - mri_realign_mni=ft_volumenormalise([],mri_realign) - mnipos=ft_warp_apply(mri_realign_mni.params,ft_warp_apply(mri_realign_mni. initial, pos,'individual2sn') Inverse warping returns coordinates of mnipos in subject space (ctfpos): - posback=ft_warp_apply(mri_realign_mni.params,mnipos,'sn2individual') - ctfpos= ft_warp_apply(pinv(mri_realign_mni.initial),posback) Best, Stan From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of jan-mathijs schoffelen Sent: dinsdag 23 september 2014 7:22 To: FieldTrip discussion list Subject: Re: [FieldTrip] leadfields MNI-coordinates Hi Stan, Part of the solution you're looking for probably lies in the fact that both the forward and inverse warp are non-linear transformations (when the volumetric normalization is done with cfg.nonlinear = 'yes'). In other words, the inverse warp cannot be achieved by a simple linear transformation (i.e. the (p)inv of a xxx.transform matrix). Fortunately, ft_warp_apply supports both ft_warp_apply(params, pos, 'individual2sn'), and ft_warp_apply(params, pos, 'sn2individual'). The latter aims to achieve the inverse warp you're looking for. Probably you need to then also still apply the inverse of mri_realign_mni.initial. Best, JM On Sep 22, 2014, at 5:12 PM, Stan van Pelt wrote: Hi Eelke, Thanks a lot, I seem to have missed that thread, very informative! However, I seem not able yet to do the inverse warping, from MNI-coordinates to CTF-coordinates. - First I do mri_realign_mni=ft_volumenormalise([],mri_realign) - This gives me the transformation/normalization parameters from ctf->mni - As an example, I apply them to a random coordinate, here [3 5 6]: mnipos=ft_warp_apply(mri_realign_mni.params,ft_warp_apply(mri_realign_mni. initial,[3 5 6]),'individual2sn') - This gives me mni-coordinates -6.0652 -21.7174 -57.2273 - But how can I do the reverse? - If I do round(ft_warp_apply(pinv(mri_realign_mni.transform),mnipos)) I don't get [3 5 6] - It seems to me I should do something like ctfpos=ft_warp_apply(pinv(mri_realign_mni.params, mnipos),mnipos,'individual2sn') or so, but I am not getting it right... Best, Stan -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Eelke Spaak Sent: maandag 22 september 2014 13:20 To: FieldTrip discussion list Subject: Re: [FieldTrip] leadfields MNI-coordinates Hi Stan, Have a look at this recent thread on the list (4 messages, Tom and me, this is the starting message): http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008362.html I think that might help you. Groetjes, Eelke On 22 September 2014 12:44, Stan van Pelt wrote: Dear FieldTrippers, For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to compute leadfields at specific (MNI-)coordinates in the brain. I am trying to find out how that is most easily done using FieldTrip - The most intuitive way seems to me to warp the MNI template to the individual's brain (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_ individual_head_space_that_are_all_aligned_in_mni_space) , and then apply the warping parameters to the ROI's MNI-coordinates, and enter the subsequent CTF-coordinates into ft_prepare_leadfield. However, I am not sure where exactly I can find these parameters, and how to apply them. Are these the ones in [gridsrc].params (output ft_sourcemodel)? - Alternatively, should I run ft_volumenormalise to warp the brain to MNI-space, and then inversely apply the warping parameters to the ROI's MNI-coordinates? Again, where can I find the warping parameters in this case, and how should they be applied? Best, Stan - Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Centre for Cognition Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 _______________________________________________ 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 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 agreene24 at gmail.com Tue Sep 23 10:10:10 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Tue, 23 Sep 2014 17:10:10 +0900 Subject: [FieldTrip] denoise_pca error In-Reply-To: <3A35A4D9-0586-4E5F-AD0F-D07985BEA275@donders.ru.nl> References: <3A35A4D9-0586-4E5F-AD0F-D07985BEA275@donders.ru.nl> Message-ID: Hi Jan, I've done electrophysiological research but am a beginner with MEG, and I'm using the data from the Centre for Cognitive Neuroimaging provided from and used in the fieldtrip tutorial website. Ashley On Tue, Sep 23, 2014 at 2:31 PM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Ashley, > Since your e-mail did not contain any background information with respect > to the acquisition system you are using, I cannot be really to-the-point in > my answer. > Ft_denoise_pca has been designed to operate on > 1) MEG data, that > 2) has been acquired on a system that has external reference channels. > I don’t know what reference channel you specified, but it seems you > didn’t, and the function probably indeed defaulted to a value that caused > the selection to be empty or so. But again, without additional info it’s > hard to tell. > Best and good luck, > Jan-Mathijs > > > > On Sep 22, 2014, at 3:27 PM, Ashley Greene wrote: > > Hello all, > > I hope someone will be able to help with this. I'm trying to run the > denoise_pca function on data after preprocessing, but I continue to get the > following error: > > Error using ./ > Matrix dimensions must agree. > > Error in ft_denoise_pca (line 193) > s1 = s./max(s(:)); > > Could it be due to the use of the default for refchannel? Forgive me for > asking such simple questions, but how do I go about choosing the reference > channel? Do I just choose the cleanest channel from that particular set of > preprocessed data? > > Thanks in advance, > > Ashley > _______________________________________________ > 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 bibi.raquel at gmail.com Tue Sep 23 16:33:44 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Tue, 23 Sep 2014 10:33:44 -0400 Subject: [FieldTrip] Reading in .bdf files In-Reply-To: References: Message-ID: Hi Ricarda, The Biosemi system uses CMS & DRL during acquisition as the common mode for the ground electrode. Are you re-referencing your EEG signals, before viewing them in ft_databrowser? Best, Raquel On Mon, Sep 22, 2014 at 10:43 AM, Ricarda Braukmann < r.braukmann at donders.ru.nl> wrote: > Hi everyone, > > > I have a question regarding reading in Biosemi .bdf files. > > > I followed the example on the ft website to read in a .bdf file, and - > although it does not give an error- , the data looks very odd. In the > ft_databrowser for example the vertical scale is [ -178000 178000 ] > which seems very werid to me. > > > I tried re-referencing the data, like in the example, using channel > 'EXG5', but this did not help. > > > Is there anyone who has experience with reading in biosemi files who could > give me some advice? > > It would also be great if someone could explain to me what these EXG > channels are exactly. > > > I have for now turned to converting the .bdf file to .edf file (using the > converter from www.biosemi.com/download/ > ). > Then the data looks normal, but it created some other issues with my > markers and I would rather not use the converted files. > > More than anything, I am very curious what is going on with the original > file, so any help is much appreciated! > > > Thanks in advance! > > Ricarda > > > -- > > Ricarda Braukmann, MSc > PhD student > > > Radboud University Medical Centre & Baby Research Center > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Neuroscience & Centre for Cognition > > Room B.01.22 > Phone: +31 (0) 24 36 12652 > Email: r.braukmann at donders.ru.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 recasensmarc at gmail.com Tue Sep 23 16:45:18 2014 From: recasensmarc at gmail.com (Marc Recasens) Date: Tue, 23 Sep 2014 16:45:18 +0200 Subject: [FieldTrip] PhD and Postdoctoral positions in Majorca, Spain In-Reply-To: References: Message-ID: Hola Francisco, Soy Marc Recasens, del Grup de Recerca en Neurociència Cognitiva (*Brainlab*) de la UB. Te escribo en relació a la plaza posdoctoral que se ofrece en tu laboratorio. Estoy muy interesado en buscar una plaza posdoc ya que voy a hacer la defensa de mi tesis en los próximos meses. Me gustaría que tuvierais en cuenta mi perfil para cubrir dicha plaza.Creo que podría encajar muy bien y el proyecto que describes en la oferta es muy atractivos para mi (connectivity, M/EEG, clinical population...). Adjunto CV actualizado y la *motivation letter*. En el CV incluyo los nombres y datos de contacto de tres posibles referees que pueden dar cuenta del trabajo que he realizado hasta la fecha como *PhD student*. Carles entre ellos. Estoy 100% disponible para realizar una entrevista por Skype o presencial cuando sea. Atentamente, Marc Recasens. On Sat, Aug 23, 2014 at 12:33 AM, Francisco Barcelo wrote: > One PhD and one Postdoctoral research positions are available at the > Department of Psychology (University of Balearic Islands, Spain) to join an > ongoing project on the Cognitive neuroscience of executive control aimed to > assess functional and effective connectivity (e.g., Dynamic Causal > Modeling) in M/EEG data sets from healthy controls and brain injured > patients. The project aims to develop state-of-the-art neuropsychological > tools for a more valid and cost-effective evaluation of dysexecutive > symptoms in elderly adults and patients with frontal lobe lesions (cf., > Barceló & Knight, Cereb. Cortex, 2007; Nyhus & Barceló, Brain & Cognition, > 2009). > > Successful pre/postdoctoral candidates will hold a MSc/PhD in Psychology, > Biology, Cognitive Neuroscience, Physics, or related fields, and will play > a key role in designing, conducting, analyzing and reporting M/EEG studies, > with a focus on event-related potentials, oscillatory neural activity and > synchrony. Candidates will be fluent in English (knowledge of Spanish is > not required), and will prove good interpersonal and communication skills, > including writing to a high standard. Both positions are funded by the > Spanish Government (MINECO’s grant PSI2013-44760-R), as well as other local > research agencies. > > Requirements for the PhD student position: 1) EU citizenship; 2) a Master > degree and excellent academic marks; 3) Programming skills (eg., Matlab > will be a plus); and 4) Demonstrated ability and high motivation to conduct > high-quality research publishable in quality international peer-reviewed > journals. > > Requirements for the Postdoc position: 1) Strong background publishing EEG > and/or MEG studies; 2) Advanced programming skills (eg., Matlab, C, > Python); 3) Excellent command of EEG/MEG data analysis software (EEGLAB, > SPM8, Brainstorm, etc); and 4) demonstrate creative and independent work. > > Applicants must submit an updated CV in pdf format, a letter of > motivation, and the names and emails of two referees to the grant holder: > Francisco Barceló (f.barcelo at uib.es). The PhD studentship is for 3 years, > and the postdoc position is for one year, with the possibility of renewal. > Starting date October 1st 2014, or until the positions are filled. Informal > inquires are welcomed. For more information visit: www.mcst.es, or > www.neuropsicologiaclinica.es. > > ><><><><><><><><><><><><><>< > Francisco Barceló, PhD > Full Professor of Neuropsychology > University of Illes Balears (UIB) > Ctra. Valldemossa, km 7.5 > E-07122 Palma de Mallorca - Spain > Personal: www.mcst.es > Lab: www.neuropsicologiaclinica.es > Phone: 971 172750 > Fax: 971 172309 > ><><><><><><><><><><><><><>< > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Marc Recasens Tel.: +34 639 24 15 98 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CV2014b_english.pdf Type: application/pdf Size: 39360 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MOTIVATION LETTER.pdf Type: application/pdf Size: 12745 bytes Desc: not available URL: From matt.craddock at uni-leipzig.de Tue Sep 23 17:12:14 2014 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Tue, 23 Sep 2014 16:12:14 +0100 Subject: [FieldTrip] Reading in .bdf files In-Reply-To: References: Message-ID: <54218DCE.803@uni-leipzig.de> Hi Ricarda, The EXG channels are for external electrodes - typically they are used for things like eye movements (for example we always placed EXG1-4 at points around the eyes) and additional reference points (e.g. mastoids, earlobes). You'd need to check with whoever recorded the dataset to be sure which channel is which. I have not tried to read .bdfs using fieldtrip, as i usually do a lot of pre-processing in eeglab and port over to fieldtrip later on, but subtracting the mean of each channel (DC) as well as re-referencing may help. BDFs have a very high dynamic range which can have some unfortunate side effects at times: http://sccn.ucsd.edu/pipermail/eeglablist/2008/002147.html http://sccn.ucsd.edu/pipermail/eeglablist/2008/002229.html Cheers, Matt On 22/09/2014 15:43, Ricarda Braukmann wrote: > Hi everyone, > > > I have a question regarding reading in Biosemi .bdf files. > > > I followed the example on the ft website to read in a .bdf file, and - > although it does not give an error- , the data looks very odd. In the > ft_databrowser for example the vertical scale is [ -178000178000 ] which > seems very werid to me. > > > I tried re-referencing the data, like in the example, using channel > 'EXG5', but this did not help. > > > Is there anyone who has experience with reading in biosemi files who > could give me some advice? > > It would also be great if someone could explain to me what these EXG > channels are exactly. > > > I have for now turned to converting the .bdf file to .edf file (using > the converter from www.biosemi.com/download/ > ). > Then the data looks normal, but it created some other issues with my > markers and I would rather not use the converted files. > > More than anything, I am very curious what is going on with the original > file, so any help is much appreciated! > > > Thanks in advance! > > Ricarda -- Dr. Matt Craddock From r.braukmann at donders.ru.nl Tue Sep 23 17:11:26 2014 From: r.braukmann at donders.ru.nl (Ricarda Braukmann) Date: Tue, 23 Sep 2014 17:11:26 +0200 Subject: [FieldTrip] Reading in .bdf files Message-ID: Hi Rachel, Yes, I was wondering about the re-referencing because I indeed read that this was the necessary first step for Biosemi data. What would one usually re-reference the data to? I tried re-referencing to all electrodes (since no mastoid etc. has been collected) but this did not solve the issue for the .bdf file. It works for the converted .edf file in which the data looks much better from the start but I am not sure whether everything is going correctly. The data is quite noisy and also when trying to apply a high-pass filter later Matlab gives an error of unstable poles. I am not sure whether this is due to the actual properties of my data or whether it is still related to the way I read it in, so any suggestions are very welcome! Thanks a lot! Best, Ricarda On Tue, Sep 23, 2014 at 4:33 PM, Raquel Bibi wrote: > >> Hi Ricarda, >> The Biosemi system uses CMS & DRL during acquisition as the common mode >> for the ground electrode. Are you re-referencing your EEG signals, before >> viewing them in ft_databrowser? >> >> Best, >> >> Raquel >> >> On Mon, Sep 22, 2014 at 10:43 AM, Ricarda Braukmann < >> r.braukmann at donders.ru.nl> wrote: >> >>> Hi everyone, >>> >>> >>> I have a question regarding reading in Biosemi .bdf files. >>> >>> >>> I followed the example on the ft website to read in a .bdf file, and - >>> although it does not give an error- , the data looks very odd. In the >>> ft_databrowser for example the vertical scale is [ -178000 178000 ] >>> which seems very werid to me. >>> >>> >>> I tried re-referencing the data, like in the example, using channel >>> 'EXG5', but this did not help. >>> >>> >>> Is there anyone who has experience with reading in biosemi files who >>> could give me some advice? >>> >>> It would also be great if someone could explain to me what these EXG >>> channels are exactly. >>> >>> >>> I have for now turned to converting the .bdf file to .edf file (using >>> the converter from www.biosemi.com/download/ >>> ). >>> Then the data looks normal, but it created some other issues with my >>> markers and I would rather not use the converted files. >>> >>> More than anything, I am very curious what is going on with the original >>> file, so any help is much appreciated! >>> >>> >>> Thanks in advance! >>> >>> Ricarda >>> >>> >>> -- >>> >>> Ricarda Braukmann, MSc >>> PhD student >>> >>> >>> Radboud University Medical Centre & Baby Research Center >>> >>> Donders Institute for Brain, Cognition and Behaviour, >>> Centre for Neuroscience & Centre for Cognition >>> >>> Room B.01.22 >>> Phone: +31 (0) 24 36 12652 >>> Email: r.braukmann at donders.ru.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 >> > > > > -- Ricarda Braukmann, MSc PhD student Radboud University Medical Centre & Baby Research Center Donders Institute for Brain, Cognition and Behaviour, Centre for Neuroscience & Centre for Cognition Room B.01.22 Phone: +31 (0) 24 36 12652 Email: r.braukmann at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Tue Sep 23 18:02:36 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Tue, 23 Sep 2014 12:02:36 -0400 Subject: [FieldTrip] Reading in .bdf files In-Reply-To: References: Message-ID: Hi Ricarda, Some suggestions: 1. Did you include your EXG electrodes in the re-referenced channels? Perhaps you could remove these? 2.Review and exclude bad channels before re-referencing? I used the Biosemi Viewer before analyzing the data in Fieldtrip. 3. Re-reference to a single channel, like CZ(A1). I haven't worked with bdfs in a while, I had the same problems you're describing initially with my data. Here are a few solutions I remember offhand. I was able to resolve them without converting them to .cnt. Best, Raquel On Tue, Sep 23, 2014 at 11:11 AM, Ricarda Braukmann < r.braukmann at donders.ru.nl> wrote: > Hi Rachel, > > Yes, I was wondering about the re-referencing because I indeed read that > this was the necessary first step for Biosemi data. > What would one usually re-reference the data to? > > I tried re-referencing to all electrodes (since no mastoid etc. has been > collected) but this did not solve the issue for the .bdf file. > > It works for the converted .edf file in which the data looks much better > from the start but I am not sure whether everything is going correctly. > The data is quite noisy and also when trying to apply a high-pass filter > later Matlab gives an error of unstable poles. I am not sure whether this > is due to the actual properties of my data or whether it is still related > to the way I read it in, so any suggestions are very welcome! > > Thanks a lot! > Best, > Ricarda > > > On Tue, Sep 23, 2014 at 4:33 PM, Raquel Bibi >> wrote: >> >>> Hi Ricarda, >>> The Biosemi system uses CMS & DRL during acquisition as the common mode >>> for the ground electrode. Are you re-referencing your EEG signals, before >>> viewing them in ft_databrowser? >>> >>> Best, >>> >>> Raquel >>> >>> On Mon, Sep 22, 2014 at 10:43 AM, Ricarda Braukmann < >>> r.braukmann at donders.ru.nl> wrote: >>> >>>> Hi everyone, >>>> >>>> >>>> I have a question regarding reading in Biosemi .bdf files. >>>> >>>> >>>> I followed the example on the ft website to read in a .bdf file, and - >>>> although it does not give an error- , the data looks very odd. In the >>>> ft_databrowser for example the vertical scale is [ -178000 178000 ] >>>> which seems very werid to me. >>>> >>>> >>>> I tried re-referencing the data, like in the example, using channel >>>> 'EXG5', but this did not help. >>>> >>>> >>>> Is there anyone who has experience with reading in biosemi files who >>>> could give me some advice? >>>> >>>> It would also be great if someone could explain to me what these EXG >>>> channels are exactly. >>>> >>>> >>>> I have for now turned to converting the .bdf file to .edf file (using >>>> the converter from www.biosemi.com/download/ >>>> ). >>>> Then the data looks normal, but it created some other issues with my >>>> markers and I would rather not use the converted files. >>>> >>>> More than anything, I am very curious what is going on with the >>>> original file, so any help is much appreciated! >>>> >>>> >>>> Thanks in advance! >>>> >>>> Ricarda >>>> >>>> >>>> -- >>>> >>>> Ricarda Braukmann, MSc >>>> PhD student >>>> >>>> >>>> Radboud University Medical Centre & Baby Research Center >>>> >>>> Donders Institute for Brain, Cognition and Behaviour, >>>> Centre for Neuroscience & Centre for Cognition >>>> >>>> Room B.01.22 >>>> Phone: +31 (0) 24 36 12652 >>>> Email: r.braukmann at donders.ru.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 >>> >> >> >> >> > -- > > Ricarda Braukmann, MSc > PhD student > > > Radboud University Medical Centre & Baby Research Center > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Neuroscience & Centre for Cognition > > Room B.01.22 > Phone: +31 (0) 24 36 12652 > Email: r.braukmann at donders.ru.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 gamaliel.ghu at gmail.com Tue Sep 23 18:35:01 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Tue, 23 Sep 2014 13:35:01 -0300 Subject: [FieldTrip] Questions about matriz lead field Message-ID: Hi experts I hope you can help me prior information 1) I pretend work with EEG data simulation 2) I pretend use a template of sensor same as system 10-20 3) I have the anatomy of the patient in MRIs T2 contrast for generate the volume conduction I have the volume conduction model that I performed with the tutorial: " creating a volume conduction model of the head for source-reconstruction of eeg data" Now, I need simulate a dipole source into brain generated (volume conduction model). I have sent repeated questions about how to do this and you responded me with two reference pages: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit?s[]=ft&s[]=dipolesimulation and http://fieldtrip.fcdonders.nl/example/combineplanar_pipelineorder?s%20[%20]%20=%20planar%20&%20s%20[]%20=%20gradiente Now my questions are the next: In the first case (page 1): Can i add my own volume conduction instead of the concentric spheres describes in the example? I tried this but, i have not good results In the second case (page 2): This reference page says that the script is specific to MEG, and not use a vol especific (use a concentric sphere). Can i use the sript as example for generate my personal dipole source in my volume conduction model? Sorry for my continuous questions, but i am new in this world, the final objective of this is try of generate my own sources to generate my own simulate eeg data, and next aplicate the source analysis to found the same position of the dipole best -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From dylan.delosangeles at gmail.com Wed Sep 24 02:32:41 2014 From: dylan.delosangeles at gmail.com (Dylan DeLosAngeles) Date: Wed, 24 Sep 2014 10:02:41 +0930 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design Message-ID: Hello, So far, the tutorial on "Cluster-based permutation tests on time-frequency data" has been very helpful. Out of the four combinations from the two UO-types (subjects and trials) and the two experimental designs (between- and within-UO), the tutorial covers statistics on data in two conditions in a between-trials, in a within-trials and in a within-subjects design. However, I am wondering if there is any information about the fourth type of experiment design: between-subjects. I have data for 2 groups with 12 subjects in each group. Both groups are measured during 11 conditions. Can I approach this in a similar fashion to within-subjects design (multiple subjects in multiple experimental conditions), such that my design is multiple *groups* in multiple experimental conditions. Is it a case of first averaging over all trials belonging to each of the experimental conditions for each subject (as instructed in tutorial), and then averaging over all subjects in each group? Configuration code for setting up the design currently looks like this; grp = 2; subj = 11; design = zeros(2, subj*grp); for i = 1:grp design(1,i:2:end) = i; end idx = 1; for i = 1:subj design(2,idx:idx+1) = i; idx = idx+2; end Is there anything else I need to take into consideration when doing these statistics? Thank you, Dr Dylan DeLosAngeles Research Fellow Brain Signal Laboratory Flinders University -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksenj at ohsu.edu Wed Sep 24 05:57:57 2014 From: eriksenj at ohsu.edu (K Jeffrey Eriksen) Date: Wed, 24 Sep 2014 03:57:57 +0000 Subject: [FieldTrip] FDM and FEM forward models Message-ID: I just joined this list. I am interested in accurate FDM and FEM models for EEG forward solutions, and note that both seem to be available in some form with FieldTrip. MY question is, can these accommodate custom head models based on individual MRIs and/or CTs, or do they use a generic head of some sort? Thanks, -Jeff Eriksen -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Sep 24 07:59:31 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 24 Sep 2014 07:59:31 +0200 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: Hello Dylan, You can analyse a between-subjects design exactly as you would a between-trials design (at least as far as the statistics step is concerned), in both cases the two conditions correspond to two groups of observations, and not to the same group of observations measured in two separate conditions (which would be a within-UO design). In FieldTrip, you would typically compute averages per subject, then use an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic (not depsamples). indepsamplesT only requires one row in the design matrix, indicating the condition. Note that if you have e.g. timelock structures in two (or more) cell arrays, corresponding to the conditions, you can input them into the statistics function as follows: stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); without having to call ft_timelockgrandaverage. In fact, the above is the preferred way to do statistics now. (The same holds for ft_freqstatistics.) Hope that helps, Best, Eelke On 24 September 2014 02:32, Dylan DeLosAngeles wrote: > Hello, > > So far, the tutorial on "Cluster-based permutation tests on time-frequency > data" has been very helpful. > > Out of the four combinations from the two UO-types (subjects and trials) and > the two experimental designs (between- and within-UO), the tutorial covers > statistics on data in two conditions in a between-trials, in a within-trials > and in a within-subjects design. However, I am wondering if there is any > information about the fourth type of experiment design: between-subjects. > > I have data for 2 groups with 12 subjects in each group. Both groups are > measured during 11 conditions. > Can I approach this in a similar fashion to within-subjects design (multiple > subjects in multiple experimental conditions), such that my design is > multiple groups in multiple experimental conditions. Is it a case of first > averaging over all trials belonging to each of the experimental conditions > for each subject (as instructed in tutorial), and then averaging over all > subjects in each group? > > Configuration code for setting up the design currently looks like this; > grp = 2; > subj = 11; > design = zeros(2, subj*grp); > > for i = 1:grp > design(1,i:2:end) = i; > end > > idx = 1; > for i = 1:subj > design(2,idx:idx+1) = i; > idx = idx+2; > end > > Is there anything else I need to take into consideration when doing these > statistics? > > Thank you, > Dr Dylan DeLosAngeles > Research Fellow > Brain Signal Laboratory > Flinders University > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Wed Sep 24 08:02:17 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 24 Sep 2014 08:02:17 +0200 Subject: [FieldTrip] FDM and FEM forward models In-Reply-To: References: Message-ID: Hi Jeff, All the forward modelling in FieldTrip is based on a user-specified MRI (preferably an individual one, but can be a template brain if an individual MRI is not available). You probably will want to have a look at this tutorial: http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg Best, Eelke On 24 September 2014 05:57, K Jeffrey Eriksen wrote: > I just joined this list. I am interested in accurate FDM and FEM models for > EEG forward solutions, and note that both seem to be available in some form > with FieldTrip. MY question is, can these accommodate custom head models > based on individual MRIs and/or CTs, or do they use a generic head of some > sort? > > > > Thanks, > > -Jeff Eriksen > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tzvetan.popov at uni-konstanz.de Wed Sep 24 10:58:45 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Wed, 24 Sep 2014 10:58:45 +0200 Subject: [FieldTrip] Questions about matriz lead field In-Reply-To: References: Message-ID: <83E25E9B-CF0F-41A5-B4FD-C4F45CDE7C5A@uni-konstanz.de> Allright then, > Sorry for my continuous questions, but i am new in this world, the final objective of this is try of generate my own sources to generate my own simulate eeg data, and next aplicate the source analysis to found the same position of the dipole here is what I would do using the standard head model and standard electrodes provided with fieldtrip. Just exchange the head model with your desired head model and make sure that the units match and the alignment of elec’s and vol is correct. good luck tzvetan load ('/Users/zez/Documents/matlabtools/fieldtrip-20140518/template/headmodel/standard_bem'); load ('/Users/zez/Documents/matlabtools/fieldtrip-20140518/template/headmodel/standard_mri'); elec = ft_read_sens('/Users/zez/Documents/matlabtools/fieldtrip-20140518/template/electrode/standard_1020.elc'); %% ft_plot_mesh(vol.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); hold on; ft_plot_mesh(vol.bnd(2),'edgecolor','none','facealpha',0.4); hold on; ft_plot_mesh(vol.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); hold on; ft_plot_sens(elec,'style', 'sk'); %% cfg=[]; cfg.method = 'ortho'; figure; ft_sourceplot(cfg,mri); %% cfg=[]; cfg.dip.pos = [55 -7 5];%dipole located in the right heschl gyrus cfg.dip.mom = [0 0 -1]; cfg.dip.frequency = 10; cfg.dip.phase = 2; cfg.dip.amplitude = 1; cfg.ntrials = 20; cfg.triallength = 2; cfg.fsample = 100; cfg.vol = vol; cfg.elec = elec; cfg.relnoise = 0.1; data = ft_dipolesimulation(cfg); data.elec = elec; %% cfg = []; cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 2:2:30; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = 0:0.05:2; % time window "slides" from 0 to 2 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, data); TLK = ft_timelockanalysis([],data); %% plot the simulated signal in time and time-freq space cfg = []; cfg.channel = {'FC2', 'FC4', 'FC6', 'FT8', 'C2', 'C4', 'C6', 'T8', 'T4'}; cfg.renderer = 'zbuffer'; cfg.xlim = [0.5 1.5]; figure subplot(2,2,1);ft_singleplotTFR(cfg, TFRhann); subplot(2,2,2);ft_singleplotER(cfg,TLK); cfg.channel = {'EEG'}; subplot(2,2,3);ft_topoplotTFR(cfg, TFRhann); subplot(2,2,4);ft_topoplotER(cfg,TLK); %% cfg = []; cfg.latency = [0.5 1.5]; % specify latency window cfg.numdipoles = 1; cfg.vol = vol; cfg.grid.resolution = 10; cfg.grid.unit = 'mm'; dip = ft_dipolefitting(cfg, TLK); %% plot the location of the dipole cfg = []; cfg.location = dip.dip.pos; figure; ft_sourceplot(cfg, mri) > > > best > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 spa268 at nyu.edu Wed Sep 24 11:17:53 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Wed, 24 Sep 2014 13:17:53 +0400 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design Message-ID: Hi Eelke, Thanks for this information. I just wanted to jump in and ask: what about for interactions in a mixed 2x2 design? For example, say I expect a difference between conditions A and B for group 1, but not group 2. Would the correct way to do this be to 1) make difference waves (A-B) for each participant, then 2) do a between-UO test on the difference waves using indepsamplesT? In the past I have always tested within-UO interactions using basically this method (based on http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html), but I was under the impression that this is not OK for mixed designs (from this post: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004244.html) Thanks, Steve > > ------------------------------ > > Message: 12 > Date: Wed, 24 Sep 2014 07:59:31 +0200 > From: Eelke Spaak > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > Message-ID: > < CABPNLUomYPTw6m__+Wx8jRJc8HvyU-Pqc4Q7+G7czOjD502dfA at mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > wrote: > > Hello, > > > > So far, the tutorial on "Cluster-based permutation tests on time-frequency > > data" has been very helpful. > > > > Out of the four combinations from the two UO-types (subjects and trials) and > > the two experimental designs (between- and within-UO), the tutorial covers > > statistics on data in two conditions in a between-trials, in a within-trials > > and in a within-subjects design. However, I am wondering if there is any > > information about the fourth type of experiment design: between-subjects. > > > > I have data for 2 groups with 12 subjects in each group. Both groups are > > measured during 11 conditions. > > Can I approach this in a similar fashion to within-subjects design (multiple > > subjects in multiple experimental conditions), such that my design is > > multiple groups in multiple experimental conditions. Is it a case of first > > averaging over all trials belonging to each of the experimental conditions > > for each subject (as instructed in tutorial), and then averaging over all > > subjects in each group? > > > > Configuration code for setting up the design currently looks like this; > > grp = 2; > > subj = 11; > > design = zeros(2, subj*grp); > > > > for i = 1:grp > > design(1,i:2:end) = i; > > end > > > > idx = 1; > > for i = 1:subj > > design(2,idx:idx+1) = i; > > idx = idx+2; > > end > > > > Is there anything else I need to take into consideration when doing these > > statistics? > > > > Thank you, > > Dr Dylan DeLosAngeles > > Research Fellow > > Brain Signal Laboratory > > Flinders University > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > All the forward modelling in FieldTrip is based on a user-specified > MRI (preferably an individual one, but can be a template brain if an > individual MRI is not available). You probably will want to have a > look at this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed Sep 24 17:26:28 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 24 Sep 2014 17:26:28 +0200 Subject: [FieldTrip] fieldtrip website updated Message-ID: <70EE18B4-801F-48EF-8CC3-9913B71E3FD5@donders.ru.nl> Dear all, This afternoon we have updated the software of the FieldTrip website. We encountered some compatibility issues with our own custom extensions. As a consequence, some things have changed slightly and some parts still need minor improvements. For example the search function is not yet 100% functional. If you notice something on the website that does not work as expected, please report it at http://bugzilla.fcdonders.nl/show_bug.cgi?id=2693 thanks Robert From katrinheimann at gmail.com Thu Sep 25 15:53:14 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Thu, 25 Sep 2014 15:53:14 +0200 Subject: [FieldTrip] numcomponent problem in ica Message-ID: Hey experts, I have a problem with an ICA. What I am basically doing is running an ICA on a big dataset and then removing the identified components from smaller datasets of the same subject. Due to interpolated channels I do reduce the components using numcomponent. But there seems to be a problem with this: My code is cfg = []; cfg.channel = {'all'}; cfg.numcomponent = 126 comp = ft_componentanalysis(cfg,obs_data_clean1); save (strcat(sb,'comp_all') , 'comp') and matlab writes: the input is component data with 126 components and 129 original channels detected 0 visual artifacts the input is component data with 126 components and 129 original channels processing trials just as expected! then I want to use this ica for cleaning a smaller dataset so I wrote: cfg = []; cfg.numcomponent = 126; cfg.unmixing = comp.unmixing; cfg.topolabel = comp.topolabel; comp_1 = ft_componentanalysis(cfg, obs90_data); the program again tells me: the input is raw data with 129 channels and 80 trials selecting 129 channels baseline correcting data scaling data with 1 over 126.842103 not concatenating data starting decomposition using predetermined unmixing matrix the call to "ft_componentanalysis" took 2 seconds and required the additional allocation of an estimated 574 MB then I remove the component I identified before as blinking cfg = []; cfg.component = [1]; obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') and suddenly matlab says: baseline correcting data removing 1 components keeping 128 components processing trials processing trial 80 from 80 Why does is speak of 129 (128+1) components??? My comp and comp_1 objects only have 126 components!!! Is it doing the right thing? Thanks again for your help! Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From gamaliel.ghu at gmail.com Thu Sep 25 18:23:00 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Thu, 25 Sep 2014 13:23:00 -0300 Subject: [FieldTrip] Problem with standard_1020.elc file Message-ID: Hi all I have the next problem: When I read the standard_1020.elc file of my FieldTrip documents. reading shows the following: elec = ft_read_sens('standard_1020.elc') elec = chanpos: [97x3 double] elecpos: [97x3 double] label: {97x1 cell} type: 'eeg1010' unit: 'mm' I know that the 1020 system is different system 1010, but reading the standard_1020.elc file that comes by default in my Fieldtrip folder. Apparently not contain the informations system 1020 but 1010. have you a page where you can download the correct file standard_1020.elc? Another question is: Where I can get the files that come by default in fieldtrip: standard_bem and standard_mri? My template folder fieldtrip not have them by default. greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Thu Sep 25 18:48:26 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Thu, 25 Sep 2014 18:48:26 +0200 Subject: [FieldTrip] Problem with standard_1020.elc file In-Reply-To: References: Message-ID: <8E550D9B-3433-424F-94C1-27EE95C60DFD@uni-konstanz.de> Hi, please download a recent FieldTrip version and do this on the command line: restoredefaultpath addpath /yourpath/fieldtrip ft_defaults If you follow these instructions: http://fieldtrip.fcdonders.nl/faq/should_i_add_fieldtrip_with_all_subdirectories_to_my_matlab_path?s[]=genpath everything should work for you. best tzvetan > Hi all > > I have the next problem: > > When I read the standard_1020.elc file of my FieldTrip documents. reading shows the following: > > elec = ft_read_sens('standard_1020.elc') > > elec = > > chanpos: [97x3 double] > elecpos: [97x3 double] > label: {97x1 cell} > type: 'eeg1010' > unit: 'mm' > > > I know that the 1020 system is different system 1010, but reading the standard_1020.elc file that comes by default in my Fieldtrip folder. Apparently not contain the informations system 1020 but 1010. > > have you a page where you can download the correct file standard_1020.elc? > > Another question is: > > Where I can get the files that come by default in fieldtrip: > > standard_bem and standard_mri? > > My template folder fieldtrip not have them by default. > > > greetings > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 linkgoron at gmail.com Fri Sep 26 20:24:34 2014 From: linkgoron at gmail.com (Nitzan Uziely) Date: Fri, 26 Sep 2014 21:24:34 +0300 Subject: [FieldTrip] Fwd: Using Akaike Information Criterion for order selection with ft_mvaranalysis In-Reply-To: References: Message-ID: Hi, My name is Nitzan Uziely, and I'm a student (under-grad) at the Hebrew University of Jerusalem. I'm using fieldtrip to process EEG signals at our lab, and I'm trying to run a PDC analysis on my data. I took the data, calculated the inverse-solution and segmented it into virtual channels using the AAL atlas. I'm trying to to calculate the correct order for the ft_mvaranalysis function. I've seen a previous question that went unanswered a few years ago about order selection ( http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003947.html). Following the above question, I searched how to calculate the Akaike Information Criterion (AIC) to calculate the correct model order. According to http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ I need to calculate the determinant of the noise covariance matrix, however the determinant (I've checked orders 1 to 10) is so small that matlab just rounds it to zero. This makes me feel that either I have a problem, I've misunderstood how to calculate AIC to select the correct model, or that AIC is not the correct way to go. So, my question is - does it seem that is something wrong with my data (which can be seen by the small determinant), am I misunderstanding the requirement of the determinant or is there a better way to select the order of the mvar model. (oh, I'm using mdcfg.toolbox = 'bsmart'; if it matters) Thanks, Nitzan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Sat Sep 27 02:42:21 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Fri, 26 Sep 2014 14:42:21 -1000 Subject: [FieldTrip] Where to add a trialfun? Message-ID: Hello all! I'm having a simple problem. I want to add this trialfun: http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun I get this error: Reference to non-existent field 'trialdef'. Error in trialfun_bit2dec (line 52) if strcmp(event(i).type, cfg.trialdef.eventtype) I'm quite sure it's because I'm not writing it in the correct part of my script. This is my trial definition part. Where should I add it and how should I write the line? % TRIAL DEFINITION cfg=[]; cfg.filename = ['my/folders/', subject, '.RAW']; cfg.headerfile = ['my/folders/', subject, '.RAW']; cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = cgrmrk; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 1; cfg.trialdef.eventtype=?; cfg = definetrial(cfg); trl = cfg.trl; cfg=[]; cfg.dataset = ['my/folders/', subject, '.RAW']; cfg.trl = trl; cfg.reref = 'yes'; cfg.refchannel = ['all']; THANKS! -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Sat Sep 27 11:05:40 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Sat, 27 Sep 2014 11:05:40 +0200 (CEST) Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: Message-ID: <1456425059.1815959.1411808740191.JavaMail.root@indus.zimbra.ru.nl> Hi Ana Laura, In general, you need to determine which trial function (Trialfun) to use when using definetrial (see this tutorial: http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the trial definition for the fully incongruent (FIC) condition). Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to your code before calling definetrial (see below). % TRIAL DEFINITION cfg=[]; cfg.filename = ['my/folders/', subject, '.RAW']; cfg.headerfile = ['my/folders/', subject, '.RAW']; cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = cgrmrk; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 1; cfg.trialdef.eventtype=?; cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition cfg = definetrial(cfg); As an addition note: based on your error message, it seemed that the problem was in the function trialfun_bit2dec. However, from the code you showed us, you haven't referenced/called this function. I was wondering if the code you provide corresponded to the code that created your error message? I'm guessing you ran [trl] =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which case, it was looking for cfg.trialdef.eventtype. You can call trialfun_bit2dec as long as you have all the relevant information in the cfg (which is in the code you showed us). Hope this helps. Best, Nietzsche ----- Original Message ----- > From: "Ana Laura Diez Martini" > To: "FieldTrip discussion list" > Sent: Saturday, 27 September, 2014 2:42:21 AM > Subject: [FieldTrip] Where to add a trialfun? > Hello all! I'm having a simple problem. I want to add this trialfun: > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > I get this error: > > > > Reference to non-existent field 'trialdef'. > > > Error in trialfun_bit2dec (line 52) > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > I'm quite sure it's because I'm not writing it in the correct part of > my script. This is my trial definition part. Where should I add it and > how should I write the line? > > > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['my/folders/', subject, '.RAW']; > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > cfg.trialdef.eventtype=?; > > > cfg = definetrial(cfg); > > > trl = cfg.trl; > cfg=[]; > cfg.dataset = ['my/folders/', subject, '.RAW']; > cfg.trl = trl; > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > > > THANKS! > _______________________________________________ > 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 matt.gerhold at gmail.com Sat Sep 27 12:52:50 2014 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Sat, 27 Sep 2014 12:52:50 +0200 Subject: [FieldTrip] Taper Function MVAR Model Fit Message-ID: Hi, I have a question(s) regarding the MVAR model fitting routine in FieldTrip. I haven't had enough time outside of my current commitments to scan through the MATLAB code when fitting the model. I hope to do so at some point. Given my time constraints, I wonder if it will be possible for you to answer one or two questions regarding the treatment of the data prior to model fitting? Is it necessary to apply a taper function such as a hamming window prior to fitting the model? I've gone through a few papers and no authors have explicitly mentioned it in the context of EEG and EMG/EEG MVAR modelling. How does the FieldTrip routine execute in default mode with regards to a taper function in the MVAR routine? What would you recommend as authors of the code and as experienced practitioners of the method(s)? Many Thanks, Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Sat Sep 27 19:18:25 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Sat, 27 Sep 2014 07:18:25 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: <1456425059.1815959.1411808740191.JavaMail.root@indus.zimbra.ru.nl> References: <1456425059.1815959.1411808740191.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Thank you Nietzsche! I added it where you suggested and now this is the error I get: Error using feval Invalid function name 'trialfun_bit2dec(cfg)'. Error in definetrial (line 105) trl = feval(cfg.trialfun, cfg); Error in process_ERP_1_fieldtrip (line 97) cfg = definetrial(cfg); Something I was worried about is that I use an old version of Fieldtrip for my scripts because I wrote them long ago and this trialfun uses the new format (with 'ft_s',etc.). Could this affect it in any way? Thanks again! On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche wrote: > Hi Ana Laura, > > In general, you need to determine which trial function (Trialfun) to use > when using definetrial (see this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the trial > definition for the fully incongruent (FIC) condition). > > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to your > code before calling definetrial (see below). > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['my/folders/', subject, '.RAW']; > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > cfg.trialdef.eventtype=?; > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun > definition > cfg = definetrial(cfg); > > > As an addition note: based on your error message, it seemed that the > problem was in the function trialfun_bit2dec. However, from the code you > showed us, you haven't referenced/called this function. I was wondering if > the code you provide corresponded to the code that created your error > message? I'm guessing you ran [trl] =trialfun_bit2dec(cfg) directly (i.e. > not via definetrial). In which case, it was looking for > cfg.trialdef.eventtype. You can call trialfun_bit2dec as long as you have > all the relevant information in the cfg (which is in the code you showed > us). Hope this helps. > > Best, > Nietzsche > > > > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" > > To: "FieldTrip discussion list" > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > Subject: [FieldTrip] Where to add a trialfun? > > Hello all! I'm having a simple problem. I want to add this trialfun: > > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > I get this error: > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > Error in trialfun_bit2dec (line 52) > > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > > > > I'm quite sure it's because I'm not writing it in the correct part of > > my script. This is my trial definition part. Where should I add it and > > how should I write the line? > > > > > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > > > > > cfg = definetrial(cfg); > > > > > > trl = cfg.trl; > > cfg=[]; > > cfg.dataset = ['my/folders/', subject, '.RAW']; > > cfg.trl = trl; > > cfg.reref = 'yes'; > > cfg.refchannel = ['all']; > > > > > > THANKS! > > _______________________________________________ > > 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 katrinheimann at gmail.com Sun Sep 28 11:54:54 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 28 Sep 2014 11:54:54 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point Message-ID: Dear all, I know I asked this already twice, but I did not get the right answer yet and just cannot figure it out myself. So, I did cut my data in quite large trials using ft_define trial and logging it to the beginning of a slide. cfg = []; cfg.dataset = name; cfg.trialfun = 'ft_trialfun_general'; % this is the default cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger cfg.trialdef.prestim = 0.216; % in seconds cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) cfg = ft_definetrial(cfg); % cancel out training trials cfg.trl([1:4],:) = []; %change timeline according to constant offset of 16 ms = 8 samples (because recorded with 500 hz)in %structure trial - plus delay reported by EGE = 18 ms = 9 samples cfg.trl(:,3)=cfg.trl(:,3)-17 Then I preprocessed these trials %% preprocess data cfg.channel = 'all'; cfg.preproc.detrend = 'yes'; cfg.preproc.demean = 'yes'; cfg.preproc.baselinewindow = [-0.1 0] % mov_data = ft_preprocessing(cfg); % save (strcat(sb,'mov_data') , 'mov_data') Now I wanna cut out smaller pieces that are centered around another trigger - the response of the subject. I did not use this trigger at the beginning as then defining a baselinewindow is impossible (as the response is always happening at a different time). I tried to just use ft_definetrial again, as I don't see a possibility to use ft_redefine trial: cfg = [] cfg.dataset= strcat(sb,'mov_data.mat') cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'resp' cfg.trialdef.prestim = 0.75 cfg.trialdef.poststim = 0.75 mov_data_small = ft_definetrial(cfg) but I get the error message: Error using ft_read_header (line 1833) unsupported header format (matlab) Error in ft_trialfun_general (line 71) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); Error in ft_definetrial (line 169) [trl, event] = feval(cfg.trialfun, cfg); I wonder if that is as the file produced by fieldtrip during the preprocessing is not one that is specified for ft_read_header - but how do I deal with this? Thanks a lot for your help Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From anne.urai at gmail.com Sun Sep 28 18:35:57 2014 From: anne.urai at gmail.com (Anne Urai) Date: Sun, 28 Sep 2014 18:35:57 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point In-Reply-To: References: Message-ID: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> Dear Katrin, if you use a custom trialfun (http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition) you can code the time between stimulus onset and response in an additional column. That way, you can shift the time axis of the data by this amount on each trial. For example: % redefine trials offset = (data.trialinfo(:,RTcol)); prestim = 1; poststim = 2; cfg = []; cfg.begsample = round(offset - prestim*data.fsample); cfg.endsample = round(offset + poststim*data.fsample); data = ft_redefinetrial(cfg, data); % then shift the time axis cfg = []; cfg.offset = -offset; data = ft_redefinetrial(cfg, data); % timelock cfg = []; cfg.keeptrials = 'yes'; data = ft_timelockanalysis(cfg, data); That way, your new data structure will now be response locked. Note that the timelockanalysis is optional, and only works when you have trials that are all the same length. If you do not want to use a custom trialfun, you could also rerun the same analysis as you have for the stimulus-locked data, but then taking the response code as your eventvalue. Good luck, --- Anne E. Urai, MSc PhD student | Institut für Neurophysiologie und Pathophysiologie | Universitätsklinikum Hamburg-Eppendorf Martinistrasse 52, 20246 Hamburg, Germany | http://anneurai.wordpress.com On 28 Sep 2014, at 11:54, KatrinH Heimann wrote: > Dear all, > I know I asked this already twice, but I did not get the right answer yet and just cannot figure it out myself. > So, I did cut my data in quite large trials using ft_define trial and logging it to the beginning of a slide. > > cfg = []; > cfg.dataset = name; > cfg.trialfun = 'ft_trialfun_general'; % this is the default > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger > cfg.trialdef.prestim = 0.216; % in seconds > cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) > cfg = ft_definetrial(cfg); > > % cancel out training trials > cfg.trl([1:4],:) = []; > > %change timeline according to constant offset of 16 ms = 8 samples (because recorded with 500 hz)in > %structure trial - plus delay reported by EGE = 18 ms = 9 samples > cfg.trl(:,3)=cfg.trl(:,3)-17 > > > > Then I preprocessed these trials > > %% preprocess data > cfg.channel = 'all'; > cfg.preproc.detrend = 'yes'; > cfg.preproc.demean = 'yes'; > cfg.preproc.baselinewindow = [-0.1 0] > % > mov_data = ft_preprocessing(cfg); > % > save (strcat(sb,'mov_data') , 'mov_data') > > > Now I wanna cut out smaller pieces that are centered around another trigger - the response of the subject. I did not use this trigger at the beginning as then defining a baselinewindow is impossible (as the response is always happening at a different time). > > I tried to just use ft_definetrial again, as I don't see a possibility to use ft_redefine trial: > > cfg = [] > cfg.dataset= strcat(sb,'mov_data.mat') > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'resp' > cfg.trialdef.prestim = 0.75 > cfg.trialdef.poststim = 0.75 > > mov_data_small = ft_definetrial(cfg) > > but I get the error message: > > Error using ft_read_header (line 1833) > unsupported header format (matlab) > > Error in ft_trialfun_general (line 71) > hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); > > Error in ft_definetrial (line 169) > [trl, event] = feval(cfg.trialfun, cfg); > > > I wonder if that is as the file produced by fieldtrip during the preprocessing is not one that is specified for ft_read_header - but how do I deal with this? > > Thanks a lot for your help > > Katrin > _______________________________________________ > 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 katrinheimann at gmail.com Sun Sep 28 19:02:40 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 28 Sep 2014 19:02:40 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point In-Reply-To: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> References: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> Message-ID: Thanks Anne! I will try that! :) Katrin 2014-09-28 18:35 GMT+02:00 Anne Urai : > Dear Katrin, > > if you use a custom trialfun ( > http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition) > you can code the time between stimulus onset and response in an additional > column. That way, you can shift the time axis of the data by this amount on > each trial. For example: > > % redefine trials > offset = (data.trialinfo(:,RTcol)); > prestim = 1; > poststim = 2; > > > cfg = []; > cfg.begsample = round(offset - prestim*data.fsample); > cfg.endsample = round(offset + poststim*data.fsample); > data = ft_redefinetrial(cfg, data); > > > % then shift the time axis > cfg = []; > cfg.offset = -offset; > data = ft_redefinetrial(cfg, data); > > % timelock > cfg = []; > cfg.keeptrials = 'yes'; > data = ft_timelockanalysis(cfg, data); > > That way, your new data structure will now be response locked. Note that > the timelockanalysis is optional, and only works when you have trials that > are all the same length. > > If you do not want to use a custom trialfun, you could also rerun the same > analysis as you have for the stimulus-locked data, but then taking the > response code as your eventvalue. > > Good luck, > > --- > Anne E. Urai, MSc > PhD student | Institut für Neurophysiologie und Pathophysiologie > | Universitätsklinikum Hamburg-Eppendorf > Martinistrasse 52, 20246 Hamburg, Germany | http://anneurai.wordpress.com > > > > > > On 28 Sep 2014, at 11:54, KatrinH Heimann wrote: > > Dear all, > I know I asked this already twice, but I did not get the right answer yet > and just cannot figure it out myself. > So, I did cut my data in quite large trials using ft_define trial and > logging it to the beginning of a slide. > > cfg = []; > cfg.dataset = name; > cfg.trialfun = 'ft_trialfun_general'; % this is the default > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger > cfg.trialdef.prestim = 0.216; % in seconds > cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) > cfg = ft_definetrial(cfg); > > > % cancel out training trials > cfg.trl([1:4],:) = []; > > > %change timeline according to constant offset of 16 ms = 8 samples > (because recorded with 500 hz)in > %structure trial - plus delay reported by EGE = 18 ms = 9 samples > cfg.trl(:,3)=cfg.trl(:,3)-17 > > > > > > Then I preprocessed these trials > > %% preprocess data > cfg.channel = 'all'; > cfg.preproc.detrend = 'yes'; > cfg.preproc.demean = 'yes'; > cfg.preproc.baselinewindow = [-0.1 0] > % > mov_data = ft_preprocessing(cfg); > % > save (strcat(sb,'mov_data') , 'mov_data') > > > > Now I wanna cut out smaller pieces that are centered around another > trigger - the response of the subject. I did not use this trigger at the > beginning as then defining a baselinewindow is impossible (as the response > is always happening at a different time). > > I tried to just use ft_definetrial again, as I don't see a possibility to > use ft_redefine trial: > > cfg = [] > cfg.dataset= strcat(sb,'mov_data.mat') > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'resp' > cfg.trialdef.prestim = 0.75 > cfg.trialdef.poststim = 0.75 > > > mov_data_small = ft_definetrial(cfg) > > but I get the error message: > > Error using ft_read_header (line 1833) > unsupported header format (matlab) > > Error in ft_trialfun_general (line 71) > hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); > > Error in ft_definetrial (line 169) > [trl, event] = feval(cfg.trialfun, cfg); > > > > I wonder if that is as the file produced by fieldtrip during the > preprocessing is not one that is specified for ft_read_header - but how do > I deal with this? > > Thanks a lot for your help > > Katrin > _______________________________________________ > 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 n.lam at fcdonders.ru.nl Mon Sep 29 10:45:53 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Mon, 29 Sep 2014 10:45:53 +0200 (CEST) Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: Message-ID: <1618358664.1830927.1411980353708.JavaMail.root@indus.zimbra.ru.nl> Hi Ana Laura, I've now noticed that you use "definetrial(cfg)" instead of "ft_definetrial", it was probably about 5 years ago that we used "definetrial". We do maintain backward compatibility, but from what I can see "trialfun_bit2dec" was only written this year, so that is probably why "definetrial" doesn't recognize it, and you get the error message "Error using feval Invalid function name 'trialfun_bit2dec(cfg)". For a bit more background, we constantly change, and update these changes in FieldTrip, so it would be best to get the newest version of Fieldtrip, and adjust your script(s) accordingly. You also referred to "this trialfun" in your email. Both "trialfun_bit2dec" and "ft_trialfun_general" are trialfuns (trial functions). Ft_definetrial is not (strictly) a trial function. Ft_definetrial gets information from a trial function (like one of the two aforementioned, or you can custom write your own) and then segments the data accordingly. Best, Nietzsche ----- Original Message ----- > From: "Ana Laura Diez Martini" > To: "FieldTrip discussion list" > Sent: Saturday, 27 September, 2014 7:18:25 PM > Subject: Re: [FieldTrip] Where to add a trialfun? > Thank you Nietzsche! > > > I added it where you suggested and now this is the error I get: > > > > Error using feval > Invalid function name 'trialfun_bit2dec(cfg)'. > > > Error in definetrial (line 105) > trl = feval(cfg.trialfun, cfg); > > > Error in process_ERP_1_fieldtrip (line 97) > cfg = definetrial(cfg); > > > Something I was worried about is that I use an old version of > Fieldtrip for my scripts because I wrote them long ago and this > trialfun uses the new format (with 'ft_s',etc.). Could this affect it > in any way? > > > Thanks again! > > > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < > n.lam at fcdonders.ru.nl > wrote: > > > Hi Ana Laura, > > In general, you need to determine which trial function (Trialfun) to > use when using definetrial (see this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the > trial definition for the fully incongruent (FIC) condition). > > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to > your code before calling definetrial (see below). > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['my/folders/', subject, '.RAW']; > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > cfg.trialdef.eventtype=?; > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition > cfg = definetrial(cfg); > > > As an addition note: based on your error message, it seemed that the > problem was in the function trialfun_bit2dec. However, from the code > you showed us, you haven't referenced/called this function. I was > wondering if the code you provide corresponded to the code that > created your error message? I'm guessing you ran [trl] > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which > case, it was looking for cfg.trialdef.eventtype. You can call > trialfun_bit2dec as long as you have all the relevant information in > the cfg (which is in the code you showed us). Hope this helps. > > Best, > Nietzsche > > > > > > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > Subject: [FieldTrip] Where to add a trialfun? > > Hello all! I'm having a simple problem. I want to add this trialfun: > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > I get this error: > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > Error in trialfun_bit2dec (line 52) > > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > > > > I'm quite sure it's because I'm not writing it in the correct part > > of > > my script. This is my trial definition part. Where should I add it > > and > > how should I write the line? > > > > > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > > > > > cfg = definetrial(cfg); > > > > > > trl = cfg.trl; > > cfg=[]; > > cfg.dataset = ['my/folders/', subject, '.RAW']; > > cfg.trl = trl; > > cfg.reref = 'yes'; > > cfg.refchannel = ['all']; > > > > > > THANKS! > > _______________________________________________ > > 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 > > > _______________________________________________ > 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 n.lam at fcdonders.ru.nl Mon Sep 29 10:53:00 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Mon, 29 Sep 2014 10:53:00 +0200 (CEST) Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: Message-ID: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Hi again Ana Laura, One other thing that I thought of was to make sure that the function "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial can find this function. By updating your fieldtrip to the most recent version "trialfun_bit2dec" is *not* included. So you'll need to store that as a separate .m file in a location that can be accessed by the paths set in matlab. Nietzsche ----- Original Message ----- > From: "Ana Laura Diez Martini" > To: "FieldTrip discussion list" > Sent: Saturday, 27 September, 2014 7:18:25 PM > Subject: Re: [FieldTrip] Where to add a trialfun? > Thank you Nietzsche! > > > I added it where you suggested and now this is the error I get: > > > > Error using feval > Invalid function name 'trialfun_bit2dec(cfg)'. > > > Error in definetrial (line 105) > trl = feval(cfg.trialfun, cfg); > > > Error in process_ERP_1_fieldtrip (line 97) > cfg = definetrial(cfg); > > > Something I was worried about is that I use an old version of > Fieldtrip for my scripts because I wrote them long ago and this > trialfun uses the new format (with 'ft_s',etc.). Could this affect it > in any way? > > > Thanks again! > > > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < > n.lam at fcdonders.ru.nl > wrote: > > > Hi Ana Laura, > > In general, you need to determine which trial function (Trialfun) to > use when using definetrial (see this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the > trial definition for the fully incongruent (FIC) condition). > > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to > your code before calling definetrial (see below). > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['my/folders/', subject, '.RAW']; > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > cfg.trialdef.eventtype=?; > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition > cfg = definetrial(cfg); > > > As an addition note: based on your error message, it seemed that the > problem was in the function trialfun_bit2dec. However, from the code > you showed us, you haven't referenced/called this function. I was > wondering if the code you provide corresponded to the code that > created your error message? I'm guessing you ran [trl] > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which > case, it was looking for cfg.trialdef.eventtype. You can call > trialfun_bit2dec as long as you have all the relevant information in > the cfg (which is in the code you showed us). Hope this helps. > > Best, > Nietzsche > > > > > > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > Subject: [FieldTrip] Where to add a trialfun? > > Hello all! I'm having a simple problem. I want to add this trialfun: > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > I get this error: > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > Error in trialfun_bit2dec (line 52) > > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > > > > I'm quite sure it's because I'm not writing it in the correct part > > of > > my script. This is my trial definition part. Where should I add it > > and > > how should I write the line? > > > > > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > > > > > cfg = definetrial(cfg); > > > > > > trl = cfg.trl; > > cfg=[]; > > cfg.dataset = ['my/folders/', subject, '.RAW']; > > cfg.trl = trl; > > cfg.reref = 'yes'; > > cfg.refchannel = ['all']; > > > > > > THANKS! > > _______________________________________________ > > 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 > > > _______________________________________________ > 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 linkgoron at gmail.com Mon Sep 29 11:46:38 2014 From: linkgoron at gmail.com (Nitzan Uziely) Date: Mon, 29 Sep 2014 12:46:38 +0300 Subject: [FieldTrip] Using Akaike Information Criterion for order selection with ft_mvaranalysis In-Reply-To: References: Message-ID: Hi again, Just to clarify the above, here is the code that I use to calculate the AIC: "source" is my inverse-solution after being partitioned into virtual channels using the AAL atlas. % mvar analysis. cfg = []; cfg.order = order; cfg.toolbox = 'bsmart'; mdata = ft_mvaranalysis(cfg, source); % aic calculation: www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ k = size(source.label,1); p = cfg.order; logv = log(det(mdata.noisecov)); % this gives me inf, as det(mdata.noisecov) is 0. % look at source nTotal = size(source.time,2)*length(source.time{1}); aic = -logv + 2*p*(k^2)/nTotal; disp(strcat(['order:' num2str(order) ', aic:',num2str(aic)])); Any ideas would be greatly appreciated! Best, Nitzan On Fri, Sep 26, 2014 at 9:24 PM, Nitzan Uziely wrote: > Hi, > > My name is Nitzan Uziely, and I'm a student (under-grad) at the Hebrew > University of Jerusalem. > > I'm using fieldtrip to process EEG signals at our lab, and I'm trying to > run a PDC analysis on my data. > > I took the data, calculated the inverse-solution and segmented it into > virtual channels using the AAL atlas. > > I'm trying to to calculate the correct order for the ft_mvaranalysis > function. > I've seen a previous question that went unanswered a few years ago about > order selection ( > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003947.html). > > Following the above question, I searched how to calculate the Akaike > Information Criterion (AIC) to calculate the correct model order. According > to http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ I need to > calculate the determinant of the noise covariance matrix, however the > determinant (I've checked orders 1 to 10) is so small that matlab just > rounds it to zero. This makes me feel that either I have a problem, I've > misunderstood how to calculate AIC to select the correct model, or that AIC > is not the correct way to go. > > So, my question is - does it seem that is something wrong with my data > (which can be seen by the small determinant), am I misunderstanding the > requirement of the determinant or is there a better way to select the order > of the mvar model. (oh, I'm using mdcfg.toolbox = 'bsmart'; if it matters) > > Thanks, > > Nitzan. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Sep 29 12:18:20 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 29 Sep 2014 12:18:20 +0200 Subject: [FieldTrip] Using Akaike Information Criterion for order selection with ft_mvaranalysis In-Reply-To: References: Message-ID: A determinant of 0 to me suggests that your data is rank deficient, which suggests the number of virtual channels is larger than the number of original observations. Best, Jan-Mathijs On Sep 29, 2014, at 11:46 AM, Nitzan Uziely wrote: > Hi again, > > Just to clarify the above, here is the code that I use to calculate the AIC: > "source" is my inverse-solution after being partitioned into virtual channels using the AAL atlas. > > % mvar analysis. > cfg = []; > cfg.order = order; > cfg.toolbox = 'bsmart'; > mdata = ft_mvaranalysis(cfg, source); > > % aic calculation: www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ > k = size(source.label,1); > p = cfg.order; > logv = log(det(mdata.noisecov)); % this gives me inf, as det(mdata.noisecov) is 0. > > % look at source > nTotal = size(source.time,2)*length(source.time{1}); > aic = -logv + 2*p*(k^2)/nTotal; > disp(strcat(['order:' num2str(order) ', aic:',num2str(aic)])); > > Any ideas would be greatly appreciated! > Best, > > Nitzan > > On Fri, Sep 26, 2014 at 9:24 PM, Nitzan Uziely wrote: > Hi, > > My name is Nitzan Uziely, and I'm a student (under-grad) at the Hebrew University of Jerusalem. > > I'm using fieldtrip to process EEG signals at our lab, and I'm trying to run a PDC analysis on my data. > > I took the data, calculated the inverse-solution and segmented it into virtual channels using the AAL atlas. > > I'm trying to to calculate the correct order for the ft_mvaranalysis function. > I've seen a previous question that went unanswered a few years ago about order selection (http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003947.html). > > Following the above question, I searched how to calculate the Akaike Information Criterion (AIC) to calculate the correct model order. According to http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ I need to calculate the determinant of the noise covariance matrix, however the determinant (I've checked orders 1 to 10) is so small that matlab just rounds it to zero. This makes me feel that either I have a problem, I've misunderstood how to calculate AIC to select the correct model, or that AIC is not the correct way to go. > > So, my question is - does it seem that is something wrong with my data (which can be seen by the small determinant), am I misunderstanding the requirement of the determinant or is there a better way to select the order of the mvar model. (oh, I'm using mdcfg.toolbox = 'bsmart'; if it matters) > > Thanks, > > Nitzan. > > _______________________________________________ > 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 dominic.nathan at gmail.com Mon Sep 29 17:04:12 2014 From: dominic.nathan at gmail.com (dominic nathan) Date: Mon, 29 Sep 2014 11:04:12 -0400 Subject: [FieldTrip] preprocessing Elekta Neuromag datasets Message-ID: Dear All, We are starting to use Fieldtrip to process our Elekta Neuromag data and were wondering if anyone has some scripts that we could follow for standard preprocessing. One of the main challenges that we face is how to combine both the gradiometers and magnetometers for the preprocessing. Thank you. dominic From diezmartini at gmail.com Mon Sep 29 19:00:26 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Mon, 29 Sep 2014 07:00:26 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Thank you again Nietzsche!! Yes, I was referring to trialfun_bit2dec. I followed your advice and I changed definetrial to ft_definetrial and I confirm the function was added to my paths. After doing this, the error I get is: Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. Error in trialfun_bit2dec (line 66) idx = any(diff(trl(:,1),1,1),2); Error in ft_definetrial (line 169) trl = feval(cfg.trialfun, cfg); Error in process_ERP_1_fieldtrip (line 95) cfg = ft_definetrial(cfg); This is again the trial definition part in which I think I added what I think are useless lines but I was just trying to make it run it. % TRIAL DEFINITION cfg=[]; cfg.filename = ['myfolders/subject.RAW']; cfg.headerfile = ['myfolders/subject.RAW']; cfg.dataset = ['myfolders/subject.RAW']; cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers cfg.trialdef.prestim = 0.2; % latency in seconds cfg.trialdef.poststim = 1; % latency in seconds cfg = ft_definetrial(cfg); trl = cfg.trl; cfg=[]; cfg.dataset = ['myfolders/subject.RAW']; cfg.trl = trl; cfg.reref = 'yes'; cfg.refchannel = ['all']; Unfortunately using this function is crucial to my analysis because I would like to use only Fieldtrip to analyse all my data. Thank you for taking all this time. On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche wrote: > Hi again Ana Laura, > > One other thing that I thought of was to make sure that the function > "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial > can find this function. > > By updating your fieldtrip to the most recent version "trialfun_bit2dec" > is *not* included. So you'll need to store that as a separate .m file in a > location that can be accessed by the paths set in matlab. > > Nietzsche > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" > > To: "FieldTrip discussion list" > > Sent: Saturday, 27 September, 2014 7:18:25 PM > > Subject: Re: [FieldTrip] Where to add a trialfun? > > Thank you Nietzsche! > > > > > > I added it where you suggested and now this is the error I get: > > > > > > > > Error using feval > > Invalid function name 'trialfun_bit2dec(cfg)'. > > > > > > Error in definetrial (line 105) > > trl = feval(cfg.trialfun, cfg); > > > > > > Error in process_ERP_1_fieldtrip (line 97) > > cfg = definetrial(cfg); > > > > > > Something I was worried about is that I use an old version of > > Fieldtrip for my scripts because I wrote them long ago and this > > trialfun uses the new format (with 'ft_s',etc.). Could this affect it > > in any way? > > > > > > Thanks again! > > > > > > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < > > n.lam at fcdonders.ru.nl > wrote: > > > > > > Hi Ana Laura, > > > > In general, you need to determine which trial function (Trialfun) to > > use when using definetrial (see this tutorial: > > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the > > trial definition for the fully incongruent (FIC) condition). > > > > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to > > your code before calling definetrial (see below). > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition > > cfg = definetrial(cfg); > > > > > > As an addition note: based on your error message, it seemed that the > > problem was in the function trialfun_bit2dec. However, from the code > > you showed us, you haven't referenced/called this function. I was > > wondering if the code you provide corresponded to the code that > > created your error message? I'm guessing you ran [trl] > > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which > > case, it was looking for cfg.trialdef.eventtype. You can call > > trialfun_bit2dec as long as you have all the relevant information in > > the cfg (which is in the code you showed us). Hope this helps. > > > > Best, > > Nietzsche > > > > > > > > > > > > > > ----- Original Message ----- > > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > > Subject: [FieldTrip] Where to add a trialfun? > > > Hello all! I'm having a simple problem. I want to add this trialfun: > > > > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > > > > > I get this error: > > > > > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > > > > Error in trialfun_bit2dec (line 52) > > > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > > > > > > > I'm quite sure it's because I'm not writing it in the correct part > > > of > > > my script. This is my trial definition part. Where should I add it > > > and > > > how should I write the line? > > > > > > > > > > > > % TRIAL DEFINITION > > > cfg=[]; > > > cfg.filename = ['my/folders/', subject, '.RAW']; > > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > > cfg.trialdef.eventvalue = cgrmrk; > > > cfg.trialdef.prestim = 0.2; > > > cfg.trialdef.poststim = 1; > > > cfg.trialdef.eventtype=?; > > > > > > > > > cfg = definetrial(cfg); > > > > > > > > > trl = cfg.trl; > > > cfg=[]; > > > cfg.dataset = ['my/folders/', subject, '.RAW']; > > > cfg.trl = trl; > > > cfg.reref = 'yes'; > > > cfg.refchannel = ['all']; > > > > > > > > > THANKS! > > > _______________________________________________ > > > 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 > > > > > > _______________________________________________ > > 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 a.stolk8 at gmail.com Mon Sep 29 20:57:40 2014 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 29 Sep 2014 20:57:40 +0200 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Hey Ana Laura, Seems from the error message you're getting "Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]." that none of the triggers were found in your event data. You might wanna check why this is happening, by debugging 'trialfun_bit2dec' on your input. Best, Arjen 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini : > Thank you again Nietzsche!! > > Yes, I was referring to trialfun_bit2dec. I followed your advice and I > changed definetrial to ft_definetrial and I confirm the function was added > to my paths. After doing this, the error I get is: > > Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > Error in process_ERP_1_fieldtrip (line 95) > cfg = ft_definetrial(cfg); > > This is again the trial definition part in which I think I added what I > think are useless lines but I was just trying to make it run it. > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['myfolders/subject.RAW']; > cfg.headerfile = ['myfolders/subject.RAW']; > cfg.dataset = ['myfolders/subject.RAW']; > cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers > cfg.trialdef.prestim = 0.2; % latency in seconds > cfg.trialdef.poststim = 1; % latency in seconds > cfg = ft_definetrial(cfg); > > trl = cfg.trl; > cfg=[]; > cfg.dataset = ['myfolders/subject.RAW']; > cfg.trl = trl; > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > > Unfortunately using this function is crucial to my analysis because I > would like to use only Fieldtrip to analyse all my data. Thank you for > taking all this time. > > On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche > wrote: > >> Hi again Ana Laura, >> >> One other thing that I thought of was to make sure that the function >> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >> can find this function. >> >> By updating your fieldtrip to the most recent version "trialfun_bit2dec" >> is *not* included. So you'll need to store that as a separate .m file in a >> location that can be accessed by the paths set in matlab. >> >> Nietzsche >> >> ----- Original Message ----- >> > From: "Ana Laura Diez Martini" >> > To: "FieldTrip discussion list" >> > Sent: Saturday, 27 September, 2014 7:18:25 PM >> > Subject: Re: [FieldTrip] Where to add a trialfun? >> > Thank you Nietzsche! >> > >> > >> > I added it where you suggested and now this is the error I get: >> > >> > >> > >> > Error using feval >> > Invalid function name 'trialfun_bit2dec(cfg)'. >> > >> > >> > Error in definetrial (line 105) >> > trl = feval(cfg.trialfun, cfg); >> > >> > >> > Error in process_ERP_1_fieldtrip (line 97) >> > cfg = definetrial(cfg); >> > >> > >> > Something I was worried about is that I use an old version of >> > Fieldtrip for my scripts because I wrote them long ago and this >> > trialfun uses the new format (with 'ft_s',etc.). Could this affect it >> > in any way? >> > >> > >> > Thanks again! >> > >> > >> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >> > n.lam at fcdonders.ru.nl > wrote: >> > >> > >> > Hi Ana Laura, >> > >> > In general, you need to determine which trial function (Trialfun) to >> > use when using definetrial (see this tutorial: >> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >> > trial definition for the fully incongruent (FIC) condition). >> > >> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >> > your code before calling definetrial (see below). >> > >> > % TRIAL DEFINITION >> > cfg=[]; >> > cfg.filename = ['my/folders/', subject, '.RAW']; >> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >> > >> > cfg.trialdef.eventtype = 'STATUS'; >> > cfg.trialdef.eventvalue = cgrmrk; >> > cfg.trialdef.prestim = 0.2; >> > cfg.trialdef.poststim = 1; >> > cfg.trialdef.eventtype=?; >> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >> > cfg = definetrial(cfg); >> > >> > >> > As an addition note: based on your error message, it seemed that the >> > problem was in the function trialfun_bit2dec. However, from the code >> > you showed us, you haven't referenced/called this function. I was >> > wondering if the code you provide corresponded to the code that >> > created your error message? I'm guessing you ran [trl] >> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >> > case, it was looking for cfg.trialdef.eventtype. You can call >> > trialfun_bit2dec as long as you have all the relevant information in >> > the cfg (which is in the code you showed us). Hope this helps. >> > >> > Best, >> > Nietzsche >> > >> > >> > >> > >> > >> > >> > ----- Original Message ----- >> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >> > > Subject: [FieldTrip] Where to add a trialfun? >> > > Hello all! I'm having a simple problem. I want to add this trialfun: >> > > >> > > >> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >> > > >> > > >> > > >> > > I get this error: >> > > >> > > >> > > >> > > Reference to non-existent field 'trialdef'. >> > > >> > > >> > > Error in trialfun_bit2dec (line 52) >> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >> > > >> > > >> > > I'm quite sure it's because I'm not writing it in the correct part >> > > of >> > > my script. This is my trial definition part. Where should I add it >> > > and >> > > how should I write the line? >> > > >> > > >> > > >> > > % TRIAL DEFINITION >> > > cfg=[]; >> > > cfg.filename = ['my/folders/', subject, '.RAW']; >> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >> > > >> > > >> > > cfg.trialdef.eventtype = 'STATUS'; >> > > cfg.trialdef.eventvalue = cgrmrk; >> > > cfg.trialdef.prestim = 0.2; >> > > cfg.trialdef.poststim = 1; >> > > cfg.trialdef.eventtype=?; >> > > >> > > >> > > cfg = definetrial(cfg); >> > > >> > > >> > > trl = cfg.trl; >> > > cfg=[]; >> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >> > > cfg.trl = trl; >> > > cfg.reref = 'yes'; >> > > cfg.refchannel = ['all']; >> > > >> > > >> > > THANKS! >> > > _______________________________________________ >> > > 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 >> > >> > >> > _______________________________________________ >> > 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 >> > > > _______________________________________________ > 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 e.maris at psych.ru.nl Mon Sep 29 21:12:33 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Mon, 29 Sep 2014 21:12:33 +0200 (CEST) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: <006b01cfdc19$4dfccce0$e9f666a0$@maris@psych.ru.nl> Hi Steve, Have a look here: http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests Best, Eric Maris From: Stephen Politzer-Ahles [mailto:spa268 at nyu.edu] Sent: woensdag 24 september 2014 11:18 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Hi Eelke, Thanks for this information. I just wanted to jump in and ask: what about for interactions in a mixed 2x2 design? For example, say I expect a difference between conditions A and B for group 1, but not group 2. Would the correct way to do this be to 1) make difference waves (A-B) for each participant, then 2) do a between-UO test on the difference waves using indepsamplesT? In the past I have always tested within-UO interactions using basically this method (based on http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html), but I was under the impression that this is not OK for mixed designs (from this post: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004244.html) Thanks, Steve > > ------------------------------ > > Message: 12 > Date: Wed, 24 Sep 2014 07:59:31 +0200 > From: Eelke Spaak > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > Message-ID: > > > > > Content-Type: text/plain; charset=UTF-8 > > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > wrote: > > Hello, > > > > So far, the tutorial on "Cluster-based permutation tests on > > time-frequency > > data" has been very helpful. > > > > Out of the four combinations from the two UO-types (subjects and trials) > > and > > the two experimental designs (between- and within-UO), the tutorial > > covers > > statistics on data in two conditions in a between-trials, in a > > within-trials > > and in a within-subjects design. However, I am wondering if there is any > > information about the fourth type of experiment design: > > between-subjects. > > > > I have data for 2 groups with 12 subjects in each group. Both groups are > > measured during 11 conditions. > > Can I approach this in a similar fashion to within-subjects design > > (multiple > > subjects in multiple experimental conditions), such that my design is > > multiple groups in multiple experimental conditions. Is it a case of > > first > > averaging over all trials belonging to each of the experimental > > conditions > > for each subject (as instructed in tutorial), and then averaging over > > all > > subjects in each group? > > > > Configuration code for setting up the design currently looks like this; > > grp = 2; > > subj = 11; > > design = zeros(2, subj*grp); > > > > for i = 1:grp > > design(1,i:2:end) = i; > > end > > > > idx = 1; > > for i = 1:subj > > design(2,idx:idx+1) = i; > > idx = idx+2; > > end > > > > Is there anything else I need to take into consideration when doing > > these > > statistics? > > > > Thank you, > > Dr Dylan DeLosAngeles > > Research Fellow > > Brain Signal Laboratory > > Flinders University > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > All the forward modelling in FieldTrip is based on a user-specified > MRI (preferably an individual one, but can be a template brain if an > individual MRI is not available). You probably will want to have a > look at this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Mon Sep 29 22:38:58 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Mon, 29 Sep 2014 22:38:58 +0200 Subject: [FieldTrip] preprocessing Elekta Neuromag datasets In-Reply-To: References: Message-ID: Dear Dominic, We have just started a week-long FieldTrip/invited lectures workshop, that we have optimized for our Neuromag system, and specifically for combined EEG and MEG recordings. We are also recording the lectures and creating wiki tutorials. In short - in a couple of weeks you can expect a lot of material coming online. I'll make sure to announce it on the mailinglist. This week will be too busy, but I keep an eye out for your (and other Neuromag users) questions. Good luck! Stephen On 29 September 2014 17:04, dominic nathan wrote: > Dear All, > > We are starting to use Fieldtrip to process our Elekta Neuromag data > and were wondering if anyone has some scripts that we could follow for > standard preprocessing. One of the main challenges that we face is how > to combine both the gradiometers and magnetometers for the > preprocessing. > > Thank you. > > dominic > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From diezmartini at gmail.com Tue Sep 30 00:11:40 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Mon, 29 Sep 2014 12:11:40 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Dear Arjen and Nietzsche, I tried debugging with dbstop if error and cfg.debug = 'saveonerror' and matlab points to: % discard the repeated values idx = any(diff(trl(:,1),1,1),2); trl = trl(idx,:); It does seem it is not reading the events. When I read them with the raw data, they seem to be there, with the DIN prefix. Any idea? On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk wrote: > Hey Ana Laura, > > Seems from the error message you're getting > > "Attempted to access trl(:,1); index out of bounds because > size(trl)=[0,0]." > > that none of the triggers were found in your event data. You might wanna > check why this is happening, by debugging 'trialfun_bit2dec' on your input. > > Best, > Arjen > > > > 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini : > >> Thank you again Nietzsche!! >> >> Yes, I was referring to trialfun_bit2dec. I followed your advice and I >> changed definetrial to ft_definetrial and I confirm the function was added >> to my paths. After doing this, the error I get is: >> >> Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> Error in process_ERP_1_fieldtrip (line 95) >> cfg = ft_definetrial(cfg); >> >> This is again the trial definition part in which I think I added what I >> think are useless lines but I was just trying to make it run it. >> >> % TRIAL DEFINITION >> cfg=[]; >> cfg.filename = ['myfolders/subject.RAW']; >> cfg.headerfile = ['myfolders/subject.RAW']; >> cfg.dataset = ['myfolders/subject.RAW']; >> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition >> cfg.trialdef.eventtype = 'STATUS'; >> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >> cfg.trialdef.prestim = 0.2; % latency in seconds >> cfg.trialdef.poststim = 1; % latency in seconds >> cfg = ft_definetrial(cfg); >> >> trl = cfg.trl; >> cfg=[]; >> cfg.dataset = ['myfolders/subject.RAW']; >> cfg.trl = trl; >> cfg.reref = 'yes'; >> cfg.refchannel = ['all']; >> >> Unfortunately using this function is crucial to my analysis because I >> would like to use only Fieldtrip to analyse all my data. Thank you for >> taking all this time. >> >> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche >> wrote: >> >>> Hi again Ana Laura, >>> >>> One other thing that I thought of was to make sure that the function >>> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >>> can find this function. >>> >>> By updating your fieldtrip to the most recent version "trialfun_bit2dec" >>> is *not* included. So you'll need to store that as a separate .m file in a >>> location that can be accessed by the paths set in matlab. >>> >>> Nietzsche >>> >>> ----- Original Message ----- >>> > From: "Ana Laura Diez Martini" >>> > To: "FieldTrip discussion list" >>> > Sent: Saturday, 27 September, 2014 7:18:25 PM >>> > Subject: Re: [FieldTrip] Where to add a trialfun? >>> > Thank you Nietzsche! >>> > >>> > >>> > I added it where you suggested and now this is the error I get: >>> > >>> > >>> > >>> > Error using feval >>> > Invalid function name 'trialfun_bit2dec(cfg)'. >>> > >>> > >>> > Error in definetrial (line 105) >>> > trl = feval(cfg.trialfun, cfg); >>> > >>> > >>> > Error in process_ERP_1_fieldtrip (line 97) >>> > cfg = definetrial(cfg); >>> > >>> > >>> > Something I was worried about is that I use an old version of >>> > Fieldtrip for my scripts because I wrote them long ago and this >>> > trialfun uses the new format (with 'ft_s',etc.). Could this affect it >>> > in any way? >>> > >>> > >>> > Thanks again! >>> > >>> > >>> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >>> > n.lam at fcdonders.ru.nl > wrote: >>> > >>> > >>> > Hi Ana Laura, >>> > >>> > In general, you need to determine which trial function (Trialfun) to >>> > use when using definetrial (see this tutorial: >>> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >>> > trial definition for the fully incongruent (FIC) condition). >>> > >>> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >>> > your code before calling definetrial (see below). >>> > >>> > % TRIAL DEFINITION >>> > cfg=[]; >>> > cfg.filename = ['my/folders/', subject, '.RAW']; >>> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>> > >>> > cfg.trialdef.eventtype = 'STATUS'; >>> > cfg.trialdef.eventvalue = cgrmrk; >>> > cfg.trialdef.prestim = 0.2; >>> > cfg.trialdef.poststim = 1; >>> > cfg.trialdef.eventtype=?; >>> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >>> > cfg = definetrial(cfg); >>> > >>> > >>> > As an addition note: based on your error message, it seemed that the >>> > problem was in the function trialfun_bit2dec. However, from the code >>> > you showed us, you haven't referenced/called this function. I was >>> > wondering if the code you provide corresponded to the code that >>> > created your error message? I'm guessing you ran [trl] >>> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >>> > case, it was looking for cfg.trialdef.eventtype. You can call >>> > trialfun_bit2dec as long as you have all the relevant information in >>> > the cfg (which is in the code you showed us). Hope this helps. >>> > >>> > Best, >>> > Nietzsche >>> > >>> > >>> > >>> > >>> > >>> > >>> > ----- Original Message ----- >>> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >>> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >>> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >>> > > Subject: [FieldTrip] Where to add a trialfun? >>> > > Hello all! I'm having a simple problem. I want to add this trialfun: >>> > > >>> > > >>> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >>> > > >>> > > >>> > > >>> > > I get this error: >>> > > >>> > > >>> > > >>> > > Reference to non-existent field 'trialdef'. >>> > > >>> > > >>> > > Error in trialfun_bit2dec (line 52) >>> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >>> > > >>> > > >>> > > I'm quite sure it's because I'm not writing it in the correct part >>> > > of >>> > > my script. This is my trial definition part. Where should I add it >>> > > and >>> > > how should I write the line? >>> > > >>> > > >>> > > >>> > > % TRIAL DEFINITION >>> > > cfg=[]; >>> > > cfg.filename = ['my/folders/', subject, '.RAW']; >>> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>> > > >>> > > >>> > > cfg.trialdef.eventtype = 'STATUS'; >>> > > cfg.trialdef.eventvalue = cgrmrk; >>> > > cfg.trialdef.prestim = 0.2; >>> > > cfg.trialdef.poststim = 1; >>> > > cfg.trialdef.eventtype=?; >>> > > >>> > > >>> > > cfg = definetrial(cfg); >>> > > >>> > > >>> > > trl = cfg.trl; >>> > > cfg=[]; >>> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >>> > > cfg.trl = trl; >>> > > cfg.reref = 'yes'; >>> > > cfg.refchannel = ['all']; >>> > > >>> > > >>> > > THANKS! >>> > > _______________________________________________ >>> > > 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 >>> > >>> > >>> > _______________________________________________ >>> > 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 >>> >> >> >> _______________________________________________ >> 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 diezmartini at gmail.com Tue Sep 30 06:20:29 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Mon, 29 Sep 2014 18:20:29 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: This is my attempt of adapting the code for the new Fieldtrip % TRIAL DEFINITION cfg=[]; cfg.dataset = 'myfile'; hdr = ft_read_header( 'myfile'); dat = ft_read_data('myfile'); cfg.trialfun = 'trialfun_bit2dec'; cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 1; cfg.reref = 'yes'; cfg.refchannel = ['all']; cfg = ft_definetrial(cfg); again the error is: Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. Error in trialfun_bit2dec (line 66) idx = any(diff(trl(:,1),1,1),2); Error in ft_definetrial (line 169) trl = feval(cfg.trialfun, cfg); Error in process_ERP_1_fieldtrip (line 106) cfg = ft_definetrial(cfg); On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini < diezmartini at gmail.com> wrote: > Dear Arjen and Nietzsche, > > I tried debugging with dbstop if error and cfg.debug = 'saveonerror' and > matlab points to: > > % discard the repeated values > idx = any(diff(trl(:,1),1,1),2); > trl = trl(idx,:); > > It does seem it is not reading the events. When I read them with the raw > data, they seem to be there, with the DIN prefix. Any idea? > > On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk wrote: > >> Hey Ana Laura, >> >> Seems from the error message you're getting >> >> "Attempted to access trl(:,1); index out of bounds because >> size(trl)=[0,0]." >> >> that none of the triggers were found in your event data. You might wanna >> check why this is happening, by debugging 'trialfun_bit2dec' on your input. >> >> Best, >> Arjen >> >> >> >> 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini >> : >> >>> Thank you again Nietzsche!! >>> >>> Yes, I was referring to trialfun_bit2dec. I followed your advice and I >>> changed definetrial to ft_definetrial and I confirm the function was added >>> to my paths. After doing this, the error I get is: >>> >>> Attempted to access trl(:,1); index out of bounds because >>> size(trl)=[0,0]. >>> >>> Error in trialfun_bit2dec (line 66) >>> idx = any(diff(trl(:,1),1,1),2); >>> >>> Error in ft_definetrial (line 169) >>> trl = feval(cfg.trialfun, cfg); >>> >>> Error in process_ERP_1_fieldtrip (line 95) >>> cfg = ft_definetrial(cfg); >>> >>> This is again the trial definition part in which I think I added what I >>> think are useless lines but I was just trying to make it run it. >>> >>> % TRIAL DEFINITION >>> cfg=[]; >>> cfg.filename = ['myfolders/subject.RAW']; >>> cfg.headerfile = ['myfolders/subject.RAW']; >>> cfg.dataset = ['myfolders/subject.RAW']; >>> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition >>> cfg.trialdef.eventtype = 'STATUS'; >>> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >>> cfg.trialdef.prestim = 0.2; % latency in seconds >>> cfg.trialdef.poststim = 1; % latency in seconds >>> cfg = ft_definetrial(cfg); >>> >>> trl = cfg.trl; >>> cfg=[]; >>> cfg.dataset = ['myfolders/subject.RAW']; >>> cfg.trl = trl; >>> cfg.reref = 'yes'; >>> cfg.refchannel = ['all']; >>> >>> Unfortunately using this function is crucial to my analysis because I >>> would like to use only Fieldtrip to analyse all my data. Thank you for >>> taking all this time. >>> >>> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche >>> wrote: >>> >>>> Hi again Ana Laura, >>>> >>>> One other thing that I thought of was to make sure that the function >>>> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >>>> can find this function. >>>> >>>> By updating your fieldtrip to the most recent version >>>> "trialfun_bit2dec" is *not* included. So you'll need to store that as a >>>> separate .m file in a location that can be accessed by the paths set in >>>> matlab. >>>> >>>> Nietzsche >>>> >>>> ----- Original Message ----- >>>> > From: "Ana Laura Diez Martini" >>>> > To: "FieldTrip discussion list" >>>> > Sent: Saturday, 27 September, 2014 7:18:25 PM >>>> > Subject: Re: [FieldTrip] Where to add a trialfun? >>>> > Thank you Nietzsche! >>>> > >>>> > >>>> > I added it where you suggested and now this is the error I get: >>>> > >>>> > >>>> > >>>> > Error using feval >>>> > Invalid function name 'trialfun_bit2dec(cfg)'. >>>> > >>>> > >>>> > Error in definetrial (line 105) >>>> > trl = feval(cfg.trialfun, cfg); >>>> > >>>> > >>>> > Error in process_ERP_1_fieldtrip (line 97) >>>> > cfg = definetrial(cfg); >>>> > >>>> > >>>> > Something I was worried about is that I use an old version of >>>> > Fieldtrip for my scripts because I wrote them long ago and this >>>> > trialfun uses the new format (with 'ft_s',etc.). Could this affect it >>>> > in any way? >>>> > >>>> > >>>> > Thanks again! >>>> > >>>> > >>>> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >>>> > n.lam at fcdonders.ru.nl > wrote: >>>> > >>>> > >>>> > Hi Ana Laura, >>>> > >>>> > In general, you need to determine which trial function (Trialfun) to >>>> > use when using definetrial (see this tutorial: >>>> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >>>> > trial definition for the fully incongruent (FIC) condition). >>>> > >>>> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >>>> > your code before calling definetrial (see below). >>>> > >>>> > % TRIAL DEFINITION >>>> > cfg=[]; >>>> > cfg.filename = ['my/folders/', subject, '.RAW']; >>>> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>> > >>>> > cfg.trialdef.eventtype = 'STATUS'; >>>> > cfg.trialdef.eventvalue = cgrmrk; >>>> > cfg.trialdef.prestim = 0.2; >>>> > cfg.trialdef.poststim = 1; >>>> > cfg.trialdef.eventtype=?; >>>> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >>>> > cfg = definetrial(cfg); >>>> > >>>> > >>>> > As an addition note: based on your error message, it seemed that the >>>> > problem was in the function trialfun_bit2dec. However, from the code >>>> > you showed us, you haven't referenced/called this function. I was >>>> > wondering if the code you provide corresponded to the code that >>>> > created your error message? I'm guessing you ran [trl] >>>> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >>>> > case, it was looking for cfg.trialdef.eventtype. You can call >>>> > trialfun_bit2dec as long as you have all the relevant information in >>>> > the cfg (which is in the code you showed us). Hope this helps. >>>> > >>>> > Best, >>>> > Nietzsche >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > ----- Original Message ----- >>>> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >>>> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >>>> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >>>> > > Subject: [FieldTrip] Where to add a trialfun? >>>> > > Hello all! I'm having a simple problem. I want to add this trialfun: >>>> > > >>>> > > >>>> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >>>> > > >>>> > > >>>> > > >>>> > > I get this error: >>>> > > >>>> > > >>>> > > >>>> > > Reference to non-existent field 'trialdef'. >>>> > > >>>> > > >>>> > > Error in trialfun_bit2dec (line 52) >>>> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >>>> > > >>>> > > >>>> > > I'm quite sure it's because I'm not writing it in the correct part >>>> > > of >>>> > > my script. This is my trial definition part. Where should I add it >>>> > > and >>>> > > how should I write the line? >>>> > > >>>> > > >>>> > > >>>> > > % TRIAL DEFINITION >>>> > > cfg=[]; >>>> > > cfg.filename = ['my/folders/', subject, '.RAW']; >>>> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>> > > >>>> > > >>>> > > cfg.trialdef.eventtype = 'STATUS'; >>>> > > cfg.trialdef.eventvalue = cgrmrk; >>>> > > cfg.trialdef.prestim = 0.2; >>>> > > cfg.trialdef.poststim = 1; >>>> > > cfg.trialdef.eventtype=?; >>>> > > >>>> > > >>>> > > cfg = definetrial(cfg); >>>> > > >>>> > > >>>> > > trl = cfg.trl; >>>> > > cfg=[]; >>>> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >>>> > > cfg.trl = trl; >>>> > > cfg.reref = 'yes'; >>>> > > cfg.refchannel = ['all']; >>>> > > >>>> > > >>>> > > THANKS! >>>> > > _______________________________________________ >>>> > > 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 >>>> > >>>> > >>>> > _______________________________________________ >>>> > 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 >>>> >>> >>> >>> _______________________________________________ >>> 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 a.stolk8 at gmail.com Tue Sep 30 09:01:11 2014 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Tue, 30 Sep 2014 09:01:11 +0200 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Hi Ana Laura, Your 'trl' is empty, which it shouldn't be. So anytime you try to index an element in it, it will throw an error. Can you check what 'event.values' you find in your dataset? And compare those with any of the ones falling under the switch case statement? One way to do this, is to put a debug marker (red dot) at the 'end' of the first for-loop (judging from the wiki). Then check the value of event(i).value, and click the continue button to move on to the next. An alternative way is to put a debug marker after event = ft_read_event and to instantly check all values of event with "[event(:).value]". Goodluck, Arjen 2014-09-30 6:20 GMT+02:00 Ana Laura Diez Martini : > This is my attempt of adapting the code for the new Fieldtrip > > % TRIAL DEFINITION > > cfg=[]; > cfg.dataset = 'myfile'; > > hdr = ft_read_header( 'myfile'); > dat = ft_read_data('myfile'); > cfg.trialfun = 'trialfun_bit2dec'; > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > cfg = ft_definetrial(cfg); > > again the error is: > > Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > Error in process_ERP_1_fieldtrip (line 106) > cfg = ft_definetrial(cfg); > > > > On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini < > diezmartini at gmail.com> wrote: > >> Dear Arjen and Nietzsche, >> >> I tried debugging with dbstop if error and cfg.debug = 'saveonerror' and >> matlab points to: >> >> % discard the repeated values >> idx = any(diff(trl(:,1),1,1),2); >> trl = trl(idx,:); >> >> It does seem it is not reading the events. When I read them with the raw >> data, they seem to be there, with the DIN prefix. Any idea? >> >> On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk wrote: >> >>> Hey Ana Laura, >>> >>> Seems from the error message you're getting >>> >>> "Attempted to access trl(:,1); index out of bounds because >>> size(trl)=[0,0]." >>> >>> that none of the triggers were found in your event data. You might wanna >>> check why this is happening, by debugging 'trialfun_bit2dec' on your input. >>> >>> Best, >>> Arjen >>> >>> >>> >>> 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini >> >: >>> >>>> Thank you again Nietzsche!! >>>> >>>> Yes, I was referring to trialfun_bit2dec. I followed your advice and I >>>> changed definetrial to ft_definetrial and I confirm the function was added >>>> to my paths. After doing this, the error I get is: >>>> >>>> Attempted to access trl(:,1); index out of bounds because >>>> size(trl)=[0,0]. >>>> >>>> Error in trialfun_bit2dec (line 66) >>>> idx = any(diff(trl(:,1),1,1),2); >>>> >>>> Error in ft_definetrial (line 169) >>>> trl = feval(cfg.trialfun, cfg); >>>> >>>> Error in process_ERP_1_fieldtrip (line 95) >>>> cfg = ft_definetrial(cfg); >>>> >>>> This is again the trial definition part in which I think I added what I >>>> think are useless lines but I was just trying to make it run it. >>>> >>>> % TRIAL DEFINITION >>>> cfg=[]; >>>> cfg.filename = ['myfolders/subject.RAW']; >>>> cfg.headerfile = ['myfolders/subject.RAW']; >>>> cfg.dataset = ['myfolders/subject.RAW']; >>>> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition >>>> cfg.trialdef.eventtype = 'STATUS'; >>>> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >>>> cfg.trialdef.prestim = 0.2; % latency in seconds >>>> cfg.trialdef.poststim = 1; % latency in seconds >>>> cfg = ft_definetrial(cfg); >>>> >>>> trl = cfg.trl; >>>> cfg=[]; >>>> cfg.dataset = ['myfolders/subject.RAW']; >>>> cfg.trl = trl; >>>> cfg.reref = 'yes'; >>>> cfg.refchannel = ['all']; >>>> >>>> Unfortunately using this function is crucial to my analysis because I >>>> would like to use only Fieldtrip to analyse all my data. Thank you for >>>> taking all this time. >>>> >>>> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche >>> > wrote: >>>> >>>>> Hi again Ana Laura, >>>>> >>>>> One other thing that I thought of was to make sure that the function >>>>> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >>>>> can find this function. >>>>> >>>>> By updating your fieldtrip to the most recent version >>>>> "trialfun_bit2dec" is *not* included. So you'll need to store that as a >>>>> separate .m file in a location that can be accessed by the paths set in >>>>> matlab. >>>>> >>>>> Nietzsche >>>>> >>>>> ----- Original Message ----- >>>>> > From: "Ana Laura Diez Martini" >>>>> > To: "FieldTrip discussion list" >>>>> > Sent: Saturday, 27 September, 2014 7:18:25 PM >>>>> > Subject: Re: [FieldTrip] Where to add a trialfun? >>>>> > Thank you Nietzsche! >>>>> > >>>>> > >>>>> > I added it where you suggested and now this is the error I get: >>>>> > >>>>> > >>>>> > >>>>> > Error using feval >>>>> > Invalid function name 'trialfun_bit2dec(cfg)'. >>>>> > >>>>> > >>>>> > Error in definetrial (line 105) >>>>> > trl = feval(cfg.trialfun, cfg); >>>>> > >>>>> > >>>>> > Error in process_ERP_1_fieldtrip (line 97) >>>>> > cfg = definetrial(cfg); >>>>> > >>>>> > >>>>> > Something I was worried about is that I use an old version of >>>>> > Fieldtrip for my scripts because I wrote them long ago and this >>>>> > trialfun uses the new format (with 'ft_s',etc.). Could this affect it >>>>> > in any way? >>>>> > >>>>> > >>>>> > Thanks again! >>>>> > >>>>> > >>>>> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >>>>> > n.lam at fcdonders.ru.nl > wrote: >>>>> > >>>>> > >>>>> > Hi Ana Laura, >>>>> > >>>>> > In general, you need to determine which trial function (Trialfun) to >>>>> > use when using definetrial (see this tutorial: >>>>> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >>>>> > trial definition for the fully incongruent (FIC) condition). >>>>> > >>>>> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >>>>> > your code before calling definetrial (see below). >>>>> > >>>>> > % TRIAL DEFINITION >>>>> > cfg=[]; >>>>> > cfg.filename = ['my/folders/', subject, '.RAW']; >>>>> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>>> > >>>>> > cfg.trialdef.eventtype = 'STATUS'; >>>>> > cfg.trialdef.eventvalue = cgrmrk; >>>>> > cfg.trialdef.prestim = 0.2; >>>>> > cfg.trialdef.poststim = 1; >>>>> > cfg.trialdef.eventtype=?; >>>>> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >>>>> > cfg = definetrial(cfg); >>>>> > >>>>> > >>>>> > As an addition note: based on your error message, it seemed that the >>>>> > problem was in the function trialfun_bit2dec. However, from the code >>>>> > you showed us, you haven't referenced/called this function. I was >>>>> > wondering if the code you provide corresponded to the code that >>>>> > created your error message? I'm guessing you ran [trl] >>>>> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >>>>> > case, it was looking for cfg.trialdef.eventtype. You can call >>>>> > trialfun_bit2dec as long as you have all the relevant information in >>>>> > the cfg (which is in the code you showed us). Hope this helps. >>>>> > >>>>> > Best, >>>>> > Nietzsche >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > ----- Original Message ----- >>>>> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >>>>> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >>>>> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >>>>> > > Subject: [FieldTrip] Where to add a trialfun? >>>>> > > Hello all! I'm having a simple problem. I want to add this >>>>> trialfun: >>>>> > > >>>>> > > >>>>> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >>>>> > > >>>>> > > >>>>> > > >>>>> > > I get this error: >>>>> > > >>>>> > > >>>>> > > >>>>> > > Reference to non-existent field 'trialdef'. >>>>> > > >>>>> > > >>>>> > > Error in trialfun_bit2dec (line 52) >>>>> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >>>>> > > >>>>> > > >>>>> > > I'm quite sure it's because I'm not writing it in the correct part >>>>> > > of >>>>> > > my script. This is my trial definition part. Where should I add it >>>>> > > and >>>>> > > how should I write the line? >>>>> > > >>>>> > > >>>>> > > >>>>> > > % TRIAL DEFINITION >>>>> > > cfg=[]; >>>>> > > cfg.filename = ['my/folders/', subject, '.RAW']; >>>>> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>>> > > >>>>> > > >>>>> > > cfg.trialdef.eventtype = 'STATUS'; >>>>> > > cfg.trialdef.eventvalue = cgrmrk; >>>>> > > cfg.trialdef.prestim = 0.2; >>>>> > > cfg.trialdef.poststim = 1; >>>>> > > cfg.trialdef.eventtype=?; >>>>> > > >>>>> > > >>>>> > > cfg = definetrial(cfg); >>>>> > > >>>>> > > >>>>> > > trl = cfg.trl; >>>>> > > cfg=[]; >>>>> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >>>>> > > cfg.trl = trl; >>>>> > > cfg.reref = 'yes'; >>>>> > > cfg.refchannel = ['all']; >>>>> > > >>>>> > > >>>>> > > THANKS! >>>>> > > _______________________________________________ >>>>> > > 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 >>>>> > >>>>> > >>>>> > _______________________________________________ >>>>> > 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 >>>>> >>>> >>>> >>>> _______________________________________________ >>>> 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: From russgport at gmail.com Tue Sep 30 16:08:39 2014 From: russgport at gmail.com (Russell G Port) Date: Tue, 30 Sep 2014 10:08:39 -0400 Subject: [FieldTrip] applying ica rejection to differently epoched data Message-ID: Hi All, I have a question, which I hope someone can help with. Currently I read in my dataset (*.ds) via standard fieldtrip commands, epoching 1 second bins for the length of the data. After proper removal of all jump and muscle artifact, I apply ICA to the resample data (now 300Hz before it was 1200Hz). This is just like fieldtrip's website suggests. Then I verify which components I want to remove via topoplots and coherence in the time domain with the ECG channels. So I now have the list of components that I think are artifact and want removed. Can these components be applied for rejection onto the same dataset, but differently parsed into epochs, now trials being centered 1 second bins around a trigger? I am trying to see if this works, because I hope if I include more data in the ICA analysis (all data in the dataset) I will get a better components since there are more trials to train the data on, rather than if I based trials around the trigger. I guess what I want to know is if I can get better estimates of my artifacts via using a larger dataset, and then apply then to the same dataset just differently epoched? Best, Russ Port -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Tue Sep 30 22:27:25 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Tue, 30 Sep 2014 10:27:25 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: For a more simple check, when I try to read the events without the trialfun ( so it uses ft_trialfun_general by default) I get the original event values: >> cfg = []; >> cfg.dataset = '27CW1.RAW'; >> cfg.trialdef.eventtype = '?'; >> cfg=ft_definetrial(cfg); Warning: no trialfun was specified, using ft_trialfun_general > In ft_definetrial at 135 evaluating trialfunction 'ft_trialfun_general' reading the events from '27CW1.RAW' the following events were found in the datafile event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' no trials have been defined yet, see FT_DEFINETRIAL for further help found 750 events created 0 trials the call to "ft_definetrial" took 4 seconds Then I try to use the trialfun, I get the same error >> cfg = []; >> cfg.dataset = '27CW1.RAW'; >> cfg.trialfun = 'trialfun_bit2dec'; >> cfg.trialdef.eventtype = '?'; >> cfg=ft_definetrial(cfg); evaluating trialfunction 'trialfun_bit2dec' Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. Error in trialfun_bit2dec (line 66) idx = any(diff(trl(:,1),1,1),2); Error in ft_definetrial (line 169) trl = feval(cfg.trialfun, cfg); So there is something the trialfun_bit2dec does that events cannot be read anymore. On Mon, Sep 29, 2014 at 9:01 PM, Arjen Stolk wrote: > Hi Ana Laura, > > Your 'trl' is empty, which it shouldn't be. So anytime you try to index an > element in it, it will throw an error. > > Can you check what 'event.values' you find in your dataset? And compare > those with any of the ones falling under the switch case statement? One way > to do this, is to put a debug marker (red dot) at the 'end' of the first > for-loop (judging from the wiki). Then check the value of event(i).value, > and click the continue button to move on to the next. An alternative way is > to put a debug marker after event = ft_read_event and to instantly check > all values of event with "[event(:).value]". > > Goodluck, > Arjen > > 2014-09-30 6:20 GMT+02:00 Ana Laura Diez Martini : > >> This is my attempt of adapting the code for the new Fieldtrip >> >> % TRIAL DEFINITION >> >> cfg=[]; >> cfg.dataset = 'myfile'; >> >> hdr = ft_read_header( 'myfile'); >> dat = ft_read_data('myfile'); >> cfg.trialfun = 'trialfun_bit2dec'; >> cfg.trialdef.eventtype = 'STATUS'; >> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >> cfg.trialdef.prestim = 0.2; >> cfg.trialdef.poststim = 1; >> >> cfg.reref = 'yes'; >> cfg.refchannel = ['all']; >> cfg = ft_definetrial(cfg); >> >> again the error is: >> >> Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> Error in process_ERP_1_fieldtrip (line 106) >> cfg = ft_definetrial(cfg); >> >> >> >> On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini < >> diezmartini at gmail.com> wrote: >> >>> Dear Arjen and Nietzsche, >>> >>> I tried debugging with dbstop if error and cfg.debug = 'saveonerror' >>> and matlab points to: >>> >>> % discard the repeated values >>> idx = any(diff(trl(:,1),1,1),2); >>> trl = trl(idx,:); >>> >>> It does seem it is not reading the events. When I read them with the raw >>> data, they seem to be there, with the DIN prefix. Any idea? >>> >>> On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk wrote: >>> >>>> Hey Ana Laura, >>>> >>>> Seems from the error message you're getting >>>> >>>> "Attempted to access trl(:,1); index out of bounds because >>>> size(trl)=[0,0]." >>>> >>>> that none of the triggers were found in your event data. You might >>>> wanna check why this is happening, by debugging 'trialfun_bit2dec' on your >>>> input. >>>> >>>> Best, >>>> Arjen >>>> >>>> >>>> >>>> 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini < >>>> diezmartini at gmail.com>: >>>> >>>>> Thank you again Nietzsche!! >>>>> >>>>> Yes, I was referring to trialfun_bit2dec. I followed your advice and I >>>>> changed definetrial to ft_definetrial and I confirm the function was added >>>>> to my paths. After doing this, the error I get is: >>>>> >>>>> Attempted to access trl(:,1); index out of bounds because >>>>> size(trl)=[0,0]. >>>>> >>>>> Error in trialfun_bit2dec (line 66) >>>>> idx = any(diff(trl(:,1),1,1),2); >>>>> >>>>> Error in ft_definetrial (line 169) >>>>> trl = feval(cfg.trialfun, cfg); >>>>> >>>>> Error in process_ERP_1_fieldtrip (line 95) >>>>> cfg = ft_definetrial(cfg); >>>>> >>>>> This is again the trial definition part in which I think I added what >>>>> I think are useless lines but I was just trying to make it run it. >>>>> >>>>> % TRIAL DEFINITION >>>>> cfg=[]; >>>>> cfg.filename = ['myfolders/subject.RAW']; >>>>> cfg.headerfile = ['myfolders/subject.RAW']; >>>>> cfg.dataset = ['myfolders/subject.RAW']; >>>>> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition >>>>> cfg.trialdef.eventtype = 'STATUS'; >>>>> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >>>>> cfg.trialdef.prestim = 0.2; % latency in seconds >>>>> cfg.trialdef.poststim = 1; % latency in seconds >>>>> cfg = ft_definetrial(cfg); >>>>> >>>>> trl = cfg.trl; >>>>> cfg=[]; >>>>> cfg.dataset = ['myfolders/subject.RAW']; >>>>> cfg.trl = trl; >>>>> cfg.reref = 'yes'; >>>>> cfg.refchannel = ['all']; >>>>> >>>>> Unfortunately using this function is crucial to my analysis because I >>>>> would like to use only Fieldtrip to analyse all my data. Thank you for >>>>> taking all this time. >>>>> >>>>> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche < >>>>> n.lam at fcdonders.ru.nl> wrote: >>>>> >>>>>> Hi again Ana Laura, >>>>>> >>>>>> One other thing that I thought of was to make sure that the function >>>>>> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >>>>>> can find this function. >>>>>> >>>>>> By updating your fieldtrip to the most recent version >>>>>> "trialfun_bit2dec" is *not* included. So you'll need to store that as a >>>>>> separate .m file in a location that can be accessed by the paths set in >>>>>> matlab. >>>>>> >>>>>> Nietzsche >>>>>> >>>>>> ----- Original Message ----- >>>>>> > From: "Ana Laura Diez Martini" >>>>>> > To: "FieldTrip discussion list" >>>>>> > Sent: Saturday, 27 September, 2014 7:18:25 PM >>>>>> > Subject: Re: [FieldTrip] Where to add a trialfun? >>>>>> > Thank you Nietzsche! >>>>>> > >>>>>> > >>>>>> > I added it where you suggested and now this is the error I get: >>>>>> > >>>>>> > >>>>>> > >>>>>> > Error using feval >>>>>> > Invalid function name 'trialfun_bit2dec(cfg)'. >>>>>> > >>>>>> > >>>>>> > Error in definetrial (line 105) >>>>>> > trl = feval(cfg.trialfun, cfg); >>>>>> > >>>>>> > >>>>>> > Error in process_ERP_1_fieldtrip (line 97) >>>>>> > cfg = definetrial(cfg); >>>>>> > >>>>>> > >>>>>> > Something I was worried about is that I use an old version of >>>>>> > Fieldtrip for my scripts because I wrote them long ago and this >>>>>> > trialfun uses the new format (with 'ft_s',etc.). Could this affect >>>>>> it >>>>>> > in any way? >>>>>> > >>>>>> > >>>>>> > Thanks again! >>>>>> > >>>>>> > >>>>>> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >>>>>> > n.lam at fcdonders.ru.nl > wrote: >>>>>> > >>>>>> > >>>>>> > Hi Ana Laura, >>>>>> > >>>>>> > In general, you need to determine which trial function (Trialfun) to >>>>>> > use when using definetrial (see this tutorial: >>>>>> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >>>>>> > trial definition for the fully incongruent (FIC) condition). >>>>>> > >>>>>> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >>>>>> > your code before calling definetrial (see below). >>>>>> > >>>>>> > % TRIAL DEFINITION >>>>>> > cfg=[]; >>>>>> > cfg.filename = ['my/folders/', subject, '.RAW']; >>>>>> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>>>> > >>>>>> > cfg.trialdef.eventtype = 'STATUS'; >>>>>> > cfg.trialdef.eventvalue = cgrmrk; >>>>>> > cfg.trialdef.prestim = 0.2; >>>>>> > cfg.trialdef.poststim = 1; >>>>>> > cfg.trialdef.eventtype=?; >>>>>> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >>>>>> > cfg = definetrial(cfg); >>>>>> > >>>>>> > >>>>>> > As an addition note: based on your error message, it seemed that the >>>>>> > problem was in the function trialfun_bit2dec. However, from the code >>>>>> > you showed us, you haven't referenced/called this function. I was >>>>>> > wondering if the code you provide corresponded to the code that >>>>>> > created your error message? I'm guessing you ran [trl] >>>>>> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >>>>>> > case, it was looking for cfg.trialdef.eventtype. You can call >>>>>> > trialfun_bit2dec as long as you have all the relevant information in >>>>>> > the cfg (which is in the code you showed us). Hope this helps. >>>>>> > >>>>>> > Best, >>>>>> > Nietzsche >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > ----- Original Message ----- >>>>>> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >>>>>> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >>>>>> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >>>>>> > > Subject: [FieldTrip] Where to add a trialfun? >>>>>> > > Hello all! I'm having a simple problem. I want to add this >>>>>> trialfun: >>>>>> > > >>>>>> > > >>>>>> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > I get this error: >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > Reference to non-existent field 'trialdef'. >>>>>> > > >>>>>> > > >>>>>> > > Error in trialfun_bit2dec (line 52) >>>>>> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >>>>>> > > >>>>>> > > >>>>>> > > I'm quite sure it's because I'm not writing it in the correct part >>>>>> > > of >>>>>> > > my script. This is my trial definition part. Where should I add it >>>>>> > > and >>>>>> > > how should I write the line? >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > % TRIAL DEFINITION >>>>>> > > cfg=[]; >>>>>> > > cfg.filename = ['my/folders/', subject, '.RAW']; >>>>>> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>>>> > > >>>>>> > > >>>>>> > > cfg.trialdef.eventtype = 'STATUS'; >>>>>> > > cfg.trialdef.eventvalue = cgrmrk; >>>>>> > > cfg.trialdef.prestim = 0.2; >>>>>> > > cfg.trialdef.poststim = 1; >>>>>> > > cfg.trialdef.eventtype=?; >>>>>> > > >>>>>> > > >>>>>> > > cfg = definetrial(cfg); >>>>>> > > >>>>>> > > >>>>>> > > trl = cfg.trl; >>>>>> > > cfg=[]; >>>>>> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >>>>>> > > cfg.trl = trl; >>>>>> > > cfg.reref = 'yes'; >>>>>> > > cfg.refchannel = ['all']; >>>>>> > > >>>>>> > > >>>>>> > > THANKS! >>>>>> > > _______________________________________________ >>>>>> > > 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 >>>>>> > >>>>>> > >>>>>> > _______________________________________________ >>>>>> > 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 >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> 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 >> > > > _______________________________________________ > 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 kathrin.muesch at gmail.com Tue Sep 30 22:49:08 2014 From: kathrin.muesch at gmail.com (=?iso-8859-1?Q?Kathrin_M=FCsch?=) Date: Tue, 30 Sep 2014 16:49:08 -0400 Subject: [FieldTrip] loading neuroscan cnt files - noninteger samples Message-ID: Dear All, I would like to analyze CNT files acquired with a Neuroscan Synamps2 system. I manage to correctly load it in the 32 bit data format. However, the samples for my trigger events are not integers. This shouldn’t be happening because precision cannot be higher than the sampling rate. I noticed that this only happens when the the teeg parameter that is read out of the cnt file is set to 3 but not to 2. For some of my data files the teeg=3 and for some it is 2 and then I get integer samples. The files come from the same data session so I cannot understand why they are read out differently. Has anyone experienced this before and has suggestions how this can be solved? Any help is appreciated. Best, Kathrin -- Kathrin Müsch, Ph.D. Department of Psychology University of Toronto Toronto, Canada www.honeylab.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Mon Sep 1 09:02:16 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Mon, 1 Sep 2014 07:02:16 +0000 Subject: [FieldTrip] Grand Average on time lock data Message-ID: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Dear all, I would like to perform the grand average in a separate script than the preprocessing one, to avoid a crash, because of the number of participants. In the preprocessing script, I performed a timelockanalysis for each participants : avgFC = ft_timelockanalysis(cfg, cleandata); and then save this file : finfname = [subjID{s} '_RP']; mkdir(subjID{s}) save([subjPath filesep finfname '.mat'], 'avgFC'); So, in my grand average script, I wrote the following : cfg = []; homePath = '/Users/emilie/Desktop/EEG_RP/Grandaverage/'; eegPath = homePath; %% Subjects datafiles = {'S83_RP','S84_RP','S85_RP','S87_RP','S88_RP','S89_RP','S90_RP','S91_RP','S92_RP','S93_RP','S94_RP','S97_RP','S98_RP','S99_RP','S100_RP', 'S101_RP'}; nFiles = length(datafiles); avgs = cell(1,nFiles); cfg.channel = 'all'; cfg.latency = 'all'; %cfg.parameter = 'avg'; for iFile = 1:nFiles thisfile = datafiles{iFile}; subjPath = [eegPath thisfile]; file = dir([subjPath '*.mat']); avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', 'feedback', 'no'); avgs{iFile} = load(datafiles{iFile}); end GA = ft_timelockgrandaverage(cfg, avgs{:}); But I'm not pretty sure to understand the error message : Error using ft_checkdata (line 366) This function requires timelock data as input. Error in Averaging (line 33) avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', 'feedback', 'no'); Because If I'm right, the files in 'datafiles' are the time locked data from the preprocessing script. Thank you, Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Sep 1 09:28:21 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 1 Sep 2014 09:28:21 +0200 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Message-ID: Dear Emilie, If you assign the return value of MATLAB's load() to a variable, that variable will become a struct with the variables in the specified mat-file as its fields. In your case avgs{k} will probably (have not read your script very thoroughly) be a struct, so avgs{k}.avgFC is the actual timelock structure. You should replace avgs{iFile} = load(datafiles{iFile}); with tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; and then I think it should work. Best, Eelke On 1 September 2014 09:02, Caspar, Emilie wrote: > Dear all, > > > I would like to perform the grand average in a separate script than the > preprocessing one, to avoid a crash, because of the number of participants. > In the preprocessing script, I performed a timelockanalysis for each > participants : avgFC = ft_timelockanalysis(cfg, cleandata); > and then save this file : > finfname = [subjID{s} '_RP']; > mkdir(subjID{s}) > save([subjPath filesep finfname '.mat'], 'avgFC'); > > > So, in my grand average script, I wrote the following : > > cfg = []; > homePath = '/Users/emilie/Desktop/EEG_RP/Grandaverage/'; > eegPath = homePath; > > > > %% Subjects > datafiles = > {'S83_RP','S84_RP','S85_RP','S87_RP','S88_RP','S89_RP','S90_RP','S91_RP','S92_RP','S93_RP','S94_RP','S97_RP','S98_RP','S99_RP','S100_RP', > 'S101_RP'}; > nFiles = length(datafiles); > avgs = cell(1,nFiles); > > > > cfg.channel = 'all'; > cfg.latency = 'all'; > %cfg.parameter = 'avg'; > > > > for iFile = 1:nFiles > thisfile = datafiles{iFile}; > subjPath = [eegPath thisfile]; > file = dir([subjPath '*.mat']); > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > 'feedback', 'no'); > avgs{iFile} = load(datafiles{iFile}); > end > > > > GA = ft_timelockgrandaverage(cfg, avgs{:}); > > But I'm not pretty sure to understand the error message : > Error using ft_checkdata (line 366) > This function requires timelock data as input. > > Error in Averaging (line 33) > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > 'feedback', 'no'); > > Because If I'm right, the files in 'datafiles' are the time locked data from > the preprocessing script. > > Thank you, > > Emilie > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Mon Sep 1 09:48:30 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 1 Sep 2014 09:48:30 +0200 Subject: [FieldTrip] Using clusterstat.m straight giving her specific statobs and statrnd In-Reply-To: References: Message-ID: Dear Constantino, First, you need to specify cfg.dim as the size of the data matrix, in your case probably just [102 500], the size(statobs) before reshaping. Note that you need to put in statobs as a vector (statobs(:)) and statrnd as a numel(statobs) X nRand matrix. Second, I don't know why you are specifying a cfg.layout, this is not used by the function. The same goes for cfg.neighbours, this is also not used. The higher-level statistics functions convert the cfg.neighbours struct-array into a logical connectivity array using the low-level private function channelconnectivity. To use clusterstat (a low-level function) directly, you need to do this beforehand. So, do something like this: cfg = []; cfg.neighbours = neighbours; cfg.channel = datachannels; % order is important here, must be the same as the data connectivity = channelconnectivity(cfg); cfg = []; ... cfg.dim = size(statobs); % assuming statobs is still a chan X time matrix cfg.connectivity = connectivity; % this assumes statrnd is a chan X time X nRand array statrnd = reshape(statrnd, [numel(statobs), size(statrnd,3)]); statobs = statobs(:); stat = clusterstat(cfg, statrnd, statobs); Best, Eelke On 29 August 2014 18:36, Constantino Méndez Bértolo < constantino.mendezbertolo at ctb.upm.es> wrote: > Dear Fieldtrippers > > We have a 3x3 design and MEG data, say only mag channels (n102) to > simplify. > > We want to perform a cluster-based permutation approach but > timelockstatistics (cfg.method = 'montecarlo', cfg.correctm = 'cluster', > etc) cannot deal with interactions when you have more than three levels > (true?) > > So we built our 'statobs' and 'statrnd' doing a GLM in -R Statistical > Package- and feed 'clusterstat.m' with them > > We have done this with one channel over time with success. However, I am > clueless now about how to solve the problem when dealing with the whole > channel set. > > I wonder what is the nature of the cfg.dim that we need to feed > 'clusterstat.m' with. > > Up to now, we use, (cioming out of -R-): > > size(statobs) = nchan*ntime % (102*500) % twin = [0 .5] % seconds > size(statrnd) = nchan*ntime*nrandomizations % (102*500*1000) > > > and the following presets: > > cfg=[]; > cfg.clustercritval = Fcritmain; % We genereate this before hand > cfg.tail = 1; cfg.clustertail = 1; cfg.clusterthreshold = 'parametric'; > cfg.dim = [1 size(statobs,1) size(statobs,2) ] % <<< The key may be here > load('neuromag306mag_neighb.mat'); > cfg.neighbours = neighbours; > cfg.feedback = 'yes'; > cfg.numrandomization = 1000; > cfg.clusterstatistic = 'maxsum'; > cfg.layout = 'neuromag306mag.lay'; > for i = 1:length(cfg.neighbours) > cfg.channel{i} = cfg.neighbours(i).label; > end > > stat = clusterstat(cfg,statrnd, statobs) > > > Which lead us to an error within findcluster > > Error using findcluster (line 59) > invalid dimension of spatdimneighbstructmat > > Error in clusterstat (line 197) > posclusobs = findcluster(reshape(postailobs, > [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); > > > If anybody has got some insigth it would be greatly appreciated. Or any > hints. Are the size of my statobs and starnd correct? I can share more > information and firstly apologize if I was not able to describe the > problem accurately, I am confused regarding that 'reshape' and the addition > of one dimension at "...reshape(postailobs,[cfg.dim,1])...", but the > problem arises first when findcluster.m tries to calculate the size of > spatdimneighbstructmat > > First line of findcluster.m calcualtes 'spatdimlength' by : " > spatdimlength = size(onoff, 1);" which in our case is "1", which is > obviously wrong?. > > manythanks&peace2all > > -- > Constantino Méndez-Bértolo > Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) > > Parque Científico y Tecnológico de la UPM, Campus de Montegancedo > > 28223 Pozuelo de Alarcón, Madrid, SPAIN > > > > _______________________________________________ > 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 Christoph.Maier at hs-heilbronn.de Mon Sep 1 11:54:28 2014 From: Christoph.Maier at hs-heilbronn.de (Maier, Christoph) Date: Mon, 1 Sep 2014 09:54:28 +0000 Subject: [FieldTrip] Realtime question: tmsi2ft saving to gdf file Message-ID: <2401574ECDCE3246B11D77FD57BFEB1E010D5D31E2@exmbx2.hhn.hs-heilbronn.de> Dear Fieldtrip Users, from the tmsi2ft description on the web (http://fieldtrip.fcdonders.nl/development/realtime/tmsi) I understand that tmsi2ft should allow to transparently save the acquired data to a gdf file while streaming it out. I successfully can read the Signal/Event data acquired with tmsi2ft into Matlab using the realtime functions. However, I can't find a gdf file, and I can't see any place where a file name could be specified. The command line accepts only the parameters tmsi2ft config.txt [hostname [port [ctrlPort]]] The parseFile() Method of the SignalConfiguration-Class does not seem to permit a specification of a filename in the configuration file, and I couldn't identify a call to ODM->setFilename() or ODM->enableSaving() in the tmsi2ft code (as opposed to the biosemi2ft code, where such calls are present and where the filename can be specified in the command line). Therefore my question is: Did I overlook anything and can a filename for a gdf file be specified anyhwere during startup of tmsi2ft? Or is the only intended way to use the TCP command interface of the OnlineDataManager? Thanks in advance for your help Christoph Maier ------------------------------------------------------------------------------------------------- Dr. Christoph Maier, Dipl.-Inform. Med. Department of Medical Informatics Faculty of Informatics (IT) Max-Planck-Str. 39 D-74081 Heilbronn Germany Tel.: +49 (0)7131 504-355 Fax: +49 (0)7131 252 470 E-Mail: christoph.maier at hs-heilbronn.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Mon Sep 1 16:51:48 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Mon, 1 Sep 2014 14:51:48 +0000 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Message-ID: <0AD437C8-8D04-4598-AD49-F50B41E0E046@live.ucl.ac.uk> Dear Eelke, Thank you for your answer. Unfortunately, I still have the same error message. It occurs at the lines you mention, as they occurred in the line I had written in the previous script: tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; Error message: Error using ft_checkdata (line 366) This function requires timelock data as input. And I still don't understand the error. Emilie Le 1 sept. 2014 à 09:28, Eelke Spaak > a écrit : tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Sep 1 16:57:56 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 1 Sep 2014 16:57:56 +0200 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: <0AD437C8-8D04-4598-AD49-F50B41E0E046@live.ucl.ac.uk> References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> <0AD437C8-8D04-4598-AD49-F50B41E0E046@live.ucl.ac.uk> Message-ID: I just now noticed you are calling ft_checkdata yourself, inside the loop. I don't understand why this is, but to me it seems you can remove it. Does it work then? Best, Eelke On 1 September 2014 16:51, Caspar, Emilie wrote: > Dear Eelke, > > Thank you for your answer. Unfortunately, I still have the same error > message. It occurs at the lines you mention, as they occurred in the line I > had written in the previous script: > > tmp = load(datafiles{iFile}); > avgs{iFile} = tmp.avgFC; > > Error message: > Error using ft_checkdata (line 366) > This function requires timelock data as input. > > And I still don't understand the error. > > Emilie > > > > Le 1 sept. 2014 à 09:28, Eelke Spaak a écrit : > > tmp = load(datafiles{iFile}); > avgs{iFile} = tmp.avgFC; > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Tue Sep 2 11:08:59 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Tue, 2 Sep 2014 09:08:59 +0000 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> <0AD437C8-8D04-4598-AD49-F50B41E0E046@live.ucl.ac.uk> Message-ID: Yes! Thank you again! Emilie Le 1 sept. 2014 à 16:57, Eelke Spaak > a écrit : I just now noticed you are calling ft_checkdata yourself, inside the loop. I don't understand why this is, but to me it seems you can remove it. Does it work then? Best, Eelke On 1 September 2014 16:51, Caspar, Emilie > wrote: Dear Eelke, Thank you for your answer. Unfortunately, I still have the same error message. It occurs at the lines you mention, as they occurred in the line I had written in the previous script: tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; Error message: Error using ft_checkdata (line 366) This function requires timelock data as input. And I still don't understand the error. Emilie Le 1 sept. 2014 à 09:28, Eelke Spaak > a écrit : tmp = load(datafiles{iFile}); avgs{iFile} = tmp.avgFC; _______________________________________________ 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 Wed Sep 3 08:59:06 2014 From: roeysc at gmail.com (Roey Schurr) Date: Wed, 3 Sep 2014 09:59:06 +0300 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Message-ID: Dear fieldtrippers, I found it uncomfortable having to know the names of different variables as I load them, so I have written a function called "load2struct" (see below). It should be used in cases in which the mat file holds only one variable (a volume, a grid, etc), otherwise only the first variable is loaded. In your example, Emilie, you could use: avgs{iFile} = load2struct(datafiles{iFile}); For me it helped increase the code readability, and allowed my codes to be more compatible with changes I did along the way, like changing the naming format for variables used for specific subjects. I hope you find it useful (and also that it's not silly (maybe there's a much simpler solution), or just wrong). Best, Roey =========================================================== function struct = load2struct(filePath) % LOAD2STRUCT loads the struct in the filePath mat file to a variable, % without needing to know the original field name of this struct. struct = load(filePath); structFieldName = fieldnames(struct); if (length(structFieldName) > 1) warning('Note: load2struct only loads the first variable in the mat file') end eval(['struct = struct.' structFieldName{1} ';']); end On Mon, Sep 1, 2014 at 10:28 AM, Eelke Spaak wrote: > Dear Emilie, > > If you assign the return value of MATLAB's load() to a variable, that > variable will become a struct with the variables in the specified > mat-file as its fields. In your case avgs{k} will probably (have not > read your script very thoroughly) be a struct, so avgs{k}.avgFC is the > actual timelock structure. You should replace > > avgs{iFile} = load(datafiles{iFile}); > > with > > tmp = load(datafiles{iFile}); > avgs{iFile} = tmp.avgFC; > > and then I think it should work. > > Best, > Eelke > > On 1 September 2014 09:02, Caspar, Emilie wrote: > > Dear all, > > > > > > I would like to perform the grand average in a separate script than the > > preprocessing one, to avoid a crash, because of the number of > participants. > > In the preprocessing script, I performed a timelockanalysis for each > > participants : avgFC = ft_timelockanalysis(cfg, cleandata); > > and then save this file : > > finfname = [subjID{s} '_RP']; > > mkdir(subjID{s}) > > save([subjPath filesep finfname '.mat'], 'avgFC'); > > > > > > So, in my grand average script, I wrote the following : > > > > cfg = []; > > homePath = '/Users/emilie/Desktop/EEG_RP/Grandaverage/'; > > eegPath = homePath; > > > > > > > > %% Subjects > > datafiles = > > > {'S83_RP','S84_RP','S85_RP','S87_RP','S88_RP','S89_RP','S90_RP','S91_RP','S92_RP','S93_RP','S94_RP','S97_RP','S98_RP','S99_RP','S100_RP', > > 'S101_RP'}; > > nFiles = length(datafiles); > > avgs = cell(1,nFiles); > > > > > > > > cfg.channel = 'all'; > > cfg.latency = 'all'; > > %cfg.parameter = 'avg'; > > > > > > > > for iFile = 1:nFiles > > thisfile = datafiles{iFile}; > > subjPath = [eegPath thisfile]; > > file = dir([subjPath '*.mat']); > > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > > 'feedback', 'no'); > > avgs{iFile} = load(datafiles{iFile}); > > end > > > > > > > > GA = ft_timelockgrandaverage(cfg, avgs{:}); > > > > But I'm not pretty sure to understand the error message : > > Error using ft_checkdata (line 366) > > This function requires timelock data as input. > > > > Error in Averaging (line 33) > > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > > 'feedback', 'no'); > > > > Because If I'm right, the files in 'datafiles' are the time locked data > from > > the preprocessing script. > > > > Thank you, > > > > Emilie > > > > > > _______________________________________________ > > 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 jm.horschig at donders.ru.nl Wed Sep 3 10:29:43 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 03 Sep 2014 10:29:43 +0200 Subject: [FieldTrip] Grand Average on time lock data In-Reply-To: References: <37A9353A-12E8-43BC-8ECC-B9E2FB662646@live.ucl.ac.uk> Message-ID: <5406D177.3060105@donders.ru.nl> Hi all, there is also a feature in FieldTrip to load or save data, which is supported by nearly all functions (if you find one which does not support it and it should, let us know). You can set cfg.inputfile = 'filename' for loading data or cfg.outputfile = 'filename' for saving data. Note, however, that cfg.inputfile is to my knowldge exclusively compatible to having used cfg.outputfile, i.e. if the variable that is saved/loaded has a different name than what FieldTrip expects, this won't work. It might be worth a try for you guys, because then everything is 'in Fieldtrip style' (and more importantly, history is kept on what data was loaded in data.cfg.previous). Apart from that, thanks Roey for sharing your code! I am sure people will use your function ;) Best, Jörn On 9/3/2014 8:59 AM, Roey Schurr wrote: > Dear fieldtrippers, > > I found it uncomfortable having to know the names of different > variables as I load them, so I have written a function called > "load2struct" (see below). > It should be used in cases in which the mat file holds only one > variable (a volume, a grid, etc), otherwise only the first variable is > loaded. In your example, Emilie, you could use: > > avgs{iFile} = load2struct(datafiles{iFile}); > > For me it helped increase the code readability, and allowed my codes > to be more compatible with changes I did along the way, like changing > the naming format for variables used for specific subjects. > I hope you find it useful (and also that it's not silly (maybe there's > a much simpler solution), or just wrong). > > Best, > Roey > > > =========================================================== > function struct = load2struct(filePath) > % LOAD2STRUCT loads the struct in the filePath mat file to a variable, > % without needing to know the original field name of this struct. > struct = load(filePath); > structFieldName = fieldnames(struct); > if (length(structFieldName) > 1) > warning('Note: load2struct only loads the first variable in > the mat file') > end > eval(['struct = struct.' structFieldName{1} ';']); > end > > > On Mon, Sep 1, 2014 at 10:28 AM, Eelke Spaak > > wrote: > > Dear Emilie, > > If you assign the return value of MATLAB's load() to a variable, that > variable will become a struct with the variables in the specified > mat-file as its fields. In your case avgs{k} will probably (have not > read your script very thoroughly) be a struct, so avgs{k}.avgFC is the > actual timelock structure. You should replace > > avgs{iFile} = load(datafiles{iFile}); > > with > > tmp = load(datafiles{iFile}); > avgs{iFile} = tmp.avgFC; > > and then I think it should work. > > Best, > Eelke > > On 1 September 2014 09:02, Caspar, Emilie > wrote: > > Dear all, > > > > > > I would like to perform the grand average in a separate script > than the > > preprocessing one, to avoid a crash, because of the number of > participants. > > In the preprocessing script, I performed a timelockanalysis for each > > participants : avgFC = ft_timelockanalysis(cfg, cleandata); > > and then save this file : > > finfname = [subjID{s} '_RP']; > > mkdir(subjID{s}) > > save([subjPath filesep finfname '.mat'], 'avgFC'); > > > > > > So, in my grand average script, I wrote the following : > > > > cfg = []; > > homePath = '/Users/emilie/Desktop/EEG_RP/Grandaverage/'; > > eegPath = homePath; > > > > > > > > %% Subjects > > datafiles = > > > {'S83_RP','S84_RP','S85_RP','S87_RP','S88_RP','S89_RP','S90_RP','S91_RP','S92_RP','S93_RP','S94_RP','S97_RP','S98_RP','S99_RP','S100_RP', > > 'S101_RP'}; > > nFiles = length(datafiles); > > avgs = cell(1,nFiles); > > > > > > > > cfg.channel = 'all'; > > cfg.latency = 'all'; > > %cfg.parameter = 'avg'; > > > > > > > > for iFile = 1:nFiles > > thisfile = datafiles{iFile}; > > subjPath = [eegPath thisfile]; > > file = dir([subjPath '*.mat']); > > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > > 'feedback', 'no'); > > avgs{iFile} = load(datafiles{iFile}); > > end > > > > > > > > GA = ft_timelockgrandaverage(cfg, avgs{:}); > > > > But I'm not pretty sure to understand the error message : > > Error using ft_checkdata (line 366) > > This function requires timelock data as input. > > > > Error in Averaging (line 33) > > avgs{iFile} = ft_checkdata(avgs{iFile}, 'datatype', 'timelock', > > 'feedback', 'no'); > > > > Because If I'm right, the files in 'datafiles' are the time > locked data from > > the preprocessing script. > > > > Thank you, > > > > Emilie > > > > > > _______________________________________________ > > 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 agreene24 at gmail.com Wed Sep 3 11:58:29 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Wed, 3 Sep 2014 18:58:29 +0900 Subject: [FieldTrip] ft_rejectvisual: removing trials marked as bad Message-ID: Hello, I have used the rejectvisual function in attempt to remove bad trials, but after marking them and pressing the quit button, although the command window states that the selected trials have been removed, there is no obvious change in the data; all of the trials are still intact. Have I overlooked something? Thanks, Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcantor at umich.edu Thu Sep 4 20:30:50 2014 From: mcantor at umich.edu (Max Cantor) Date: Thu, 4 Sep 2014 14:30:50 -0400 Subject: [FieldTrip] TRENTOOL pipeline help Message-ID: Hi fieldtrippers, I know trentool is not produced by the Donders Institute, so I'm not 100% sure if it is appropriate to ask questions about it here, but to the best of my knowledge they do not have a mailing list and I saw a few trentool questions in the archives, so I'm going to assume it's ok... In any case, below is my current pipeline (slightly modified for comprehensibility): (notes in bold are comments/questions made in this email, not present in the pipeline. Sorry in advance for the long post! Any help would be greatly appreciated as I'm a bit over my head on this but I think I'm close!) ***** % Prepare group TE data cfgP = []; cfgP.Path2TSTOOL = *TSTOOLPATH* cfgP.TEcalctype = 'VW_ds'; cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; *I'm trying to find the transfer entropy between the left and right auditory cortices in my experiment. The input is virtual sensor data that was produced using SAM in fieldtrip on real MEG data. * % specify u to be scanned cfgP.predicttime_u = 30; cfgP.toi = [-0.4 0.4]; *For clarification, the predicttime_u is in seconds but the toi is in milliseconds. If I understand correctly, the predicttime_u must fit within the toi, but beyond that are there any benefits to it being earlier or later?* % ACT (Autocorrelation Time) estimation and constraints cfgP.maxlag = 150; cfgP.actthrvalue = 7.5; cfgP.minnrtrials = 5; *My understanding is maxlag should be 1/2 the sampling rate, so since the data are downsampled to 300hz, it should be 150. I know that the sample rate and filters are used to determine the actthrvalue, but I don't actually know the calculation. 7.5 was a rough guess just to test the pipeline. I'm also uncertain of what minnrtrials should be.* % Optimization cfgP.optimizemethod = 'ragwitz'; cfgP.ragdim = 4:8; cfgP.ragtaurange = [0.2 0.4]; cfgP.ragtausteps = 15; cfgP.repPred = 100; *I am completely at a loss for this. I've done some reading into transfer entropy, mutual information, etc., cited in trentool, but I'm yet to understand how exactly this optimization works and what the configuration should be, given my data and experimental intentions.* % Kernel-based TE estimation cfgP.flagNei = 'Mass'; cfgP.sizeNei = 4; % Default cfgP.ensemblemethod = 'no'; cfgP.outputpath = *OUTPUT PATH*; if ~exist(*Path for TEprepare data object*) load VSdat; TE_Wrd = {}; for i = 1:nConds for j = 1:Nsub TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); end end clear VSdat; save('TE_Wrd', 'TE_Wrd'); end *The configuration and virtual sensor data, organized in a 3 x 15 cell of structures (condition by subject) are the input. The TEprepare substructure is added to each individual condition x subject .mat files' data structure which are stored on disk independently.* % Use object_to_mat_conversion.m to replace individual condition x subject virtual sensor data % .mat files with their TE_Wrd equivalent *I'm using a separate script to make some manipulations to the objects from disk; this will all eventually be integrated into the main pipeline*.* TRENTOOL seems to handle data output very differently from fieldtrip and I've had trouble thinking through the most logical way to handle the data so it's a bit haphazard right now.* load cond080sub01.mat cfgG = []; cfgG.dim = cond080sub01.TEprepare.optdim; cfgG.tau = cond080sub01.TEprepare.opttau; if isfield(cond080sub01, 'TEprepare') TEgroup_prepare(cfgG, fileCell); else error('Need to run TEprepare before TEgroup_prepare'); end *For clarification, fileCell is a cell with the name of each condition x subject .mat file, which as I said before is collectively the same as the 3 x 15 VSdat structure (condition x subject).* % Replace .mat files with '_for_TEgroup_calculate' version in % object_to_mat_conversion.m % TE Group Calculate load cond080sub01.mat if isfield(cond080sub01, 'TEgroupprepare') for i = 1:length(fileCell) TEgroup_calculate(fileCell{i}); end else error('Need to run TEgroup_prepare before TEgroup_calculate'); end *At this step I get the following error:Error using transferentropy (line 337)\nTRENTOOL ERROR: not enough data points left after embeddingError in TEgroup_calculate (line 133)[TEresult] = transferentropy(cfg,data);* % TE Group Stats cfgGSTAT = []; cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; cfgGSTAT.uvar = 1; cfgGSTAT.ivar = 2; cfgGSTAT.fileidout = 'test_groupstats'; TEgroup_stats(cfgGSTAT, fileCell); *Given the error above, I am yet to get to this step, but it does not seem fundamentally different from normal fieldtrip stats.* ***** In case my notes were not clear or you skipped to the bottom, *my primary concern is whether the error I'm getting in TEgroup_calculate is a pipeline issue* (I noticed the example pipeline in trentool, the manual, and published methods articles all seem to have slightly or significantly different pipeline compositions), *or if the error is* due to ACT, ragwitz optimization, or some other faulty parameterization *on my part due to a lack of understanding of how transfer entropy works on a more theoretical/mathematical level*. If the latter is the case, is there any relatively straightforward way to conceptualize this, or is this something where I'm just going to have to keep reading and rereading until it eventually makes sense? I've already done quite a bit of that and it hasn't pierced my thick skull yet but I'm sure it will eventually! Thank you so much, Max Cantor -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Fri Sep 5 14:06:36 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Fri, 5 Sep 2014 12:06:36 +0000 Subject: [FieldTrip] Data Interpolation Message-ID: Dear Fieldtrippers, I need to interpolate my data to remove artifacts due to the electric stimulation at the moment of the trigger. So I wrote : cfg = []; epData = ft_redefinetrial(epData_cfg, allData_prepross); fname = [contfname]; save([subjPath filesep fname '.mat'], 'epData'); electric_windows = [0.002 0.013]; electric_window_idx = [nearest(epData.time{1},electric_window(1)) nearest(epData.time{1},electric_window(2))]; for i=1:numel(epData.trial) % Loop through all trials epData.trial{i}(:,electric_window_idx(1):electric_window_idx(2))=nan; % Replace the segment of data corresponding to our window of interest with nans end; cfg.method = 'linear'; cfg.prewindow = 0.01; cfg.postwindow = 0.01; interpoldata = ft_interpolatenan(cfg, epData); But I get the following error: Undefined function 'electric_window' for input arguments of type 'double'. Even if I see what the problem is, I don't know how to solve it without doing any mistakes. Thank you! Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Sep 5 14:22:09 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 5 Sep 2014 14:22:09 +0200 Subject: [FieldTrip] Data Interpolation In-Reply-To: References: Message-ID: The error is here: electric_window_idx = [nearest(epData.time{1},electric_window(1)) nearest(epData.time{1},electric_window(2))]; Find the missing 's' ;) On 5 September 2014 14:06, Caspar, Emilie wrote: > Dear Fieldtrippers, > > I need to interpolate my data to remove artifacts due to the electric > stimulation at the moment of the trigger. So I wrote : > > > cfg = []; > epData = ft_redefinetrial(epData_cfg, > allData_prepross); > fname = [contfname]; > save([subjPath filesep fname '.mat'], 'epData'); > > > electric_windows = [0.002 0.013]; > electric_window_idx = [nearest(epData.time{1},electric_window(1)) > nearest(epData.time{1},electric_window(2))]; > for i=1:numel(epData.trial) % Loop through all trials > > epData.trial{i}(:,electric_window_idx(1):electric_window_idx(2))=nan; % > Replace the segment of data corresponding to our window of interest with > nans > end; > > > > cfg.method = 'linear'; > cfg.prewindow = 0.01; > cfg.postwindow = 0.01; > interpoldata = ft_interpolatenan(cfg, epData); > > But I get the following error: > Undefined function 'electric_window' for input arguments of type 'double'. > > Even if I see what the problem is, I don't know how to solve it without > doing any mistakes. > > Thank you! > > Emilie > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Fri Sep 5 14:41:52 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Fri, 5 Sep 2014 12:41:52 +0000 Subject: [FieldTrip] Data Interpolation In-Reply-To: References: Message-ID: <18261BAB-F049-4920-A2DA-EC31DA16F9A3@live.ucl.ac.uk> Oh yes! scatterbrained, sorry ;) Thanks! Le 5 sept. 2014 à 14:06, "Caspar, Emilie" > a écrit : Dear Fieldtrippers, I need to interpolate my data to remove artifacts due to the electric stimulation at the moment of the trigger. So I wrote : cfg = []; epData = ft_redefinetrial(epData_cfg, allData_prepross); fname = [contfname]; save([subjPath filesep fname '.mat'], 'epData'); electric_windows = [0.002 0.013]; electric_window_idx = [nearest(epData.time{1},electric_window(1)) nearest(epData.time{1},electric_window(2))]; for i=1:numel(epData.trial) % Loop through all trials epData.trial{i}(:,electric_window_idx(1):electric_window_idx(2))=nan; % Replace the segment of data corresponding to our window of interest with nans end; cfg.method = 'linear'; cfg.prewindow = 0.01; cfg.postwindow = 0.01; interpoldata = ft_interpolatenan(cfg, epData); But I get the following error: Undefined function 'electric_window' for input arguments of type 'double'. Even if I see what the problem is, I don't know how to solve it without doing any mistakes. Thank you! Emilie _______________________________________________ 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 constantino.mendezbertolo at ctb.upm.es Fri Sep 5 17:30:26 2014 From: constantino.mendezbertolo at ctb.upm.es (=?UTF-8?Q?Constantino_M=C3=A9ndez_B=C3=A9rtolo?=) Date: Fri, 5 Sep 2014 17:30:26 +0200 Subject: [FieldTrip] Using clusterstat.m straight giving her specific statobs and statrnd In-Reply-To: References: Message-ID: Dear Eelke, Many thank yous - just a follow-up after your response on how to call clusterstat with proper dimensions (days later because it took sometime to compute the statobs and the statrnd) Yes it works! :) ps: To make this message less spammy, I will add the things we finally need to consider in case it helps anyone. This assumes you have computed the statobs and the statrnd structure (using whatever statistic you are into, in this case, the interaction effect of two factors within a manova was tested for each time point and channel in -R-). Statobs should be Nchan*Ntime and statrnd Nchan*Ntime*Nrand (randomizations performed) Statobs should be converted int oa single vector and statrnd a matrix as long * Nrand Cfg.dim will have the same dimensions and statobs. Use cfg.connectivity by calling ft_channelconnectivity Of course you need to provide clusterstat with the specific critvalue calculated beforehand. You will encounter that you need to reshape back fields prob and clusterlabelmat (eg: reshape(stat.posclusterslabelmat,[Nchan Ntime]) to make it readable for humans Last advice: you may be asking yourself why matlab says there is no channelconnectivity functions or clusterstat.m --- they are inside fieldtrip##\private and you may need to includes them in the path/alter the name of the folder Thanks a lot again Eelke, Tino 2014-09-01 9:48 GMT+02:00 Eelke Spaak : > Dear Constantino, > > First, you need to specify cfg.dim as the size of the data matrix, in your > case probably just [102 500], the size(statobs) before reshaping. Note that > you need to put in statobs as a vector (statobs(:)) and statrnd as a > numel(statobs) X nRand matrix. > > Second, I don't know why you are specifying a cfg.layout, this is not used > by the function. The same goes for cfg.neighbours, this is also not used. > The higher-level statistics functions convert the cfg.neighbours > struct-array into a logical connectivity array using the low-level private > function channelconnectivity. To use clusterstat (a low-level function) > directly, you need to do this beforehand. > > So, do something like this: > > cfg = []; > cfg.neighbours = neighbours; > cfg.channel = datachannels; % order is important here, must be the same as > the data > connectivity = channelconnectivity(cfg); > > cfg = []; > ... > cfg.dim = size(statobs); % assuming statobs is still a chan X time matrix > cfg.connectivity = connectivity; > > % this assumes statrnd is a chan X time X nRand array > statrnd = reshape(statrnd, [numel(statobs), size(statrnd,3)]); > > statobs = statobs(:); > stat = clusterstat(cfg, statrnd, statobs); > > Best, > Eelke > > > On 29 August 2014 18:36, Constantino Méndez Bértolo < > constantino.mendezbertolo at ctb.upm.es> wrote: > >> Dear Fieldtrippers >> >> We have a 3x3 design and MEG data, say only mag channels (n102) to >> simplify. >> >> We want to perform a cluster-based permutation approach but >> timelockstatistics (cfg.method = 'montecarlo', cfg.correctm = 'cluster', >> etc) cannot deal with interactions when you have more than three levels >> (true?) >> >> So we built our 'statobs' and 'statrnd' doing a GLM in -R Statistical >> Package- and feed 'clusterstat.m' with them >> >> We have done this with one channel over time with success. However, I am >> clueless now about how to solve the problem when dealing with the whole >> channel set. >> >> I wonder what is the nature of the cfg.dim that we need to feed >> 'clusterstat.m' with. >> >> Up to now, we use, (cioming out of -R-): >> >> size(statobs) = nchan*ntime % (102*500) % twin = [0 .5] % seconds >> size(statrnd) = nchan*ntime*nrandomizations % (102*500*1000) >> >> >> and the following presets: >> >> cfg=[]; >> cfg.clustercritval = Fcritmain; % We genereate this before hand >> cfg.tail = 1; cfg.clustertail = 1; cfg.clusterthreshold = 'parametric'; >> cfg.dim = [1 size(statobs,1) size(statobs,2) ] % <<< The key may be here >> load('neuromag306mag_neighb.mat'); >> cfg.neighbours = neighbours; >> cfg.feedback = 'yes'; >> cfg.numrandomization = 1000; >> cfg.clusterstatistic = 'maxsum'; >> cfg.layout = 'neuromag306mag.lay'; >> for i = 1:length(cfg.neighbours) >> cfg.channel{i} = cfg.neighbours(i).label; >> end >> >> stat = clusterstat(cfg,statrnd, statobs) >> >> >> Which lead us to an error within findcluster >> >> Error using findcluster (line 59) >> invalid dimension of spatdimneighbstructmat >> >> Error in clusterstat (line 197) >> posclusobs = findcluster(reshape(postailobs, >> [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); >> >> >> If anybody has got some insigth it would be greatly appreciated. Or any >> hints. Are the size of my statobs and starnd correct? I can share more >> information and firstly apologize if I was not able to describe the >> problem accurately, I am confused regarding that 'reshape' and the addition >> of one dimension at "...reshape(postailobs,[cfg.dim,1])...", but the >> problem arises first when findcluster.m tries to calculate the size of >> spatdimneighbstructmat >> >> First line of findcluster.m calcualtes 'spatdimlength' by : " >> spatdimlength = size(onoff, 1);" which in our case is "1", which is >> obviously wrong?. >> >> manythanks&peace2all >> >> -- >> Constantino Méndez-Bértolo >> Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) >> >> Parque Científico y Tecnológico de la UPM, Campus de Montegancedo >> >> 28223 Pozuelo de Alarcón, Madrid, SPAIN >> >> >> >> _______________________________________________ >> 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 > -- Constantino Méndez-Bértolo Laboratorio de Neurociencia Clínica, Centro de Tecnología Biomédica (CTB) Parque Científico y Tecnológico de la UPM, Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Sat Sep 6 09:55:25 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Sat, 6 Sep 2014 07:55:25 +0000 Subject: [FieldTrip] ft_channelrepair and connectivity Message-ID: <1409990124934.33614@flinders.edu.au> ?Hello fieldtrip, I was just wondering whether there would be potential issues with using the function ft_channelrepair to effectively fill in missing EEG channels (which would have been originally dirty) and calculating connectivity (in the time domain). I cant really see an issue because of how well it is implemented, but its making me doubt myself. Any thoughts? Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66125 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Sat Sep 6 14:07:33 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Sat, 6 Sep 2014 12:07:33 +0000 Subject: [FieldTrip] timelockanalysis and beamformer Message-ID: <1410005248989.24450@flinders.edu.au> ?Hello fieldtrip, I was just wondering when it is appropriate to use the configuration cfg.keeptrials = 'yes' in ft_timelockanalysis, and when it is appropriate to have it as 'no'. I have continuous data of 30 seconds. However its separated into a 5, 6 and 19 second segments. So they arent event-related events. At present I am not asking timelockanalysis to keep the trials, or ft_sourceanalysis (LCMV beamformer) for that matter. Is this bad? Im worried about unstable spatial filters (if I calculate covariance matrices and spatial filters for each trial) and loss of phase (if I average the covariance matrices over trials and produce one spatial filter). I noticed that in the tutorial connectivityextended that they never specify these things and therefore use the default, which is cfg.keeptrials = 'no' and they calculate . Is that my answer? Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66125 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdien07 at mac.com Sun Sep 7 07:53:57 2014 From: jdien07 at mac.com (Joseph Dien) Date: Sun, 07 Sep 2014 01:53:57 -0400 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: Message-ID: <85691A9F-3696-4881-B2C6-147935FBFB9A@mac.com> Hi, I’m one of the main Fieldtrip contributors working on supporting EGI data. A couple things. First of all, exactly which net do you use? If they are 129-channel, there is still the question of whether they are the Hydrocel or the older geodesic nets. Regardless, that shouldn't cause an error like this. Could you send me the file you are trying to process and the script you are using and I’ll try troubleshooting it. Joe On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini wrote: > Which nets do you use? I use EGI. I tried both the ones you mention and they didn't work. It was hard to find that exact one online but it was the only file that actually worked. > > > On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann wrote: > Dear Ana, dear all, > the layout you used does not correspond to our nets. I tried the > GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. Please can anybody help? > Cheers > Katrin > > > 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : > > Try this one I use > > > On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann wrote: > Dear all, my problems seem neverending. This time however i really need help. > I implemented a pipeline for ERPs. All works now, trialdefinition, preprocessing, channelreplacement, ica, componentrejection, final artifactdetection, timelock of the single subject data. However, when I wanna compute the grandaverage of the single subjects I get the following error message: > > computing average of avg over 19 subjects > Warning: discarding electrode information because it cannot be averaged > > In ft_timelockgrandaverage at 249 > the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 3 MB > computing average of avg over 2 subjects > Warning: discarding electrode information because it cannot be averaged > > In ft_timelockgrandaverage at 249 > the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 0 MB > the call to "ft_prepare_layout" took 0 seconds and required the additional allocation of an estimated 0 MB > the call to "ft_topoplotER" took 0 seconds and required the additional allocation of an estimated 0 MB > > Furthermore in the plot of the significant clusters, the channelnames are mixed up (do not correspond to my net) > > > I guess that there is a problem with the layout I use. > Here the code that I use > > %For generating the layout (also in the single subjects): > cfg = []; > > cfg.channel = obs_data.label; > > cfg.layout = 'GSN-HydroCel-129.sfp'; > > cfg.feedback = 'yes'; > > lay = ft_prepare_layout(cfg); > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = lay; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > > > > %For computing the grand average > > cfg = []; > > cfg.channel = 'all'; > > cfg.latency = 'all'; > > cfg.parameter = 'avg'; > > cfg.keepindividual = 'no' > > GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > > GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > > % "{:}" means to use data from all elements of the variable > > > For plotting the significant clusters > > cfg = []; > > cfg.style = 'blank'; > > cfg.layout = lay; > > cfg.channellabels = 'yes'; > > cfg.highlight = 'labels'; > > cfg.highlightchannel = find(stat.mask); > > cfg.comment = 'no'; > > figure; ft_topoplotER(cfg, GA_90) > > title('Nonparametric: significant with cluster multiple comparison correction') > > > > Do you have ANY idea to this? I am really completely helpless.... > > thanks and best > > Katrin > > > _______________________________________________ > 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 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------------------------------------------------------------------------- Joseph Dien, PhD Research Associate Cognitive Neurology The Johns Hopkins University School of Medicine Lab E-mail: jdien1 at jhmi.edu Private E-mail: jdien07 at mac.com Office Phone: 410-614-3115 Cell Phone: 202-297-8117 Fax: 410-955-0188 http://joedien.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Mon Sep 8 14:22:13 2014 From: roeysc at gmail.com (Roey Schurr) Date: Mon, 8 Sep 2014 15:22:13 +0300 Subject: [FieldTrip] MNE Source Reconstruction Sanity Check In-Reply-To: References: <346147900.8004488.1406126123454.JavaMail.root@sculptor.zimbra.ru.nl> <790E6AB9-6372-4F70-9B98-2DE6E084F552@donders.ru.nl> <53D1FD3B.7040600@donders.ru.nl> Message-ID: Dear fieldtrippers, I am reposting this question in hope someone could help me use the template BEM head model in EEG source reconstruction. Any help would be greatly appreciated! Thank you all, roey On Wed, Aug 20, 2014 at 5:23 PM, Roey Schurr wrote: > Dear fieldtrippers, dear Jörn, > > > > I am currently trying to use the standard BEM head model provided in the > fieldtrip toolbox (on a 19 electrodes EEG recording, segmented into > 10-seconds trials, not time-locked), but I have encountered a problem I > could not resolve: > > > > Error using svd > > Input to SVD must not contain NaN or Inf. > > > > Error in pinv (line 29) > > [U,S,V] = svd(A,0); > > > > Error in pinv (line 27) > > X = pinv(A',varargin{:})'; > > > > Error in minimumnormestimate (line 151) > > w = pinv(lf); > > > > Error in ft_sourceanalysis (line 876) > > dip(i) = minimumnormestimate(grid, sens, vol, squeeze_avg, > optarg{:}); > > > > Following some old posts in the mailing list I made sure the electrodes > data structure of the data is the same as that given in the cfg > of ft_sourceanalysis. However, it is still possible that using a 19 > electrodes recording is not possible using the source model I am using? > > > > I am also afraid computing the source reconstruction on such continuous > data, that is not time-locked, could be a problem. For example, having to > calculate the “avg” field artificially seems a little fishy. > > > > I also tried running the code on the EEG data of the continuous data > preprocessing tutorial (after choosing only 19 of its electrodes, though > possibly not the right ones). > > > > Any advice would be greatly appreciated! > > Thank you all, > > Roey > > > > > > > THE CODE > > --------------- > > % Load head model, “vol” > > hdmfile = fullfile(which('standard_bem.mat')); > > load(hdmfile); > > > > % Create grid > > gridcfg = []; > > gridcfg.grid.xgrid = -20:1:20; > > gridcfg.grid.ygrid = -20:1:20; > > gridcfg.grid.zgrid = -20:1:20; > > gridcfg.grid.unit = 'cm'; > > gridcfg.grid.tight = 'yes'; > > gridcfg.inwardshift = -1.5; > > gridcfg.vol = vol; > > > > gridVar = ft_prepare_sourcemodel(gridcfg); > > > > % Restrict source reconstruction to outside of the cerrebellum > > gridVar = getRidOfCerrebellum([], gridVar); > > > > % Source reconstruction > > slcfg = struct; > > slcfg.method = ‘mne’; > > slcfg.elec = data.elec; > > slcfg.grid = gridVar; > > slcfg.vol = vol; > > slcfg.rawtrial = 'yes'; > > slcfg.hdmfile = hdmfile; > > slcfg.mne.lambda = '5%'; > > slcfg.keepfilter = 'yes'; > > slcfg.rawtrial = 'no'; % this is because we are now just computing the > spatial filter > > slcfg.singletrial = 'no'; > > slcfg.keeptrials = 'yes'; > > > > % calculate the avg of each trial, for use in ft_sourceanalysis > > for trialI = 1:length(data.trial) > > data.avg(:,trialI) = mean(data.trial{trialI}')'; > > end > > > > source_for_filter = ft_sourceanalysis(slcfg, data); %this source structure > is used to compute the filter to be used later > > > > On Fri, Jul 25, 2014 at 9:46 AM, "Jörn M. Horschig" < > jm.horschig at donders.ru.nl> wrote: > >> Dear Roey, >> >> I agreet that this is a bad idea - independently of what result you will >> get, the error is just too big to draw any reliable conclusions. Imho, you >> can better try using ICA to decompose your data into components. >> >> Concerning the headmodel, there is a standard BEM headmodel template >> available in FieldTrip. >> >> Best, >> Jörn >> >> >> On 7/24/2014 8:50 PM, Roey Schurr wrote: >> >>> Dear Jim, >>> Thank you for drawing my attention to this problem. I have actually >>> tried building a realistic head model using OPENMEG but encountered some >>> compitability problems since our lab does not use Linux. This is indeed one >>> of the most important (short) future tasks - being able to use such >>> realistic head models. >>> Best, >>> roey >>> >>> >>> On Thu, Jul 24, 2014 at 6:34 PM, E688205 >> > wrote: >>> >>> Dear Roey, >>> >>> To add to Diego's comments, since you are dealing with EEG data a >>> single sphere headmodel is not a good idea because it does not >>> take into account the differences in conductivity between the >>> skull, scalp, and brain. This is not a problem for MEG but is >>> important for EEG. Therefore it is better to use, for example, a >>> BEM head model. >>> >>> Best, >>> >>> Jim >>> >>> On 23 jul. 2014, at 16:38, "Lozano Soldevilla, D. (Diego)" >>> >> > wrote: >>> >>> Dear Roey, >>>> >>>> In my opinion it's definitely not a good idea to compute MNE >>>> using 19 sensors. There are studies that have found a drastic >>>> localization precision from 31 to 63 electrodes and further >>>> improvements till 123: >>>> >>>> http://www.ncbi.nlm.nih.gov/pubmed/15351361 (see figure 1) >>>> http://www.ncbi.nlm.nih.gov/pubmed/12495765 >>>> >>>> Although it's very difficult to know the "minimum" number of >>>> electrodes needed to accurately localize a given source (it >>>> depends on the strength of the source you want to localize, >>>> source reconstruction algorithm, data noise...), 19 electrodes >>>> are too low to trust the results you can get. >>>> >>>> best, >>>> >>>> Diego >>>> >>>> >>>> ------------------------------------------------------------ >>>> ------------ >>>> From roeysc atgmail.com Mon Jul 21 11:21:32 >>>> 2014 >>>> From: roeysc atgmail.com (Roey Schurr) >>>> >>>> Date: Mon, 21 Jul 2014 12:21:32 +0300 >>>> Subject: [FieldTrip] MNE Source Reconstruction Sanity Check >>>> Message-ID: >>> mail.gmail.com >>> AQ_W43cHF_8J2b+rNyzd55x4aRviw at mail.gmail.com>> >>>> >>>> >>>> Dear fieldtrippers, >>>> >>>> >>>> >>>> I want to do a sanity check on mne source reconstruction. >>>> >>>> I'm working on continuous EEG recordings (19 electrodes), >>>> estimating the >>>> source reconstruction activity using the *mne* (minimum norm >>>> estimate) >>>> method, a *template MRI* (Colin27) and a *singlesphere* headmodel. >>>> As a >>>> sanity check for the source reconstruction itself, I wanted to >>>> compare >>>> conditions in which I could estimate the loci of significant >>>> changes, e.g.: >>>> rest vs movement of the hand, moving the right hand vs the left >>>> hand, etc. >>>> I have about 60 seconds of recording for each condition. >>>> >>>> >>>> >>>> What I did was: >>>> >>>> 1) Segment the recording of each condition into many "trials" of 2 >>>> seconds >>>> each. >>>> >>>> 2) For each trial, average the activity in each of the 90 ROIs of >>>> the aal >>>> atlas (I excluded the cerebellum from the source reconstruction). >>>> >>>> >>>> >>>> I was wondering what comparison would be best in this case. Since >>>> this is >>>> not Evoked Responses data, I find it hard to find relevant ideas, >>>> and would >>>> like to hear your thoughts. >>>> >>>> >>>> >>>> 1) I did a frequency analysis (mtmfft) in conventional bands of >>>> interest >>>> and ran ft_freqstatistics on the resulting structures (using ttest2 >>>> and the >>>> bonferoni correction for the multiple comparison problem). This >>>> gave some >>>> results, however for most conditions they are not very encouraging >>>> (the >>>> ROIs that showed significant differences were not close to those >>>> that I >>>> have assumed). >>>> >>>> >>>> >>>> *QUESTION 1*: do you think this is a proper method? Note that I did >>>> not use >>>> a frequency based source reconstruction in the first place, because >>>> I'm >>>> ultimately interested in the time course in the source space. >>>> >>>> >>>> >>>> 2) I was wondering if a cluster based permutation test is >>>> impossible to use >>>> here, since this is a continuous recording, so clustering according >>>> to time >>>> adjacency seems irrelevant. >>>> >>>> >>>> >>>> *QUESTION 2*: is it possible to use a cluster based statistical >>>> test here? >>>> If so, it could be better than a-priori averaging the source >>>> activity in >>>> the atlas ROIs, which could mask some of the effects, if they are >>>> located >>>> in a small area. >>>> >>>> >>>> >>>> 3) Another possibility is looking at the data itself. Unfortunately >>>> I >>>> encountered some problems using ft_sourcemovie, though this is a >>>> subject >>>> for a different thread. >>>> >>>> >>>> >>>> Any thoughts and advice are highly appreciated! >>>> >>>> Thank you for taking the time, >>>> >>>> roey >>>> _______________________________________________ >>>> >>>> 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 >> >> >> _______________________________________________ >> 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 e.maris at psych.ru.nl Mon Sep 8 15:46:11 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) Subject: [FieldTrip] Question regarding nonparametric testing for coherence differences In-Reply-To: References: Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris@psych.ru.nl> Dear Hwee Ling, In the paper you refer to (Maris et al, JNM, 2007), I did not perform a cluster-based permutation test at the level of the channel pairs. Instead, all coherences mentioned in the paper are coherence between a single EMG channel (2 electrodes mounted on the forearm) and all MEG electrodes. Thus, there are as many EMG-MEG coherences as there are MEG channels (275 in our lab), and the clustering of these coherences involves the same neighbourhood structure as the clustering of channel-specific statistics on power or evoked response. The analysis you propose involves clustering in a much more complex space, namely the formed by all (MEG,MEG) channel pairs (275*275=75625 pairs). In the early days of cluster-based permutation statistics, I have worked on this problem but did not pursue it because the resulting clusters are very hard to interpret. Best, Eric Maris Dear all and Prof Maris, I'm re-posting this question again, as I didn't get any replies previously. I’m interested to investigate if there are any differences in phase synchronization in resting state data at timepoint 2 versus timepoint 1. The EEG data was collected using 64 EEG channels, resting state, eyes opened and eyes closed. I’ve arbitrarily segmented the resting state data into epochs of 2s each, and the epochs with artifacts are excluded completely from further analyses. I then performed mtmfft to get the fourier representation of the data, extracted the coherence, and compared the coherence difference of timepoint 2 versus timepoint 1 of all channels paired with all other channels. I figured that if I extract the connectivity analyses without specifying the channelcmb, I get a 'chan_chan_freq' dimord variable that would allow me to perform cluster-based statistical analyses. I get an output with ‘chan_chan’ dimord variable. However, I was not 100% sure that this is correct, hence, I’ve inserted my code (see below). It’ll be great if you could tell me if what I’m doing makes any sense at all. Also, I don’t know how I can plot the results to see if it make any sense at all. Also, I checked the values obtained from when I specified "cfg.channelcmb" and when I did not specify "cfg.channelcmb", I noticed that the values were somehow different. I would assume that the values to be similar, although I'm not sure why they would have differences in the values obtained from specifying "cfg.channelcmb". This is my code that I've used thus far: for sub = 1:5 cfg = []; cfg.output = 'fourier'; cfg.channel = {'all'}; cfg.method = 'mtmfft'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 5; cfg.foilim = [0 100]; cfg.taper = 'dpss'; % find the index for the c200 condition pre_c200_idx = find(data5.trialinfo == 201); cfg.trials = pre_c200_idx; HLF_pre_c200 = ft_freqanalysis(cfg, data5); post_c200_idx = find(data5.trialinfo == 200); cfg.trials = post_c200_idx; HLF_post_c200 = ft_freqanalysis(cfg, data5); cfg = []; cfg.keeptrials = 'no'; cfg.channel = {'all'}; cfg.removemean = 'yes'; cfg.method = 'coh'; HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_pre_c200); HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_post_c200); end load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); cfg_neighb.method = 'template'; cfg_neighb.layout = lay; cfg_neighb.channel = 'all'; neighbours = ft_prepare_neighbours(cfg_neighb, sub_HLF_pre_c200coh{1}); cfg = []; cfg.layout = lay; cfg.neighbours = neighbours; cfg.channel = 'all'; cfg.channelcmb = {cfg.channel, cfg.channel}; cfg.latency = 'all'; cfg.avgovertime = 'no'; cfg.avgoverchan = 'no'; cfg.parameter = 'cohspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.correctm = 'cluster'; cfg.tail = 0; % cfg.clustertail = 0; cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 frequency bands. cfg.numrandomization = 10000; cfg.ivar = 2; cfg.uvar = 1; % design matrices clear design; design(1,:) = [1:5, 1:5]; design(2,:) = [ones(1,5), ones(1,5) * 2]; cfg.design = design; % for theta band cfg.avgoverfreq = 'yes'; cfg.frequency = [4 8]; % I also performed the statistics for delta (2-4), alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma (30-40), and gamma (40-100). [diffc200_theta_stat] = ft_freqstatistics(cfg, sub_HLF_post_c200coh{:}, sub_HLF_pre_c200coh{:}); When I tried to plot the results, I used this code: cfg = []; cfg.channel = 'all'; cfg.layout = 'lay'; cfg.zlim = [-1 1]; cfg.alpha = 0.05; cfg.refchannel = 'all'; ft_clusterplot(cfg, diffc200_theta_stat); However, I was not sure how I could plot the results. I get an error message from Fieldtrip when using ft_clusterplot: Error using topoplot_common (line 366) no reference channel is specified Error in ft_topoplotTFR (line 192) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_clusterplot (line 372) ft_topoplotTFR(cfgtopo, stat); According to your paper in 2007, the topoplot of the results were masked by the spatio-spectral pattern of the significant clusters. I don't know how to do this, and I would really appreciate if you can show me how to make such a plot. Thank you very much. Kind regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Mon Sep 8 21:38:01 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Mon, 8 Sep 2014 21:38:01 +0200 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: <85691A9F-3696-4881-B2C6-147935FBFB9A@mac.com> References: <85691A9F-3696-4881-B2C6-147935FBFB9A@mac.com> Message-ID: Dear Joseph, thanks so much, I really appreciate your help. I was also wandering, if maybe there is another bug in my code. Our nets are 128 channels, Hydrocel, but as a colleague of me adviced me to do so, I also tried the 129 layout. My code you find below (without selection of bad channels etc.) If you need also the data of two subjects to have a look, let me know!!! Best and thanks really! Katrin subject=input('Which subject do you want to analyse? ','s'); name = strcat(subject,'.raw'); subjectnumber=input('Which is the subjectnumber?', 's'); sb=subjectnumber %subjectnumber = strcat(subjectnumber, '.txt') %% cfg = []; cfg.dataset = name; cfg.trialfun = 'ft_trialfun_general'; % this is the default cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus trigger cfg.trialdef.prestim = 0.234; % in seconds cfg.trialdef.poststim = 7.266; % in seconds (whole time of video observation, but maybe we need less) cfg = ft_definetrial(cfg); cfg.trl([1:7],:) = []; %change timeline according to constant offset of 16 ms = 8 samples (because recorded with 500 hz)in %structure trial cfg.trl(:,3)=cfg.trl(:,3)-8 %change timeline to make the cut the zeropoint cfg.trl(:,3)=cfg.trl(:,3)- 1000; %% preprocess data cfg.channel = 'all'; cfg.preproc.detrend = 'yes'; cfg.preproc.demean = 'yes'; cfg.preproc.baselinewindow = [-2.1 -2.0] %cfg.preproc.bpfilter = 'yes'; - the data here has to be already filtered %(0.1-45) and bad channels have to be replaced!!!! %cfg.preproc.bpfreq = [6 32]; % % obs_data = ft_preprocessing(cfg); % save (strcat(sb,'obs_data') , 'obs_data') %% determining channel neighbours (necessary for Artifact detection) cfg = []; cfg.channel = obs_data.label; cfg.layout = 'GSN128.sfp'; cfg.feedback = 'yes'; lay = ft_prepare_layout(cfg); cfg_neighb = []; cfg_neighb.feedback = 'yes'; cfg_neighb.method = 'triangulation'; cfg_neighb.layout = 'GSN128.sfp'; neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); obs_data.elec = ft_read_sens('GSN128.sfp'); %% Artifacts - to detect bad channels - is not saved!!! cfg.method = 'summary'; cfg.latency=[0 1]; cfg.layout = 'GSN128.sfp'; % this allows for plotting obs_data_try = ft_rejectvisual(cfg, obs_data); cfg = []; cfg.viewmode = 'vertical'; cfg.latency=[0 1]; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs_data); %cfg.artfctdef.reject = 'complete'; obs_data_try = ft_rejectartifact (cfg,obs_data); %% Preparing neighbours for channel repair - but bad channel info in!!! % cfg_neighb = []; % cfg_neighb.feedback = 'yes'; % cfg_neighb.method = 'triangulation'; % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); % Interpolate and put into new data structure cfg = []; cfg.badchannel = {}; cfg.layout = 'GSN128.sfp'; cfg.method = 'nearest'; cfg.neighbours = neighbours; obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) % Check reconstruction cfg = []; cfg.viewmode = 'vertical'; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs_data_channelrepaired); %cfg.artfctdef.reject = 'complete'; obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); % dat1=obs_data; % dat2=obs_data_channelrepaired; % % x=dat1.trial{1}(62,:); % 68 is channel index of E68 % y=dat2.trial{1}(62,:); % plot(x);hold on;plot(y,'r'); % % x=dat1.trial{1}(72,:); % y=dat2.trial{1}(75,:); % figure; % plot(x);hold on;plot(y,'r') % % x=dat1.trial{1}(75,:); % y=dat2.trial{1}(75,:); % figure; % plot(x);hold on;plot(y,'r') %% artifact rejection/trial inspection - throw out electrode jumps etc. cfg = []; cfg.viewmode = 'vertical'; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs_data_channelrepaired); %cfg.artfctdef.reject = 'complete'; obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent according to channels interpolated %% 128-number of interp. channels) cfg = []; cfg.channel = {'all'}; cfg.numcomponent = 128 comp = ft_componentanalysis(cfg,obs_data_clean1); save (strcat(sb,'comp_all') , 'comp') %% cfg = []; cfg.viewmode = 'component'; cfg.continuous = 'no'; cfg.plotlabels='some'; cfg.layout = 'GSN128.sfp'; ft_databrowser(cfg,comp); %% poweranalysis components cfg = []; cfg.output = 'pow'; cfg.channel = 'all';%compute the power spectrum in all ICs cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = 0:0.2:50; obs_freq = ft_freqanalysis(cfg, comp); %And you can plot the spectra: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nsubplots = 16; nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain decimals, type doc subplot Nfigs = ceil(size(comp.topo,1)/nsubplots); tot = Nfigs*nsubplots; rptvect = 1:size(comp.topo,1); rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); rptvect = reshape(rptvect,nsubplots,Nfigs)'; for r=1:size(rptvect,1); figure;set(gcf,'units','normalized','outerposition',[0 0 1 1]);%full screen k=0; for j=1:size(rptvect,2); if~(rptvect(r,j)==0); k=k+1; cfg=[]; cfg.channel = rptvect(r,j); cfg.ylim =[0 500] cfg.xlim =[0 50] subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); end end end %For the IC topos you'll follow the same logic as above but with: figure cfg = []; cfg.component = [1:20]; % specify the component(s) that should be plotted cfg.layout = 'GSN128.sfp'; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) figure cfg = []; cfg.component = [21:40]; % specify the component(s) that should be plotted cfg.layout = 'GSN128.sfp'; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) figure cfg = []; cfg.component = [41:60]; % specify the component(s) that should be plotted cfg.layout = 'GSN128.sfp'; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) figure cfg = []; cfg.component = [61:80]; % specify the component(s) that should be plotted cfg.layout = 'GSN128.sfp'; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) %% Seperate observation conditions name1= strcat(num2str(sb),'_90.xls'); list1=xlsread (name1) name2= strcat(num2str(sb),'_180.xls'); list2=xlsread (name2) % cfg = [] cfg.trials = [list1] obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) cfg = [] cfg.trials = [list2] obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) %%PIPELINE FOR obs90 %% Decompose original data according to the components found before load (strcat(sb,'comp_all')) cfg = []; cfg.numcomponent = 128; cfg.unmixing = comp.unmixing; cfg.topolabel = comp.topolabel; comp_1 = ft_componentanalysis(cfg, obs90_data); %% Reject component cfg = []; cfg.component = []; obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') %% Artifacts - final detection cfg.method = 'summary'; cfg.latency=[0 1]; cfg.layout = 'GSN128.sfp'; % this allows for plotting obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); cfg = []; cfg.viewmode = 'vertical'; cfg.latency=[0 1]; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs90_data_clean3); %cfg.artfctdef.reject = 'complete'; obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); % Save clean data save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') %% Rereferencing data cfg = []; cfg.channel = 'all'; cfg.preproc.reref = 'yes'; cfg.preproc.refchannel = 'all'; obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) save (strcat(subject,'obs90_ref') , 'obs90_data_ref') %% Snap out smaller pieces (the third second) cfg = [] cfg.toilim = [0 1] obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) %% TIMELOCK ERP obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') %% plot it cfg = []; cfg.layout = lay ; cfg.interactive = 'yes'; ft_multiplotER(cfg, obs90_data_ERP) %% PIPELINE FOR obs180 %% Decompose original data according to the components found before load (strcat(sb,'comp_all')) cfg = []; cfg.numcomponent = 128 cfg.unmixing = comp.unmixing; cfg.topolabel = comp.topolabel; comp_2 = ft_componentanalysis(cfg, obs180_data); %% Reject component cfg = []; cfg.component = []; obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, obs180_data); save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') %% Artifacts final 180 cfg.method = 'summary'; cfg.latency=[0 1]; cfg.layout = 'GSN128.sfp'; % this allows for plotting obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); cfg = []; cfg.viewmode = 'vertical'; cfg.latency=[0 1]; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs180_data_clean3); %cfg.artfctdef.reject = 'complete'; obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); % Save clean data save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') %% Rereferencing data cfg = []; cfg.channel = 'all'; cfg.preproc.reref = 'yes'; cfg.preproc.refchannel = 'all'; obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) save (strcat(subject,'obs180_ref') , 'obs180_data_ref') %% Snap out smaller pieces (the third second) cfg = [] cfg.toilim = [0 1] obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) %% TIMELOCK ERP obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') %% plot 180 ERP cfg = []; cfg.layout = lay ; cfg.interactive = 'yes'; ft_multiplotER(cfg, obs180_data_ERP) %% plot both ERPs cfg = []; cfg.layout = lay ; cfg.interactive = 'yes'; cfg.showlabels = 'yes'; ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) %% plot difference wave difference = obs180_data_ERP; % copy one of the structures difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute the difference ERP cfg = []; cfg.layout = lay; cfg.interactive = 'yes'; ft_multiplotER(cfg, difference) 2014-09-07 7:53 GMT+02:00 Joseph Dien : > Hi, > I’m one of the main Fieldtrip contributors working on supporting EGI > data. A couple things. First of all, exactly which net do you use? If > they are 129-channel, there is still the question of whether they are the > Hydrocel or the older geodesic nets. Regardless, that shouldn't cause an > error like this. Could you send me the file you are trying to process and > the script you are using and I’ll try troubleshooting it. > > Joe > > > On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < > diezmartini at gmail.com> wrote: > > Which nets do you use? I use EGI. I tried both the ones you mention and > they didn't work. It was hard to find that exact one online but it was the > only file that actually worked. > > > On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > wrote: > >> Dear Ana, dear all, >> the layout you used does not correspond to our nets. I tried the >> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. >> Please can anybody help? >> Cheers >> Katrin >> >> >> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : >> >> Try this one >>> I use >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>> katrinheimann at gmail.com> wrote: >>> >>>> Dear all, my problems seem neverending. This time however i really need >>>> help. >>>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>>> preprocessing, channelreplacement, ica, componentrejection, final >>>> artifactdetection, timelock of the single subject data. However, when I >>>> wanna compute the grandaverage of the single subjects I get the following >>>> error message: >>>> >>>> computing average of avg over 19 subjects >>>> Warning: discarding electrode information because it cannot be averaged >>>> > In ft_timelockgrandaverage at 249 >>>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>>> additional allocation of an estimated 3 MB >>>> computing average of avg over 2 subjects >>>> Warning: discarding electrode information because it cannot be averaged >>>> > In ft_timelockgrandaverage at 249 >>>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>>> additional allocation of an estimated 0 MB >>>> the call to "ft_prepare_layout" took 0 seconds and required the >>>> additional allocation of an estimated 0 MB >>>> the call to "ft_topoplotER" took 0 seconds and required the additional >>>> allocation of an estimated 0 MB >>>> >>>> Furthermore in the plot of the significant clusters, the channelnames >>>> are mixed up (do not correspond to my net) >>>> >>>> >>>> I guess that there is a problem with the layout I use. >>>> Here the code that I use >>>> >>>> %For generating the layout (also in the single subjects): >>>> >>>> cfg = []; >>>> >>>> cfg.channel = obs_data.label; >>>> >>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>>> >>>> cfg.feedback = 'yes'; >>>> >>>> lay = ft_prepare_layout(cfg); >>>> >>>> >>>> cfg_neighb = []; >>>> >>>> cfg_neighb.feedback = 'yes'; >>>> >>>> cfg_neighb.method = 'triangulation'; >>>> >>>> cfg_neighb.layout = lay; >>>> >>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>>> >>>> >>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>>> >>>> >>>> %For computing the grand average >>>> >>>> cfg = []; >>>> >>>> cfg.channel = 'all'; >>>> >>>> cfg.latency = 'all'; >>>> >>>> cfg.parameter = 'avg'; >>>> >>>> cfg.keepindividual = 'no' >>>> >>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>>> >>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>>> >>>> % "{:}" means to use data from all elements of the variable >>>> >>>> >>>> For plotting the significant clusters >>>> >>>> cfg = []; >>>> >>>> cfg.style = 'blank'; >>>> >>>> cfg.layout = lay; >>>> >>>> cfg.channellabels = 'yes'; >>>> >>>> cfg.highlight = 'labels'; >>>> >>>> cfg.highlightchannel = find(stat.mask); >>>> >>>> cfg.comment = 'no'; >>>> >>>> figure; ft_topoplotER(cfg, GA_90) >>>> >>>> title('Nonparametric: significant with cluster multiple comparison >>>> correction') >>>> >>>> >>>> Do you have ANY idea to this? I am really completely helpless.... >>>> >>>> thanks and best >>>> >>>> Katrin >>>> >>>> _______________________________________________ >>>> 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 >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -------------------------------------------------------------------------------- > > Joseph Dien, PhD > Research Associate > Cognitive Neurology > The Johns Hopkins University School of Medicine > > Lab E-mail: jdien1 at jhmi.edu > Private E-mail: jdien07 at mac.com > Office Phone: 410-614-3115 > Cell Phone: 202-297-8117 > Fax: 410-955-0188 > http://joedien.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 jdien07 at mac.com Tue Sep 9 03:55:44 2014 From: jdien07 at mac.com (Joseph Dien) Date: Mon, 08 Sep 2014 21:55:44 -0400 Subject: [FieldTrip] Problem with Geodesic 129 layout!! In-Reply-To: References: <85691A9F-3696-4881-B2C6-147935FBFB9A@mac.com> Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03@mac.com> yes, please do send me the data. Thanks! Joe On Sep 8, 2014, at 3:38 PM, KatrinH Heimann wrote: > Dear Joseph, thanks so much, I really appreciate your help. I was also wandering, if maybe there is another bug in my code. > Our nets are 128 channels, Hydrocel, but as a colleague of me adviced me to do so, I also tried the 129 layout. > My code you find below (without selection of bad channels etc.) > If you need also the data of two subjects to have a look, let me know!!! > Best and thanks really! > Katrin > > > > subject=input('Which subject do you want to analyse? ','s'); > > name = strcat(subject,'.raw'); > > subjectnumber=input('Which is the subjectnumber?', 's'); > > sb=subjectnumber > > %subjectnumber = strcat(subjectnumber, '.txt') > > %% > > > > cfg = []; > > cfg.dataset = name; > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus trigger > > cfg.trialdef.prestim = 0.234; % in seconds > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video observation, but maybe we need less) > > cfg = ft_definetrial(cfg); > > > > cfg.trl([1:7],:) = []; > > > > %change timeline according to constant offset of 16 ms = 8 samples (because recorded with 500 hz)in > > %structure trial > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > > %change timeline to make the cut the zeropoint > > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > > > %% preprocess data > > cfg.channel = 'all'; > > cfg.preproc.detrend = 'yes'; > > cfg.preproc.demean = 'yes'; > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already filtered > > %(0.1-45) and bad channels have to be replaced!!!! > > %cfg.preproc.bpfreq = [6 32]; > > % > > % > > obs_data = ft_preprocessing(cfg); > > % > > save (strcat(sb,'obs_data') , 'obs_data') > > > > %% determining channel neighbours (necessary for Artifact detection) > > cfg = []; > > cfg.channel = obs_data.label; > > cfg.layout = 'GSN128.sfp'; > > cfg.feedback = 'yes'; > > lay = ft_prepare_layout(cfg); > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = 'GSN128.sfp'; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > > > %% Preparing neighbours for channel repair - but bad channel info in!!! > > > > % cfg_neighb = []; > > % cfg_neighb.feedback = 'yes'; > > % cfg_neighb.method = 'triangulation'; > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > % Interpolate and put into new data structure > > cfg = []; > > cfg.badchannel = {}; > > cfg.layout = 'GSN128.sfp'; > > cfg.method = 'nearest'; > > cfg.neighbours = neighbours; > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > > % Check reconstruction > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > % dat1=obs_data; > > % dat2=obs_data_channelrepaired; > > % > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > % y=dat2.trial{1}(62,:); > > % plot(x);hold on;plot(y,'r'); > > % > > % x=dat1.trial{1}(72,:); > > % y=dat2.trial{1}(75,:); > > % figure; > > % plot(x);hold on;plot(y,'r') > > % > > % x=dat1.trial{1}(75,:); > > % y=dat2.trial{1}(75,:); > > % figure; > > % plot(x);hold on;plot(y,'r') > > %% artifact rejection/trial inspection - throw out electrode jumps etc. > > > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent according to channels interpolated %% 128-number of interp. channels) > > > cfg = []; > > cfg.channel = {'all'}; > > cfg.numcomponent = 128 > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > save (strcat(sb,'comp_all') , 'comp') > > > > %% > > cfg = []; > > cfg.viewmode = 'component'; > > cfg.continuous = 'no'; > > cfg.plotlabels='some'; > > cfg.layout = 'GSN128.sfp'; > > ft_databrowser(cfg,comp); > > > > %% poweranalysis components > > cfg = []; > > cfg.output = 'pow'; > > cfg.channel = 'all';%compute the power spectrum in all ICs > > cfg.method = 'mtmfft'; > > cfg.taper = 'hanning'; > > cfg.foi = 0:0.2:50; > > obs_freq = ft_freqanalysis(cfg, comp); > > > > %And you can plot the spectra: > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > nsubplots = 16; > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain decimals, type doc subplot > > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > tot = Nfigs*nsubplots; > > > > rptvect = 1:size(comp.topo,1); > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > > for r=1:size(rptvect,1); > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 1]);%full screen > > k=0; > > for j=1:size(rptvect,2); > > if~(rptvect(r,j)==0); > > k=k+1; > > cfg=[]; > > cfg.channel = rptvect(r,j); > > cfg.ylim =[0 500] > > cfg.xlim =[0 50] > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > end > > end > > end > > > > %For the IC topos you'll follow the same logic as above but with: > > > > figure > > cfg = []; > > cfg.component = [1:20]; % specify the component(s) that should be plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > figure > > cfg = []; > > cfg.component = [21:40]; % specify the component(s) that should be plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > figure > > cfg = []; > > cfg.component = [41:60]; % specify the component(s) that should be plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > figure > > cfg = []; > > cfg.component = [61:80]; % specify the component(s) that should be plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > > > > > > > > > %% Seperate observation conditions > > > > name1= strcat(num2str(sb),'_90.xls'); > > list1=xlsread (name1) > > > > name2= strcat(num2str(sb),'_180.xls'); > > list2=xlsread (name2) > > > % > > > > cfg = [] > > cfg.trials = [list1] > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > cfg = [] > > cfg.trials = [list2] > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > %%PIPELINE FOR obs90 > > > > %% Decompose original data according to the components found before > > load (strcat(sb,'comp_all')) > > > > cfg = []; > > cfg.numcomponent = 128; > > cfg.unmixing = comp.unmixing; > > cfg.topolabel = comp.topolabel; > > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > > > %% Reject component > > cfg = []; > > cfg.component = []; > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > > > > %% Artifacts - final detection > > > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > %cfg.artfctdef.reject = 'complete'; > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > > > % Save clean data > > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > > > %% Rereferencing data > > cfg = []; > > > > cfg.channel = 'all'; > > cfg.preproc.reref = 'yes'; > > cfg.preproc.refchannel = 'all'; > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > %% Snap out smaller pieces (the third second) > > > > cfg = [] > > cfg.toilim = [0 1] > > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > > %% TIMELOCK ERP > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > > %% plot it > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > > > > > > > %% PIPELINE FOR obs180 > > > > > > %% Decompose original data according to the components found before > > load (strcat(sb,'comp_all')) > > > > cfg = []; > > cfg.numcomponent = 128 > > cfg.unmixing = comp.unmixing; > > cfg.topolabel = comp.topolabel; > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > > > %% Reject component > > cfg = []; > > cfg.component = []; > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, obs180_data); > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > > > > %% Artifacts final 180 > > > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > %cfg.artfctdef.reject = 'complete'; > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > > > % Save clean data > > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > > > %% Rereferencing data > > cfg = []; > > cfg.channel = 'all'; > > cfg.preproc.reref = 'yes'; > > cfg.preproc.refchannel = 'all'; > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > %% Snap out smaller pieces (the third second) > > > > cfg = [] > > cfg.toilim = [0 1] > > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > > %% TIMELOCK ERP > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > > %% plot 180 ERP > > > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, obs180_data_ERP) > > > > %% plot both ERPs > > > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > cfg.showlabels = 'yes'; > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > > %% plot difference wave > > > > difference = obs180_data_ERP; % copy one of the structures > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute the difference ERP > > > cfg = []; > > cfg.layout = lay; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, difference) > > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > Hi, > I’m one of the main Fieldtrip contributors working on supporting EGI data. A couple things. First of all, exactly which net do you use? If they are 129-channel, there is still the question of whether they are the Hydrocel or the older geodesic nets. Regardless, that shouldn't cause an error like this. Could you send me the file you are trying to process and the script you are using and I’ll try troubleshooting it. > > Joe > > > On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini wrote: > >> Which nets do you use? I use EGI. I tried both the ones you mention and they didn't work. It was hard to find that exact one online but it was the only file that actually worked. >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann wrote: >> Dear Ana, dear all, >> the layout you used does not correspond to our nets. I tried the >> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. Please can anybody help? >> Cheers >> Katrin >> >> >> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : >> >> Try this one I use >> >> >> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann wrote: >> Dear all, my problems seem neverending. This time however i really need help. >> I implemented a pipeline for ERPs. All works now, trialdefinition, preprocessing, channelreplacement, ica, componentrejection, final artifactdetection, timelock of the single subject data. However, when I wanna compute the grandaverage of the single subjects I get the following error message: >> >> computing average of avg over 19 subjects >> Warning: discarding electrode information because it cannot be averaged >> > In ft_timelockgrandaverage at 249 >> the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 3 MB >> computing average of avg over 2 subjects >> Warning: discarding electrode information because it cannot be averaged >> > In ft_timelockgrandaverage at 249 >> the call to "ft_timelockgrandaverage" took 0 seconds and required the additional allocation of an estimated 0 MB >> the call to "ft_prepare_layout" took 0 seconds and required the additional allocation of an estimated 0 MB >> the call to "ft_topoplotER" took 0 seconds and required the additional allocation of an estimated 0 MB >> >> Furthermore in the plot of the significant clusters, the channelnames are mixed up (do not correspond to my net) >> >> >> I guess that there is a problem with the layout I use. >> Here the code that I use >> >> %For generating the layout (also in the single subjects): >> cfg = []; >> >> cfg.channel = obs_data.label; >> >> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >> cfg.feedback = 'yes'; >> >> lay = ft_prepare_layout(cfg); >> >> >> cfg_neighb = []; >> >> cfg_neighb.feedback = 'yes'; >> >> cfg_neighb.method = 'triangulation'; >> >> cfg_neighb.layout = lay; >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >> >> >> %For computing the grand average >> >> cfg = []; >> >> cfg.channel = 'all'; >> >> cfg.latency = 'all'; >> >> cfg.parameter = 'avg'; >> >> cfg.keepindividual = 'no' >> >> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >> % "{:}" means to use data from all elements of the variable >> >> >> For plotting the significant clusters >> >> cfg = []; >> >> cfg.style = 'blank'; >> >> cfg.layout = lay; >> >> cfg.channellabels = 'yes'; >> >> cfg.highlight = 'labels'; >> >> cfg.highlightchannel = find(stat.mask); >> >> cfg.comment = 'no'; >> >> figure; ft_topoplotER(cfg, GA_90) >> >> title('Nonparametric: significant with cluster multiple comparison correction') >> >> >> >> Do you have ANY idea to this? I am really completely helpless.... >> >> thanks and best >> >> Katrin >> >> >> _______________________________________________ >> 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 >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------------------------------------------------------------------------- > > Joseph Dien, PhD > Research Associate > Cognitive Neurology > The Johns Hopkins University School of Medicine > > Lab E-mail: jdien1 at jhmi.edu > Private E-mail: jdien07 at mac.com > Office Phone: 410-614-3115 > Cell Phone: 202-297-8117 > Fax: 410-955-0188 > http://joedien.com > > > _______________________________________________ > 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 -------------------------------------------------------------------------------- Joseph Dien, PhD Research Associate Cognitive Neurology The Johns Hopkins University School of Medicine Lab E-mail: jdien1 at jhmi.edu Private E-mail: jdien07 at mac.com Office Phone: 410-614-3115 Cell Phone: 202-297-8117 Fax: 410-955-0188 http://joedien.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.caspar at ucl.ac.uk Tue Sep 9 08:37:13 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Tue, 9 Sep 2014 06:37:13 +0000 Subject: [FieldTrip] ft_rejectvisual: removing trials marked as bad In-Reply-To: References: Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6@live.ucl.ac.uk> Hi Ashley, Maybe the mistake is you did not integrate in your script the command to save the rejection. Normally, with the following command, you will see in the Matlab Window that artifacts are correctly rejected after the "quit" button. clean_data = ft_rejectvisual(cfg, interpoldata); cfg.artfctdef.reject = 'complete'; cfg.artfctdef.feedback = 'yes'; cleandata = ft_rejectartifact(cfg,clean_data); Emilie Le 3 sept. 2014 à 11:58, Ashley Greene > a écrit : Hello, I have used the rejectvisual function in attempt to remove bad trials, but after marking them and pressing the quit button, although the command window states that the selected trials have been removed, there is no obvious change in the data; all of the trials are still intact. Have I overlooked something? Thanks, Ashley _______________________________________________ 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 Patricia.Wollstadt at gmx.de Tue Sep 9 14:16:20 2014 From: Patricia.Wollstadt at gmx.de (Patricia Wollstadt) Date: Tue, 09 Sep 2014 14:16:20 +0200 Subject: [FieldTrip] TRENTOOL pipeline help In-Reply-To: References: Message-ID: <540EEF94.9080601@gmx.de> Hello Max, I added a few comments to the questions regarding individual parameters below. To address the general problem of TRENTOOL telling you, that there are not enough sample points in your data: From what I can see in your script, you probably don't have enough data points in each time series to robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, which gives you 240 samples per time series. Can you maybe avoid downsampling to 300 Hz and downsample to 600 Hz instead? Or could you analyze a longer time window of interest? Note that you also 'lose' data to embedding and the interaction delay: The first point that can be used for TE estimation is at max. embedding length + max. interaction delay in samples. For example: max. embedding length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max interaction delay of 30 ms = 9 samples. In this example, you would be left with 240 - 29 samples for TE estimation per trial. There is also the possibility to estimate time resolved TE/TE for shorter time windows of interest (see section 4.4 in the manual); however, this method requires the use of a GPU for TE estimation. I would further recommend to use the new pipeline for group statistics described in the manual in section 4.5 (the function 'TEgroup_calculate' is deprecated). The new pipeline allows you to reconstruct the interaction delay and uses the following functions (see also comments in the script): TEgroup_prepare -> prepares all data sets (all subjects/all conditions) for group analysis (this means finding common embedding parameters such that estimates are not biased between groups) InteractionDelayReconstruction_calculate -> estimates TE for individual data sets and all assumed interaction delays u InteractionDelayReconstruction_analyze -> reconstructs the interaction delay by selecting the u that maximizes TE for each channel TEgroup_stats -> calculate group statistics using a permutation test I can send you an example script for group TE analysis using this pipeline to get you started. I hope this helps you to get the group analysis running. Just write again if you're having trouble setting up the pipeline or something is not clear about the parameters/my comments. Best, Patricia On 09/04/2014 08:30 PM, Max Cantor wrote: > Hi fieldtrippers, > > I know trentool is not produced by the Donders Institute, so I'm not > 100% sure if it is appropriate to ask questions about it here, but to > the best of my knowledge they do not have a mailing list and I saw a > few trentool questions in the archives, so I'm going to assume it's ok... > > In any case, below is my current pipeline (slightly modified for > comprehensibility): > > (notes in bold are comments/questions made in this email, not present > in the pipeline. Sorry in advance for the long post! Any help would be > greatly appreciated as I'm a bit over my head on this but I think I'm > close!) > > ***** > > % Prepare group TE data > > cfgP = []; > cfgP.Path2TSTOOL = *TSTOOLPATH* > cfgP.TEcalctype = 'VW_ds'; > cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > > *I'm trying to find the transfer entropy between the left and right > auditory cortices in my experiment. The input is virtual sensor data > that was produced using SAM in fieldtrip on real MEG data. * > > % specify u to be scanned > > cfgP.predicttime_u = 30; > cfgP.toi = [-0.4 0.4]; > > *For clarification, the predicttime_u is in seconds but the toi is in > milliseconds. If I understand correctly, the predicttime_u must fit > within the toi, but beyond that are there any benefits to it being > earlier or later?* PW: The predictiontime_u is in milliseconds and the > toi is in seconds. The prediction time is the assumed interaction > delay between your two sources and should fit within your toi. In > general it is preferable to use the method for interaction delay > reconstruction for TE estimation, because it allows you to reconstruct > the actual delay between your source and target times series. A > non-optimal u/interaction delay may cause an underestimation of TE, so > it is recommended to use the pipeline for interaction delay > reconstruction whenever estimating TE for unknown delays. > If you use the methods for interaction delay reconstruction > 'predicttime_u' is replaced by > cfgTEP.predicttimemin_u % minimum u to be scanned > cfgTEP.predicttimemax_u % maximum u to be scanned > cfgTEP.predicttimestepsize % time steps between u to be scanned > A large range for u values to be scanned increases computing time a > lot, so it is best to limit the u range to values that are > physiologically plausible. > > % ACT (Autocorrelation Time) estimation and constraints > > cfgP.maxlag = 150; > cfgP.actthrvalue = 7.5; > cfgP.minnrtrials = 5; > > *My understanding is maxlag should be 1/2 the sampling rate, so since > the data are downsampled to 300hz, it should be 150. I know that the > sample rate and filters are used to determine the actthrvalue, but I > don't actually know the calculation. 7.5 was a rough guess just to > test the pipeline. I'm also uncertain of what minnrtrials should be.* > PW: You can set the actthrvalue based on the filtering you did prior > to TE analysis. If you for example highpass filtered at 10 Hz, you > shouldn't find an ACT higher than 30 samples, because you filtered out > any components of the signal slower than 10 Hz/30 samples (given your > sampling frequency of 300 Hz). So in this scenario the actthrvalue > would be 30. > A good value for cfgP.minnrtrials is 12 (a minimum number of trials is > needed to realize the permutation test for estimated TE values). > > % Optimization > > cfgP.optimizemethod = 'ragwitz'; > cfgP.ragdim = 4:8; > cfgP.ragtaurange = [0.2 0.4]; > cfgP.ragtausteps = 15; > cfgP.repPred = 100; > * > * > *I am completely at a loss for this. I've done some reading into > transfer entropy, mutual information, etc., cited in trentool, but I'm > yet to understand how exactly this optimization works and what the > configuration should be, given my data and experimental intentions.* > PW: The Ragwitz criterion tries to find optimal embedding parameters > dim and tau for the data. To do that, the method iteratively takes all > possible combinations of dim and tau values that are provided in > cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well these > combinations embed the data. To test an embedding, the method builds > the embedding vectors from the data; it then tests for each point how > well the next point in time can be predicted from the reference > point's nearest neighbours. So for each embedded point, the method > searches for the nearest neighbours and calculates the average of > those nearest neighbours. The difference between the > averaged/predicted point and the actual next point is the error of the > local predictor. The Ragwitz criterion will then return the parameter > combination for which this error over all points is minimal. > The parameters set the following: 'ragdim' are dimensions to be tested > by the method (I would reccomend to start with 2:10), 'ragtaurange' > together with 'ragtausteps' specifies the tau values to be tested > (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, that > the values here are factors that are later multiplied with the ACT to > obtain the actual tau. 'repPred' is the number of points that will be > used for the local prediction, i.e. the Ragwitz criterion will test > the local prediction and calculate the error for the first 100 points > in your time series. The two parameters 'flagNei' ans 'sizeNei' below > specify the type of neighbour search conducted by the Ragwitz > criterion: 'flagNei' tells the method to either conduct a kNN or range > search; 'sizeNei' specifies the number of neighbours or the radius to > be searched by a range search. > > > % Kernel-based TE estimation > > cfgP.flagNei = 'Mass'; > cfgP.sizeNei = 4; % Default > > cfgP.ensemblemethod = 'no'; > cfgP.outputpath = *OUTPUT PATH*; > > if ~exist(*Path for TEprepare data object*) > load VSdat; > TE_Wrd = {}; > for i = 1:nConds > for j = 1:Nsub > TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > end > end > clear VSdat; > save('TE_Wrd', 'TE_Wrd'); > end > * > * > *The configuration and virtual sensor data, organized in a 3 x 15 cell > of structures (condition by subject) are the input. The TEprepare > substructure is added to each individual condition x subject .mat > files' data structure which are stored on disk independently.* > > % Use object_to_mat_conversion.m to replace individual condition x > subject virtual sensor data > % .mat files with their TE_Wrd equivalent > * > * > *I'm using a separate script to make some manipulations to the objects > from disk; this will all eventually be integrated into the main > pipeline*.*TRENTOOL seems to handle data output very differently from > fieldtrip and I've had trouble thinking through the most logical way > to handle the data so it's a bit haphazard right now.* > > load cond080sub01.mat > > cfgG = []; > cfgG.dim = cond080sub01.TEprepare.optdim; > cfgG.tau = cond080sub01.TEprepare.opttau; > > if isfield(cond080sub01, 'TEprepare') > TEgroup_prepare(cfgG, fileCell); > else > error('Need to run TEprepare before TEgroup_prepare'); > end > * > * > *For clarification, fileCell is a cell with the name of each condition > x subject .mat file, which as I said before is collectively the same > as the 3 x 15 VSdat structure (condition x subject).* > > % Replace .mat files with '_for_TEgroup_calculate' version in > % object_to_mat_conversion.m > > % TE Group Calculate > > load cond080sub01.mat > if isfield(cond080sub01, 'TEgroupprepare') > for i = 1:length(fileCell) > TEgroup_calculate(fileCell{i}); > end > else > error('Need to run TEgroup_prepare before TEgroup_calculate'); > end > * > * > *At this step I get the following error: > > Error using transferentropy (line 337) > \nTRENTOOL ERROR: not enough data points left after embedding > > Error in TEgroup_calculate (line 133) > [TEresult] = transferentropy(cfg,data);* > > % TE Group Stats > > cfgGSTAT = []; > cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > > cfgGSTAT.uvar = 1; > cfgGSTAT.ivar = 2; > cfgGSTAT.fileidout = 'test_groupstats'; > > TEgroup_stats(cfgGSTAT, fileCell); > > *Given the error above, I am yet to get to this step, but it does not > seem fundamentally different from normal fieldtrip stats.* > > ***** > > In case my notes were not clear or you skipped to the bottom, *my > primary concern is whether the error I'm getting in TEgroup_calculate > is a pipeline issue* (I noticed the example pipeline in trentool, the > manual, and published methods articles all seem to have slightly or > significantly different pipeline compositions), *or if the error is* > due to ACT, ragwitz optimization, or some other faulty > parameterization *on my part due to a lack of understanding of how > transfer entropy works on a more theoretical/mathematical level*. If > the latter is the case, is there any relatively straightforward way to > conceptualize this, or is this something where I'm just going to have > to keep reading and rereading until it eventually makes sense? I've > already done quite a bit of that and it hasn't pierced my thick skull > yet but I'm sure it will eventually! > > Thank you so much, > > Max Cantor > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > > _______________________________________________ > 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 Holger.Krause at med.uni-duesseldorf.de Tue Sep 9 15:21:20 2014 From: Holger.Krause at med.uni-duesseldorf.de (Holger Krause) Date: Tue, 9 Sep 2014 15:21:20 +0200 Subject: [FieldTrip] Latest FT version on ftp-server is from three days ago Message-ID: <201409091521.22589.Holger.Krause@med.uni-duesseldorf.de> Dear developers, Could you please check the process for creation/publication of zip-files on the FTP server? The latest file I can find there is fieldtrip-20140906.zip. Thanks in advance, Holger From mcantor at umich.edu Tue Sep 9 15:19:55 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 9 Sep 2014 09:19:55 -0400 Subject: [FieldTrip] TRENTOOL pipeline help In-Reply-To: <540EEF94.9080601@gmx.de> References: <540EEF94.9080601@gmx.de> Message-ID: This is immensely helpful, thank you. I was very confused about why some versions of the pipeline I saw were using group calculate and others were using interaction delay reconstruction and what that meant, and I think I have a more clear idea of what the different steps of the pipeline are doing. There are still a few things I'm a bit confused about though in terms of the pipeline. For instance, whether or not I need to do TEprepare before group prepare, and if I need to do graph analysis (which I'm not sure I fully understand but also haven't looked deeply into) before group stats. If you don't mind me taking you up on your offer, I think seeing your example script might help clarify some of these issues. Thank you! On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < Patricia.Wollstadt at gmx.de> wrote: > Hello Max, > > I added a few comments to the questions regarding individual parameters > below. To address the general problem of TRENTOOL telling you, that there > are not enough sample points in your data: From what I can see in your > script, you probably don't have enough data points in each time series to > robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, which > gives you 240 samples per time series. Can you maybe avoid downsampling to > 300 Hz and downsample to 600 Hz instead? Or could you analyze a longer time > window of interest? > Note that you also 'lose' data to embedding and the interaction delay: The > first point that can be used for TE estimation is at max. embedding length > + max. interaction delay in samples. For example: max. embedding length = > dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max interaction > delay of 30 ms = 9 samples. In this example, you would be left with 240 - > 29 samples for TE estimation per trial. There is also the possibility to > estimate time resolved TE/TE for shorter time windows of interest (see > section 4.4 in the manual); however, this method requires the use of a GPU > for TE estimation. > > I would further recommend to use the new pipeline for group statistics > described in the manual in section 4.5 (the function 'TEgroup_calculate' is > deprecated). The new pipeline allows you to reconstruct the interaction > delay and uses the following functions (see also comments in the script): > > TEgroup_prepare -> prepares all data sets (all subjects/all conditions) > for group analysis (this means finding common embedding parameters such > that estimates are not biased between groups) > InteractionDelayReconstruction_calculate -> estimates TE for > individual data sets and all assumed interaction delays u > InteractionDelayReconstruction_analyze -> reconstructs the > interaction delay by selecting the u that maximizes TE for each channel > TEgroup_stats -> calculate group statistics using a permutation test > > I can send you an example script for group TE analysis using this pipeline > to get you started. I hope this helps you to get the group analysis > running. Just write again if you're having trouble setting up the pipeline > or something is not clear about the parameters/my comments. > > Best, > Patricia > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: > > Hi fieldtrippers, > > I know trentool is not produced by the Donders Institute, so I'm not 100% > sure if it is appropriate to ask questions about it here, but to the best > of my knowledge they do not have a mailing list and I saw a few trentool > questions in the archives, so I'm going to assume it's ok... > > In any case, below is my current pipeline (slightly modified for > comprehensibility): > > (notes in bold are comments/questions made in this email, not present in > the pipeline. Sorry in advance for the long post! Any help would be greatly > appreciated as I'm a bit over my head on this but I think I'm close!) > > ***** > > % Prepare group TE data > > cfgP = []; > cfgP.Path2TSTOOL = *TSTOOLPATH* > cfgP.TEcalctype = 'VW_ds'; > cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > > *I'm trying to find the transfer entropy between the left and right > auditory cortices in my experiment. The input is virtual sensor data that > was produced using SAM in fieldtrip on real MEG data. * > > % specify u to be scanned > > cfgP.predicttime_u = 30; > cfgP.toi = [-0.4 0.4]; > > *For clarification, the predicttime_u is in seconds but the toi is in > milliseconds. If I understand correctly, the predicttime_u must fit within > the toi, but beyond that are there any benefits to it being earlier or > later?* PW: The predictiontime_u is in milliseconds and the toi is in > seconds. The prediction time is the assumed interaction delay between your > two sources and should fit within your toi. In general it is preferable to > use the method for interaction delay reconstruction for TE estimation, > because it allows you to reconstruct the actual delay between your source > and target times series. A non-optimal u/interaction delay may cause an > underestimation of TE, so it is recommended to use the pipeline for > interaction delay reconstruction whenever estimating TE for unknown delays. > If you use the methods for interaction delay reconstruction > 'predicttime_u' is replaced by > cfgTEP.predicttimemin_u % minimum u to be scanned > cfgTEP.predicttimemax_u % maximum u to be scanned > cfgTEP.predicttimestepsize % time steps between u to be scanned > A large range for u values to be scanned increases computing time a lot, > so it is best to limit the u range to values that are physiologically > plausible. > > > % ACT (Autocorrelation Time) estimation and constraints > > cfgP.maxlag = 150; > cfgP.actthrvalue = 7.5; > cfgP.minnrtrials = 5; > > *My understanding is maxlag should be 1/2 the sampling rate, so since > the data are downsampled to 300hz, it should be 150. I know that the sample > rate and filters are used to determine the actthrvalue, but I don't > actually know the calculation. 7.5 was a rough guess just to test the > pipeline. I'm also uncertain of what minnrtrials should be.* PW: You can > set the actthrvalue based on the filtering you did prior to TE analysis. If > you for example highpass filtered at 10 Hz, you shouldn't find an ACT > higher than 30 samples, because you filtered out any components of the > signal slower than 10 Hz/30 samples (given your sampling frequency of 300 > Hz). So in this scenario the actthrvalue would be 30. > A good value for cfgP.minnrtrials is 12 (a minimum number of trials is > needed to realize the permutation test for estimated TE values). > > > % Optimization > > cfgP.optimizemethod = 'ragwitz'; > cfgP.ragdim = 4:8; > cfgP.ragtaurange = [0.2 0.4]; > cfgP.ragtausteps = 15; > cfgP.repPred = 100; > > *I am completely at a loss for this. I've done some reading into > transfer entropy, mutual information, etc., cited in trentool, but I'm yet > to understand how exactly this optimization works and what the > configuration should be, given my data and experimental intentions.* PW: > The Ragwitz criterion tries to find optimal embedding parameters dim and > tau for the data. To do that, the method iteratively takes all possible > combinations of dim and tau values that are provided in cfgP.ragdim and > cfgP.ragtaurange/.ragtausteps and tests how well these combinations embed > the data. To test an embedding, the method builds the embedding vectors > from the data; it then tests for each point how well the next point in time > can be predicted from the reference point's nearest neighbours. So for each > embedded point, the method searches for the nearest neighbours and > calculates the average of those nearest neighbours. The difference between > the averaged/predicted point and the actual next point is the error of the > local predictor. The Ragwitz criterion will then return the parameter > combination for which this error over all points is minimal. > The parameters set the following: 'ragdim' are dimensions to be tested by > the method (I would reccomend to start with 2:10), 'ragtaurange' together > with 'ragtausteps' specifies the tau values to be tested (TRENTOOL will > build a vector from 0.2 to 0.4 in 15 steps). Note, that the values here are > factors that are later multiplied with the ACT to obtain the actual tau. > 'repPred' is the number of points that will be used for the local > prediction, i.e. the Ragwitz criterion will test the local prediction and > calculate the error for the first 100 points in your time series. The two > parameters 'flagNei' ans 'sizeNei' below specify the type of neighbour > search conducted by the Ragwitz criterion: 'flagNei' tells the method to > either conduct a kNN or range search; 'sizeNei' specifies the number of > neighbours or the radius to be searched by a range search. > > > % Kernel-based TE estimation > > cfgP.flagNei = 'Mass'; > cfgP.sizeNei = 4; % Default > > cfgP.ensemblemethod = 'no'; > cfgP.outputpath = *OUTPUT PATH*; > > if ~exist(*Path for TEprepare data object*) > load VSdat; > TE_Wrd = {}; > for i = 1:nConds > for j = 1:Nsub > TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > end > end > clear VSdat; > save('TE_Wrd', 'TE_Wrd'); > end > > *The configuration and virtual sensor data, organized in a 3 x 15 cell > of structures (condition by subject) are the input. The TEprepare > substructure is added to each individual condition x subject .mat files' > data structure which are stored on disk independently.* > > % Use object_to_mat_conversion.m to replace individual condition x subject > virtual sensor data > % .mat files with their TE_Wrd equivalent > > *I'm using a separate script to make some manipulations to the objects > from disk; this will all eventually be integrated into the main pipeline*.* > TRENTOOL seems to handle data output very differently from fieldtrip and > I've had trouble thinking through the most logical way to handle the data > so it's a bit haphazard right now.* > > load cond080sub01.mat > > cfgG = []; > cfgG.dim = cond080sub01.TEprepare.optdim; > cfgG.tau = cond080sub01.TEprepare.opttau; > > if isfield(cond080sub01, 'TEprepare') > TEgroup_prepare(cfgG, fileCell); > else > error('Need to run TEprepare before TEgroup_prepare'); > end > > *For clarification, fileCell is a cell with the name of each condition x > subject .mat file, which as I said before is collectively the same as the 3 > x 15 VSdat structure (condition x subject).* > > % Replace .mat files with '_for_TEgroup_calculate' version in > % object_to_mat_conversion.m > > % TE Group Calculate > > load cond080sub01.mat > if isfield(cond080sub01, 'TEgroupprepare') > for i = 1:length(fileCell) > TEgroup_calculate(fileCell{i}); > end > else > error('Need to run TEgroup_prepare before TEgroup_calculate'); > end > > > > > > > > *At this step I get the following error: Error using transferentropy (line > 337) \nTRENTOOL ERROR: not enough data points left after embedding Error in > TEgroup_calculate (line 133) [TEresult] = transferentropy(cfg,data);* > > % TE Group Stats > > cfgGSTAT = []; > cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > > cfgGSTAT.uvar = 1; > cfgGSTAT.ivar = 2; > cfgGSTAT.fileidout = 'test_groupstats'; > > TEgroup_stats(cfgGSTAT, fileCell); > > *Given the error above, I am yet to get to this step, but it does not > seem fundamentally different from normal fieldtrip stats.* > > ***** > > In case my notes were not clear or you skipped to the bottom, *my > primary concern is whether the error I'm getting in TEgroup_calculate is a > pipeline issue* (I noticed the example pipeline in trentool, the manual, > and published methods articles all seem to have slightly or significantly > different pipeline compositions), *or if the error is* due to ACT, > ragwitz optimization, or some other faulty parameterization *on my part > due to a lack of understanding of how transfer entropy works on a more > theoretical/mathematical level*. If the latter is the case, is there any > relatively straightforward way to conceptualize this, or is this something > where I'm just going to have to keep reading and rereading until it > eventually makes sense? I've already done quite a bit of that and it hasn't > pierced my thick skull yet but I'm sure it will eventually! > > Thank you so much, > > Max Cantor > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patricia.Wollstadt at gmx.de Tue Sep 9 15:51:33 2014 From: Patricia.Wollstadt at gmx.de (Patricia Wollstadt) Date: Tue, 09 Sep 2014 15:51:33 +0200 Subject: [FieldTrip] TRENTOOL pipeline help In-Reply-To: References: <540EEF94.9080601@gmx.de> Message-ID: <540F05E5.1000109@gmx.de> I'm glad that cleared things up a little. Sorry about the confusion, we will try to include warnings for deprecated function in the next release of TRENTOOL. You don't need to run TEprepare before running TEgroup_prepare. You just run the four functions - TEgroup_prepare - InteractionDelayReconstruction_calculate - InteractionDelayReconstruction_analyze - TEgroup_stats in that order. The graph analysis is an optional step that can be run on the individual outputs of InteractionDelayReconstruction_analyze. The function will partially correct the output for multivariate effects. Since you are looking at one connection only, you don't need to include the graph analysis step into your pipeline. (I also sent you an example script directly, because I think it is not a good idea to send attachments via the mailing list.) Best, Patricia On 09/09/2014 03:19 PM, Max Cantor wrote: > This is immensely helpful, thank you. I was very confused about why > some versions of the pipeline I saw were using group calculate and > others were using interaction delay reconstruction and what that > meant, and I think I have a more clear idea of what the different > steps of the pipeline are doing. There are still a few things I'm a > bit confused about though in terms of the pipeline. For instance, > whether or not I need to do TEprepare before group prepare, and if I > need to do graph analysis (which I'm not sure I fully understand but > also haven't looked deeply into) before group stats. > > If you don't mind me taking you up on your offer, I think seeing your > example script might help clarify some of these issues. > > Thank you! > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt > > wrote: > > Hello Max, > > I added a few comments to the questions regarding individual > parameters below. To address the general problem of TRENTOOL > telling you, that there are not enough sample points in your data: > From what I can see in your script, you probably don't have enough > data points in each time series to robustly estimate TE. You > analyze 800 ms of data sampled at 300 Hz, which gives you 240 > samples per time series. Can you maybe avoid downsampling to 300 > Hz and downsample to 600 Hz instead? Or could you analyze a longer > time window of interest? > Note that you also 'lose' data to embedding and the interaction > delay: The first point that can be used for TE estimation is at > max. embedding length + max. interaction delay in samples. For > example: max. embedding length = dim * tau_factor * ACT = 10 * 0.4 > * 5 = 20 samples plus the max interaction delay of 30 ms = 9 > samples. In this example, you would be left with 240 - 29 samples > for TE estimation per trial. There is also the possibility to > estimate time resolved TE/TE for shorter time windows of interest > (see section 4.4 in the manual); however, this method requires the > use of a GPU for TE estimation. > > I would further recommend to use the new pipeline for group > statistics described in the manual in section 4.5 (the function > 'TEgroup_calculate' is deprecated). The new pipeline allows you to > reconstruct the interaction delay and uses the following functions > (see also comments in the script): > > TEgroup_prepare -> prepares all data sets (all subjects/all > conditions) for group analysis (this means finding common > embedding parameters such that estimates are not biased between > groups) > InteractionDelayReconstruction_calculate -> estimates TE for > individual data sets and all assumed interaction delays u > InteractionDelayReconstruction_analyze -> reconstructs the > interaction delay by selecting the u that maximizes TE for each > channel > TEgroup_stats -> calculate group statistics using a > permutation test > > I can send you an example script for group TE analysis using this > pipeline to get you started. I hope this helps you to get the > group analysis running. Just write again if you're having trouble > setting up the pipeline or something is not clear about the > parameters/my comments. > > Best, > Patricia > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: >> Hi fieldtrippers, >> >> I know trentool is not produced by the Donders Institute, so I'm >> not 100% sure if it is appropriate to ask questions about it >> here, but to the best of my knowledge they do not have a mailing >> list and I saw a few trentool questions in the archives, so I'm >> going to assume it's ok... >> >> In any case, below is my current pipeline (slightly modified for >> comprehensibility): >> >> (notes in bold are comments/questions made in this email, not >> present in the pipeline. Sorry in advance for the long post! Any >> help would be greatly appreciated as I'm a bit over my head on >> this but I think I'm close!) >> >> ***** >> >> % Prepare group TE data >> >> cfgP = []; >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> cfgP.TEcalctype = 'VW_ds'; >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> *I'm trying to find the transfer entropy between the left and >> right auditory cortices in my experiment. The input is virtual >> sensor data that was produced using SAM in fieldtrip on real MEG >> data. * >> >> % specify u to be scanned >> >> cfgP.predicttime_u = 30; >> cfgP.toi = [-0.4 0.4]; >> >> *For clarification, the predicttime_u is in seconds but the toi >> is in milliseconds. If I understand correctly, the predicttime_u >> must fit within the toi, but beyond that are there any benefits >> to it being earlier or later?* PW: The predictiontime_u is in >> milliseconds and the toi is in seconds. The prediction time is >> the assumed interaction delay between your two sources and should >> fit within your toi. In general it is preferable to use the >> method for interaction delay reconstruction for TE estimation, >> because it allows you to reconstruct the actual delay between >> your source and target times series. A non-optimal u/interaction >> delay may cause an underestimation of TE, so it is recommended to >> use the pipeline for interaction delay reconstruction whenever >> estimating TE for unknown delays. >> If you use the methods for interaction delay reconstruction >> 'predicttime_u' is replaced by >> cfgTEP.predicttimemin_u % minimum u to be scanned >> cfgTEP.predicttimemax_u % maximum u to be scanned >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> A large range for u values to be scanned increases computing time >> a lot, so it is best to limit the u range to values that are >> physiologically plausible. >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> cfgP.maxlag = 150; >> cfgP.actthrvalue = 7.5; >> cfgP.minnrtrials = 5; >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> since the data are downsampled to 300hz, it should be 150. I know >> that the sample rate and filters are used to determine the >> actthrvalue, but I don't actually know the calculation. 7.5 was a >> rough guess just to test the pipeline. I'm also uncertain of what >> minnrtrials should be.* PW: You can set the actthrvalue based on >> the filtering you did prior to TE analysis. If you for example >> highpass filtered at 10 Hz, you shouldn't find an ACT higher than >> 30 samples, because you filtered out any components of the signal >> slower than 10 Hz/30 samples (given your sampling frequency of >> 300 Hz). So in this scenario the actthrvalue would be 30. >> A good value for cfgP.minnrtrials is 12 (a minimum number of >> trials is needed to realize the permutation test for estimated >> TE values). >> >> % Optimization >> >> cfgP.optimizemethod = 'ragwitz'; >> cfgP.ragdim = 4:8; >> cfgP.ragtaurange = [0.2 0.4]; >> cfgP.ragtausteps = 15; >> cfgP.repPred = 100; >> * >> * >> *I am completely at a loss for this. I've done some reading into >> transfer entropy, mutual information, etc., cited in trentool, >> but I'm yet to understand how exactly this optimization works and >> what the configuration should be, given my data and experimental >> intentions.* PW: The Ragwitz criterion tries to find optimal >> embedding parameters dim and tau for the data. To do that, the >> method iteratively takes all possible combinations of dim and tau >> values that are provided in cfgP.ragdim and >> cfgP.ragtaurange/.ragtausteps and tests how well these >> combinations embed the data. To test an embedding, the method >> builds the embedding vectors from the data; it then tests for >> each point how well the next point in time can be predicted from >> the reference point's nearest neighbours. So for each embedded >> point, the method searches for the nearest neighbours and >> calculates the average of those nearest neighbours. The >> difference between the averaged/predicted point and the actual >> next point is the error of the local predictor. The Ragwitz >> criterion will then return the parameter combination for which >> this error over all points is minimal. >> The parameters set the following: 'ragdim' are dimensions to be >> tested by the method (I would reccomend to start with 2:10), >> 'ragtaurange' together with 'ragtausteps' specifies the tau >> values to be tested (TRENTOOL will build a vector from 0.2 to 0.4 >> in 15 steps). Note, that the values here are factors that are >> later multiplied with the ACT to obtain the actual tau. 'repPred' >> is the number of points that will be used for the local >> prediction, i.e. the Ragwitz criterion will test the local >> prediction and calculate the error for the first 100 points in >> your time series. The two parameters 'flagNei' ans 'sizeNei' >> below specify the type of neighbour search conducted by the >> Ragwitz criterion: 'flagNei' tells the method to either conduct a >> kNN or range search; 'sizeNei' specifies the number of neighbours >> or the radius to be searched by a range search. >> >> >> % Kernel-based TE estimation >> >> cfgP.flagNei = 'Mass'; >> cfgP.sizeNei = 4; % Default >> >> cfgP.ensemblemethod = 'no'; >> cfgP.outputpath = *OUTPUT PATH*; >> >> if ~exist(*Path for TEprepare data object*) >> load VSdat; >> TE_Wrd = {}; >> for i = 1:nConds >> for j = 1:Nsub >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> end >> end >> clear VSdat; >> save('TE_Wrd', 'TE_Wrd'); >> end >> * >> * >> *The configuration and virtual sensor data, organized in a 3 x 15 >> cell of structures (condition by subject) are the input. The >> TEprepare substructure is added to each individual condition x >> subject .mat files' data structure which are stored on disk >> independently.* >> >> % Use object_to_mat_conversion.m to replace individual condition >> x subject virtual sensor data >> % .mat files with their TE_Wrd equivalent >> * >> * >> *I'm using a separate script to make some manipulations to the >> objects from disk; this will all eventually be integrated into >> the main pipeline*.*TRENTOOL seems to handle data output very >> differently from fieldtrip and I've had trouble thinking through >> the most logical way to handle the data so it's a bit haphazard >> right now.* >> >> load cond080sub01.mat >> >> cfgG = []; >> cfgG.dim = cond080sub01.TEprepare.optdim; >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> if isfield(cond080sub01, 'TEprepare') >> TEgroup_prepare(cfgG, fileCell); >> else >> error('Need to run TEprepare before TEgroup_prepare'); >> end >> * >> * >> *For clarification, fileCell is a cell with the name of each >> condition x subject .mat file, which as I said before is >> collectively the same as the 3 x 15 VSdat structure (condition x >> subject).* >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> % object_to_mat_conversion.m >> >> % TE Group Calculate >> >> load cond080sub01.mat >> if isfield(cond080sub01, 'TEgroupprepare') >> for i = 1:length(fileCell) >> TEgroup_calculate(fileCell{i}); >> end >> else >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> end >> * >> * >> *At this step I get the following error: >> >> Error using transferentropy (line 337) >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in TEgroup_calculate (line 133) >> [TEresult] = transferentropy(cfg,data);* >> >> % TE Group Stats >> >> cfgGSTAT = []; >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> cfgGSTAT.uvar = 1; >> cfgGSTAT.ivar = 2; >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> *Given the error above, I am yet to get to this step, but it does >> not seem fundamentally different from normal fieldtrip stats.* >> >> ***** >> >> In case my notes were not clear or you skipped to the bottom, *my >> primary concern is whether the error I'm getting in >> TEgroup_calculate is a pipeline issue* (I noticed the example >> pipeline in trentool, the manual, and published methods articles >> all seem to have slightly or significantly different pipeline >> compositions), *or if the error is* due to ACT, ragwitz >> optimization, or some other faulty parameterization *on my part >> due to a lack of understanding of how transfer entropy works on a >> more theoretical/mathematical level*. If the latter is the case, >> is there any relatively straightforward way to conceptualize >> this, or is this something where I'm just going to have to keep >> reading and rereading until it eventually makes sense? I've >> already done quite a bit of that and it hasn't pierced my thick >> skull yet but I'm sure it will eventually! >> >> Thank you so much, >> >> Max Cantor >> >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> >> _______________________________________________ >> 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 > > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > > _______________________________________________ > 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 mcantor at umich.edu Tue Sep 9 16:39:18 2014 From: mcantor at umich.edu (Max Cantor) Date: Tue, 9 Sep 2014 10:39:18 -0400 Subject: [FieldTrip] TRENTOOL pipeline help In-Reply-To: <540F05E5.1000109@gmx.de> References: <540EEF94.9080601@gmx.de> <540F05E5.1000109@gmx.de> Message-ID: Looking at the sample script, it should be reasonably straightforward for me to adapt my pipeline, and between the ragwitz tutorial and your notes I should be able to develop a better understanding of what the pipeline is doing in a more sophisticated way. Again, thank you so much! I will try to incorporate this new information as soon as possible, and if I have any other issues I'll follow up, but hopefully this should solve most of my problems. On Tue, Sep 9, 2014 at 9:51 AM, Patricia Wollstadt < Patricia.Wollstadt at gmx.de> wrote: > I'm glad that cleared things up a little. Sorry about the confusion, we > will try to include warnings for deprecated function in the next release of > TRENTOOL. > > You don't need to run TEprepare before running TEgroup_prepare. You just > run the four functions > - TEgroup_prepare > - InteractionDelayReconstruction_calculate > - InteractionDelayReconstruction_analyze > - TEgroup_stats > in that order. > > The graph analysis is an optional step that can be run on the individual > outputs of InteractionDelayReconstruction_analyze. The function will > partially correct the output for multivariate effects. Since you are > looking at one connection only, you don't need to include the graph > analysis step into your pipeline. (I also sent you an example script > directly, because I think it is not a good idea to send attachments via the > mailing list.) > > Best, Patricia > > > > > On 09/09/2014 03:19 PM, Max Cantor wrote: > > This is immensely helpful, thank you. I was very confused about why some > versions of the pipeline I saw were using group calculate and others were > using interaction delay reconstruction and what that meant, and I think I > have a more clear idea of what the different steps of the pipeline are > doing. There are still a few things I'm a bit confused about though in > terms of the pipeline. For instance, whether or not I need to do TEprepare > before group prepare, and if I need to do graph analysis (which I'm not > sure I fully understand but also haven't looked deeply into) before group > stats. > > If you don't mind me taking you up on your offer, I think seeing your > example script might help clarify some of these issues. > > Thank you! > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > Patricia.Wollstadt at gmx.de> wrote: > >> Hello Max, >> >> I added a few comments to the questions regarding individual parameters >> below. To address the general problem of TRENTOOL telling you, that there >> are not enough sample points in your data: From what I can see in your >> script, you probably don't have enough data points in each time series to >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, which >> gives you 240 samples per time series. Can you maybe avoid downsampling to >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a longer time >> window of interest? >> Note that you also 'lose' data to embedding and the interaction delay: >> The first point that can be used for TE estimation is at max. embedding >> length + max. interaction delay in samples. For example: max. embedding >> length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >> interaction delay of 30 ms = 9 samples. In this example, you would be left >> with 240 - 29 samples for TE estimation per trial. There is also the >> possibility to estimate time resolved TE/TE for shorter time windows of >> interest (see section 4.4 in the manual); however, this method requires the >> use of a GPU for TE estimation. >> >> I would further recommend to use the new pipeline for group statistics >> described in the manual in section 4.5 (the function 'TEgroup_calculate' is >> deprecated). The new pipeline allows you to reconstruct the interaction >> delay and uses the following functions (see also comments in the script): >> >> TEgroup_prepare -> prepares all data sets (all subjects/all >> conditions) for group analysis (this means finding common embedding >> parameters such that estimates are not biased between groups) >> InteractionDelayReconstruction_calculate -> estimates TE for >> individual data sets and all assumed interaction delays u >> InteractionDelayReconstruction_analyze -> reconstructs the >> interaction delay by selecting the u that maximizes TE for each channel >> TEgroup_stats -> calculate group statistics using a permutation >> test >> >> I can send you an example script for group TE analysis using this >> pipeline to get you started. I hope this helps you to get the group >> analysis running. Just write again if you're having trouble setting up the >> pipeline or something is not clear about the parameters/my comments. >> >> Best, >> Patricia >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> I know trentool is not produced by the Donders Institute, so I'm not >> 100% sure if it is appropriate to ask questions about it here, but to the >> best of my knowledge they do not have a mailing list and I saw a few >> trentool questions in the archives, so I'm going to assume it's ok... >> >> In any case, below is my current pipeline (slightly modified for >> comprehensibility): >> >> (notes in bold are comments/questions made in this email, not present in >> the pipeline. Sorry in advance for the long post! Any help would be greatly >> appreciated as I'm a bit over my head on this but I think I'm close!) >> >> ***** >> >> % Prepare group TE data >> >> cfgP = []; >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> cfgP.TEcalctype = 'VW_ds'; >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> *I'm trying to find the transfer entropy between the left and right >> auditory cortices in my experiment. The input is virtual sensor data that >> was produced using SAM in fieldtrip on real MEG data. * >> >> % specify u to be scanned >> >> cfgP.predicttime_u = 30; >> cfgP.toi = [-0.4 0.4]; >> >> *For clarification, the predicttime_u is in seconds but the toi is in >> milliseconds. If I understand correctly, the predicttime_u must fit within >> the toi, but beyond that are there any benefits to it being earlier or >> later?* PW: The predictiontime_u is in milliseconds and the toi is in >> seconds. The prediction time is the assumed interaction delay between your >> two sources and should fit within your toi. In general it is preferable to >> use the method for interaction delay reconstruction for TE estimation, >> because it allows you to reconstruct the actual delay between your source >> and target times series. A non-optimal u/interaction delay may cause an >> underestimation of TE, so it is recommended to use the pipeline for >> interaction delay reconstruction whenever estimating TE for unknown delays. >> If you use the methods for interaction delay reconstruction >> 'predicttime_u' is replaced by >> cfgTEP.predicttimemin_u % minimum u to be scanned >> cfgTEP.predicttimemax_u % maximum u to be scanned >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> A large range for u values to be scanned increases computing time a lot, >> so it is best to limit the u range to values that are physiologically >> plausible. >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> cfgP.maxlag = 150; >> cfgP.actthrvalue = 7.5; >> cfgP.minnrtrials = 5; >> >> *My understanding is maxlag should be 1/2 the sampling rate, so since >> the data are downsampled to 300hz, it should be 150. I know that the sample >> rate and filters are used to determine the actthrvalue, but I don't >> actually know the calculation. 7.5 was a rough guess just to test the >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: You can >> set the actthrvalue based on the filtering you did prior to TE analysis. If >> you for example highpass filtered at 10 Hz, you shouldn't find an ACT >> higher than 30 samples, because you filtered out any components of the >> signal slower than 10 Hz/30 samples (given your sampling frequency of 300 >> Hz). So in this scenario the actthrvalue would be 30. >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials is >> needed to realize the permutation test for estimated TE values). >> >> >> % Optimization >> >> cfgP.optimizemethod = 'ragwitz'; >> cfgP.ragdim = 4:8; >> cfgP.ragtaurange = [0.2 0.4]; >> cfgP.ragtausteps = 15; >> cfgP.repPred = 100; >> >> *I am completely at a loss for this. I've done some reading into >> transfer entropy, mutual information, etc., cited in trentool, but I'm yet >> to understand how exactly this optimization works and what the >> configuration should be, given my data and experimental intentions.* PW: >> The Ragwitz criterion tries to find optimal embedding parameters dim and >> tau for the data. To do that, the method iteratively takes all possible >> combinations of dim and tau values that are provided in cfgP.ragdim and >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations embed >> the data. To test an embedding, the method builds the embedding vectors >> from the data; it then tests for each point how well the next point in time >> can be predicted from the reference point's nearest neighbours. So for each >> embedded point, the method searches for the nearest neighbours and >> calculates the average of those nearest neighbours. The difference between >> the averaged/predicted point and the actual next point is the error of the >> local predictor. The Ragwitz criterion will then return the parameter >> combination for which this error over all points is minimal. >> The parameters set the following: 'ragdim' are dimensions to be tested by >> the method (I would reccomend to start with 2:10), 'ragtaurange' together >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL will >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values here are >> factors that are later multiplied with the ACT to obtain the actual tau. >> 'repPred' is the number of points that will be used for the local >> prediction, i.e. the Ragwitz criterion will test the local prediction and >> calculate the error for the first 100 points in your time series. The two >> parameters 'flagNei' ans 'sizeNei' below specify the type of neighbour >> search conducted by the Ragwitz criterion: 'flagNei' tells the method to >> either conduct a kNN or range search; 'sizeNei' specifies the number of >> neighbours or the radius to be searched by a range search. >> >> >> % Kernel-based TE estimation >> >> cfgP.flagNei = 'Mass'; >> cfgP.sizeNei = 4; % Default >> >> cfgP.ensemblemethod = 'no'; >> cfgP.outputpath = *OUTPUT PATH*; >> >> if ~exist(*Path for TEprepare data object*) >> load VSdat; >> TE_Wrd = {}; >> for i = 1:nConds >> for j = 1:Nsub >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> end >> end >> clear VSdat; >> save('TE_Wrd', 'TE_Wrd'); >> end >> >> *The configuration and virtual sensor data, organized in a 3 x 15 cell >> of structures (condition by subject) are the input. The TEprepare >> substructure is added to each individual condition x subject .mat files' >> data structure which are stored on disk independently.* >> >> % Use object_to_mat_conversion.m to replace individual condition x >> subject virtual sensor data >> % .mat files with their TE_Wrd equivalent >> >> *I'm using a separate script to make some manipulations to the objects >> from disk; this will all eventually be integrated into the main pipeline* >> .* TRENTOOL seems to handle data output very differently from fieldtrip >> and I've had trouble thinking through the most logical way to handle the >> data so it's a bit haphazard right now.* >> >> load cond080sub01.mat >> >> cfgG = []; >> cfgG.dim = cond080sub01.TEprepare.optdim; >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> if isfield(cond080sub01, 'TEprepare') >> TEgroup_prepare(cfgG, fileCell); >> else >> error('Need to run TEprepare before TEgroup_prepare'); >> end >> >> *For clarification, fileCell is a cell with the name of each condition >> x subject .mat file, which as I said before is collectively the same as the >> 3 x 15 VSdat structure (condition x subject).* >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> % object_to_mat_conversion.m >> >> % TE Group Calculate >> >> load cond080sub01.mat >> if isfield(cond080sub01, 'TEgroupprepare') >> for i = 1:length(fileCell) >> TEgroup_calculate(fileCell{i}); >> end >> else >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> end >> >> >> >> >> >> >> >> *At this step I get the following error: Error using transferentropy >> (line 337) \nTRENTOOL ERROR: not enough data points left after embedding >> Error in TEgroup_calculate (line 133) [TEresult] = >> transferentropy(cfg,data);* >> >> % TE Group Stats >> >> cfgGSTAT = []; >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> cfgGSTAT.uvar = 1; >> cfgGSTAT.ivar = 2; >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> *Given the error above, I am yet to get to this step, but it does not >> seem fundamentally different from normal fieldtrip stats.* >> >> ***** >> >> In case my notes were not clear or you skipped to the bottom, *my >> primary concern is whether the error I'm getting in TEgroup_calculate is a >> pipeline issue* (I noticed the example pipeline in trentool, the manual, >> and published methods articles all seem to have slightly or significantly >> different pipeline compositions), *or if the error is* due to ACT, >> ragwitz optimization, or some other faulty parameterization *on my part >> due to a lack of understanding of how transfer entropy works on a more >> theoretical/mathematical level*. If the latter is the case, is there any >> relatively straightforward way to conceptualize this, or is this something >> where I'm just going to have to keep reading and rereading until it >> eventually makes sense? I've already done quite a bit of that and it hasn't >> pierced my thick skull yet but I'm sure it will eventually! >> >> Thank you so much, >> >> Max Cantor >> >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> >> _______________________________________________ >> fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 >> > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://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 > -- Max Cantor Lab Manager Computational Neurolinguistics Lab University of Michigan -------------- next part -------------- An HTML attachment was scrubbed... URL: From cas243 at georgetown.edu Tue Sep 9 21:25:21 2014 From: cas243 at georgetown.edu (Clara A. Scholl) Date: Tue, 9 Sep 2014 15:25:21 -0400 Subject: [FieldTrip] data.sampleinfo when preprocessing was completed in EEGLAB Message-ID: Dear FieldTrip Community, I did preprocessing in EEGLAB and imported into FieldTrip using eeglab2fieldtrip (from EEGLAB version 13.3.2b). The resulting FieldTrip data structures do not have the data field "sampleinfo" to specify the position of each trial relative to the actual recording. As a result of this, I get the warning "reconstructing sampleinfo by assuming that the trials are consecutive segments of a continuous recording" when calling the functions ft_timelockanalysis and ft_mvaranalysis. My questions are twofold: 1) when can I ignore this warning? 2) has anyone imported the sampleinfo into FieldTrip from an EEGLAB EEG structure? Any guidance on the best way to do this? Thanks immensely for feedback! Respectfully, Clara -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Sep 10 10:49:58 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 10 Sep 2014 10:49:58 +0200 Subject: [FieldTrip] data.sampleinfo when preprocessing was completed in EEGLAB In-Reply-To: References: Message-ID: Dear Clara, 1) Some FT functions require a sampleinfo for their inner workings, so they reconstruct it in a simple way if it is not present. You can safely ignore this warning if you are not doing anything with sample indices yourself. Specifically, the FT artifact and event functions use sample indices (i.e. return segments of artifacts/events in terms of samples relative to the original recording), if you are not using these you are probably safe. 2) Not me ;) Best, Eelke On 9 September 2014 21:25, Clara A. Scholl wrote: > Dear FieldTrip Community, > > I did preprocessing in EEGLAB and imported into FieldTrip using > eeglab2fieldtrip (from EEGLAB version 13.3.2b). The resulting FieldTrip > data structures do not have the data field "sampleinfo" to specify the > position of each trial relative to the actual recording. As a result of > this, I get the warning "reconstructing sampleinfo by assuming that the > trials are consecutive segments of a continuous recording" when calling the > functions ft_timelockanalysis and ft_mvaranalysis. > > My questions are twofold: > > 1) when can I ignore this warning? > 2) has anyone imported the sampleinfo into FieldTrip from an EEGLAB EEG > structure? Any guidance on the best way to do this? > > Thanks immensely for feedback! > Respectfully, > Clara > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From barbara.schorr at uni-ulm.de Wed Sep 10 14:07:14 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Wed, 10 Sep 2014 14:07:14 +0200 Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' In-Reply-To: References: Message-ID: <20140910140714.9n2t9bxs008o400c@imap.uni-ulm.de> Dear fieldtripers. as mentioned in the subject line I would like to anaylse my timelocked ERP Data with the function ft_globalmeanfield. I get the Error: Undefined function or variable 'abort' Error in ft_globalmeanfield (line84) if abort in the function it says: %the abort variable is set to true or false in ft_preamble_inti if abort % do not continue function execution in case the outputfile is present and the user indicated to keep it return end I don't understand what this means. I would really appreciate your help to get this running. Also, what is the result when I run this function on my data? (This method was proposed from a reviewer. I never used it before, so I don't exactly know what it does and what the result will look like). Thank you very much in advance! Best, Barbara Schorr Zitat von 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: Question regarding nonparametric testing for coherence > differences (Eric Maris) > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) > 4. Re: ft_rejectvisual: removing trials marked as bad > (Caspar, Emilie) > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) > 6. Latest FT version on ftp-server is from three days ago > (Holger Krause) > 7. Re: TRENTOOL pipeline help (Max Cantor) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) > From: "Eric Maris" > To: , "'FieldTrip discussion list'" > > Subject: Re: [FieldTrip] Question regarding nonparametric testing for > coherence differences > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> > Content-Type: text/plain; charset="utf-8" > > Dear Hwee Ling, > > > > In the paper you refer to (Maris et al, JNM, 2007), I did not perform a > cluster-based permutation test at the level of the channel pairs. Instead, > all coherences mentioned in the paper are coherence between a single EMG > channel (2 electrodes mounted on the forearm) and all MEG electrodes. Thus, > there are as many EMG-MEG coherences as there are MEG channels (275 in our > lab), and the clustering of these coherences involves the same neighbourhood > structure as the clustering of channel-specific statistics on power or > evoked response. The analysis you propose involves clustering in a much more > complex space, namely the formed by all (MEG,MEG) channel pairs > (275*275=75625 pairs). In the early days of cluster-based permutation > statistics, I have worked on this problem but did not pursue it because the > resulting clusters are very hard to interpret. > > > > Best, > > > > Eric Maris > > > > > > Dear all and Prof Maris, > > I'm re-posting this question again, as I didn't get any replies previously. > > I?m interested to investigate if there are any differences in phase > synchronization in resting state data at timepoint 2 versus timepoint 1. The > EEG data was collected using 64 EEG channels, resting state, eyes opened and > eyes closed. I?ve arbitrarily segmented the resting state data into epochs > of 2s each, and the epochs with artifacts are excluded completely from > further analyses. I then performed mtmfft to get the fourier representation > of the data, extracted the coherence, and compared the coherence difference > of timepoint 2 versus timepoint 1 of all channels paired with all other > channels. > > I figured that if I extract the connectivity analyses without specifying the > channelcmb, I get a 'chan_chan_freq' dimord variable that would allow me to > perform cluster-based statistical analyses. I get an output with ?chan_chan? > dimord variable. However, I was not 100% sure that this is correct, > hence, I?ve > inserted my code (see below). It?ll be great if you could tell me if what I?m > doing makes any sense at all. Also, I don?t know how I can plot the results > to see if it make any sense at all. > > Also, I checked the values obtained from when I specified "cfg.channelcmb" > and when I did not specify "cfg.channelcmb", I noticed that the values were > somehow different. I would assume that the values to be similar, although > I'm not sure why they would have differences in the values obtained from > specifying "cfg.channelcmb". > > This is my code that I've used thus far: > > for sub = 1:5 > > cfg = []; > > cfg.output = 'fourier'; > > cfg.channel = {'all'}; > > cfg.method = 'mtmfft'; > > cfg.keeptrials = 'yes'; > > cfg.tapsmofrq = 5; > > cfg.foilim = [0 100]; > > cfg.taper = 'dpss'; > > % find the index for the c200 condition > > pre_c200_idx = find(data5.trialinfo == 201); > > cfg.trials = pre_c200_idx; > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > post_c200_idx = find(data5.trialinfo == 200); > > cfg.trials = post_c200_idx; > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > cfg = []; > > cfg.keeptrials = 'no'; > > cfg.channel = {'all'}; > > cfg.removemean = 'yes'; > > cfg.method = 'coh'; > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, HLF_pre_c200); > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > HLF_post_c200); > > end > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); > > cfg_neighb.method = 'template'; > > cfg_neighb.layout = lay; > > cfg_neighb.channel = 'all'; > > neighbours = ft_prepare_neighbours(cfg_neighb, sub_HLF_pre_c200coh{1}); > > > > cfg = []; > > cfg.layout = lay; > > cfg.neighbours = neighbours; > > cfg.channel = 'all'; > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > cfg.latency = 'all'; > > cfg.avgovertime = 'no'; > > cfg.avgoverchan = 'no'; > > cfg.parameter = 'cohspctrm'; > > cfg.method = 'montecarlo'; > > cfg.statistic = 'depsamplesT'; > > cfg.correctm = 'cluster'; > > cfg.tail = 0; > > % cfg.clustertail = 0; > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 frequency > bands. > > cfg.numrandomization = 10000; > > cfg.ivar = 2; > > cfg.uvar = 1; > > > > % design matrices > > clear design; > > design(1,:) = [1:5, 1:5]; > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > cfg.design = design; > > % for theta band > > cfg.avgoverfreq = 'yes'; > > cfg.frequency = [4 8]; % I also performed the statistics for delta (2-4), > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma (30-40), > and gamma (40-100). > > [diffc200_theta_stat] = ft_freqstatistics(cfg, sub_HLF_post_c200coh{:}, > sub_HLF_pre_c200coh{:}); > > > > When I tried to plot the results, I used this code: > > cfg = []; > > cfg.channel = 'all'; > > cfg.layout = 'lay'; > > cfg.zlim = [-1 1]; > > cfg.alpha = 0.05; > > cfg.refchannel = 'all'; > > ft_clusterplot(cfg, diffc200_theta_stat); > > However, I was not sure how I could plot the results. I get an error message > from Fieldtrip when using ft_clusterplot: > > Error using topoplot_common (line 366) > > no reference channel is specified > > Error in ft_topoplotTFR (line 192) > > [cfg] = topoplot_common(cfg, varargin{:}); > > Error in ft_clusterplot (line 372) > > ft_topoplotTFR(cfgtopo, stat); > > > > According to your paper in 2007, the topoplot of the results were masked by > the spatio-spectral pattern of the significant clusters. I don't know how to > do this, and I would really appreciate if you can show me how to make such a > plot. > > Thank you very much. > > Kind regards, > > Hweeling > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 2 > Date: Mon, 8 Sep 2014 21:38:01 +0200 > From: KatrinH Heimann > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Dear Joseph, thanks so much, I really appreciate your help. I was also > wandering, if maybe there is another bug in my code. > Our nets are 128 channels, Hydrocel, but as a colleague of me adviced me to > do so, I also tried the 129 layout. > My code you find below (without selection of bad channels etc.) > If you need also the data of two subjects to have a look, let me know!!! > Best and thanks really! > Katrin > > > subject=input('Which subject do you want to analyse? ','s'); > > name = strcat(subject,'.raw'); > > subjectnumber=input('Which is the subjectnumber?', 's'); > > sb=subjectnumber > > %subjectnumber = strcat(subjectnumber, '.txt') > > %% > > > cfg = []; > > cfg.dataset = name; > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus trigger > > cfg.trialdef.prestim = 0.234; % in seconds > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > observation, but maybe we need less) > > cfg = ft_definetrial(cfg); > > > cfg.trl([1:7],:) = []; > > > %change timeline according to constant offset of 16 ms = 8 samples (because > recorded with 500 hz)in > > %structure trial > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > %change timeline to make the cut the zeropoint > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > %% preprocess data > > cfg.channel = 'all'; > > cfg.preproc.detrend = 'yes'; > > cfg.preproc.demean = 'yes'; > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already filtered > > %(0.1-45) and bad channels have to be replaced!!!! > > %cfg.preproc.bpfreq = [6 32]; > > % > > % > > obs_data = ft_preprocessing(cfg); > > % > > save (strcat(sb,'obs_data') , 'obs_data') > > > %% determining channel neighbours (necessary for Artifact detection) > > cfg = []; > > cfg.channel = obs_data.label; > > cfg.layout = 'GSN128.sfp'; > > cfg.feedback = 'yes'; > > lay = ft_prepare_layout(cfg); > > > > cfg_neighb = []; > > cfg_neighb.feedback = 'yes'; > > > cfg_neighb.method = 'triangulation'; > > cfg_neighb.layout = 'GSN128.sfp'; > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > %% Preparing neighbours for channel repair - but bad channel info in!!! > > > % cfg_neighb = []; > > % cfg_neighb.feedback = 'yes'; > > % cfg_neighb.method = 'triangulation'; > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > % Interpolate and put into new data structure > > cfg = []; > > cfg.badchannel = {}; > > cfg.layout = 'GSN128.sfp'; > > cfg.method = 'nearest'; > > cfg.neighbours = neighbours; > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > % Check reconstruction > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > % dat1=obs_data; > > % dat2=obs_data_channelrepaired; > > % > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > % y=dat2.trial{1}(62,:); > > % plot(x);hold on;plot(y,'r'); > > % > > % x=dat1.trial{1}(72,:); > > % y=dat2.trial{1}(75,:); > > % figure; > > % plot(x);hold on;plot(y,'r') > > % > > % x=dat1.trial{1}(75,:); > > % y=dat2.trial{1}(75,:); > > % figure; > > % plot(x);hold on;plot(y,'r') > > %% artifact rejection/trial inspection - throw out electrode jumps etc. > > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > %cfg.artfctdef.reject = 'complete'; > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent according to > channels interpolated %% 128-number of interp. channels) > > > > cfg = []; > > cfg.channel = {'all'}; > > cfg.numcomponent = 128 > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > save (strcat(sb,'comp_all') , 'comp') > > > %% > > cfg = []; > > cfg.viewmode = 'component'; > > cfg.continuous = 'no'; > > cfg.plotlabels='some'; > > cfg.layout = 'GSN128.sfp'; > > ft_databrowser(cfg,comp); > > > %% poweranalysis components > > cfg = []; > > cfg.output = 'pow'; > > cfg.channel = 'all';%compute the power spectrum in all ICs > > cfg.method = 'mtmfft'; > > cfg.taper = 'hanning'; > > cfg.foi = 0:0.2:50; > > obs_freq = ft_freqanalysis(cfg, comp); > > > %And you can plot the spectra: > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > nsubplots = 16; > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain decimals, type > doc subplot > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > tot = Nfigs*nsubplots; > > > rptvect = 1:size(comp.topo,1); > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > for r=1:size(rptvect,1); > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 1]);%full > screen > > k=0; > > for j=1:size(rptvect,2); > > if~(rptvect(r,j)==0); > > k=k+1; > > cfg=[]; > > cfg.channel = rptvect(r,j); > > cfg.ylim =[0 500] > > cfg.xlim =[0 50] > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > end > > end > > end > > > %For the IC topos you'll follow the same logic as above but with: > > > figure > > cfg = []; > > cfg.component = [1:20]; % specify the component(s) that should be > plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > figure > > cfg = []; > > cfg.component = [21:40]; % specify the component(s) that should be > plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > figure > > cfg = []; > > cfg.component = [41:60]; % specify the component(s) that should be > plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > figure > > cfg = []; > > cfg.component = [61:80]; % specify the component(s) that should be > plotted > > cfg.layout = 'GSN128.sfp'; > > cfg.comment = 'no'; > > ft_topoplotIC(cfg, comp) > > > > > > > %% Seperate observation conditions > > > name1= strcat(num2str(sb),'_90.xls'); > > list1=xlsread (name1) > > > > > > name2= strcat(num2str(sb),'_180.xls'); > > list2=xlsread (name2) > > > > % > > > cfg = [] > > cfg.trials = [list1] > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > cfg = [] > > cfg.trials = [list2] > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > %%PIPELINE FOR obs90 > > > %% Decompose original data according to the components found before > > load (strcat(sb,'comp_all')) > > > cfg = []; > > cfg.numcomponent = 128; > > cfg.unmixing = comp.unmixing; > > cfg.topolabel = comp.topolabel; > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > %% Reject component > > cfg = []; > > cfg.component = []; > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > %% Artifacts - final detection > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > %cfg.artfctdef.reject = 'complete'; > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > % Save clean data > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > %% Rereferencing data > > cfg = []; > > > cfg.channel = 'all'; > > cfg.preproc.reref = 'yes'; > > cfg.preproc.refchannel = 'all'; > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > %% Snap out smaller pieces (the third second) > > > cfg = [] > > cfg.toilim = [0 1] > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > %% TIMELOCK ERP > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > %% plot it > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > %% PIPELINE FOR obs180 > > > > %% Decompose original data according to the components found before > > load (strcat(sb,'comp_all')) > > > cfg = []; > > cfg.numcomponent = 128 > > cfg.unmixing = comp.unmixing; > > cfg.topolabel = comp.topolabel; > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > %% Reject component > > cfg = []; > > cfg.component = []; > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, obs180_data); > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > %% Artifacts final 180 > > > > cfg.method = 'summary'; > > cfg.latency=[0 1]; > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > cfg = []; > > cfg.viewmode = 'vertical'; > > cfg.latency=[0 1]; > > cfg.continuous = 'no'; > > cfg.plotlabels='yes' > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > %cfg.artfctdef.reject = 'complete'; > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > % Save clean data > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > %% Rereferencing data > > cfg = []; > > cfg.channel = 'all'; > > cfg.preproc.reref = 'yes'; > > cfg.preproc.refchannel = 'all'; > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > %% Snap out smaller pieces (the third second) > > > cfg = [] > > cfg.toilim = [0 1] > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > %% TIMELOCK ERP > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > %% plot 180 ERP > > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, obs180_data_ERP) > > > %% plot both ERPs > > > cfg = []; > > cfg.layout = lay ; > > cfg.interactive = 'yes'; > > cfg.showlabels = 'yes'; > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > %% plot difference wave > > > difference = obs180_data_ERP; % copy one of the > structures > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute the > difference ERP > > > > cfg = []; > > cfg.layout = lay; > > cfg.interactive = 'yes'; > > ft_multiplotER(cfg, difference) > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > >> Hi, >> I?m one of the main Fieldtrip contributors working on supporting EGI >> data. A couple things. First of all, exactly which net do you use? If >> they are 129-channel, there is still the question of whether they are the >> Hydrocel or the older geodesic nets. Regardless, that shouldn't cause an >> error like this. Could you send me the file you are trying to process and >> the script you are using and I?ll try troubleshooting it. >> >> Joe >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >> diezmartini at gmail.com> wrote: >> >> Which nets do you use? I use EGI. I tried both the ones you mention and >> they didn't work. It was hard to find that exact one online but it was the >> only file that actually worked. >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> wrote: >> >>> Dear Ana, dear all, >>> the layout you used does not correspond to our nets. I tried the >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't work. >>> Please can anybody help? >>> Cheers >>> Katrin >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : >>> >>> Try this one >>>> I use >>>> >>>> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>>> katrinheimann at gmail.com> wrote: >>>> >>>>> Dear all, my problems seem neverending. This time however i really need >>>>> help. >>>>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>>>> preprocessing, channelreplacement, ica, componentrejection, final >>>>> artifactdetection, timelock of the single subject data. However, when I >>>>> wanna compute the grandaverage of the single subjects I get the following >>>>> error message: >>>>> >>>>> computing average of avg over 19 subjects >>>>> Warning: discarding electrode information because it cannot be averaged >>>>> > In ft_timelockgrandaverage at 249 >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>>>> additional allocation of an estimated 3 MB >>>>> computing average of avg over 2 subjects >>>>> Warning: discarding electrode information because it cannot be averaged >>>>> > In ft_timelockgrandaverage at 249 >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and required the >>>>> additional allocation of an estimated 0 MB >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >>>>> additional allocation of an estimated 0 MB >>>>> the call to "ft_topoplotER" took 0 seconds and required the additional >>>>> allocation of an estimated 0 MB >>>>> >>>>> Furthermore in the plot of the significant clusters, the channelnames >>>>> are mixed up (do not correspond to my net) >>>>> >>>>> >>>>> I guess that there is a problem with the layout I use. >>>>> Here the code that I use >>>>> >>>>> %For generating the layout (also in the single subjects): >>>>> >>>>> cfg = []; >>>>> >>>>> cfg.channel = obs_data.label; >>>>> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>>>> >>>>> cfg.feedback = 'yes'; >>>>> >>>>> lay = ft_prepare_layout(cfg); >>>>> >>>>> >>>>> cfg_neighb = []; >>>>> >>>>> cfg_neighb.feedback = 'yes'; >>>>> >>>>> cfg_neighb.method = 'triangulation'; >>>>> >>>>> cfg_neighb.layout = lay; >>>>> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>>>> >>>>> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>>>> >>>>> >>>>> %For computing the grand average >>>>> >>>>> cfg = []; >>>>> >>>>> cfg.channel = 'all'; >>>>> >>>>> cfg.latency = 'all'; >>>>> >>>>> cfg.parameter = 'avg'; >>>>> >>>>> cfg.keepindividual = 'no' >>>>> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>>>> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>>>> >>>>> % "{:}" means to use data from all elements of the variable >>>>> >>>>> >>>>> For plotting the significant clusters >>>>> >>>>> cfg = []; >>>>> >>>>> cfg.style = 'blank'; >>>>> >>>>> cfg.layout = lay; >>>>> >>>>> cfg.channellabels = 'yes'; >>>>> >>>>> cfg.highlight = 'labels'; >>>>> >>>>> cfg.highlightchannel = find(stat.mask); >>>>> >>>>> cfg.comment = 'no'; >>>>> >>>>> figure; ft_topoplotER(cfg, GA_90) >>>>> >>>>> title('Nonparametric: significant with cluster multiple comparison >>>>> correction') >>>>> >>>>> >>>>> Do you have ANY idea to this? I am really completely helpless.... >>>>> >>>>> thanks and best >>>>> >>>>> Katrin >>>>> >>>>> _______________________________________________ >>>>> 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 >>> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> -------------------------------------------------------------------------------- >> >> Joseph Dien, PhD >> Research Associate >> Cognitive Neurology >> The Johns Hopkins University School of Medicine >> >> Lab E-mail: jdien1 at jhmi.edu >> Private E-mail: jdien07 at mac.com >> Office Phone: 410-614-3115 >> Cell Phone: 202-297-8117 >> Fax: 410-955-0188 >> http://joedien.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: > > > ------------------------------ > > Message: 3 > Date: Mon, 08 Sep 2014 21:55:44 -0400 > From: Joseph Dien > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> > Content-Type: text/plain; charset="windows-1252" > > yes, please do send me the data. > > Thanks! > > Joe > > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann wrote: > >> Dear Joseph, thanks so much, I really appreciate your help. I was >> also wandering, if maybe there is another bug in my code. >> Our nets are 128 channels, Hydrocel, but as a colleague of me >> adviced me to do so, I also tried the 129 layout. >> My code you find below (without selection of bad channels etc.) >> If you need also the data of two subjects to have a look, let me know!!! >> Best and thanks really! >> Katrin >> >> >> >> subject=input('Which subject do you want to analyse? ','s'); >> >> name = strcat(subject,'.raw'); >> >> subjectnumber=input('Which is the subjectnumber?', 's'); >> >> sb=subjectnumber >> >> %subjectnumber = strcat(subjectnumber, '.txt') >> >> %% >> >> >> >> cfg = []; >> >> cfg.dataset = name; >> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> >> cfg.trialdef.eventtype = 'trigger'; >> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus trigger >> >> cfg.trialdef.prestim = 0.234; % in seconds >> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> observation, but maybe we need less) >> >> cfg = ft_definetrial(cfg); >> >> >> >> cfg.trl([1:7],:) = []; >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> (because recorded with 500 hz)in >> >> %structure trial >> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >> >> >> >> %change timeline to make the cut the zeropoint >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> >> >> >> >> >> %% preprocess data >> >> cfg.channel = 'all'; >> >> cfg.preproc.detrend = 'yes'; >> >> cfg.preproc.demean = 'yes'; >> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already filtered >> >> %(0.1-45) and bad channels have to be replaced!!!! >> >> %cfg.preproc.bpfreq = [6 32]; >> >> % >> >> % >> >> obs_data = ft_preprocessing(cfg); >> >> % >> >> save (strcat(sb,'obs_data') , 'obs_data') >> >> >> >> %% determining channel neighbours (necessary for Artifact detection) >> >> cfg = []; >> >> cfg.channel = obs_data.label; >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.feedback = 'yes'; >> >> lay = ft_prepare_layout(cfg); >> >> >> cfg_neighb = []; >> >> cfg_neighb.feedback = 'yes'; >> >> >> >> cfg_neighb.method = 'triangulation'; >> >> cfg_neighb.layout = 'GSN128.sfp'; >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >> >> >> >> %% Artifacts - to detect bad channels - is not saved!!! >> >> >> >> >> >> cfg.method = 'summary'; >> >> cfg.latency=[0 1]; >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >> >> >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.latency=[0 1]; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs_data); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >> >> >> >> >> >> %% Preparing neighbours for channel repair - but bad channel info in!!! >> >> >> >> % cfg_neighb = []; >> >> % cfg_neighb.feedback = 'yes'; >> >> % cfg_neighb.method = 'triangulation'; >> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> % Interpolate and put into new data structure >> >> cfg = []; >> >> cfg.badchannel = {}; >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.method = 'nearest'; >> >> cfg.neighbours = neighbours; >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> >> % Check reconstruction >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> % dat1=obs_data; >> >> % dat2=obs_data_channelrepaired; >> >> % >> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> >> % y=dat2.trial{1}(62,:); >> >> % plot(x);hold on;plot(y,'r'); >> >> % >> >> % x=dat1.trial{1}(72,:); >> >> % y=dat2.trial{1}(75,:); >> >> % figure; >> >> % plot(x);hold on;plot(y,'r') >> >> % >> >> % x=dat1.trial{1}(75,:); >> >> % y=dat2.trial{1}(75,:); >> >> % figure; >> >> % plot(x);hold on;plot(y,'r') >> >> %% artifact rejection/trial inspection - throw out electrode jumps etc. >> >> >> >> >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> according to channels interpolated %% 128-number of interp. channels) >> >> >> cfg = []; >> >> cfg.channel = {'all'}; >> >> cfg.numcomponent = 128 >> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >> >> save (strcat(sb,'comp_all') , 'comp') >> >> >> >> %% >> >> cfg = []; >> >> cfg.viewmode = 'component'; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='some'; >> >> cfg.layout = 'GSN128.sfp'; >> >> ft_databrowser(cfg,comp); >> >> >> >> %% poweranalysis components >> >> cfg = []; >> >> cfg.output = 'pow'; >> >> cfg.channel = 'all';%compute the power spectrum in all ICs >> >> cfg.method = 'mtmfft'; >> >> cfg.taper = 'hanning'; >> >> cfg.foi = 0:0.2:50; >> >> obs_freq = ft_freqanalysis(cfg, comp); >> >> >> >> %And you can plot the spectra: >> >> >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> nsubplots = 16; >> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> decimals, type doc subplot >> >> >> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >> >> tot = Nfigs*nsubplots; >> >> >> >> rptvect = 1:size(comp.topo,1); >> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> >> >> >> for r=1:size(rptvect,1); >> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> 1]);%full screen >> >> k=0; >> >> for j=1:size(rptvect,2); >> >> if~(rptvect(r,j)==0); >> >> k=k+1; >> >> cfg=[]; >> >> cfg.channel = rptvect(r,j); >> >> cfg.ylim =[0 500] >> >> cfg.xlim =[0 50] >> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> >> end >> >> end >> >> end >> >> >> >> %For the IC topos you'll follow the same logic as above but with: >> >> >> >> figure >> >> cfg = []; >> >> cfg.component = [1:20]; % specify the component(s) that >> should be plotted >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.comment = 'no'; >> >> ft_topoplotIC(cfg, comp) >> >> >> >> figure >> >> cfg = []; >> >> cfg.component = [21:40]; % specify the component(s) that >> should be plotted >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.comment = 'no'; >> >> ft_topoplotIC(cfg, comp) >> >> >> >> figure >> >> cfg = []; >> >> cfg.component = [41:60]; % specify the component(s) that >> should be plotted >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.comment = 'no'; >> >> ft_topoplotIC(cfg, comp) >> >> >> >> figure >> >> cfg = []; >> >> cfg.component = [61:80]; % specify the component(s) that >> should be plotted >> >> cfg.layout = 'GSN128.sfp'; >> >> cfg.comment = 'no'; >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> >> >> >> >> %% Seperate observation conditions >> >> >> >> name1= strcat(num2str(sb),'_90.xls'); >> >> list1=xlsread (name1) >> >> >> >> name2= strcat(num2str(sb),'_180.xls'); >> >> list2=xlsread (name2) >> >> >> % >> >> >> >> cfg = [] >> >> cfg.trials = [list1] >> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> cfg = [] >> >> cfg.trials = [list2] >> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> %%PIPELINE FOR obs90 >> >> >> >> %% Decompose original data according to the components found before >> >> load (strcat(sb,'comp_all')) >> >> >> >> cfg = []; >> >> cfg.numcomponent = 128; >> >> cfg.unmixing = comp.unmixing; >> >> cfg.topolabel = comp.topolabel; >> >> >> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >> >> >> >> >> >> %% Reject component >> >> cfg = []; >> >> cfg.component = []; >> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); >> >> >> >> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> >> >> >> >> >> >> >> %% Artifacts - final detection >> >> >> >> >> >> cfg.method = 'summary'; >> >> cfg.latency=[0 1]; >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> >> >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.latency=[0 1]; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> >> >> >> >> >> % Save clean data >> >> >> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> >> >> >> >> >> %% Rereferencing data >> >> cfg = []; >> >> >> >> cfg.channel = 'all'; >> >> cfg.preproc.reref = 'yes'; >> >> cfg.preproc.refchannel = 'all'; >> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> >> >> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> >> %% Snap out smaller pieces (the third second) >> >> >> >> cfg = [] >> >> cfg.toilim = [0 1] >> >> >> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> >> >> >> %% TIMELOCK ERP >> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> >> >> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> >> >> >> %% plot it >> >> cfg = []; >> >> cfg.layout = lay ; >> >> cfg.interactive = 'yes'; >> >> ft_multiplotER(cfg, obs90_data_ERP) >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% PIPELINE FOR obs180 >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> load (strcat(sb,'comp_all')) >> >> >> >> cfg = []; >> >> cfg.numcomponent = 128 >> >> cfg.unmixing = comp.unmixing; >> >> cfg.topolabel = comp.topolabel; >> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >> >> >> >> >> >> %% Reject component >> >> cfg = []; >> >> cfg.component = []; >> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, obs180_data); >> >> >> >> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> >> >> >> >> >> >> >> %% Artifacts final 180 >> >> >> >> >> >> cfg.method = 'summary'; >> >> cfg.latency=[0 1]; >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> >> >> >> cfg = []; >> >> cfg.viewmode = 'vertical'; >> >> cfg.latency=[0 1]; >> >> cfg.continuous = 'no'; >> >> cfg.plotlabels='yes' >> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >> >> %cfg.artfctdef.reject = 'complete'; >> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> >> >> >> >> >> % Save clean data >> >> >> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> >> >> >> >> >> %% Rereferencing data >> >> cfg = []; >> >> cfg.channel = 'all'; >> >> cfg.preproc.reref = 'yes'; >> >> cfg.preproc.refchannel = 'all'; >> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> >> >> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> >> %% Snap out smaller pieces (the third second) >> >> >> >> cfg = [] >> >> cfg.toilim = [0 1] >> >> >> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> >> >> >> %% TIMELOCK ERP >> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> >> >> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> >> >> >> %% plot 180 ERP >> >> >> >> cfg = []; >> >> cfg.layout = lay ; >> >> cfg.interactive = 'yes'; >> >> ft_multiplotER(cfg, obs180_data_ERP) >> >> >> >> %% plot both ERPs >> >> >> >> cfg = []; >> >> cfg.layout = lay ; >> >> cfg.interactive = 'yes'; >> >> cfg.showlabels = 'yes'; >> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> >> >> >> %% plot difference wave >> >> >> >> difference = obs180_data_ERP; % copy one of >> the structures >> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >> compute the difference ERP >> >> >> cfg = []; >> >> cfg.layout = lay; >> >> cfg.interactive = 'yes'; >> >> ft_multiplotER(cfg, difference) >> >> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> Hi, >> I?m one of the main Fieldtrip contributors working on supporting >> EGI data. A couple things. First of all, exactly which net do >> you use? If they are 129-channel, there is still the question of >> whether they are the Hydrocel or the older geodesic nets. >> Regardless, that shouldn't cause an error like this. Could you >> send me the file you are trying to process and the script you are >> using and I?ll try troubleshooting it. >> >> Joe >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >> wrote: >> >>> Which nets do you use? I use EGI. I tried both the ones you >>> mention and they didn't work. It was hard to find that exact one >>> online but it was the only file that actually worked. >>> >>> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> wrote: >>> Dear Ana, dear all, >>> the layout you used does not correspond to our nets. I tried the >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> work. Please can anybody help? >>> Cheers >>> Katrin >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini : >>> >>> Try this one I use >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >>> wrote: >>> Dear all, my problems seem neverending. This time however i really >>> need help. >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> preprocessing, channelreplacement, ica, componentrejection, final >>> artifactdetection, timelock of the single subject data. However, >>> when I wanna compute the grandaverage of the single subjects I get >>> the following error message: >>> >>> computing average of avg over 19 subjects >>> Warning: discarding electrode information because it cannot be averaged >>> > In ft_timelockgrandaverage at 249 >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> the additional allocation of an estimated 3 MB >>> computing average of avg over 2 subjects >>> Warning: discarding electrode information because it cannot be averaged >>> > In ft_timelockgrandaverage at 249 >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> the additional allocation of an estimated 0 MB >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> additional allocation of an estimated 0 MB >>> the call to "ft_topoplotER" took 0 seconds and required the >>> additional allocation of an estimated 0 MB >>> >>> Furthermore in the plot of the significant clusters, the >>> channelnames are mixed up (do not correspond to my net) >>> >>> >>> I guess that there is a problem with the layout I use. >>> Here the code that I use >>> >>> %For generating the layout (also in the single subjects): >>> cfg = []; >>> >>> cfg.channel = obs_data.label; >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> cfg.feedback = 'yes'; >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> cfg_neighb = []; >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> cfg_neighb.layout = lay; >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> >>> %For computing the grand average >>> >>> cfg = []; >>> >>> cfg.channel = 'all'; >>> >>> cfg.latency = 'all'; >>> >>> cfg.parameter = 'avg'; >>> >>> cfg.keepindividual = 'no' >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> For plotting the significant clusters >>> >>> cfg = []; >>> >>> cfg.style = 'blank'; >>> >>> cfg.layout = lay; >>> >>> cfg.channellabels = 'yes'; >>> >>> cfg.highlight = 'labels'; >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> cfg.comment = 'no'; >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> correction') >>> >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> thanks and best >>> >>> Katrin >>> >>> >>> _______________________________________________ >>> 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 >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -------------------------------------------------------------------------------- >> >> Joseph Dien, PhD >> Research Associate >> Cognitive Neurology >> The Johns Hopkins University School of Medicine >> >> Lab E-mail: jdien1 at jhmi.edu >> Private E-mail: jdien07 at mac.com >> Office Phone: 410-614-3115 >> Cell Phone: 202-297-8117 >> Fax: 410-955-0188 >> http://joedien.com >> >> >> _______________________________________________ >> 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 > > -------------------------------------------------------------------------------- > > Joseph Dien, PhD > Research Associate > Cognitive Neurology > The Johns Hopkins University School of Medicine > > Lab E-mail: jdien1 at jhmi.edu > Private E-mail: jdien07 at mac.com > Office Phone: 410-614-3115 > Cell Phone: 202-297-8117 > Fax: 410-955-0188 > http://joedien.com > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 4 > Date: Tue, 9 Sep 2014 06:37:13 +0000 > From: "Caspar, Emilie" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > bad > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Ashley, > > Maybe the mistake is you did not integrate in your script the > command to save the rejection. Normally, with the following command, > you will see in the Matlab Window that artifacts are correctly > rejected after the "quit" button. > > clean_data = ft_rejectvisual(cfg, interpoldata); > cfg.artfctdef.reject = 'complete'; > cfg.artfctdef.feedback = 'yes'; > cleandata = ft_rejectartifact(cfg,clean_data); > > Emilie > > > > > > Le 3 sept. 2014 ? 11:58, Ashley Greene > > a ?crit : > > Hello, > > I have used the rejectvisual function in attempt to remove bad > trials, but after marking them and pressing the quit button, > although the command window states that the selected trials have > been removed, there is no obvious change in the data; all of the > trials are still intact. Have I overlooked something? > > Thanks, > > Ashley > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 5 > Date: Tue, 09 Sep 2014 14:16:20 +0200 > From: Patricia Wollstadt > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] TRENTOOL pipeline help > Message-ID: <540EEF94.9080601 at gmx.de> > Content-Type: text/plain; charset="windows-1252" > > Hello Max, > > I added a few comments to the questions regarding individual parameters > below. To address the general problem of TRENTOOL telling you, that > there are not enough sample points in your data: From what I can see in > your script, you probably don't have enough data points in each time > series to robustly estimate TE. You analyze 800 ms of data sampled at > 300 Hz, which gives you 240 samples per time series. Can you maybe avoid > downsampling to 300 Hz and downsample to 600 Hz instead? Or could you > analyze a longer time window of interest? > Note that you also 'lose' data to embedding and the interaction delay: > The first point that can be used for TE estimation is at max. embedding > length + max. interaction delay in samples. For example: max. embedding > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max > interaction delay of 30 ms = 9 samples. In this example, you would be > left with 240 - 29 samples for TE estimation per trial. There is also > the possibility to estimate time resolved TE/TE for shorter time windows > of interest (see section 4.4 in the manual); however, this method > requires the use of a GPU for TE estimation. > > I would further recommend to use the new pipeline for group statistics > described in the manual in section 4.5 (the function 'TEgroup_calculate' > is deprecated). The new pipeline allows you to reconstruct the > interaction delay and uses the following functions (see also comments in > the script): > > TEgroup_prepare -> prepares all data sets (all subjects/all > conditions) for group analysis (this means finding common embedding > parameters such that estimates are not biased between groups) > InteractionDelayReconstruction_calculate -> estimates TE for > individual data sets and all assumed interaction delays u > InteractionDelayReconstruction_analyze -> reconstructs the > interaction delay by selecting the u that maximizes TE for each channel > TEgroup_stats -> calculate group statistics using a permutation test > > I can send you an example script for group TE analysis using this > pipeline to get you started. I hope this helps you to get the group > analysis running. Just write again if you're having trouble setting up > the pipeline or something is not clear about the parameters/my comments. > > Best, > Patricia > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: >> Hi fieldtrippers, >> >> I know trentool is not produced by the Donders Institute, so I'm not >> 100% sure if it is appropriate to ask questions about it here, but to >> the best of my knowledge they do not have a mailing list and I saw a >> few trentool questions in the archives, so I'm going to assume it's ok... >> >> In any case, below is my current pipeline (slightly modified for >> comprehensibility): >> >> (notes in bold are comments/questions made in this email, not present >> in the pipeline. Sorry in advance for the long post! Any help would be >> greatly appreciated as I'm a bit over my head on this but I think I'm >> close!) >> >> ***** >> >> % Prepare group TE data >> >> cfgP = []; >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> cfgP.TEcalctype = 'VW_ds'; >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> *I'm trying to find the transfer entropy between the left and right >> auditory cortices in my experiment. The input is virtual sensor data >> that was produced using SAM in fieldtrip on real MEG data. * >> >> % specify u to be scanned >> >> cfgP.predicttime_u = 30; >> cfgP.toi = [-0.4 0.4]; >> >> *For clarification, the predicttime_u is in seconds but the toi is in >> milliseconds. If I understand correctly, the predicttime_u must fit >> within the toi, but beyond that are there any benefits to it being >> earlier or later?* PW: The predictiontime_u is in milliseconds and the >> toi is in seconds. The prediction time is the assumed interaction >> delay between your two sources and should fit within your toi. In >> general it is preferable to use the method for interaction delay >> reconstruction for TE estimation, because it allows you to reconstruct >> the actual delay between your source and target times series. A >> non-optimal u/interaction delay may cause an underestimation of TE, so >> it is recommended to use the pipeline for interaction delay >> reconstruction whenever estimating TE for unknown delays. >> If you use the methods for interaction delay reconstruction >> 'predicttime_u' is replaced by >> cfgTEP.predicttimemin_u % minimum u to be scanned >> cfgTEP.predicttimemax_u % maximum u to be scanned >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> A large range for u values to be scanned increases computing time a >> lot, so it is best to limit the u range to values that are >> physiologically plausible. >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> cfgP.maxlag = 150; >> cfgP.actthrvalue = 7.5; >> cfgP.minnrtrials = 5; >> >> *My understanding is maxlag should be 1/2 the sampling rate, so since >> the data are downsampled to 300hz, it should be 150. I know that the >> sample rate and filters are used to determine the actthrvalue, but I >> don't actually know the calculation. 7.5 was a rough guess just to >> test the pipeline. I'm also uncertain of what minnrtrials should be.* >> PW: You can set the actthrvalue based on the filtering you did prior >> to TE analysis. If you for example highpass filtered at 10 Hz, you >> shouldn't find an ACT higher than 30 samples, because you filtered out >> any components of the signal slower than 10 Hz/30 samples (given your >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >> would be 30. >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials is >> needed to realize the permutation test for estimated TE values). >> >> % Optimization >> >> cfgP.optimizemethod = 'ragwitz'; >> cfgP.ragdim = 4:8; >> cfgP.ragtaurange = [0.2 0.4]; >> cfgP.ragtausteps = 15; >> cfgP.repPred = 100; >> * >> * >> *I am completely at a loss for this. I've done some reading into >> transfer entropy, mutual information, etc., cited in trentool, but I'm >> yet to understand how exactly this optimization works and what the >> configuration should be, given my data and experimental intentions.* >> PW: The Ragwitz criterion tries to find optimal embedding parameters >> dim and tau for the data. To do that, the method iteratively takes all >> possible combinations of dim and tau values that are provided in >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well these >> combinations embed the data. To test an embedding, the method builds >> the embedding vectors from the data; it then tests for each point how >> well the next point in time can be predicted from the reference >> point's nearest neighbours. So for each embedded point, the method >> searches for the nearest neighbours and calculates the average of >> those nearest neighbours. The difference between the >> averaged/predicted point and the actual next point is the error of the >> local predictor. The Ragwitz criterion will then return the parameter >> combination for which this error over all points is minimal. >> The parameters set the following: 'ragdim' are dimensions to be tested >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >> together with 'ragtausteps' specifies the tau values to be tested >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, that >> the values here are factors that are later multiplied with the ACT to >> obtain the actual tau. 'repPred' is the number of points that will be >> used for the local prediction, i.e. the Ragwitz criterion will test >> the local prediction and calculate the error for the first 100 points >> in your time series. The two parameters 'flagNei' ans 'sizeNei' below >> specify the type of neighbour search conducted by the Ragwitz >> criterion: 'flagNei' tells the method to either conduct a kNN or range >> search; 'sizeNei' specifies the number of neighbours or the radius to >> be searched by a range search. >> >> >> % Kernel-based TE estimation >> >> cfgP.flagNei = 'Mass'; >> cfgP.sizeNei = 4; % Default >> >> cfgP.ensemblemethod = 'no'; >> cfgP.outputpath = *OUTPUT PATH*; >> >> if ~exist(*Path for TEprepare data object*) >> load VSdat; >> TE_Wrd = {}; >> for i = 1:nConds >> for j = 1:Nsub >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> end >> end >> clear VSdat; >> save('TE_Wrd', 'TE_Wrd'); >> end >> * >> * >> *The configuration and virtual sensor data, organized in a 3 x 15 cell >> of structures (condition by subject) are the input. The TEprepare >> substructure is added to each individual condition x subject .mat >> files' data structure which are stored on disk independently.* >> >> % Use object_to_mat_conversion.m to replace individual condition x >> subject virtual sensor data >> % .mat files with their TE_Wrd equivalent >> * >> * >> *I'm using a separate script to make some manipulations to the objects >> from disk; this will all eventually be integrated into the main >> pipeline*.*TRENTOOL seems to handle data output very differently from >> fieldtrip and I've had trouble thinking through the most logical way >> to handle the data so it's a bit haphazard right now.* >> >> load cond080sub01.mat >> >> cfgG = []; >> cfgG.dim = cond080sub01.TEprepare.optdim; >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> if isfield(cond080sub01, 'TEprepare') >> TEgroup_prepare(cfgG, fileCell); >> else >> error('Need to run TEprepare before TEgroup_prepare'); >> end >> * >> * >> *For clarification, fileCell is a cell with the name of each condition >> x subject .mat file, which as I said before is collectively the same >> as the 3 x 15 VSdat structure (condition x subject).* >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> % object_to_mat_conversion.m >> >> % TE Group Calculate >> >> load cond080sub01.mat >> if isfield(cond080sub01, 'TEgroupprepare') >> for i = 1:length(fileCell) >> TEgroup_calculate(fileCell{i}); >> end >> else >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> end >> * >> * >> *At this step I get the following error: >> >> Error using transferentropy (line 337) >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in TEgroup_calculate (line 133) >> [TEresult] = transferentropy(cfg,data);* >> >> % TE Group Stats >> >> cfgGSTAT = []; >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> cfgGSTAT.uvar = 1; >> cfgGSTAT.ivar = 2; >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> *Given the error above, I am yet to get to this step, but it does not >> seem fundamentally different from normal fieldtrip stats.* >> >> ***** >> >> In case my notes were not clear or you skipped to the bottom, *my >> primary concern is whether the error I'm getting in TEgroup_calculate >> is a pipeline issue* (I noticed the example pipeline in trentool, the >> manual, and published methods articles all seem to have slightly or >> significantly different pipeline compositions), *or if the error is* >> due to ACT, ragwitz optimization, or some other faulty >> parameterization *on my part due to a lack of understanding of how >> transfer entropy works on a more theoretical/mathematical level*. If >> the latter is the case, is there any relatively straightforward way to >> conceptualize this, or is this something where I'm just going to have >> to keep reading and rereading until it eventually makes sense? I've >> already done quite a bit of that and it hasn't pierced my thick skull >> yet but I'm sure it will eventually! >> >> Thank you so much, >> >> Max Cantor >> >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> >> _______________________________________________ >> 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: > > > ------------------------------ > > Message: 6 > Date: Tue, 9 Sep 2014 15:21:20 +0200 > From: Holger Krause > To: FieldTrip discussion list > Subject: [FieldTrip] Latest FT version on ftp-server is from three > days ago > Message-ID: <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> > Content-Type: text/plain; charset="us-ascii" > > Dear developers, > > Could you please check the process for creation/publication of zip-files on > the FTP server? The latest file I can find there is fieldtrip-20140906.zip. > > Thanks in advance, > > Holger > > > ------------------------------ > > Message: 7 > Date: Tue, 9 Sep 2014 09:19:55 -0400 > From: Max Cantor > To: FieldTrip discussion list > Subject: Re: [FieldTrip] TRENTOOL pipeline help > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > This is immensely helpful, thank you. I was very confused about why some > versions of the pipeline I saw were using group calculate and others were > using interaction delay reconstruction and what that meant, and I think I > have a more clear idea of what the different steps of the pipeline are > doing. There are still a few things I'm a bit confused about though in > terms of the pipeline. For instance, whether or not I need to do TEprepare > before group prepare, and if I need to do graph analysis (which I'm not > sure I fully understand but also haven't looked deeply into) before group > stats. > > If you don't mind me taking you up on your offer, I think seeing your > example script might help clarify some of these issues. > > Thank you! > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > Patricia.Wollstadt at gmx.de> wrote: > >> Hello Max, >> >> I added a few comments to the questions regarding individual parameters >> below. To address the general problem of TRENTOOL telling you, that there >> are not enough sample points in your data: From what I can see in your >> script, you probably don't have enough data points in each time series to >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, which >> gives you 240 samples per time series. Can you maybe avoid downsampling to >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a longer time >> window of interest? >> Note that you also 'lose' data to embedding and the interaction delay: The >> first point that can be used for TE estimation is at max. embedding length >> + max. interaction delay in samples. For example: max. embedding length = >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max interaction >> delay of 30 ms = 9 samples. In this example, you would be left with 240 - >> 29 samples for TE estimation per trial. There is also the possibility to >> estimate time resolved TE/TE for shorter time windows of interest (see >> section 4.4 in the manual); however, this method requires the use of a GPU >> for TE estimation. >> >> I would further recommend to use the new pipeline for group statistics >> described in the manual in section 4.5 (the function 'TEgroup_calculate' is >> deprecated). The new pipeline allows you to reconstruct the interaction >> delay and uses the following functions (see also comments in the script): >> >> TEgroup_prepare -> prepares all data sets (all subjects/all conditions) >> for group analysis (this means finding common embedding parameters such >> that estimates are not biased between groups) >> InteractionDelayReconstruction_calculate -> estimates TE for >> individual data sets and all assumed interaction delays u >> InteractionDelayReconstruction_analyze -> reconstructs the >> interaction delay by selecting the u that maximizes TE for each channel >> TEgroup_stats -> calculate group statistics using a permutation test >> >> I can send you an example script for group TE analysis using this pipeline >> to get you started. I hope this helps you to get the group analysis >> running. Just write again if you're having trouble setting up the pipeline >> or something is not clear about the parameters/my comments. >> >> Best, >> Patricia >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> I know trentool is not produced by the Donders Institute, so I'm not 100% >> sure if it is appropriate to ask questions about it here, but to the best >> of my knowledge they do not have a mailing list and I saw a few trentool >> questions in the archives, so I'm going to assume it's ok... >> >> In any case, below is my current pipeline (slightly modified for >> comprehensibility): >> >> (notes in bold are comments/questions made in this email, not present in >> the pipeline. Sorry in advance for the long post! Any help would be greatly >> appreciated as I'm a bit over my head on this but I think I'm close!) >> >> ***** >> >> % Prepare group TE data >> >> cfgP = []; >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> cfgP.TEcalctype = 'VW_ds'; >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> *I'm trying to find the transfer entropy between the left and right >> auditory cortices in my experiment. The input is virtual sensor data that >> was produced using SAM in fieldtrip on real MEG data. * >> >> % specify u to be scanned >> >> cfgP.predicttime_u = 30; >> cfgP.toi = [-0.4 0.4]; >> >> *For clarification, the predicttime_u is in seconds but the toi is in >> milliseconds. If I understand correctly, the predicttime_u must fit within >> the toi, but beyond that are there any benefits to it being earlier or >> later?* PW: The predictiontime_u is in milliseconds and the toi is in >> seconds. The prediction time is the assumed interaction delay between your >> two sources and should fit within your toi. In general it is preferable to >> use the method for interaction delay reconstruction for TE estimation, >> because it allows you to reconstruct the actual delay between your source >> and target times series. A non-optimal u/interaction delay may cause an >> underestimation of TE, so it is recommended to use the pipeline for >> interaction delay reconstruction whenever estimating TE for unknown delays. >> If you use the methods for interaction delay reconstruction >> 'predicttime_u' is replaced by >> cfgTEP.predicttimemin_u % minimum u to be scanned >> cfgTEP.predicttimemax_u % maximum u to be scanned >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> A large range for u values to be scanned increases computing time a lot, >> so it is best to limit the u range to values that are physiologically >> plausible. >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> cfgP.maxlag = 150; >> cfgP.actthrvalue = 7.5; >> cfgP.minnrtrials = 5; >> >> *My understanding is maxlag should be 1/2 the sampling rate, so since >> the data are downsampled to 300hz, it should be 150. I know that the sample >> rate and filters are used to determine the actthrvalue, but I don't >> actually know the calculation. 7.5 was a rough guess just to test the >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: You can >> set the actthrvalue based on the filtering you did prior to TE analysis. If >> you for example highpass filtered at 10 Hz, you shouldn't find an ACT >> higher than 30 samples, because you filtered out any components of the >> signal slower than 10 Hz/30 samples (given your sampling frequency of 300 >> Hz). So in this scenario the actthrvalue would be 30. >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials is >> needed to realize the permutation test for estimated TE values). >> >> >> % Optimization >> >> cfgP.optimizemethod = 'ragwitz'; >> cfgP.ragdim = 4:8; >> cfgP.ragtaurange = [0.2 0.4]; >> cfgP.ragtausteps = 15; >> cfgP.repPred = 100; >> >> *I am completely at a loss for this. I've done some reading into >> transfer entropy, mutual information, etc., cited in trentool, but I'm yet >> to understand how exactly this optimization works and what the >> configuration should be, given my data and experimental intentions.* PW: >> The Ragwitz criterion tries to find optimal embedding parameters dim and >> tau for the data. To do that, the method iteratively takes all possible >> combinations of dim and tau values that are provided in cfgP.ragdim and >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations embed >> the data. To test an embedding, the method builds the embedding vectors >> from the data; it then tests for each point how well the next point in time >> can be predicted from the reference point's nearest neighbours. So for each >> embedded point, the method searches for the nearest neighbours and >> calculates the average of those nearest neighbours. The difference between >> the averaged/predicted point and the actual next point is the error of the >> local predictor. The Ragwitz criterion will then return the parameter >> combination for which this error over all points is minimal. >> The parameters set the following: 'ragdim' are dimensions to be tested by >> the method (I would reccomend to start with 2:10), 'ragtaurange' together >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL will >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values here are >> factors that are later multiplied with the ACT to obtain the actual tau. >> 'repPred' is the number of points that will be used for the local >> prediction, i.e. the Ragwitz criterion will test the local prediction and >> calculate the error for the first 100 points in your time series. The two >> parameters 'flagNei' ans 'sizeNei' below specify the type of neighbour >> search conducted by the Ragwitz criterion: 'flagNei' tells the method to >> either conduct a kNN or range search; 'sizeNei' specifies the number of >> neighbours or the radius to be searched by a range search. >> >> >> % Kernel-based TE estimation >> >> cfgP.flagNei = 'Mass'; >> cfgP.sizeNei = 4; % Default >> >> cfgP.ensemblemethod = 'no'; >> cfgP.outputpath = *OUTPUT PATH*; >> >> if ~exist(*Path for TEprepare data object*) >> load VSdat; >> TE_Wrd = {}; >> for i = 1:nConds >> for j = 1:Nsub >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> end >> end >> clear VSdat; >> save('TE_Wrd', 'TE_Wrd'); >> end >> >> *The configuration and virtual sensor data, organized in a 3 x 15 cell >> of structures (condition by subject) are the input. The TEprepare >> substructure is added to each individual condition x subject .mat files' >> data structure which are stored on disk independently.* >> >> % Use object_to_mat_conversion.m to replace individual condition x subject >> virtual sensor data >> % .mat files with their TE_Wrd equivalent >> >> *I'm using a separate script to make some manipulations to the objects >> from disk; this will all eventually be integrated into the main pipeline*.* >> TRENTOOL seems to handle data output very differently from fieldtrip and >> I've had trouble thinking through the most logical way to handle the data >> so it's a bit haphazard right now.* >> >> load cond080sub01.mat >> >> cfgG = []; >> cfgG.dim = cond080sub01.TEprepare.optdim; >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> if isfield(cond080sub01, 'TEprepare') >> TEgroup_prepare(cfgG, fileCell); >> else >> error('Need to run TEprepare before TEgroup_prepare'); >> end >> >> *For clarification, fileCell is a cell with the name of each condition x >> subject .mat file, which as I said before is collectively the same as the 3 >> x 15 VSdat structure (condition x subject).* >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> % object_to_mat_conversion.m >> >> % TE Group Calculate >> >> load cond080sub01.mat >> if isfield(cond080sub01, 'TEgroupprepare') >> for i = 1:length(fileCell) >> TEgroup_calculate(fileCell{i}); >> end >> else >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> end >> >> >> >> >> >> >> >> *At this step I get the following error: Error using transferentropy (line >> 337) \nTRENTOOL ERROR: not enough data points left after embedding Error in >> TEgroup_calculate (line 133) [TEresult] = transferentropy(cfg,data);* >> >> % TE Group Stats >> >> cfgGSTAT = []; >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> cfgGSTAT.uvar = 1; >> cfgGSTAT.ivar = 2; >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> *Given the error above, I am yet to get to this step, but it does not >> seem fundamentally different from normal fieldtrip stats.* >> >> ***** >> >> In case my notes were not clear or you skipped to the bottom, *my >> primary concern is whether the error I'm getting in TEgroup_calculate is a >> pipeline issue* (I noticed the example pipeline in trentool, the manual, >> and published methods articles all seem to have slightly or significantly >> different pipeline compositions), *or if the error is* due to ACT, >> ragwitz optimization, or some other faulty parameterization *on my part >> due to a lack of understanding of how transfer entropy works on a more >> theoretical/mathematical level*. If the latter is the case, is there any >> relatively straightforward way to conceptualize this, or is this something >> where I'm just going to have to keep reading and rereading until it >> eventually makes sense? I've already done quite a bit of that and it hasn't >> pierced my thick skull yet but I'm sure it will eventually! >> >> Thank you so much, >> >> Max Cantor >> >> >> -- >> Max Cantor >> Lab Manager >> Computational Neurolinguistics Lab >> University of Michigan >> >> >> _______________________________________________ >> fieldtrip mailing >> listfieldtrip at donders.ru.nlhttp://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 >> > > > > -- > Max Cantor > Lab Manager > Computational Neurolinguistics Lab > University of Michigan > -------------- 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 46, Issue 3 > **************************************** > Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From clara.scholl at gmail.com Wed Sep 10 16:56:38 2014 From: clara.scholl at gmail.com (Clara A. Scholl) Date: Wed, 10 Sep 2014 10:56:38 -0400 Subject: [FieldTrip] data.sampleinfo when preprocessing was completed in EEGLAB In-Reply-To: References: Message-ID: Dear Eelke, Thank you! Just to clarify: when I use ft_mvaranalysis to perform multivariate autoregressive modeling on time series data over multiple trials, the relative temporal adjacency of each trial (assumed to be consecutive segments, when this is not the case) has no impact on the resulting autoregressive coefficients and the covariance of the residuals? Respectfully, Clara On Wed, Sep 10, 2014 at 4:49 AM, Eelke Spaak wrote: > Dear Clara, > > 1) Some FT functions require a sampleinfo for their inner workings, so > they reconstruct it in a simple way if it is not present. You can > safely ignore this warning if you are not doing anything with sample > indices yourself. Specifically, the FT artifact and event functions > use sample indices (i.e. return segments of artifacts/events in terms > of samples relative to the original recording), if you are not using > these you are probably safe. > > 2) Not me ;) > > Best, > Eelke > > On 9 September 2014 21:25, Clara A. Scholl wrote: > > Dear FieldTrip Community, > > > > I did preprocessing in EEGLAB and imported into FieldTrip using > > eeglab2fieldtrip (from EEGLAB version 13.3.2b). The resulting FieldTrip > > data structures do not have the data field "sampleinfo" to specify the > > position of each trial relative to the actual recording. As a result of > > this, I get the warning "reconstructing sampleinfo by assuming that the > > trials are consecutive segments of a continuous recording" when calling > the > > functions ft_timelockanalysis and ft_mvaranalysis. > > > > My questions are twofold: > > > > 1) when can I ignore this warning? > > 2) has anyone imported the sampleinfo into FieldTrip from an EEGLAB EEG > > structure? Any guidance on the best way to do this? > > > > Thanks immensely for feedback! > > Respectfully, > > Clara > > > > _______________________________________________ > > 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 eelke.spaak at donders.ru.nl Thu Sep 11 09:55:25 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Thu, 11 Sep 2014 09:55:25 +0200 Subject: [FieldTrip] data.sampleinfo when preprocessing was completed in EEGLAB In-Reply-To: References: Message-ID: Correct :) On 10 September 2014 16:56, Clara A. Scholl wrote: > Dear Eelke, > > Thank you! Just to clarify: when I use ft_mvaranalysis to perform > multivariate autoregressive modeling on time series data over multiple > trials, the relative temporal adjacency of each trial (assumed to be > consecutive segments, when this is not the case) has no impact on the > resulting autoregressive coefficients and the covariance of the residuals? > > Respectfully, > Clara > > > On Wed, Sep 10, 2014 at 4:49 AM, Eelke Spaak > wrote: >> >> Dear Clara, >> >> 1) Some FT functions require a sampleinfo for their inner workings, so >> they reconstruct it in a simple way if it is not present. You can >> safely ignore this warning if you are not doing anything with sample >> indices yourself. Specifically, the FT artifact and event functions >> use sample indices (i.e. return segments of artifacts/events in terms >> of samples relative to the original recording), if you are not using >> these you are probably safe. >> >> 2) Not me ;) >> >> Best, >> Eelke >> >> On 9 September 2014 21:25, Clara A. Scholl wrote: >> > Dear FieldTrip Community, >> > >> > I did preprocessing in EEGLAB and imported into FieldTrip using >> > eeglab2fieldtrip (from EEGLAB version 13.3.2b). The resulting FieldTrip >> > data structures do not have the data field "sampleinfo" to specify the >> > position of each trial relative to the actual recording. As a result of >> > this, I get the warning "reconstructing sampleinfo by assuming that the >> > trials are consecutive segments of a continuous recording" when calling >> > the >> > functions ft_timelockanalysis and ft_mvaranalysis. >> > >> > My questions are twofold: >> > >> > 1) when can I ignore this warning? >> > 2) has anyone imported the sampleinfo into FieldTrip from an EEGLAB EEG >> > structure? Any guidance on the best way to do this? >> > >> > Thanks immensely for feedback! >> > Respectfully, >> > Clara >> > >> > _______________________________________________ >> > 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 luke.bloy at gmail.com Thu Sep 11 18:30:57 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Thu, 11 Sep 2014 12:30:57 -0400 Subject: [FieldTrip] topoplot_common Message-ID: Is there a reason that topoplot_common doesn't support 'raw' datatypes. I have been using ft_topoplotER to plot topos at particular time windows in continuous raw datasets. This recently broke after an update. the error happens in ft_datatype_comp trying to convert my 'raw' to a 'comp' datatype. If i add 'raw' to the list of supported datatypes, https://github.com/fieldtrip/fieldtrip/blob/master/private/topoplot_common.m#L74 , everything seems to work fine? Thanks Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From agreene24 at gmail.com Fri Sep 12 14:39:43 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Fri, 12 Sep 2014 21:39:43 +0900 Subject: [FieldTrip] ft_rejectvisual: removing trials marked as bad In-Reply-To: <3C365782-4B07-4EFE-A921-99489BDD5DA6@live.ucl.ac.uk> References: <3C365782-4B07-4EFE-A921-99489BDD5DA6@live.ucl.ac.uk> Message-ID: Hi Emilie, Thanks!! I, of course, completely overlooked that. Ashley On Tue, Sep 9, 2014 at 3:37 PM, Caspar, Emilie wrote: > Hi Ashley, > > Maybe the mistake is you did not integrate in your script the command to > save the rejection. Normally, with the following command, you will see in > the Matlab Window that artifacts are correctly rejected after the "quit" > button. > > clean_data = ft_rejectvisual(cfg, interpoldata); > cfg.artfctdef.reject = 'complete'; > cfg.artfctdef.feedback = 'yes'; > cleandata = ft_rejectartifact(cfg,clean_data); > > Emilie > > > > > > Le 3 sept. 2014 à 11:58, Ashley Greene a écrit : > > Hello, > > I have used the rejectvisual function in attempt to remove bad trials, > but after marking them and pressing the quit button, although the command > window states that the selected trials have been removed, there is no > obvious change in the data; all of the trials are still intact. Have I > overlooked something? > > Thanks, > > Ashley > _______________________________________________ > 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 tobiastrame at uni-muenster.de Fri Sep 12 18:23:17 2014 From: tobiastrame at uni-muenster.de (Tobias Trame) Date: Fri, 12 Sep 2014 18:23:17 +0200 (CEST) Subject: [FieldTrip] Read only EEG data from combined MEG/EEG ctf file Message-ID: Hi everybody! I'm trying to read only the EEG data from a combined MEG/EEG ctf file in order to create leadfields later on, but the function "ft_read_sens" just returns the gradiometer information in a 'grad' field. It searches for an 'elec'-field in the header of the data which is not present. Is there a configuration to get the EEG-elecrodes by using "ft_read_sens"? My first attempt was to write the EEG-Information from the header by hand using the following code: hdr = ft_read_header('subject.ds', 'headerformat', 'ctf_ds'); elec.elecpos = [hdr.orig.eeg.pos]'; elec.chanpos = [hdr.orig.eeg.pos]'; elec.label = {hdr.orig.eeg.name}'; elec.type = 'eeg'; elec.unit = 'cm'; But now I get a similar problem if I want to create leadfields from timelock data. After doing the timelock analysis using timelock_data = ft_timelockanalysis(cfg, mydata); the structure timelock_data contains just a 'grad' and no 'elec' field so that ft_prepare_leadfield(cfg, timelock_data) always ignores the EEG-elecrodes and tries to use the gradiometes - even if I put the electrodes defined above into cfg.elec. Thanks for any suggestions! Tobias From j.herring at fcdonders.ru.nl Mon Sep 15 12:01:02 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Mon, 15 Sep 2014 12:01:02 +0200 (CEST) Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' In-Reply-To: <20140910140714.9n2t9bxs008o400c@imap.uni-ulm.de> Message-ID: <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> Dear Barbara, The error seems to be related to a bug that pops up now and then (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a corrupt installation of fieldtrip and/or the need to update fieldtrip. Could you please try downloading the most recent version of fieldtrip and see if the problem persists? For an example of what can be expected from this function see: Esser SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. Best, Jim ----- Oorspronkelijk bericht ----- > Van: "barbara schorr" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 10 september 2014 14:07:14 > Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' > Dear fieldtripers. > > as mentioned in the subject line I would like to anaylse my timelocked > ERP Data with the function ft_globalmeanfield. > > I get the Error: Undefined function or variable 'abort' > Error in ft_globalmeanfield (line84) > if abort > > in the function it says: > > %the abort variable is set to true or false in ft_preamble_inti > if abort > % do not continue function execution in case the outputfile is > present and the user indicated to keep it > return > end > > > I don't understand what this means. I would really appreciate your > help to get this running. > > Also, what is the result when I run this function on my data? (This > method was proposed from a reviewer. I never used it before, so I > don't exactly know what it does and what the result will look like). > > Thank you very much in advance! > > Best, > > Barbara Schorr > > > > > Zitat von 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: Question regarding nonparametric testing for coherence > > differences (Eric Maris) > > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) > > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) > > 4. Re: ft_rejectvisual: removing trials marked as bad > > (Caspar, Emilie) > > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) > > 6. Latest FT version on ftp-server is from three days ago > > (Holger Krause) > > 7. Re: TRENTOOL pipeline help (Max Cantor) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) > > From: "Eric Maris" > > To: , "'FieldTrip discussion list'" > > > > Subject: Re: [FieldTrip] Question regarding nonparametric testing > > for > > coherence differences > > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> > > Content-Type: text/plain; charset="utf-8" > > > > Dear Hwee Ling, > > > > > > > > In the paper you refer to (Maris et al, JNM, 2007), I did not > > perform a > > cluster-based permutation test at the level of the channel pairs. > > Instead, > > all coherences mentioned in the paper are coherence between a single > > EMG > > channel (2 electrodes mounted on the forearm) and all MEG > > electrodes. Thus, > > there are as many EMG-MEG coherences as there are MEG channels (275 > > in our > > lab), and the clustering of these coherences involves the same > > neighbourhood > > structure as the clustering of channel-specific statistics on power > > or > > evoked response. The analysis you propose involves clustering in a > > much more > > complex space, namely the formed by all (MEG,MEG) channel pairs > > (275*275=75625 pairs). In the early days of cluster-based > > permutation > > statistics, I have worked on this problem but did not pursue it > > because the > > resulting clusters are very hard to interpret. > > > > > > > > Best, > > > > > > > > Eric Maris > > > > > > > > > > > > Dear all and Prof Maris, > > > > I'm re-posting this question again, as I didn't get any replies > > previously. > > > > I?m interested to investigate if there are any differences in phase > > synchronization in resting state data at timepoint 2 versus > > timepoint 1. The > > EEG data was collected using 64 EEG channels, resting state, eyes > > opened and > > eyes closed. I?ve arbitrarily segmented the resting state data into > > epochs > > of 2s each, and the epochs with artifacts are excluded completely > > from > > further analyses. I then performed mtmfft to get the fourier > > representation > > of the data, extracted the coherence, and compared the coherence > > difference > > of timepoint 2 versus timepoint 1 of all channels paired with all > > other > > channels. > > > > I figured that if I extract the connectivity analyses without > > specifying the > > channelcmb, I get a 'chan_chan_freq' dimord variable that would > > allow me to > > perform cluster-based statistical analyses. I get an output with > > ?chan_chan? > > dimord variable. However, I was not 100% sure that this is correct, > > hence, I?ve > > inserted my code (see below). It?ll be great if you could tell me if > > what I?m > > doing makes any sense at all. Also, I don?t know how I can plot the > > results > > to see if it make any sense at all. > > > > Also, I checked the values obtained from when I specified > > "cfg.channelcmb" > > and when I did not specify "cfg.channelcmb", I noticed that the > > values were > > somehow different. I would assume that the values to be similar, > > although > > I'm not sure why they would have differences in the values obtained > > from > > specifying "cfg.channelcmb". > > > > This is my code that I've used thus far: > > > > for sub = 1:5 > > > > cfg = []; > > > > cfg.output = 'fourier'; > > > > cfg.channel = {'all'}; > > > > cfg.method = 'mtmfft'; > > > > cfg.keeptrials = 'yes'; > > > > cfg.tapsmofrq = 5; > > > > cfg.foilim = [0 100]; > > > > cfg.taper = 'dpss'; > > > > % find the index for the c200 condition > > > > pre_c200_idx = find(data5.trialinfo == 201); > > > > cfg.trials = pre_c200_idx; > > > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > > > post_c200_idx = find(data5.trialinfo == 200); > > > > cfg.trials = post_c200_idx; > > > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > > > > > cfg = []; > > > > cfg.keeptrials = 'no'; > > > > cfg.channel = {'all'}; > > > > cfg.removemean = 'yes'; > > > > cfg.method = 'coh'; > > > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_pre_c200); > > > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_post_c200); > > > > end > > > > > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); > > > > cfg_neighb.method = 'template'; > > > > cfg_neighb.layout = lay; > > > > cfg_neighb.channel = 'all'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, > > sub_HLF_pre_c200coh{1}); > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.neighbours = neighbours; > > > > cfg.channel = 'all'; > > > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > > > cfg.latency = 'all'; > > > > cfg.avgovertime = 'no'; > > > > cfg.avgoverchan = 'no'; > > > > cfg.parameter = 'cohspctrm'; > > > > cfg.method = 'montecarlo'; > > > > cfg.statistic = 'depsamplesT'; > > > > cfg.correctm = 'cluster'; > > > > cfg.tail = 0; > > > > % cfg.clustertail = 0; > > > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 > > frequency > > bands. > > > > cfg.numrandomization = 10000; > > > > cfg.ivar = 2; > > > > cfg.uvar = 1; > > > > > > > > % design matrices > > > > clear design; > > > > design(1,:) = [1:5, 1:5]; > > > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > > > cfg.design = design; > > > > % for theta band > > > > cfg.avgoverfreq = 'yes'; > > > > cfg.frequency = [4 8]; % I also performed the statistics for delta > > (2-4), > > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma > > (30-40), > > and gamma (40-100). > > > > [diffc200_theta_stat] = ft_freqstatistics(cfg, > > sub_HLF_post_c200coh{:}, > > sub_HLF_pre_c200coh{:}); > > > > > > > > When I tried to plot the results, I used this code: > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.layout = 'lay'; > > > > cfg.zlim = [-1 1]; > > > > cfg.alpha = 0.05; > > > > cfg.refchannel = 'all'; > > > > ft_clusterplot(cfg, diffc200_theta_stat); > > > > However, I was not sure how I could plot the results. I get an error > > message > > from Fieldtrip when using ft_clusterplot: > > > > Error using topoplot_common (line 366) > > > > no reference channel is specified > > > > Error in ft_topoplotTFR (line 192) > > > > [cfg] = topoplot_common(cfg, varargin{:}); > > > > Error in ft_clusterplot (line 372) > > > > ft_topoplotTFR(cfgtopo, stat); > > > > > > > > According to your paper in 2007, the topoplot of the results were > > masked by > > the spatio-spectral pattern of the significant clusters. I don't > > know how to > > do this, and I would really appreciate if you can show me how to > > make such a > > plot. > > > > Thank you very much. > > > > Kind regards, > > > > Hweeling > > > > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 2 > > Date: Mon, 8 Sep 2014 21:38:01 +0200 > > From: KatrinH Heimann > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > Dear Joseph, thanks so much, I really appreciate your help. I was > > also > > wandering, if maybe there is another bug in my code. > > Our nets are 128 channels, Hydrocel, but as a colleague of me > > adviced me to > > do so, I also tried the 129 layout. > > My code you find below (without selection of bad channels etc.) > > If you need also the data of two subjects to have a look, let me > > know!!! > > Best and thanks really! > > Katrin > > > > > > subject=input('Which subject do you want to analyse? ','s'); > > > > name = strcat(subject,'.raw'); > > > > subjectnumber=input('Which is the subjectnumber?', 's'); > > > > sb=subjectnumber > > > > %subjectnumber = strcat(subjectnumber, '.txt') > > > > %% > > > > > > cfg = []; > > > > cfg.dataset = name; > > > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > > > cfg.trialdef.eventtype = 'trigger'; > > > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > > trigger > > > > cfg.trialdef.prestim = 0.234; % in seconds > > > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > > observation, but maybe we need less) > > > > cfg = ft_definetrial(cfg); > > > > > > cfg.trl([1:7],:) = []; > > > > > > %change timeline according to constant offset of 16 ms = 8 samples > > (because > > recorded with 500 hz)in > > > > %structure trial > > > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > > > > %change timeline to make the cut the zeropoint > > > > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > > > > > %% preprocess data > > > > cfg.channel = 'all'; > > > > cfg.preproc.detrend = 'yes'; > > > > cfg.preproc.demean = 'yes'; > > > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > > filtered > > > > %(0.1-45) and bad channels have to be replaced!!!! > > > > %cfg.preproc.bpfreq = [6 32]; > > > > % > > > > % > > > > obs_data = ft_preprocessing(cfg); > > > > % > > > > save (strcat(sb,'obs_data') , 'obs_data') > > > > > > %% determining channel neighbours (necessary for Artifact detection) > > > > cfg = []; > > > > cfg.channel = obs_data.label; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.feedback = 'yes'; > > > > lay = ft_prepare_layout(cfg); > > > > > > > > cfg_neighb = []; > > > > cfg_neighb.feedback = 'yes'; > > > > > > cfg_neighb.method = 'triangulation'; > > > > cfg_neighb.layout = 'GSN128.sfp'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > > > > > %% Preparing neighbours for channel repair - but bad channel info > > in!!! > > > > > > % cfg_neighb = []; > > > > % cfg_neighb.feedback = 'yes'; > > > > % cfg_neighb.method = 'triangulation'; > > > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > % Interpolate and put into new data structure > > > > cfg = []; > > > > cfg.badchannel = {}; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.method = 'nearest'; > > > > cfg.neighbours = neighbours; > > > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > > > > % Check reconstruction > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > % dat1=obs_data; > > > > % dat2=obs_data_channelrepaired; > > > > % > > > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > > > % y=dat2.trial{1}(62,:); > > > > % plot(x);hold on;plot(y,'r'); > > > > % > > > > % x=dat1.trial{1}(72,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > % > > > > % x=dat1.trial{1}(75,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > %% artifact rejection/trial inspection - throw out electrode jumps > > etc. > > > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > > according to > > channels interpolated %% 128-number of interp. channels) > > > > > > > > cfg = []; > > > > cfg.channel = {'all'}; > > > > cfg.numcomponent = 128 > > > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > > > save (strcat(sb,'comp_all') , 'comp') > > > > > > %% > > > > cfg = []; > > > > cfg.viewmode = 'component'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='some'; > > > > cfg.layout = 'GSN128.sfp'; > > > > ft_databrowser(cfg,comp); > > > > > > %% poweranalysis components > > > > cfg = []; > > > > cfg.output = 'pow'; > > > > cfg.channel = 'all';%compute the power spectrum in all ICs > > > > cfg.method = 'mtmfft'; > > > > cfg.taper = 'hanning'; > > > > cfg.foi = 0:0.2:50; > > > > obs_freq = ft_freqanalysis(cfg, comp); > > > > > > %And you can plot the spectra: > > > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > nsubplots = 16; > > > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > > decimals, type > > doc subplot > > > > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > > > tot = Nfigs*nsubplots; > > > > > > rptvect = 1:size(comp.topo,1); > > > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > > > > for r=1:size(rptvect,1); > > > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 > > 1]);%full > > screen > > > > k=0; > > > > for j=1:size(rptvect,2); > > > > if~(rptvect(r,j)==0); > > > > k=k+1; > > > > cfg=[]; > > > > cfg.channel = rptvect(r,j); > > > > cfg.ylim =[0 500] > > > > cfg.xlim =[0 50] > > > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > > > end > > > > end > > > > end > > > > > > %For the IC topos you'll follow the same logic as above but with: > > > > > > figure > > > > cfg = []; > > > > cfg.component = [1:20]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [21:40]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [41:60]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [61:80]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > > > > > > > > > %% Seperate observation conditions > > > > > > name1= strcat(num2str(sb),'_90.xls'); > > > > list1=xlsread (name1) > > > > > > > > > > > > name2= strcat(num2str(sb),'_180.xls'); > > > > list2=xlsread (name2) > > > > > > > > % > > > > > > cfg = [] > > > > cfg.trials = [list1] > > > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > cfg = [] > > > > cfg.trials = [list2] > > > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > %%PIPELINE FOR obs90 > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128; > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > > obs90_data); > > > > > > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > > > > > > %% Artifacts - final detection > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > > > > %% plot it > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > > > > > > > > > %% PIPELINE FOR obs180 > > > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128 > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > > obs180_data); > > > > > > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > > > > > > %% Artifacts final 180 > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > > > > %% plot 180 ERP > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs180_data_ERP) > > > > > > %% plot both ERPs > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > cfg.showlabels = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > > > > %% plot difference wave > > > > > > difference = obs180_data_ERP; % copy one of the > > structures > > > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute > > the > > difference ERP > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, difference) > > > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > > > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI > >> data. A couple things. First of all, exactly which net do you use? > >> If > >> they are 129-channel, there is still the question of whether they > >> are the > >> Hydrocel or the older geodesic nets. Regardless, that shouldn't > >> cause an > >> error like this. Could you send me the file you are trying to > >> process and > >> the script you are using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < > >> diezmartini at gmail.com> wrote: > >> > >> Which nets do you use? I use EGI. I tried both the ones you mention > >> and > >> they didn't work. It was hard to find that exact one online but it > >> was the > >> only file that actually worked. > >> > >> > >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >> > >> wrote: > >> > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. > >>> Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one > >>> > >>>> I use > >>>> > >>>> > >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < > >>>> katrinheimann at gmail.com> wrote: > >>>> > >>>>> Dear all, my problems seem neverending. This time however i > >>>>> really need > >>>>> help. > >>>>> I implemented a pipeline for ERPs. All works now, > >>>>> trialdefinition, > >>>>> preprocessing, channelreplacement, ica, componentrejection, > >>>>> final > >>>>> artifactdetection, timelock of the single subject data. However, > >>>>> when I > >>>>> wanna compute the grandaverage of the single subjects I get the > >>>>> following > >>>>> error message: > >>>>> > >>>>> computing average of avg over 19 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 3 MB > >>>>> computing average of avg over 2 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_prepare_layout" took 0 seconds and required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_topoplotER" took 0 seconds and required the > >>>>> additional > >>>>> allocation of an estimated 0 MB > >>>>> > >>>>> Furthermore in the plot of the significant clusters, the > >>>>> channelnames > >>>>> are mixed up (do not correspond to my net) > >>>>> > >>>>> > >>>>> I guess that there is a problem with the layout I use. > >>>>> Here the code that I use > >>>>> > >>>>> %For generating the layout (also in the single subjects): > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = obs_data.label; > >>>>> > >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>>>> > >>>>> cfg.feedback = 'yes'; > >>>>> > >>>>> lay = ft_prepare_layout(cfg); > >>>>> > >>>>> > >>>>> cfg_neighb = []; > >>>>> > >>>>> cfg_neighb.feedback = 'yes'; > >>>>> > >>>>> cfg_neighb.method = 'triangulation'; > >>>>> > >>>>> cfg_neighb.layout = lay; > >>>>> > >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>>>> > >>>>> > >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>>>> > >>>>> > >>>>> %For computing the grand average > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = 'all'; > >>>>> > >>>>> cfg.latency = 'all'; > >>>>> > >>>>> cfg.parameter = 'avg'; > >>>>> > >>>>> cfg.keepindividual = 'no' > >>>>> > >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>>>> > >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>>>> > >>>>> % "{:}" means to use data from all elements of the variable > >>>>> > >>>>> > >>>>> For plotting the significant clusters > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.style = 'blank'; > >>>>> > >>>>> cfg.layout = lay; > >>>>> > >>>>> cfg.channellabels = 'yes'; > >>>>> > >>>>> cfg.highlight = 'labels'; > >>>>> > >>>>> cfg.highlightchannel = find(stat.mask); > >>>>> > >>>>> cfg.comment = 'no'; > >>>>> > >>>>> figure; ft_topoplotER(cfg, GA_90) > >>>>> > >>>>> title('Nonparametric: significant with cluster multiple > >>>>> comparison > >>>>> correction') > >>>>> > >>>>> > >>>>> Do you have ANY idea to this? I am really completely > >>>>> helpless.... > >>>>> > >>>>> thanks and best > >>>>> > >>>>> Katrin > >>>>> > >>>>> _______________________________________________ > >>>>> 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 > >>> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> > >> -------------------------------------------------------------------------------- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.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: > > > > > > ------------------------------ > > > > Message: 3 > > Date: Mon, 08 Sep 2014 21:55:44 -0400 > > From: Joseph Dien > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> > > Content-Type: text/plain; charset="windows-1252" > > > > yes, please do send me the data. > > > > Thanks! > > > > Joe > > > > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann > > wrote: > > > >> Dear Joseph, thanks so much, I really appreciate your help. I was > >> also wandering, if maybe there is another bug in my code. > >> Our nets are 128 channels, Hydrocel, but as a colleague of me > >> adviced me to do so, I also tried the 129 layout. > >> My code you find below (without selection of bad channels etc.) > >> If you need also the data of two subjects to have a look, let me > >> know!!! > >> Best and thanks really! > >> Katrin > >> > >> > >> > >> subject=input('Which subject do you want to analyse? ','s'); > >> > >> name = strcat(subject,'.raw'); > >> > >> subjectnumber=input('Which is the subjectnumber?', 's'); > >> > >> sb=subjectnumber > >> > >> %subjectnumber = strcat(subjectnumber, '.txt') > >> > >> %% > >> > >> > >> > >> cfg = []; > >> > >> cfg.dataset = name; > >> > >> cfg.trialfun = 'ft_trialfun_general'; % this is the default > >> > >> cfg.trialdef.eventtype = 'trigger'; > >> > >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > >> trigger > >> > >> cfg.trialdef.prestim = 0.234; % in seconds > >> > >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > >> observation, but maybe we need less) > >> > >> cfg = ft_definetrial(cfg); > >> > >> > >> > >> cfg.trl([1:7],:) = []; > >> > >> > >> > >> %change timeline according to constant offset of 16 ms = 8 samples > >> (because recorded with 500 hz)in > >> > >> %structure trial > >> > >> cfg.trl(:,3)=cfg.trl(:,3)-8 > >> > >> > >> > >> %change timeline to make the cut the zeropoint > >> > >> > >> > >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; > >> > >> > >> > >> > >> > >> %% preprocess data > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.detrend = 'yes'; > >> > >> cfg.preproc.demean = 'yes'; > >> > >> cfg.preproc.baselinewindow = [-2.1 -2.0] > >> > >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > >> filtered > >> > >> %(0.1-45) and bad channels have to be replaced!!!! > >> > >> %cfg.preproc.bpfreq = [6 32]; > >> > >> % > >> > >> % > >> > >> obs_data = ft_preprocessing(cfg); > >> > >> % > >> > >> save (strcat(sb,'obs_data') , 'obs_data') > >> > >> > >> > >> %% determining channel neighbours (necessary for Artifact > >> detection) > >> > >> cfg = []; > >> > >> cfg.channel = obs_data.label; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.feedback = 'yes'; > >> > >> lay = ft_prepare_layout(cfg); > >> > >> > >> cfg_neighb = []; > >> > >> cfg_neighb.feedback = 'yes'; > >> > >> > >> > >> cfg_neighb.method = 'triangulation'; > >> > >> cfg_neighb.layout = 'GSN128.sfp'; > >> > >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> obs_data.elec = ft_read_sens('GSN128.sfp'); > >> > >> > >> > >> %% Artifacts - to detect bad channels - is not saved!!! > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs_data_try = ft_rejectvisual(cfg, obs_data); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_try = ft_rejectartifact (cfg,obs_data); > >> > >> > >> > >> > >> > >> %% Preparing neighbours for channel repair - but bad channel info > >> in!!! > >> > >> > >> > >> % cfg_neighb = []; > >> > >> % cfg_neighb.feedback = 'yes'; > >> > >> % cfg_neighb.method = 'triangulation'; > >> > >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > >> > >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> % Interpolate and put into new data structure > >> > >> cfg = []; > >> > >> cfg.badchannel = {}; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.method = 'nearest'; > >> > >> cfg.neighbours = neighbours; > >> > >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >> > >> > >> > >> % Check reconstruction > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> % dat1=obs_data; > >> > >> % dat2=obs_data_channelrepaired; > >> > >> % > >> > >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > >> > >> % y=dat2.trial{1}(62,:); > >> > >> % plot(x);hold on;plot(y,'r'); > >> > >> % > >> > >> % x=dat1.trial{1}(72,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> % > >> > >> % x=dat1.trial{1}(75,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> %% artifact rejection/trial inspection - throw out electrode jumps > >> etc. > >> > >> > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > >> according to channels interpolated %% 128-number of interp. > >> channels) > >> > >> > >> cfg = []; > >> > >> cfg.channel = {'all'}; > >> > >> cfg.numcomponent = 128 > >> > >> comp = ft_componentanalysis(cfg,obs_data_clean1); > >> > >> save (strcat(sb,'comp_all') , 'comp') > >> > >> > >> > >> %% > >> > >> cfg = []; > >> > >> cfg.viewmode = 'component'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='some'; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> ft_databrowser(cfg,comp); > >> > >> > >> > >> %% poweranalysis components > >> > >> cfg = []; > >> > >> cfg.output = 'pow'; > >> > >> cfg.channel = 'all';%compute the power spectrum in all ICs > >> > >> cfg.method = 'mtmfft'; > >> > >> cfg.taper = 'hanning'; > >> > >> cfg.foi = 0:0.2:50; > >> > >> obs_freq = ft_freqanalysis(cfg, comp); > >> > >> > >> > >> %And you can plot the spectra: > >> > >> > >> > >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > >> > >> nsubplots = 16; > >> > >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > >> decimals, type doc subplot > >> > >> > >> > >> Nfigs = ceil(size(comp.topo,1)/nsubplots); > >> > >> tot = Nfigs*nsubplots; > >> > >> > >> > >> rptvect = 1:size(comp.topo,1); > >> > >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > >> > >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; > >> > >> > >> > >> for r=1:size(rptvect,1); > >> > >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 > >> 1]);%full screen > >> > >> k=0; > >> > >> for j=1:size(rptvect,2); > >> > >> if~(rptvect(r,j)==0); > >> > >> k=k+1; > >> > >> cfg=[]; > >> > >> cfg.channel = rptvect(r,j); > >> > >> cfg.ylim =[0 500] > >> > >> cfg.xlim =[0 50] > >> > >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > >> > >> end > >> > >> end > >> > >> end > >> > >> > >> > >> %For the IC topos you'll follow the same logic as above but with: > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [1:20]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [21:40]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [41:60]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [61:80]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% Seperate observation conditions > >> > >> > >> > >> name1= strcat(num2str(sb),'_90.xls'); > >> > >> list1=xlsread (name1) > >> > >> > >> > >> name2= strcat(num2str(sb),'_180.xls'); > >> > >> list2=xlsread (name2) > >> > >> > >> % > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list1] > >> > >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list2] > >> > >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> %%PIPELINE FOR obs90 > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128; > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> > >> > >> comp_1 = ft_componentanalysis(cfg, obs90_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > >> obs90_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts - final detection > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs90_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > >> > >> > >> > >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > >> > >> > >> > >> %% plot it > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% PIPELINE FOR obs180 > >> > >> > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128 > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> comp_2 = ft_componentanalysis(cfg, obs180_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > >> obs180_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts final 180 > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs180_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > >> > >> > >> > >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > >> > >> > >> > >> %% plot 180 ERP > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs180_data_ERP) > >> > >> > >> > >> %% plot both ERPs > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> cfg.showlabels = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > >> > >> > >> > >> %% plot difference wave > >> > >> > >> > >> difference = obs180_data_ERP; % copy one of > >> the structures > >> > >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % > >> compute the difference ERP > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, difference) > >> > >> > >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI data. A couple things. First of all, exactly which net do > >> you use? If they are 129-channel, there is still the question of > >> whether they are the Hydrocel or the older geodesic nets. > >> Regardless, that shouldn't cause an error like this. Could you > >> send me the file you are trying to process and the script you are > >> using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini > >> wrote: > >> > >>> Which nets do you use? I use EGI. I tried both the ones you > >>> mention and they didn't work. It was hard to find that exact one > >>> online but it was the only file that actually worked. > >>> > >>> > >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >>> wrote: > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one I use > >>> > >>> > >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > >>> wrote: > >>> Dear all, my problems seem neverending. This time however i really > >>> need help. > >>> I implemented a pipeline for ERPs. All works now, trialdefinition, > >>> preprocessing, channelreplacement, ica, componentrejection, final > >>> artifactdetection, timelock of the single subject data. However, > >>> when I wanna compute the grandaverage of the single subjects I get > >>> the following error message: > >>> > >>> computing average of avg over 19 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 3 MB > >>> computing average of avg over 2 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 0 MB > >>> the call to "ft_prepare_layout" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> the call to "ft_topoplotER" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> > >>> Furthermore in the plot of the significant clusters, the > >>> channelnames are mixed up (do not correspond to my net) > >>> > >>> > >>> I guess that there is a problem with the layout I use. > >>> Here the code that I use > >>> > >>> %For generating the layout (also in the single subjects): > >>> cfg = []; > >>> > >>> cfg.channel = obs_data.label; > >>> > >>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>> > >>> cfg.feedback = 'yes'; > >>> > >>> lay = ft_prepare_layout(cfg); > >>> > >>> > >>> cfg_neighb = []; > >>> > >>> cfg_neighb.feedback = 'yes'; > >>> > >>> cfg_neighb.method = 'triangulation'; > >>> > >>> cfg_neighb.layout = lay; > >>> > >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>> > >>> > >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>> > >>> > >>> > >>> %For computing the grand average > >>> > >>> cfg = []; > >>> > >>> cfg.channel = 'all'; > >>> > >>> cfg.latency = 'all'; > >>> > >>> cfg.parameter = 'avg'; > >>> > >>> cfg.keepindividual = 'no' > >>> > >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>> > >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>> > >>> % "{:}" means to use data from all elements of the variable > >>> > >>> > >>> For plotting the significant clusters > >>> > >>> cfg = []; > >>> > >>> cfg.style = 'blank'; > >>> > >>> cfg.layout = lay; > >>> > >>> cfg.channellabels = 'yes'; > >>> > >>> cfg.highlight = 'labels'; > >>> > >>> cfg.highlightchannel = find(stat.mask); > >>> > >>> cfg.comment = 'no'; > >>> > >>> figure; ft_topoplotER(cfg, GA_90) > >>> > >>> title('Nonparametric: significant with cluster multiple comparison > >>> correction') > >>> > >>> > >>> > >>> Do you have ANY idea to this? I am really completely helpless.... > >>> > >>> thanks and best > >>> > >>> Katrin > >>> > >>> > >>> _______________________________________________ > >>> 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 > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> -------------------------------------------------------------------------------- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.com > >> > >> > >> _______________________________________________ > >> 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 > > > > -------------------------------------------------------------------------------- > > > > Joseph Dien, PhD > > Research Associate > > Cognitive Neurology > > The Johns Hopkins University School of Medicine > > > > Lab E-mail: jdien1 at jhmi.edu > > Private E-mail: jdien07 at mac.com > > Office Phone: 410-614-3115 > > Cell Phone: 202-297-8117 > > Fax: 410-955-0188 > > http://joedien.com > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 4 > > Date: Tue, 9 Sep 2014 06:37:13 +0000 > > From: "Caspar, Emilie" > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > > bad > > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi Ashley, > > > > Maybe the mistake is you did not integrate in your script the > > command to save the rejection. Normally, with the following command, > > you will see in the Matlab Window that artifacts are correctly > > rejected after the "quit" button. > > > > clean_data = ft_rejectvisual(cfg, interpoldata); > > cfg.artfctdef.reject = 'complete'; > > cfg.artfctdef.feedback = 'yes'; > > cleandata = ft_rejectartifact(cfg,clean_data); > > > > Emilie > > > > > > > > > > > > Le 3 sept. 2014 ? 11:58, Ashley Greene > > > a ?crit : > > > > Hello, > > > > I have used the rejectvisual function in attempt to remove bad > > trials, but after marking them and pressing the quit button, > > although the command window states that the selected trials have > > been removed, there is no obvious change in the data; all of the > > trials are still intact. Have I overlooked something? > > > > Thanks, > > > > Ashley > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 5 > > Date: Tue, 09 Sep 2014 14:16:20 +0200 > > From: Patricia Wollstadt > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: <540EEF94.9080601 at gmx.de> > > Content-Type: text/plain; charset="windows-1252" > > > > Hello Max, > > > > I added a few comments to the questions regarding individual > > parameters > > below. To address the general problem of TRENTOOL telling you, that > > there are not enough sample points in your data: From what I can see > > in > > your script, you probably don't have enough data points in each time > > series to robustly estimate TE. You analyze 800 ms of data sampled > > at > > 300 Hz, which gives you 240 samples per time series. Can you maybe > > avoid > > downsampling to 300 Hz and downsample to 600 Hz instead? Or could > > you > > analyze a longer time window of interest? > > Note that you also 'lose' data to embedding and the interaction > > delay: > > The first point that can be used for TE estimation is at max. > > embedding > > length + max. interaction delay in samples. For example: max. > > embedding > > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the > > max > > interaction delay of 30 ms = 9 samples. In this example, you would > > be > > left with 240 - 29 samples for TE estimation per trial. There is > > also > > the possibility to estimate time resolved TE/TE for shorter time > > windows > > of interest (see section 4.4 in the manual); however, this method > > requires the use of a GPU for TE estimation. > > > > I would further recommend to use the new pipeline for group > > statistics > > described in the manual in section 4.5 (the function > > 'TEgroup_calculate' > > is deprecated). The new pipeline allows you to reconstruct the > > interaction delay and uses the following functions (see also > > comments in > > the script): > > > > TEgroup_prepare -> prepares all data sets (all subjects/all > > conditions) for group analysis (this means finding common embedding > > parameters such that estimates are not biased between groups) > > InteractionDelayReconstruction_calculate -> estimates TE for > > individual data sets and all assumed interaction delays u > > InteractionDelayReconstruction_analyze -> reconstructs the > > interaction delay by selecting the u that maximizes TE for each > > channel > > TEgroup_stats -> calculate group statistics using a permutation test > > > > I can send you an example script for group TE analysis using this > > pipeline to get you started. I hope this helps you to get the group > > analysis running. Just write again if you're having trouble setting > > up > > the pipeline or something is not clear about the parameters/my > > comments. > > > > Best, > > Patricia > > > > > > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not > >> 100% sure if it is appropriate to ask questions about it here, but > >> to > >> the best of my knowledge they do not have a mailing list and I saw > >> a > >> few trentool questions in the archives, so I'm going to assume it's > >> ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present > >> in the pipeline. Sorry in advance for the long post! Any help would > >> be > >> greatly appreciated as I'm a bit over my head on this but I think > >> I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data > >> that was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi is > >> in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within the toi, but beyond that are there any benefits to it being > >> earlier or later?* PW: The predictiontime_u is in milliseconds and > >> the > >> toi is in seconds. The prediction time is the assumed interaction > >> delay between your two sources and should fit within your toi. In > >> general it is preferable to use the method for interaction delay > >> reconstruction for TE estimation, because it allows you to > >> reconstruct > >> the actual delay between your source and target times series. A > >> non-optimal u/interaction delay may cause an underestimation of TE, > >> so > >> it is recommended to use the pipeline for interaction delay > >> reconstruction whenever estimating TE for unknown delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, so it is best to limit the u range to values that are > >> physiologically plausible. > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the > >> sample rate and filters are used to determine the actthrvalue, but > >> I > >> don't actually know the calculation. 7.5 was a rough guess just to > >> test the pipeline. I'm also uncertain of what minnrtrials should > >> be.* > >> PW: You can set the actthrvalue based on the filtering you did > >> prior > >> to TE analysis. If you for example highpass filtered at 10 Hz, you > >> shouldn't find an ACT higher than 30 samples, because you filtered > >> out > >> any components of the signal slower than 10 Hz/30 samples (given > >> your > >> sampling frequency of 300 Hz). So in this scenario the actthrvalue > >> would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> * > >> * > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm > >> yet to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* > >> PW: The Ragwitz criterion tries to find optimal embedding > >> parameters > >> dim and tau for the data. To do that, the method iteratively takes > >> all > >> possible combinations of dim and tau values that are provided in > >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well > >> these > >> combinations embed the data. To test an embedding, the method > >> builds > >> the embedding vectors from the data; it then tests for each point > >> how > >> well the next point in time can be predicted from the reference > >> point's nearest neighbours. So for each embedded point, the method > >> searches for the nearest neighbours and calculates the average of > >> those nearest neighbours. The difference between the > >> averaged/predicted point and the actual next point is the error of > >> the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested > >> by the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together with 'ragtausteps' specifies the tau values to be tested > >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, > >> that > >> the values here are factors that are later multiplied with the ACT > >> to > >> obtain the actual tau. 'repPred' is the number of points that will > >> be > >> used for the local prediction, i.e. the Ragwitz criterion will test > >> the local prediction and calculate the error for the first 100 > >> points > >> in your time series. The two parameters 'flagNei' ans 'sizeNei' > >> below > >> specify the type of neighbour search conducted by the Ragwitz > >> criterion: 'flagNei' tells the method to either conduct a kNN or > >> range > >> search; 'sizeNei' specifies the number of neighbours or the radius > >> to > >> be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> * > >> * > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> * > >> * > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.*TRENTOOL seems to handle data output very differently > >> from > >> fieldtrip and I've had trouble thinking through the most logical > >> way > >> to handle the data so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> * > >> * > >> *For clarification, fileCell is a cell with the name of each > >> condition > >> x subject .mat file, which as I said before is collectively the > >> same > >> as the 3 x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> * > >> * > >> *At this step I get the following error: > >> > >> Error using transferentropy (line 337) > >> \nTRENTOOL ERROR: not enough data points left after embedding > >> > >> Error in TEgroup_calculate (line 133) > >> [TEresult] = transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate > >> is a pipeline issue* (I noticed the example pipeline in trentool, > >> the > >> manual, and published methods articles all seem to have slightly or > >> significantly different pipeline compositions), *or if the error > >> is* > >> due to ACT, ragwitz optimization, or some other faulty > >> parameterization *on my part due to a lack of understanding of how > >> transfer entropy works on a more theoretical/mathematical level*. > >> If > >> the latter is the case, is there any relatively straightforward way > >> to > >> conceptualize this, or is this something where I'm just going to > >> have > >> to keep reading and rereading until it eventually makes sense? I've > >> already done quite a bit of that and it hasn't pierced my thick > >> skull > >> yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> 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: > > > > > > ------------------------------ > > > > Message: 6 > > Date: Tue, 9 Sep 2014 15:21:20 +0200 > > From: Holger Krause > > To: FieldTrip discussion list > > Subject: [FieldTrip] Latest FT version on ftp-server is from three > > days ago > > Message-ID: > > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> > > Content-Type: text/plain; charset="us-ascii" > > > > Dear developers, > > > > Could you please check the process for creation/publication of > > zip-files on > > the FTP server? The latest file I can find there is > > fieldtrip-20140906.zip. > > > > Thanks in advance, > > > > Holger > > > > > > ------------------------------ > > > > Message: 7 > > Date: Tue, 9 Sep 2014 09:19:55 -0400 > > From: Max Cantor > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > This is immensely helpful, thank you. I was very confused about why > > some > > versions of the pipeline I saw were using group calculate and others > > were > > using interaction delay reconstruction and what that meant, and I > > think I > > have a more clear idea of what the different steps of the pipeline > > are > > doing. There are still a few things I'm a bit confused about though > > in > > terms of the pipeline. For instance, whether or not I need to do > > TEprepare > > before group prepare, and if I need to do graph analysis (which I'm > > not > > sure I fully understand but also haven't looked deeply into) before > > group > > stats. > > > > If you don't mind me taking you up on your offer, I think seeing > > your > > example script might help clarify some of these issues. > > > > Thank you! > > > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > > Patricia.Wollstadt at gmx.de> wrote: > > > >> Hello Max, > >> > >> I added a few comments to the questions regarding individual > >> parameters > >> below. To address the general problem of TRENTOOL telling you, that > >> there > >> are not enough sample points in your data: From what I can see in > >> your > >> script, you probably don't have enough data points in each time > >> series to > >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, > >> which > >> gives you 240 samples per time series. Can you maybe avoid > >> downsampling to > >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a > >> longer time > >> window of interest? > >> Note that you also 'lose' data to embedding and the interaction > >> delay: The > >> first point that can be used for TE estimation is at max. embedding > >> length > >> + max. interaction delay in samples. For example: max. embedding > >> length = > >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max > >> interaction > >> delay of 30 ms = 9 samples. In this example, you would be left with > >> 240 - > >> 29 samples for TE estimation per trial. There is also the > >> possibility to > >> estimate time resolved TE/TE for shorter time windows of interest > >> (see > >> section 4.4 in the manual); however, this method requires the use > >> of a GPU > >> for TE estimation. > >> > >> I would further recommend to use the new pipeline for group > >> statistics > >> described in the manual in section 4.5 (the function > >> 'TEgroup_calculate' is > >> deprecated). The new pipeline allows you to reconstruct the > >> interaction > >> delay and uses the following functions (see also comments in the > >> script): > >> > >> TEgroup_prepare -> prepares all data sets (all subjects/all > >> conditions) > >> for group analysis (this means finding common embedding parameters > >> such > >> that estimates are not biased between groups) > >> InteractionDelayReconstruction_calculate -> estimates TE for > >> individual data sets and all assumed interaction delays u > >> InteractionDelayReconstruction_analyze -> reconstructs the > >> interaction delay by selecting the u that maximizes TE for each > >> channel > >> TEgroup_stats -> calculate group statistics using a permutation > >> test > >> > >> I can send you an example script for group TE analysis using this > >> pipeline > >> to get you started. I hope this helps you to get the group analysis > >> running. Just write again if you're having trouble setting up the > >> pipeline > >> or something is not clear about the parameters/my comments. > >> > >> Best, > >> Patricia > >> > >> > >> > >> > >> On 09/04/2014 08:30 PM, Max Cantor wrote: > >> > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not 100% > >> sure if it is appropriate to ask questions about it here, but to > >> the best > >> of my knowledge they do not have a mailing list and I saw a few > >> trentool > >> questions in the archives, so I'm going to assume it's ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present in > >> the pipeline. Sorry in advance for the long post! Any help would be > >> greatly > >> appreciated as I'm a bit over my head on this but I think I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data that > >> was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi > >> is in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within > >> the toi, but beyond that are there any benefits to it being earlier > >> or > >> later?* PW: The predictiontime_u is in milliseconds and the toi is > >> in > >> seconds. The prediction time is the assumed interaction delay > >> between your > >> two sources and should fit within your toi. In general it is > >> preferable to > >> use the method for interaction delay reconstruction for TE > >> estimation, > >> because it allows you to reconstruct the actual delay between your > >> source > >> and target times series. A non-optimal u/interaction delay may > >> cause an > >> underestimation of TE, so it is recommended to use the pipeline for > >> interaction delay reconstruction whenever estimating TE for unknown > >> delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, > >> so it is best to limit the u range to values that are > >> physiologically > >> plausible. > >> > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the sample > >> rate and filters are used to determine the actthrvalue, but I don't > >> actually know the calculation. 7.5 was a rough guess just to test > >> the > >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: > >> You can > >> set the actthrvalue based on the filtering you did prior to TE > >> analysis. If > >> you for example highpass filtered at 10 Hz, you shouldn't find an > >> ACT > >> higher than 30 samples, because you filtered out any components of > >> the > >> signal slower than 10 Hz/30 samples (given your sampling frequency > >> of 300 > >> Hz). So in this scenario the actthrvalue would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm yet > >> to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* PW: > >> The Ragwitz criterion tries to find optimal embedding parameters > >> dim and > >> tau for the data. To do that, the method iteratively takes all > >> possible > >> combinations of dim and tau values that are provided in cfgP.ragdim > >> and > >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations > >> embed > >> the data. To test an embedding, the method builds the embedding > >> vectors > >> from the data; it then tests for each point how well the next point > >> in time > >> can be predicted from the reference point's nearest neighbours. So > >> for each > >> embedded point, the method searches for the nearest neighbours and > >> calculates the average of those nearest neighbours. The difference > >> between > >> the averaged/predicted point and the actual next point is the error > >> of the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested by > >> the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together > >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL > >> will > >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values > >> here are > >> factors that are later multiplied with the ACT to obtain the actual > >> tau. > >> 'repPred' is the number of points that will be used for the local > >> prediction, i.e. the Ragwitz criterion will test the local > >> prediction and > >> calculate the error for the first 100 points in your time series. > >> The two > >> parameters 'flagNei' ans 'sizeNei' below specify the type of > >> neighbour > >> search conducted by the Ragwitz criterion: 'flagNei' tells the > >> method to > >> either conduct a kNN or range search; 'sizeNei' specifies the > >> number of > >> neighbours or the radius to be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' > >> data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject > >> virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.* > >> TRENTOOL seems to handle data output very differently from > >> fieldtrip and > >> I've had trouble thinking through the most logical way to handle > >> the data > >> so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> > >> *For clarification, fileCell is a cell with the name of each > >> condition x > >> subject .mat file, which as I said before is collectively the same > >> as the 3 > >> x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> > >> > >> > >> > >> > >> > >> > >> *At this step I get the following error: Error using > >> transferentropy (line > >> 337) \nTRENTOOL ERROR: not enough data points left after embedding > >> Error in > >> TEgroup_calculate (line 133) [TEresult] = > >> transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate is a > >> pipeline issue* (I noticed the example pipeline in trentool, the > >> manual, > >> and published methods articles all seem to have slightly or > >> significantly > >> different pipeline compositions), *or if the error is* due to ACT, > >> ragwitz optimization, or some other faulty parameterization *on my > >> part > >> due to a lack of understanding of how transfer entropy works on a > >> more > >> theoretical/mathematical level*. If the latter is the case, is > >> there any > >> relatively straightforward way to conceptualize this, or is this > >> something > >> where I'm just going to have to keep reading and rereading until it > >> eventually makes sense? I've already done quite a bit of that and > >> it hasn't > >> pierced my thick skull yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> fieldtrip mailing > >> listfieldtrip at donders.ru.nlhttp://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 > >> > > > > > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > -------------- 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 46, Issue 3 > > **************************************** > > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen From f.roux at bcbl.eu Mon Sep 15 12:09:24 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Mon, 15 Sep 2014 12:09:24 +0200 (CEST) Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs In-Reply-To: <81946224.3066122.1410775297001.JavaMail.root@bcbl.eu> Message-ID: <867006743.3066178.1410775764568.JavaMail.root@bcbl.eu> Dear all, my question relates to the computation of combined planar gradients using the ft_combineplanar function. Our data has been recorded with an Elekta Neuromag 306 channel system, and I would like to know if it is "safe" to compute combined gradients before calling ft_freqstatistics, if the input data contains single trial TFRs. The reason why I am asking is because in the documentation of the function it says % Use as % [data] = ft_combineplanar(cfg, data) % where data contains an averaged planar gradient (either ERF or TFR). However, the following tutorial suggests that this can be safely applied if the input data contains TFRs which have been computed with the cfg.keeptrials = 'yes' option: http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq I am bit confused as both information (the fieldtrip documentation and the tutorial) seem to contradict each other. The 2 options that are see are: 1) compute TFRs with cfg.keeptrials = 'yes', then call ft_frestatistics, then call ft_combineplanar by using the output of ft_freqstatistics as input for the ft_combineplanar function. 2) compute TFRs with cfg.keeptrials = 'yes', then call ft_combineplanar, then call ft_freqstatistics Could anyone with experience on this issue please let me know what the best way to proceed would be? Fred --------------------------------------------------------------------------- From gamaliel.ghu at gmail.com Mon Sep 15 18:12:38 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Mon, 15 Sep 2014 13:12:38 -0300 Subject: [FieldTrip] dipole simulation on head model Message-ID: hi all I hope you can help my problem. I have generated a model of head fieldtrip, and now I need to simulate sources at different positions within the crust generated. I followed the tutorial head model generation for EEG. However I have not found information on how to simulate a source. Any help would be welcome. Thank you greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Mon Sep 15 18:38:26 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 15 Sep 2014 18:38:26 +0200 Subject: [FieldTrip] dipole simulation on head model In-Reply-To: References: Message-ID: <6677301D-D72C-4C12-BC84-779D5E4DF8F3@uni-konstanz.de> Dear Gamaliel, you might try something like this: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit good luck tzvetan Am 15.09.2014 um 18:12 schrieb gamaliel huerta urrea : > hi all > > I hope you can help my problem. > > I have generated a model of head fieldtrip, and now I need to simulate sources at different positions within the crust generated. I followed the tutorial head model generation for EEG. However I have not found information on how to simulate a source. Any help would be welcome. > > Thank you > greetings > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 jingfan.jf at gmail.com Mon Sep 15 19:40:41 2014 From: jingfan.jf at gmail.com (Jing Fan) Date: Mon, 15 Sep 2014 12:40:41 -0500 Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' In-Reply-To: <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> References: <20140910140714.9n2t9bxs008o400c@imap.uni-ulm.de> <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> Message-ID: <000001cfd10c$2b7786a0$826693e0$@gmail.com> Hi Jim, I download the latest .zip file from FTP. I received the same error message when calling function ft_definetrial(cfg). It seems to me that ft_preamble init command will go to script ft_preamble.m instead of ft_preamble_init.m. Any help to resolve this issue will be appreciated. Best, Jing -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) Sent: Monday, September 15, 2014 5:01 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' Dear Barbara, The error seems to be related to a bug that pops up now and then (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a corrupt installation of fieldtrip and/or the need to update fieldtrip. Could you please try downloading the most recent version of fieldtrip and see if the problem persists? For an example of what can be expected from this function see: Esser SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. Best, Jim ----- Oorspronkelijk bericht ----- > Van: "barbara schorr" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 10 september 2014 14:07:14 > Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' > Dear fieldtripers. > > as mentioned in the subject line I would like to anaylse my timelocked > ERP Data with the function ft_globalmeanfield. > > I get the Error: Undefined function or variable 'abort' > Error in ft_globalmeanfield (line84) > if abort > > in the function it says: > > %the abort variable is set to true or false in ft_preamble_inti > if abort > % do not continue function execution in case the outputfile is > present and the user indicated to keep it > return > end > > > I don't understand what this means. I would really appreciate your > help to get this running. > > Also, what is the result when I run this function on my data? (This > method was proposed from a reviewer. I never used it before, so I > don't exactly know what it does and what the result will look like). > > Thank you very much in advance! > > Best, > > Barbara Schorr > > > > > Zitat von 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: Question regarding nonparametric testing for coherence > > differences (Eric Maris) > > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) > > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) > > 4. Re: ft_rejectvisual: removing trials marked as bad > > (Caspar, Emilie) > > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) > > 6. Latest FT version on ftp-server is from three days ago > > (Holger Krause) > > 7. Re: TRENTOOL pipeline help (Max Cantor) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) > > From: "Eric Maris" > > To: , "'FieldTrip discussion list'" > > > > Subject: Re: [FieldTrip] Question regarding nonparametric testing > > for > > coherence differences > > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> > > Content-Type: text/plain; charset="utf-8" > > > > Dear Hwee Ling, > > > > > > > > In the paper you refer to (Maris et al, JNM, 2007), I did not > > perform a > > cluster-based permutation test at the level of the channel pairs. > > Instead, > > all coherences mentioned in the paper are coherence between a single > > EMG > > channel (2 electrodes mounted on the forearm) and all MEG > > electrodes. Thus, > > there are as many EMG-MEG coherences as there are MEG channels (275 > > in our > > lab), and the clustering of these coherences involves the same > > neighbourhood > > structure as the clustering of channel-specific statistics on power > > or > > evoked response. The analysis you propose involves clustering in a > > much more > > complex space, namely the formed by all (MEG,MEG) channel pairs > > (275*275=75625 pairs). In the early days of cluster-based > > permutation > > statistics, I have worked on this problem but did not pursue it > > because the > > resulting clusters are very hard to interpret. > > > > > > > > Best, > > > > > > > > Eric Maris > > > > > > > > > > > > Dear all and Prof Maris, > > > > I'm re-posting this question again, as I didn't get any replies > > previously. > > > > I?m interested to investigate if there are any differences in phase > > synchronization in resting state data at timepoint 2 versus > > timepoint 1. The > > EEG data was collected using 64 EEG channels, resting state, eyes > > opened and > > eyes closed. I?ve arbitrarily segmented the resting state data into > > epochs > > of 2s each, and the epochs with artifacts are excluded completely > > from > > further analyses. I then performed mtmfft to get the fourier > > representation > > of the data, extracted the coherence, and compared the coherence > > difference > > of timepoint 2 versus timepoint 1 of all channels paired with all > > other > > channels. > > > > I figured that if I extract the connectivity analyses without > > specifying the > > channelcmb, I get a 'chan_chan_freq' dimord variable that would > > allow me to > > perform cluster-based statistical analyses. I get an output with > > ?chan_chan? > > dimord variable. However, I was not 100% sure that this is correct, > > hence, I?ve > > inserted my code (see below). It?ll be great if you could tell me if > > what I?m > > doing makes any sense at all. Also, I don?t know how I can plot the > > results > > to see if it make any sense at all. > > > > Also, I checked the values obtained from when I specified > > "cfg.channelcmb" > > and when I did not specify "cfg.channelcmb", I noticed that the > > values were > > somehow different. I would assume that the values to be similar, > > although > > I'm not sure why they would have differences in the values obtained > > from > > specifying "cfg.channelcmb". > > > > This is my code that I've used thus far: > > > > for sub = 1:5 > > > > cfg = []; > > > > cfg.output = 'fourier'; > > > > cfg.channel = {'all'}; > > > > cfg.method = 'mtmfft'; > > > > cfg.keeptrials = 'yes'; > > > > cfg.tapsmofrq = 5; > > > > cfg.foilim = [0 100]; > > > > cfg.taper = 'dpss'; > > > > % find the index for the c200 condition > > > > pre_c200_idx = find(data5.trialinfo == 201); > > > > cfg.trials = pre_c200_idx; > > > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > > > post_c200_idx = find(data5.trialinfo == 200); > > > > cfg.trials = post_c200_idx; > > > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > > > > > cfg = []; > > > > cfg.keeptrials = 'no'; > > > > cfg.channel = {'all'}; > > > > cfg.removemean = 'yes'; > > > > cfg.method = 'coh'; > > > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_pre_c200); > > > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_post_c200); > > > > end > > > > > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat '); > > > > cfg_neighb.method = 'template'; > > > > cfg_neighb.layout = lay; > > > > cfg_neighb.channel = 'all'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, > > sub_HLF_pre_c200coh{1}); > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.neighbours = neighbours; > > > > cfg.channel = 'all'; > > > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > > > cfg.latency = 'all'; > > > > cfg.avgovertime = 'no'; > > > > cfg.avgoverchan = 'no'; > > > > cfg.parameter = 'cohspctrm'; > > > > cfg.method = 'montecarlo'; > > > > cfg.statistic = 'depsamplesT'; > > > > cfg.correctm = 'cluster'; > > > > cfg.tail = 0; > > > > % cfg.clustertail = 0; > > > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 > > frequency > > bands. > > > > cfg.numrandomization = 10000; > > > > cfg.ivar = 2; > > > > cfg.uvar = 1; > > > > > > > > % design matrices > > > > clear design; > > > > design(1,:) = [1:5, 1:5]; > > > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > > > cfg.design = design; > > > > % for theta band > > > > cfg.avgoverfreq = 'yes'; > > > > cfg.frequency = [4 8]; % I also performed the statistics for delta > > (2-4), > > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma > > (30-40), > > and gamma (40-100). > > > > [diffc200_theta_stat] = ft_freqstatistics(cfg, > > sub_HLF_post_c200coh{:}, > > sub_HLF_pre_c200coh{:}); > > > > > > > > When I tried to plot the results, I used this code: > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.layout = 'lay'; > > > > cfg.zlim = [-1 1]; > > > > cfg.alpha = 0.05; > > > > cfg.refchannel = 'all'; > > > > ft_clusterplot(cfg, diffc200_theta_stat); > > > > However, I was not sure how I could plot the results. I get an error > > message > > from Fieldtrip when using ft_clusterplot: > > > > Error using topoplot_common (line 366) > > > > no reference channel is specified > > > > Error in ft_topoplotTFR (line 192) > > > > [cfg] = topoplot_common(cfg, varargin{:}); > > > > Error in ft_clusterplot (line 372) > > > > ft_topoplotTFR(cfgtopo, stat); > > > > > > > > According to your paper in 2007, the topoplot of the results were > > masked by > > the spatio-spectral pattern of the significant clusters. I don't > > know how to > > do this, and I would really appreciate if you can show me how to > > make such a > > plot. > > > > Thank you very much. > > > > Kind regards, > > > > Hweeling > > > > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 2 > > Date: Mon, 8 Sep 2014 21:38:01 +0200 > > From: KatrinH Heimann > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > Dear Joseph, thanks so much, I really appreciate your help. I was > > also > > wandering, if maybe there is another bug in my code. > > Our nets are 128 channels, Hydrocel, but as a colleague of me > > adviced me to > > do so, I also tried the 129 layout. > > My code you find below (without selection of bad channels etc.) > > If you need also the data of two subjects to have a look, let me > > know!!! > > Best and thanks really! > > Katrin > > > > > > subject=input('Which subject do you want to analyse? ','s'); > > > > name = strcat(subject,'.raw'); > > > > subjectnumber=input('Which is the subjectnumber?', 's'); > > > > sb=subjectnumber > > > > %subjectnumber = strcat(subjectnumber, '.txt') > > > > %% > > > > > > cfg = []; > > > > cfg.dataset = name; > > > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > > > cfg.trialdef.eventtype = 'trigger'; > > > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > > trigger > > > > cfg.trialdef.prestim = 0.234; % in seconds > > > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > > observation, but maybe we need less) > > > > cfg = ft_definetrial(cfg); > > > > > > cfg.trl([1:7],:) = []; > > > > > > %change timeline according to constant offset of 16 ms = 8 samples > > (because > > recorded with 500 hz)in > > > > %structure trial > > > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > > > > %change timeline to make the cut the zeropoint > > > > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > > > > > %% preprocess data > > > > cfg.channel = 'all'; > > > > cfg.preproc.detrend = 'yes'; > > > > cfg.preproc.demean = 'yes'; > > > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > > filtered > > > > %(0.1-45) and bad channels have to be replaced!!!! > > > > %cfg.preproc.bpfreq = [6 32]; > > > > % > > > > % > > > > obs_data = ft_preprocessing(cfg); > > > > % > > > > save (strcat(sb,'obs_data') , 'obs_data') > > > > > > %% determining channel neighbours (necessary for Artifact detection) > > > > cfg = []; > > > > cfg.channel = obs_data.label; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.feedback = 'yes'; > > > > lay = ft_prepare_layout(cfg); > > > > > > > > cfg_neighb = []; > > > > cfg_neighb.feedback = 'yes'; > > > > > > cfg_neighb.method = 'triangulation'; > > > > cfg_neighb.layout = 'GSN128.sfp'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > > > > > %% Preparing neighbours for channel repair - but bad channel info > > in!!! > > > > > > % cfg_neighb = []; > > > > % cfg_neighb.feedback = 'yes'; > > > > % cfg_neighb.method = 'triangulation'; > > > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > % Interpolate and put into new data structure > > > > cfg = []; > > > > cfg.badchannel = {}; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.method = 'nearest'; > > > > cfg.neighbours = neighbours; > > > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > > > > % Check reconstruction > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > % dat1=obs_data; > > > > % dat2=obs_data_channelrepaired; > > > > % > > > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > > > % y=dat2.trial{1}(62,:); > > > > % plot(x);hold on;plot(y,'r'); > > > > % > > > > % x=dat1.trial{1}(72,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > % > > > > % x=dat1.trial{1}(75,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > %% artifact rejection/trial inspection - throw out electrode jumps > > etc. > > > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > > according to > > channels interpolated %% 128-number of interp. channels) > > > > > > > > cfg = []; > > > > cfg.channel = {'all'}; > > > > cfg.numcomponent = 128 > > > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > > > save (strcat(sb,'comp_all') , 'comp') > > > > > > %% > > > > cfg = []; > > > > cfg.viewmode = 'component'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='some'; > > > > cfg.layout = 'GSN128.sfp'; > > > > ft_databrowser(cfg,comp); > > > > > > %% poweranalysis components > > > > cfg = []; > > > > cfg.output = 'pow'; > > > > cfg.channel = 'all';%compute the power spectrum in all ICs > > > > cfg.method = 'mtmfft'; > > > > cfg.taper = 'hanning'; > > > > cfg.foi = 0:0.2:50; > > > > obs_freq = ft_freqanalysis(cfg, comp); > > > > > > %And you can plot the spectra: > > > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > nsubplots = 16; > > > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > > decimals, type > > doc subplot > > > > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > > > tot = Nfigs*nsubplots; > > > > > > rptvect = 1:size(comp.topo,1); > > > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > > > > for r=1:size(rptvect,1); > > > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 > > 1]);%full > > screen > > > > k=0; > > > > for j=1:size(rptvect,2); > > > > if~(rptvect(r,j)==0); > > > > k=k+1; > > > > cfg=[]; > > > > cfg.channel = rptvect(r,j); > > > > cfg.ylim =[0 500] > > > > cfg.xlim =[0 50] > > > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > > > end > > > > end > > > > end > > > > > > %For the IC topos you'll follow the same logic as above but with: > > > > > > figure > > > > cfg = []; > > > > cfg.component = [1:20]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [21:40]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [41:60]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [61:80]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > > > > > > > > > %% Seperate observation conditions > > > > > > name1= strcat(num2str(sb),'_90.xls'); > > > > list1=xlsread (name1) > > > > > > > > > > > > name2= strcat(num2str(sb),'_180.xls'); > > > > list2=xlsread (name2) > > > > > > > > % > > > > > > cfg = [] > > > > cfg.trials = [list1] > > > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > cfg = [] > > > > cfg.trials = [list2] > > > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > %%PIPELINE FOR obs90 > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128; > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > > obs90_data); > > > > > > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > > > > > > %% Artifacts - final detection > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > > > > %% plot it > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > > > > > > > > > %% PIPELINE FOR obs180 > > > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128 > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > > obs180_data); > > > > > > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > > > > > > %% Artifacts final 180 > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > > > > %% plot 180 ERP > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs180_data_ERP) > > > > > > %% plot both ERPs > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > cfg.showlabels = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > > > > %% plot difference wave > > > > > > difference = obs180_data_ERP; % copy one of the > > structures > > > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute > > the > > difference ERP > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, difference) > > > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > > > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI > >> data. A couple things. First of all, exactly which net do you use? > >> If > >> they are 129-channel, there is still the question of whether they > >> are the > >> Hydrocel or the older geodesic nets. Regardless, that shouldn't > >> cause an > >> error like this. Could you send me the file you are trying to > >> process and > >> the script you are using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < > >> diezmartini at gmail.com> wrote: > >> > >> Which nets do you use? I use EGI. I tried both the ones you mention > >> and > >> they didn't work. It was hard to find that exact one online but it > >> was the > >> only file that actually worked. > >> > >> > >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >> > >> wrote: > >> > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. > >>> Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one > >>> > >>>> I use > >>>> > >>>> > >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < > >>>> katrinheimann at gmail.com> wrote: > >>>> > >>>>> Dear all, my problems seem neverending. This time however i > >>>>> really need > >>>>> help. > >>>>> I implemented a pipeline for ERPs. All works now, > >>>>> trialdefinition, > >>>>> preprocessing, channelreplacement, ica, componentrejection, > >>>>> final > >>>>> artifactdetection, timelock of the single subject data. However, > >>>>> when I > >>>>> wanna compute the grandaverage of the single subjects I get the > >>>>> following > >>>>> error message: > >>>>> > >>>>> computing average of avg over 19 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 3 MB > >>>>> computing average of avg over 2 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_prepare_layout" took 0 seconds and required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_topoplotER" took 0 seconds and required the > >>>>> additional > >>>>> allocation of an estimated 0 MB > >>>>> > >>>>> Furthermore in the plot of the significant clusters, the > >>>>> channelnames > >>>>> are mixed up (do not correspond to my net) > >>>>> > >>>>> > >>>>> I guess that there is a problem with the layout I use. > >>>>> Here the code that I use > >>>>> > >>>>> %For generating the layout (also in the single subjects): > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = obs_data.label; > >>>>> > >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>>>> > >>>>> cfg.feedback = 'yes'; > >>>>> > >>>>> lay = ft_prepare_layout(cfg); > >>>>> > >>>>> > >>>>> cfg_neighb = []; > >>>>> > >>>>> cfg_neighb.feedback = 'yes'; > >>>>> > >>>>> cfg_neighb.method = 'triangulation'; > >>>>> > >>>>> cfg_neighb.layout = lay; > >>>>> > >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>>>> > >>>>> > >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>>>> > >>>>> > >>>>> %For computing the grand average > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = 'all'; > >>>>> > >>>>> cfg.latency = 'all'; > >>>>> > >>>>> cfg.parameter = 'avg'; > >>>>> > >>>>> cfg.keepindividual = 'no' > >>>>> > >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>>>> > >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>>>> > >>>>> % "{:}" means to use data from all elements of the variable > >>>>> > >>>>> > >>>>> For plotting the significant clusters > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.style = 'blank'; > >>>>> > >>>>> cfg.layout = lay; > >>>>> > >>>>> cfg.channellabels = 'yes'; > >>>>> > >>>>> cfg.highlight = 'labels'; > >>>>> > >>>>> cfg.highlightchannel = find(stat.mask); > >>>>> > >>>>> cfg.comment = 'no'; > >>>>> > >>>>> figure; ft_topoplotER(cfg, GA_90) > >>>>> > >>>>> title('Nonparametric: significant with cluster multiple > >>>>> comparison > >>>>> correction') > >>>>> > >>>>> > >>>>> Do you have ANY idea to this? I am really completely > >>>>> helpless.... > >>>>> > >>>>> thanks and best > >>>>> > >>>>> Katrin > >>>>> > >>>>> _______________________________________________ > >>>>> 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 > >>> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> > >> ---------------------------------------------------------------------------- ---- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.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: > > > > > > ------------------------------ > > > > Message: 3 > > Date: Mon, 08 Sep 2014 21:55:44 -0400 > > From: Joseph Dien > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> > > Content-Type: text/plain; charset="windows-1252" > > > > yes, please do send me the data. > > > > Thanks! > > > > Joe > > > > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann > > wrote: > > > >> Dear Joseph, thanks so much, I really appreciate your help. I was > >> also wandering, if maybe there is another bug in my code. > >> Our nets are 128 channels, Hydrocel, but as a colleague of me > >> adviced me to do so, I also tried the 129 layout. > >> My code you find below (without selection of bad channels etc.) > >> If you need also the data of two subjects to have a look, let me > >> know!!! > >> Best and thanks really! > >> Katrin > >> > >> > >> > >> subject=input('Which subject do you want to analyse? ','s'); > >> > >> name = strcat(subject,'.raw'); > >> > >> subjectnumber=input('Which is the subjectnumber?', 's'); > >> > >> sb=subjectnumber > >> > >> %subjectnumber = strcat(subjectnumber, '.txt') > >> > >> %% > >> > >> > >> > >> cfg = []; > >> > >> cfg.dataset = name; > >> > >> cfg.trialfun = 'ft_trialfun_general'; % this is the default > >> > >> cfg.trialdef.eventtype = 'trigger'; > >> > >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > >> trigger > >> > >> cfg.trialdef.prestim = 0.234; % in seconds > >> > >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > >> observation, but maybe we need less) > >> > >> cfg = ft_definetrial(cfg); > >> > >> > >> > >> cfg.trl([1:7],:) = []; > >> > >> > >> > >> %change timeline according to constant offset of 16 ms = 8 samples > >> (because recorded with 500 hz)in > >> > >> %structure trial > >> > >> cfg.trl(:,3)=cfg.trl(:,3)-8 > >> > >> > >> > >> %change timeline to make the cut the zeropoint > >> > >> > >> > >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; > >> > >> > >> > >> > >> > >> %% preprocess data > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.detrend = 'yes'; > >> > >> cfg.preproc.demean = 'yes'; > >> > >> cfg.preproc.baselinewindow = [-2.1 -2.0] > >> > >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > >> filtered > >> > >> %(0.1-45) and bad channels have to be replaced!!!! > >> > >> %cfg.preproc.bpfreq = [6 32]; > >> > >> % > >> > >> % > >> > >> obs_data = ft_preprocessing(cfg); > >> > >> % > >> > >> save (strcat(sb,'obs_data') , 'obs_data') > >> > >> > >> > >> %% determining channel neighbours (necessary for Artifact > >> detection) > >> > >> cfg = []; > >> > >> cfg.channel = obs_data.label; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.feedback = 'yes'; > >> > >> lay = ft_prepare_layout(cfg); > >> > >> > >> cfg_neighb = []; > >> > >> cfg_neighb.feedback = 'yes'; > >> > >> > >> > >> cfg_neighb.method = 'triangulation'; > >> > >> cfg_neighb.layout = 'GSN128.sfp'; > >> > >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> obs_data.elec = ft_read_sens('GSN128.sfp'); > >> > >> > >> > >> %% Artifacts - to detect bad channels - is not saved!!! > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs_data_try = ft_rejectvisual(cfg, obs_data); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_try = ft_rejectartifact (cfg,obs_data); > >> > >> > >> > >> > >> > >> %% Preparing neighbours for channel repair - but bad channel info > >> in!!! > >> > >> > >> > >> % cfg_neighb = []; > >> > >> % cfg_neighb.feedback = 'yes'; > >> > >> % cfg_neighb.method = 'triangulation'; > >> > >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > >> > >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> % Interpolate and put into new data structure > >> > >> cfg = []; > >> > >> cfg.badchannel = {}; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.method = 'nearest'; > >> > >> cfg.neighbours = neighbours; > >> > >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >> > >> > >> > >> % Check reconstruction > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> % dat1=obs_data; > >> > >> % dat2=obs_data_channelrepaired; > >> > >> % > >> > >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > >> > >> % y=dat2.trial{1}(62,:); > >> > >> % plot(x);hold on;plot(y,'r'); > >> > >> % > >> > >> % x=dat1.trial{1}(72,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> % > >> > >> % x=dat1.trial{1}(75,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> %% artifact rejection/trial inspection - throw out electrode jumps > >> etc. > >> > >> > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > >> according to channels interpolated %% 128-number of interp. > >> channels) > >> > >> > >> cfg = []; > >> > >> cfg.channel = {'all'}; > >> > >> cfg.numcomponent = 128 > >> > >> comp = ft_componentanalysis(cfg,obs_data_clean1); > >> > >> save (strcat(sb,'comp_all') , 'comp') > >> > >> > >> > >> %% > >> > >> cfg = []; > >> > >> cfg.viewmode = 'component'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='some'; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> ft_databrowser(cfg,comp); > >> > >> > >> > >> %% poweranalysis components > >> > >> cfg = []; > >> > >> cfg.output = 'pow'; > >> > >> cfg.channel = 'all';%compute the power spectrum in all ICs > >> > >> cfg.method = 'mtmfft'; > >> > >> cfg.taper = 'hanning'; > >> > >> cfg.foi = 0:0.2:50; > >> > >> obs_freq = ft_freqanalysis(cfg, comp); > >> > >> > >> > >> %And you can plot the spectra: > >> > >> > >> > >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > >> > >> nsubplots = 16; > >> > >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > >> decimals, type doc subplot > >> > >> > >> > >> Nfigs = ceil(size(comp.topo,1)/nsubplots); > >> > >> tot = Nfigs*nsubplots; > >> > >> > >> > >> rptvect = 1:size(comp.topo,1); > >> > >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > >> > >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; > >> > >> > >> > >> for r=1:size(rptvect,1); > >> > >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 > >> 1]);%full screen > >> > >> k=0; > >> > >> for j=1:size(rptvect,2); > >> > >> if~(rptvect(r,j)==0); > >> > >> k=k+1; > >> > >> cfg=[]; > >> > >> cfg.channel = rptvect(r,j); > >> > >> cfg.ylim =[0 500] > >> > >> cfg.xlim =[0 50] > >> > >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > >> > >> end > >> > >> end > >> > >> end > >> > >> > >> > >> %For the IC topos you'll follow the same logic as above but with: > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [1:20]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [21:40]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [41:60]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [61:80]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% Seperate observation conditions > >> > >> > >> > >> name1= strcat(num2str(sb),'_90.xls'); > >> > >> list1=xlsread (name1) > >> > >> > >> > >> name2= strcat(num2str(sb),'_180.xls'); > >> > >> list2=xlsread (name2) > >> > >> > >> % > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list1] > >> > >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list2] > >> > >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> %%PIPELINE FOR obs90 > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128; > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> > >> > >> comp_1 = ft_componentanalysis(cfg, obs90_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > >> obs90_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts - final detection > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs90_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > >> > >> > >> > >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > >> > >> > >> > >> %% plot it > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% PIPELINE FOR obs180 > >> > >> > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128 > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> comp_2 = ft_componentanalysis(cfg, obs180_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > >> obs180_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts final 180 > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs180_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > >> > >> > >> > >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > >> > >> > >> > >> %% plot 180 ERP > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs180_data_ERP) > >> > >> > >> > >> %% plot both ERPs > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> cfg.showlabels = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > >> > >> > >> > >> %% plot difference wave > >> > >> > >> > >> difference = obs180_data_ERP; % copy one of > >> the structures > >> > >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % > >> compute the difference ERP > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, difference) > >> > >> > >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI data. A couple things. First of all, exactly which net do > >> you use? If they are 129-channel, there is still the question of > >> whether they are the Hydrocel or the older geodesic nets. > >> Regardless, that shouldn't cause an error like this. Could you > >> send me the file you are trying to process and the script you are > >> using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini > >> wrote: > >> > >>> Which nets do you use? I use EGI. I tried both the ones you > >>> mention and they didn't work. It was hard to find that exact one > >>> online but it was the only file that actually worked. > >>> > >>> > >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >>> wrote: > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one I use > >>> > >>> > >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > >>> wrote: > >>> Dear all, my problems seem neverending. This time however i really > >>> need help. > >>> I implemented a pipeline for ERPs. All works now, trialdefinition, > >>> preprocessing, channelreplacement, ica, componentrejection, final > >>> artifactdetection, timelock of the single subject data. However, > >>> when I wanna compute the grandaverage of the single subjects I get > >>> the following error message: > >>> > >>> computing average of avg over 19 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 3 MB > >>> computing average of avg over 2 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 0 MB > >>> the call to "ft_prepare_layout" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> the call to "ft_topoplotER" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> > >>> Furthermore in the plot of the significant clusters, the > >>> channelnames are mixed up (do not correspond to my net) > >>> > >>> > >>> I guess that there is a problem with the layout I use. > >>> Here the code that I use > >>> > >>> %For generating the layout (also in the single subjects): > >>> cfg = []; > >>> > >>> cfg.channel = obs_data.label; > >>> > >>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>> > >>> cfg.feedback = 'yes'; > >>> > >>> lay = ft_prepare_layout(cfg); > >>> > >>> > >>> cfg_neighb = []; > >>> > >>> cfg_neighb.feedback = 'yes'; > >>> > >>> cfg_neighb.method = 'triangulation'; > >>> > >>> cfg_neighb.layout = lay; > >>> > >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>> > >>> > >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>> > >>> > >>> > >>> %For computing the grand average > >>> > >>> cfg = []; > >>> > >>> cfg.channel = 'all'; > >>> > >>> cfg.latency = 'all'; > >>> > >>> cfg.parameter = 'avg'; > >>> > >>> cfg.keepindividual = 'no' > >>> > >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>> > >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>> > >>> % "{:}" means to use data from all elements of the variable > >>> > >>> > >>> For plotting the significant clusters > >>> > >>> cfg = []; > >>> > >>> cfg.style = 'blank'; > >>> > >>> cfg.layout = lay; > >>> > >>> cfg.channellabels = 'yes'; > >>> > >>> cfg.highlight = 'labels'; > >>> > >>> cfg.highlightchannel = find(stat.mask); > >>> > >>> cfg.comment = 'no'; > >>> > >>> figure; ft_topoplotER(cfg, GA_90) > >>> > >>> title('Nonparametric: significant with cluster multiple comparison > >>> correction') > >>> > >>> > >>> > >>> Do you have ANY idea to this? I am really completely helpless.... > >>> > >>> thanks and best > >>> > >>> Katrin > >>> > >>> > >>> _______________________________________________ > >>> 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 > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> ---------------------------------------------------------------------------- ---- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.com > >> > >> > >> _______________________________________________ > >> 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 > > > > ---------------------------------------------------------------------------- ---- > > > > Joseph Dien, PhD > > Research Associate > > Cognitive Neurology > > The Johns Hopkins University School of Medicine > > > > Lab E-mail: jdien1 at jhmi.edu > > Private E-mail: jdien07 at mac.com > > Office Phone: 410-614-3115 > > Cell Phone: 202-297-8117 > > Fax: 410-955-0188 > > http://joedien.com > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 4 > > Date: Tue, 9 Sep 2014 06:37:13 +0000 > > From: "Caspar, Emilie" > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > > bad > > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi Ashley, > > > > Maybe the mistake is you did not integrate in your script the > > command to save the rejection. Normally, with the following command, > > you will see in the Matlab Window that artifacts are correctly > > rejected after the "quit" button. > > > > clean_data = ft_rejectvisual(cfg, interpoldata); > > cfg.artfctdef.reject = 'complete'; > > cfg.artfctdef.feedback = 'yes'; > > cleandata = ft_rejectartifact(cfg,clean_data); > > > > Emilie > > > > > > > > > > > > Le 3 sept. 2014 ? 11:58, Ashley Greene > > > a ?crit : > > > > Hello, > > > > I have used the rejectvisual function in attempt to remove bad > > trials, but after marking them and pressing the quit button, > > although the command window states that the selected trials have > > been removed, there is no obvious change in the data; all of the > > trials are still intact. Have I overlooked something? > > > > Thanks, > > > > Ashley > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 5 > > Date: Tue, 09 Sep 2014 14:16:20 +0200 > > From: Patricia Wollstadt > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: <540EEF94.9080601 at gmx.de> > > Content-Type: text/plain; charset="windows-1252" > > > > Hello Max, > > > > I added a few comments to the questions regarding individual > > parameters > > below. To address the general problem of TRENTOOL telling you, that > > there are not enough sample points in your data: From what I can see > > in > > your script, you probably don't have enough data points in each time > > series to robustly estimate TE. You analyze 800 ms of data sampled > > at > > 300 Hz, which gives you 240 samples per time series. Can you maybe > > avoid > > downsampling to 300 Hz and downsample to 600 Hz instead? Or could > > you > > analyze a longer time window of interest? > > Note that you also 'lose' data to embedding and the interaction > > delay: > > The first point that can be used for TE estimation is at max. > > embedding > > length + max. interaction delay in samples. For example: max. > > embedding > > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the > > max > > interaction delay of 30 ms = 9 samples. In this example, you would > > be > > left with 240 - 29 samples for TE estimation per trial. There is > > also > > the possibility to estimate time resolved TE/TE for shorter time > > windows > > of interest (see section 4.4 in the manual); however, this method > > requires the use of a GPU for TE estimation. > > > > I would further recommend to use the new pipeline for group > > statistics > > described in the manual in section 4.5 (the function > > 'TEgroup_calculate' > > is deprecated). The new pipeline allows you to reconstruct the > > interaction delay and uses the following functions (see also > > comments in > > the script): > > > > TEgroup_prepare -> prepares all data sets (all subjects/all > > conditions) for group analysis (this means finding common embedding > > parameters such that estimates are not biased between groups) > > InteractionDelayReconstruction_calculate -> estimates TE for > > individual data sets and all assumed interaction delays u > > InteractionDelayReconstruction_analyze -> reconstructs the > > interaction delay by selecting the u that maximizes TE for each > > channel > > TEgroup_stats -> calculate group statistics using a permutation test > > > > I can send you an example script for group TE analysis using this > > pipeline to get you started. I hope this helps you to get the group > > analysis running. Just write again if you're having trouble setting > > up > > the pipeline or something is not clear about the parameters/my > > comments. > > > > Best, > > Patricia > > > > > > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not > >> 100% sure if it is appropriate to ask questions about it here, but > >> to > >> the best of my knowledge they do not have a mailing list and I saw > >> a > >> few trentool questions in the archives, so I'm going to assume it's > >> ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present > >> in the pipeline. Sorry in advance for the long post! Any help would > >> be > >> greatly appreciated as I'm a bit over my head on this but I think > >> I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data > >> that was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi is > >> in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within the toi, but beyond that are there any benefits to it being > >> earlier or later?* PW: The predictiontime_u is in milliseconds and > >> the > >> toi is in seconds. The prediction time is the assumed interaction > >> delay between your two sources and should fit within your toi. In > >> general it is preferable to use the method for interaction delay > >> reconstruction for TE estimation, because it allows you to > >> reconstruct > >> the actual delay between your source and target times series. A > >> non-optimal u/interaction delay may cause an underestimation of TE, > >> so > >> it is recommended to use the pipeline for interaction delay > >> reconstruction whenever estimating TE for unknown delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, so it is best to limit the u range to values that are > >> physiologically plausible. > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the > >> sample rate and filters are used to determine the actthrvalue, but > >> I > >> don't actually know the calculation. 7.5 was a rough guess just to > >> test the pipeline. I'm also uncertain of what minnrtrials should > >> be.* > >> PW: You can set the actthrvalue based on the filtering you did > >> prior > >> to TE analysis. If you for example highpass filtered at 10 Hz, you > >> shouldn't find an ACT higher than 30 samples, because you filtered > >> out > >> any components of the signal slower than 10 Hz/30 samples (given > >> your > >> sampling frequency of 300 Hz). So in this scenario the actthrvalue > >> would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> * > >> * > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm > >> yet to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* > >> PW: The Ragwitz criterion tries to find optimal embedding > >> parameters > >> dim and tau for the data. To do that, the method iteratively takes > >> all > >> possible combinations of dim and tau values that are provided in > >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well > >> these > >> combinations embed the data. To test an embedding, the method > >> builds > >> the embedding vectors from the data; it then tests for each point > >> how > >> well the next point in time can be predicted from the reference > >> point's nearest neighbours. So for each embedded point, the method > >> searches for the nearest neighbours and calculates the average of > >> those nearest neighbours. The difference between the > >> averaged/predicted point and the actual next point is the error of > >> the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested > >> by the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together with 'ragtausteps' specifies the tau values to be tested > >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, > >> that > >> the values here are factors that are later multiplied with the ACT > >> to > >> obtain the actual tau. 'repPred' is the number of points that will > >> be > >> used for the local prediction, i.e. the Ragwitz criterion will test > >> the local prediction and calculate the error for the first 100 > >> points > >> in your time series. The two parameters 'flagNei' ans 'sizeNei' > >> below > >> specify the type of neighbour search conducted by the Ragwitz > >> criterion: 'flagNei' tells the method to either conduct a kNN or > >> range > >> search; 'sizeNei' specifies the number of neighbours or the radius > >> to > >> be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> * > >> * > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> * > >> * > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.*TRENTOOL seems to handle data output very differently > >> from > >> fieldtrip and I've had trouble thinking through the most logical > >> way > >> to handle the data so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> * > >> * > >> *For clarification, fileCell is a cell with the name of each > >> condition > >> x subject .mat file, which as I said before is collectively the > >> same > >> as the 3 x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> * > >> * > >> *At this step I get the following error: > >> > >> Error using transferentropy (line 337) > >> \nTRENTOOL ERROR: not enough data points left after embedding > >> > >> Error in TEgroup_calculate (line 133) > >> [TEresult] = transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate > >> is a pipeline issue* (I noticed the example pipeline in trentool, > >> the > >> manual, and published methods articles all seem to have slightly or > >> significantly different pipeline compositions), *or if the error > >> is* > >> due to ACT, ragwitz optimization, or some other faulty > >> parameterization *on my part due to a lack of understanding of how > >> transfer entropy works on a more theoretical/mathematical level*. > >> If > >> the latter is the case, is there any relatively straightforward way > >> to > >> conceptualize this, or is this something where I'm just going to > >> have > >> to keep reading and rereading until it eventually makes sense? I've > >> already done quite a bit of that and it hasn't pierced my thick > >> skull > >> yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> 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: > > > > > > ------------------------------ > > > > Message: 6 > > Date: Tue, 9 Sep 2014 15:21:20 +0200 > > From: Holger Krause > > To: FieldTrip discussion list > > Subject: [FieldTrip] Latest FT version on ftp-server is from three > > days ago > > Message-ID: > > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> > > Content-Type: text/plain; charset="us-ascii" > > > > Dear developers, > > > > Could you please check the process for creation/publication of > > zip-files on > > the FTP server? The latest file I can find there is > > fieldtrip-20140906.zip. > > > > Thanks in advance, > > > > Holger > > > > > > ------------------------------ > > > > Message: 7 > > Date: Tue, 9 Sep 2014 09:19:55 -0400 > > From: Max Cantor > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > This is immensely helpful, thank you. I was very confused about why > > some > > versions of the pipeline I saw were using group calculate and others > > were > > using interaction delay reconstruction and what that meant, and I > > think I > > have a more clear idea of what the different steps of the pipeline > > are > > doing. There are still a few things I'm a bit confused about though > > in > > terms of the pipeline. For instance, whether or not I need to do > > TEprepare > > before group prepare, and if I need to do graph analysis (which I'm > > not > > sure I fully understand but also haven't looked deeply into) before > > group > > stats. > > > > If you don't mind me taking you up on your offer, I think seeing > > your > > example script might help clarify some of these issues. > > > > Thank you! > > > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > > Patricia.Wollstadt at gmx.de> wrote: > > > >> Hello Max, > >> > >> I added a few comments to the questions regarding individual > >> parameters > >> below. To address the general problem of TRENTOOL telling you, that > >> there > >> are not enough sample points in your data: From what I can see in > >> your > >> script, you probably don't have enough data points in each time > >> series to > >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, > >> which > >> gives you 240 samples per time series. Can you maybe avoid > >> downsampling to > >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a > >> longer time > >> window of interest? > >> Note that you also 'lose' data to embedding and the interaction > >> delay: The > >> first point that can be used for TE estimation is at max. embedding > >> length > >> + max. interaction delay in samples. For example: max. embedding > >> length = > >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max > >> interaction > >> delay of 30 ms = 9 samples. In this example, you would be left with > >> 240 - > >> 29 samples for TE estimation per trial. There is also the > >> possibility to > >> estimate time resolved TE/TE for shorter time windows of interest > >> (see > >> section 4.4 in the manual); however, this method requires the use > >> of a GPU > >> for TE estimation. > >> > >> I would further recommend to use the new pipeline for group > >> statistics > >> described in the manual in section 4.5 (the function > >> 'TEgroup_calculate' is > >> deprecated). The new pipeline allows you to reconstruct the > >> interaction > >> delay and uses the following functions (see also comments in the > >> script): > >> > >> TEgroup_prepare -> prepares all data sets (all subjects/all > >> conditions) > >> for group analysis (this means finding common embedding parameters > >> such > >> that estimates are not biased between groups) > >> InteractionDelayReconstruction_calculate -> estimates TE for > >> individual data sets and all assumed interaction delays u > >> InteractionDelayReconstruction_analyze -> reconstructs the > >> interaction delay by selecting the u that maximizes TE for each > >> channel > >> TEgroup_stats -> calculate group statistics using a permutation > >> test > >> > >> I can send you an example script for group TE analysis using this > >> pipeline > >> to get you started. I hope this helps you to get the group analysis > >> running. Just write again if you're having trouble setting up the > >> pipeline > >> or something is not clear about the parameters/my comments. > >> > >> Best, > >> Patricia > >> > >> > >> > >> > >> On 09/04/2014 08:30 PM, Max Cantor wrote: > >> > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not 100% > >> sure if it is appropriate to ask questions about it here, but to > >> the best > >> of my knowledge they do not have a mailing list and I saw a few > >> trentool > >> questions in the archives, so I'm going to assume it's ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present in > >> the pipeline. Sorry in advance for the long post! Any help would be > >> greatly > >> appreciated as I'm a bit over my head on this but I think I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data that > >> was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi > >> is in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within > >> the toi, but beyond that are there any benefits to it being earlier > >> or > >> later?* PW: The predictiontime_u is in milliseconds and the toi is > >> in > >> seconds. The prediction time is the assumed interaction delay > >> between your > >> two sources and should fit within your toi. In general it is > >> preferable to > >> use the method for interaction delay reconstruction for TE > >> estimation, > >> because it allows you to reconstruct the actual delay between your > >> source > >> and target times series. A non-optimal u/interaction delay may > >> cause an > >> underestimation of TE, so it is recommended to use the pipeline for > >> interaction delay reconstruction whenever estimating TE for unknown > >> delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, > >> so it is best to limit the u range to values that are > >> physiologically > >> plausible. > >> > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the sample > >> rate and filters are used to determine the actthrvalue, but I don't > >> actually know the calculation. 7.5 was a rough guess just to test > >> the > >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: > >> You can > >> set the actthrvalue based on the filtering you did prior to TE > >> analysis. If > >> you for example highpass filtered at 10 Hz, you shouldn't find an > >> ACT > >> higher than 30 samples, because you filtered out any components of > >> the > >> signal slower than 10 Hz/30 samples (given your sampling frequency > >> of 300 > >> Hz). So in this scenario the actthrvalue would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm yet > >> to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* PW: > >> The Ragwitz criterion tries to find optimal embedding parameters > >> dim and > >> tau for the data. To do that, the method iteratively takes all > >> possible > >> combinations of dim and tau values that are provided in cfgP.ragdim > >> and > >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations > >> embed > >> the data. To test an embedding, the method builds the embedding > >> vectors > >> from the data; it then tests for each point how well the next point > >> in time > >> can be predicted from the reference point's nearest neighbours. So > >> for each > >> embedded point, the method searches for the nearest neighbours and > >> calculates the average of those nearest neighbours. The difference > >> between > >> the averaged/predicted point and the actual next point is the error > >> of the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested by > >> the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together > >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL > >> will > >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values > >> here are > >> factors that are later multiplied with the ACT to obtain the actual > >> tau. > >> 'repPred' is the number of points that will be used for the local > >> prediction, i.e. the Ragwitz criterion will test the local > >> prediction and > >> calculate the error for the first 100 points in your time series. > >> The two > >> parameters 'flagNei' ans 'sizeNei' below specify the type of > >> neighbour > >> search conducted by the Ragwitz criterion: 'flagNei' tells the > >> method to > >> either conduct a kNN or range search; 'sizeNei' specifies the > >> number of > >> neighbours or the radius to be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' > >> data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject > >> virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.* > >> TRENTOOL seems to handle data output very differently from > >> fieldtrip and > >> I've had trouble thinking through the most logical way to handle > >> the data > >> so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> > >> *For clarification, fileCell is a cell with the name of each > >> condition x > >> subject .mat file, which as I said before is collectively the same > >> as the 3 > >> x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> > >> > >> > >> > >> > >> > >> > >> *At this step I get the following error: Error using > >> transferentropy (line > >> 337) \nTRENTOOL ERROR: not enough data points left after embedding > >> Error in > >> TEgroup_calculate (line 133) [TEresult] = > >> transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate is a > >> pipeline issue* (I noticed the example pipeline in trentool, the > >> manual, > >> and published methods articles all seem to have slightly or > >> significantly > >> different pipeline compositions), *or if the error is* due to ACT, > >> ragwitz optimization, or some other faulty parameterization *on my > >> part > >> due to a lack of understanding of how transfer entropy works on a > >> more > >> theoretical/mathematical level*. If the latter is the case, is > >> there any > >> relatively straightforward way to conceptualize this, or is this > >> something > >> where I'm just going to have to keep reading and rereading until it > >> eventually makes sense? I've already done quite a bit of that and > >> it hasn't > >> pierced my thick skull yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> fieldtrip mailing > >> listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie ldtrip > >> > >> > >> -- > >> ------------------------------------------------------------ > >> > >> 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 > >> > > > > > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > -------------- 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 46, Issue 3 > > **************************************** > > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jingfan.jf at gmail.com Mon Sep 15 19:53:19 2014 From: jingfan.jf at gmail.com (Jing Fan) Date: Mon, 15 Sep 2014 12:53:19 -0500 Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' In-Reply-To: <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> References: <20140910140714.9n2t9bxs008o400c@imap.uni-ulm.de> <2103383764.4690548.1410775262514.JavaMail.root@draco.zimbra.ru.nl> Message-ID: <000301cfd10d$ef53cba0$cdfb62e0$@gmail.com> Hi Barbara and Jim, I added path your/path/to/fieldtrip/utilities and now it worked. Hope it helps solve the problem. Best, Jing -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) Sent: Monday, September 15, 2014 5:01 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' Dear Barbara, The error seems to be related to a bug that pops up now and then (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a corrupt installation of fieldtrip and/or the need to update fieldtrip. Could you please try downloading the most recent version of fieldtrip and see if the problem persists? For an example of what can be expected from this function see: Esser SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. Best, Jim ----- Oorspronkelijk bericht ----- > Van: "barbara schorr" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 10 september 2014 14:07:14 > Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable 'abort' > Dear fieldtripers. > > as mentioned in the subject line I would like to anaylse my timelocked > ERP Data with the function ft_globalmeanfield. > > I get the Error: Undefined function or variable 'abort' > Error in ft_globalmeanfield (line84) > if abort > > in the function it says: > > %the abort variable is set to true or false in ft_preamble_inti > if abort > % do not continue function execution in case the outputfile is > present and the user indicated to keep it > return > end > > > I don't understand what this means. I would really appreciate your > help to get this running. > > Also, what is the result when I run this function on my data? (This > method was proposed from a reviewer. I never used it before, so I > don't exactly know what it does and what the result will look like). > > Thank you very much in advance! > > Best, > > Barbara Schorr > > > > > Zitat von 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: Question regarding nonparametric testing for coherence > > differences (Eric Maris) > > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) > > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) > > 4. Re: ft_rejectvisual: removing trials marked as bad > > (Caspar, Emilie) > > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) > > 6. Latest FT version on ftp-server is from three days ago > > (Holger Krause) > > 7. Re: TRENTOOL pipeline help (Max Cantor) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) > > From: "Eric Maris" > > To: , "'FieldTrip discussion list'" > > > > Subject: Re: [FieldTrip] Question regarding nonparametric testing > > for > > coherence differences > > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> > > Content-Type: text/plain; charset="utf-8" > > > > Dear Hwee Ling, > > > > > > > > In the paper you refer to (Maris et al, JNM, 2007), I did not > > perform a > > cluster-based permutation test at the level of the channel pairs. > > Instead, > > all coherences mentioned in the paper are coherence between a single > > EMG > > channel (2 electrodes mounted on the forearm) and all MEG > > electrodes. Thus, > > there are as many EMG-MEG coherences as there are MEG channels (275 > > in our > > lab), and the clustering of these coherences involves the same > > neighbourhood > > structure as the clustering of channel-specific statistics on power > > or > > evoked response. The analysis you propose involves clustering in a > > much more > > complex space, namely the formed by all (MEG,MEG) channel pairs > > (275*275=75625 pairs). In the early days of cluster-based > > permutation > > statistics, I have worked on this problem but did not pursue it > > because the > > resulting clusters are very hard to interpret. > > > > > > > > Best, > > > > > > > > Eric Maris > > > > > > > > > > > > Dear all and Prof Maris, > > > > I'm re-posting this question again, as I didn't get any replies > > previously. > > > > I?m interested to investigate if there are any differences in phase > > synchronization in resting state data at timepoint 2 versus > > timepoint 1. The > > EEG data was collected using 64 EEG channels, resting state, eyes > > opened and > > eyes closed. I?ve arbitrarily segmented the resting state data into > > epochs > > of 2s each, and the epochs with artifacts are excluded completely > > from > > further analyses. I then performed mtmfft to get the fourier > > representation > > of the data, extracted the coherence, and compared the coherence > > difference > > of timepoint 2 versus timepoint 1 of all channels paired with all > > other > > channels. > > > > I figured that if I extract the connectivity analyses without > > specifying the > > channelcmb, I get a 'chan_chan_freq' dimord variable that would > > allow me to > > perform cluster-based statistical analyses. I get an output with > > ?chan_chan? > > dimord variable. However, I was not 100% sure that this is correct, > > hence, I?ve > > inserted my code (see below). It?ll be great if you could tell me if > > what I?m > > doing makes any sense at all. Also, I don?t know how I can plot the > > results > > to see if it make any sense at all. > > > > Also, I checked the values obtained from when I specified > > "cfg.channelcmb" > > and when I did not specify "cfg.channelcmb", I noticed that the > > values were > > somehow different. I would assume that the values to be similar, > > although > > I'm not sure why they would have differences in the values obtained > > from > > specifying "cfg.channelcmb". > > > > This is my code that I've used thus far: > > > > for sub = 1:5 > > > > cfg = []; > > > > cfg.output = 'fourier'; > > > > cfg.channel = {'all'}; > > > > cfg.method = 'mtmfft'; > > > > cfg.keeptrials = 'yes'; > > > > cfg.tapsmofrq = 5; > > > > cfg.foilim = [0 100]; > > > > cfg.taper = 'dpss'; > > > > % find the index for the c200 condition > > > > pre_c200_idx = find(data5.trialinfo == 201); > > > > cfg.trials = pre_c200_idx; > > > > HLF_pre_c200 = ft_freqanalysis(cfg, data5); > > > > post_c200_idx = find(data5.trialinfo == 200); > > > > cfg.trials = post_c200_idx; > > > > HLF_post_c200 = ft_freqanalysis(cfg, data5); > > > > > > > > cfg = []; > > > > cfg.keeptrials = 'no'; > > > > cfg.channel = {'all'}; > > > > cfg.removemean = 'yes'; > > > > cfg.method = 'coh'; > > > > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_pre_c200); > > > > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, > > HLF_post_c200); > > > > end > > > > > > > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat '); > > > > cfg_neighb.method = 'template'; > > > > cfg_neighb.layout = lay; > > > > cfg_neighb.channel = 'all'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, > > sub_HLF_pre_c200coh{1}); > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.neighbours = neighbours; > > > > cfg.channel = 'all'; > > > > cfg.channelcmb = {cfg.channel, cfg.channel}; > > > > cfg.latency = 'all'; > > > > cfg.avgovertime = 'no'; > > > > cfg.avgoverchan = 'no'; > > > > cfg.parameter = 'cohspctrm'; > > > > cfg.method = 'montecarlo'; > > > > cfg.statistic = 'depsamplesT'; > > > > cfg.correctm = 'cluster'; > > > > cfg.tail = 0; > > > > % cfg.clustertail = 0; > > > > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 > > frequency > > bands. > > > > cfg.numrandomization = 10000; > > > > cfg.ivar = 2; > > > > cfg.uvar = 1; > > > > > > > > % design matrices > > > > clear design; > > > > design(1,:) = [1:5, 1:5]; > > > > design(2,:) = [ones(1,5), ones(1,5) * 2]; > > > > cfg.design = design; > > > > % for theta band > > > > cfg.avgoverfreq = 'yes'; > > > > cfg.frequency = [4 8]; % I also performed the statistics for delta > > (2-4), > > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma > > (30-40), > > and gamma (40-100). > > > > [diffc200_theta_stat] = ft_freqstatistics(cfg, > > sub_HLF_post_c200coh{:}, > > sub_HLF_pre_c200coh{:}); > > > > > > > > When I tried to plot the results, I used this code: > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.layout = 'lay'; > > > > cfg.zlim = [-1 1]; > > > > cfg.alpha = 0.05; > > > > cfg.refchannel = 'all'; > > > > ft_clusterplot(cfg, diffc200_theta_stat); > > > > However, I was not sure how I could plot the results. I get an error > > message > > from Fieldtrip when using ft_clusterplot: > > > > Error using topoplot_common (line 366) > > > > no reference channel is specified > > > > Error in ft_topoplotTFR (line 192) > > > > [cfg] = topoplot_common(cfg, varargin{:}); > > > > Error in ft_clusterplot (line 372) > > > > ft_topoplotTFR(cfgtopo, stat); > > > > > > > > According to your paper in 2007, the topoplot of the results were > > masked by > > the spatio-spectral pattern of the significant clusters. I don't > > know how to > > do this, and I would really appreciate if you can show me how to > > make such a > > plot. > > > > Thank you very much. > > > > Kind regards, > > > > Hweeling > > > > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 2 > > Date: Mon, 8 Sep 2014 21:38:01 +0200 > > From: KatrinH Heimann > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > Dear Joseph, thanks so much, I really appreciate your help. I was > > also > > wandering, if maybe there is another bug in my code. > > Our nets are 128 channels, Hydrocel, but as a colleague of me > > adviced me to > > do so, I also tried the 129 layout. > > My code you find below (without selection of bad channels etc.) > > If you need also the data of two subjects to have a look, let me > > know!!! > > Best and thanks really! > > Katrin > > > > > > subject=input('Which subject do you want to analyse? ','s'); > > > > name = strcat(subject,'.raw'); > > > > subjectnumber=input('Which is the subjectnumber?', 's'); > > > > sb=subjectnumber > > > > %subjectnumber = strcat(subjectnumber, '.txt') > > > > %% > > > > > > cfg = []; > > > > cfg.dataset = name; > > > > cfg.trialfun = 'ft_trialfun_general'; % this is the default > > > > cfg.trialdef.eventtype = 'trigger'; > > > > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > > trigger > > > > cfg.trialdef.prestim = 0.234; % in seconds > > > > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > > observation, but maybe we need less) > > > > cfg = ft_definetrial(cfg); > > > > > > cfg.trl([1:7],:) = []; > > > > > > %change timeline according to constant offset of 16 ms = 8 samples > > (because > > recorded with 500 hz)in > > > > %structure trial > > > > cfg.trl(:,3)=cfg.trl(:,3)-8 > > > > > > %change timeline to make the cut the zeropoint > > > > > > cfg.trl(:,3)=cfg.trl(:,3)- 1000; > > > > > > > > %% preprocess data > > > > cfg.channel = 'all'; > > > > cfg.preproc.detrend = 'yes'; > > > > cfg.preproc.demean = 'yes'; > > > > cfg.preproc.baselinewindow = [-2.1 -2.0] > > > > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > > filtered > > > > %(0.1-45) and bad channels have to be replaced!!!! > > > > %cfg.preproc.bpfreq = [6 32]; > > > > % > > > > % > > > > obs_data = ft_preprocessing(cfg); > > > > % > > > > save (strcat(sb,'obs_data') , 'obs_data') > > > > > > %% determining channel neighbours (necessary for Artifact detection) > > > > cfg = []; > > > > cfg.channel = obs_data.label; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.feedback = 'yes'; > > > > lay = ft_prepare_layout(cfg); > > > > > > > > cfg_neighb = []; > > > > cfg_neighb.feedback = 'yes'; > > > > > > cfg_neighb.method = 'triangulation'; > > > > cfg_neighb.layout = 'GSN128.sfp'; > > > > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > obs_data.elec = ft_read_sens('GSN128.sfp'); > > > > > > %% Artifacts - to detect bad channels - is not saved!!! > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs_data_try = ft_rejectvisual(cfg, obs_data); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_try = ft_rejectartifact (cfg,obs_data); > > > > > > > > %% Preparing neighbours for channel repair - but bad channel info > > in!!! > > > > > > % cfg_neighb = []; > > > > % cfg_neighb.feedback = 'yes'; > > > > % cfg_neighb.method = 'triangulation'; > > > > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > > > > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > > > > > > % Interpolate and put into new data structure > > > > cfg = []; > > > > cfg.badchannel = {}; > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.method = 'nearest'; > > > > cfg.neighbours = neighbours; > > > > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > > > > > > % Check reconstruction > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > % dat1=obs_data; > > > > % dat2=obs_data_channelrepaired; > > > > % > > > > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > > > > % y=dat2.trial{1}(62,:); > > > > % plot(x);hold on;plot(y,'r'); > > > > % > > > > % x=dat1.trial{1}(72,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > % > > > > % x=dat1.trial{1}(75,:); > > > > % y=dat2.trial{1}(75,:); > > > > % figure; > > > > % plot(x);hold on;plot(y,'r') > > > > %% artifact rejection/trial inspection - throw out electrode jumps > > etc. > > > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs_data_channelrepaired); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > > > > > > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > > according to > > channels interpolated %% 128-number of interp. channels) > > > > > > > > cfg = []; > > > > cfg.channel = {'all'}; > > > > cfg.numcomponent = 128 > > > > comp = ft_componentanalysis(cfg,obs_data_clean1); > > > > save (strcat(sb,'comp_all') , 'comp') > > > > > > %% > > > > cfg = []; > > > > cfg.viewmode = 'component'; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='some'; > > > > cfg.layout = 'GSN128.sfp'; > > > > ft_databrowser(cfg,comp); > > > > > > %% poweranalysis components > > > > cfg = []; > > > > cfg.output = 'pow'; > > > > cfg.channel = 'all';%compute the power spectrum in all ICs > > > > cfg.method = 'mtmfft'; > > > > cfg.taper = 'hanning'; > > > > cfg.foi = 0:0.2:50; > > > > obs_freq = ft_freqanalysis(cfg, comp); > > > > > > %And you can plot the spectra: > > > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > nsubplots = 16; > > > > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > > decimals, type > > doc subplot > > > > > > Nfigs = ceil(size(comp.topo,1)/nsubplots); > > > > tot = Nfigs*nsubplots; > > > > > > rptvect = 1:size(comp.topo,1); > > > > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > > > > rptvect = reshape(rptvect,nsubplots,Nfigs)'; > > > > > > for r=1:size(rptvect,1); > > > > figure;set(gcf,'units','normalized','outerposition',[0 0 1 > > 1]);%full > > screen > > > > k=0; > > > > for j=1:size(rptvect,2); > > > > if~(rptvect(r,j)==0); > > > > k=k+1; > > > > cfg=[]; > > > > cfg.channel = rptvect(r,j); > > > > cfg.ylim =[0 500] > > > > cfg.xlim =[0 50] > > > > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > > > > end > > > > end > > > > end > > > > > > %For the IC topos you'll follow the same logic as above but with: > > > > > > figure > > > > cfg = []; > > > > cfg.component = [1:20]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [21:40]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [41:60]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > figure > > > > cfg = []; > > > > cfg.component = [61:80]; % specify the component(s) that should be > > plotted > > > > cfg.layout = 'GSN128.sfp'; > > > > cfg.comment = 'no'; > > > > ft_topoplotIC(cfg, comp) > > > > > > > > > > > > > > %% Seperate observation conditions > > > > > > name1= strcat(num2str(sb),'_90.xls'); > > > > list1=xlsread (name1) > > > > > > > > > > > > name2= strcat(num2str(sb),'_180.xls'); > > > > list2=xlsread (name2) > > > > > > > > % > > > > > > cfg = [] > > > > cfg.trials = [list1] > > > > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > cfg = [] > > > > cfg.trials = [list2] > > > > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > > > > > > %%PIPELINE FOR obs90 > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128; > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > > > comp_1 = ft_componentanalysis(cfg, obs90_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > > obs90_data); > > > > > > > > > > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > > > > > > > > > > %% Artifacts - final detection > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs90_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > > > > > > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > > > > > > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > > > > > > %% plot it > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP) > > > > > > > > > > > > > > > > %% PIPELINE FOR obs180 > > > > > > > > %% Decompose original data according to the components found before > > > > load (strcat(sb,'comp_all')) > > > > > > cfg = []; > > > > cfg.numcomponent = 128 > > > > cfg.unmixing = comp.unmixing; > > > > cfg.topolabel = comp.topolabel; > > > > comp_2 = ft_componentanalysis(cfg, obs180_data); > > > > > > > > %% Reject component > > > > cfg = []; > > > > cfg.component = []; > > > > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > > obs180_data); > > > > > > > > > > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > > > > > > > > > > %% Artifacts final 180 > > > > > > > > cfg.method = 'summary'; > > > > cfg.latency=[0 1]; > > > > cfg.layout = 'GSN128.sfp'; % this allows for plotting > > > > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > > > > > > cfg = []; > > > > cfg.viewmode = 'vertical'; > > > > cfg.latency=[0 1]; > > > > cfg.continuous = 'no'; > > > > cfg.plotlabels='yes' > > > > cfg = ft_databrowser(cfg,obs180_data_clean3); > > > > %cfg.artfctdef.reject = 'complete'; > > > > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > > > > > > > > % Save clean data > > > > > > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > > > > > > > > %% Rereferencing data > > > > cfg = []; > > > > cfg.channel = 'all'; > > > > cfg.preproc.reref = 'yes'; > > > > cfg.preproc.refchannel = 'all'; > > > > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > > > > > > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > > > > %% Snap out smaller pieces (the third second) > > > > > > cfg = [] > > > > cfg.toilim = [0 1] > > > > > > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > > > > > > %% TIMELOCK ERP > > > > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > > > > > > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > > > > > > %% plot 180 ERP > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, obs180_data_ERP) > > > > > > %% plot both ERPs > > > > > > cfg = []; > > > > cfg.layout = lay ; > > > > cfg.interactive = 'yes'; > > > > cfg.showlabels = 'yes'; > > > > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > > > > > > %% plot difference wave > > > > > > difference = obs180_data_ERP; % copy one of the > > structures > > > > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute > > the > > difference ERP > > > > > > > > cfg = []; > > > > cfg.layout = lay; > > > > cfg.interactive = 'yes'; > > > > ft_multiplotER(cfg, difference) > > > > 2014-09-07 7:53 GMT+02:00 Joseph Dien : > > > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI > >> data. A couple things. First of all, exactly which net do you use? > >> If > >> they are 129-channel, there is still the question of whether they > >> are the > >> Hydrocel or the older geodesic nets. Regardless, that shouldn't > >> cause an > >> error like this. Could you send me the file you are trying to > >> process and > >> the script you are using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < > >> diezmartini at gmail.com> wrote: > >> > >> Which nets do you use? I use EGI. I tried both the ones you mention > >> and > >> they didn't work. It was hard to find that exact one online but it > >> was the > >> only file that actually worked. > >> > >> > >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >> > >> wrote: > >> > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. > >>> Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one > >>> > >>>> I use > >>>> > >>>> > >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < > >>>> katrinheimann at gmail.com> wrote: > >>>> > >>>>> Dear all, my problems seem neverending. This time however i > >>>>> really need > >>>>> help. > >>>>> I implemented a pipeline for ERPs. All works now, > >>>>> trialdefinition, > >>>>> preprocessing, channelreplacement, ica, componentrejection, > >>>>> final > >>>>> artifactdetection, timelock of the single subject data. However, > >>>>> when I > >>>>> wanna compute the grandaverage of the single subjects I get the > >>>>> following > >>>>> error message: > >>>>> > >>>>> computing average of avg over 19 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 3 MB > >>>>> computing average of avg over 2 subjects > >>>>> Warning: discarding electrode information because it cannot be > >>>>> averaged > >>>>> > In ft_timelockgrandaverage at 249 > >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and > >>>>> required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_prepare_layout" took 0 seconds and required the > >>>>> additional allocation of an estimated 0 MB > >>>>> the call to "ft_topoplotER" took 0 seconds and required the > >>>>> additional > >>>>> allocation of an estimated 0 MB > >>>>> > >>>>> Furthermore in the plot of the significant clusters, the > >>>>> channelnames > >>>>> are mixed up (do not correspond to my net) > >>>>> > >>>>> > >>>>> I guess that there is a problem with the layout I use. > >>>>> Here the code that I use > >>>>> > >>>>> %For generating the layout (also in the single subjects): > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = obs_data.label; > >>>>> > >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>>>> > >>>>> cfg.feedback = 'yes'; > >>>>> > >>>>> lay = ft_prepare_layout(cfg); > >>>>> > >>>>> > >>>>> cfg_neighb = []; > >>>>> > >>>>> cfg_neighb.feedback = 'yes'; > >>>>> > >>>>> cfg_neighb.method = 'triangulation'; > >>>>> > >>>>> cfg_neighb.layout = lay; > >>>>> > >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>>>> > >>>>> > >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>>>> > >>>>> > >>>>> %For computing the grand average > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.channel = 'all'; > >>>>> > >>>>> cfg.latency = 'all'; > >>>>> > >>>>> cfg.parameter = 'avg'; > >>>>> > >>>>> cfg.keepindividual = 'no' > >>>>> > >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>>>> > >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>>>> > >>>>> % "{:}" means to use data from all elements of the variable > >>>>> > >>>>> > >>>>> For plotting the significant clusters > >>>>> > >>>>> cfg = []; > >>>>> > >>>>> cfg.style = 'blank'; > >>>>> > >>>>> cfg.layout = lay; > >>>>> > >>>>> cfg.channellabels = 'yes'; > >>>>> > >>>>> cfg.highlight = 'labels'; > >>>>> > >>>>> cfg.highlightchannel = find(stat.mask); > >>>>> > >>>>> cfg.comment = 'no'; > >>>>> > >>>>> figure; ft_topoplotER(cfg, GA_90) > >>>>> > >>>>> title('Nonparametric: significant with cluster multiple > >>>>> comparison > >>>>> correction') > >>>>> > >>>>> > >>>>> Do you have ANY idea to this? I am really completely > >>>>> helpless.... > >>>>> > >>>>> thanks and best > >>>>> > >>>>> Katrin > >>>>> > >>>>> _______________________________________________ > >>>>> 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 > >>> > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> > >> ---------------------------------------------------------------------------- ---- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.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: > > > > > > ------------------------------ > > > > Message: 3 > > Date: Mon, 08 Sep 2014 21:55:44 -0400 > > From: Joseph Dien > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! > > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> > > Content-Type: text/plain; charset="windows-1252" > > > > yes, please do send me the data. > > > > Thanks! > > > > Joe > > > > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann > > wrote: > > > >> Dear Joseph, thanks so much, I really appreciate your help. I was > >> also wandering, if maybe there is another bug in my code. > >> Our nets are 128 channels, Hydrocel, but as a colleague of me > >> adviced me to do so, I also tried the 129 layout. > >> My code you find below (without selection of bad channels etc.) > >> If you need also the data of two subjects to have a look, let me > >> know!!! > >> Best and thanks really! > >> Katrin > >> > >> > >> > >> subject=input('Which subject do you want to analyse? ','s'); > >> > >> name = strcat(subject,'.raw'); > >> > >> subjectnumber=input('Which is the subjectnumber?', 's'); > >> > >> sb=subjectnumber > >> > >> %subjectnumber = strcat(subjectnumber, '.txt') > >> > >> %% > >> > >> > >> > >> cfg = []; > >> > >> cfg.dataset = name; > >> > >> cfg.trialfun = 'ft_trialfun_general'; % this is the default > >> > >> cfg.trialdef.eventtype = 'trigger'; > >> > >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus > >> trigger > >> > >> cfg.trialdef.prestim = 0.234; % in seconds > >> > >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video > >> observation, but maybe we need less) > >> > >> cfg = ft_definetrial(cfg); > >> > >> > >> > >> cfg.trl([1:7],:) = []; > >> > >> > >> > >> %change timeline according to constant offset of 16 ms = 8 samples > >> (because recorded with 500 hz)in > >> > >> %structure trial > >> > >> cfg.trl(:,3)=cfg.trl(:,3)-8 > >> > >> > >> > >> %change timeline to make the cut the zeropoint > >> > >> > >> > >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; > >> > >> > >> > >> > >> > >> %% preprocess data > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.detrend = 'yes'; > >> > >> cfg.preproc.demean = 'yes'; > >> > >> cfg.preproc.baselinewindow = [-2.1 -2.0] > >> > >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already > >> filtered > >> > >> %(0.1-45) and bad channels have to be replaced!!!! > >> > >> %cfg.preproc.bpfreq = [6 32]; > >> > >> % > >> > >> % > >> > >> obs_data = ft_preprocessing(cfg); > >> > >> % > >> > >> save (strcat(sb,'obs_data') , 'obs_data') > >> > >> > >> > >> %% determining channel neighbours (necessary for Artifact > >> detection) > >> > >> cfg = []; > >> > >> cfg.channel = obs_data.label; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.feedback = 'yes'; > >> > >> lay = ft_prepare_layout(cfg); > >> > >> > >> cfg_neighb = []; > >> > >> cfg_neighb.feedback = 'yes'; > >> > >> > >> > >> cfg_neighb.method = 'triangulation'; > >> > >> cfg_neighb.layout = 'GSN128.sfp'; > >> > >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> obs_data.elec = ft_read_sens('GSN128.sfp'); > >> > >> > >> > >> %% Artifacts - to detect bad channels - is not saved!!! > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs_data_try = ft_rejectvisual(cfg, obs_data); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_try = ft_rejectartifact (cfg,obs_data); > >> > >> > >> > >> > >> > >> %% Preparing neighbours for channel repair - but bad channel info > >> in!!! > >> > >> > >> > >> % cfg_neighb = []; > >> > >> % cfg_neighb.feedback = 'yes'; > >> > >> % cfg_neighb.method = 'triangulation'; > >> > >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; > >> > >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >> > >> > >> > >> % Interpolate and put into new data structure > >> > >> cfg = []; > >> > >> cfg.badchannel = {}; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.method = 'nearest'; > >> > >> cfg.neighbours = neighbours; > >> > >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) > >> > >> > >> > >> % Check reconstruction > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> % dat1=obs_data; > >> > >> % dat2=obs_data_channelrepaired; > >> > >> % > >> > >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 > >> > >> % y=dat2.trial{1}(62,:); > >> > >> % plot(x);hold on;plot(y,'r'); > >> > >> % > >> > >> % x=dat1.trial{1}(72,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> % > >> > >> % x=dat1.trial{1}(75,:); > >> > >> % y=dat2.trial{1}(75,:); > >> > >> % figure; > >> > >> % plot(x);hold on;plot(y,'r') > >> > >> %% artifact rejection/trial inspection - throw out electrode jumps > >> etc. > >> > >> > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); > >> > >> > >> > >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent > >> according to channels interpolated %% 128-number of interp. > >> channels) > >> > >> > >> cfg = []; > >> > >> cfg.channel = {'all'}; > >> > >> cfg.numcomponent = 128 > >> > >> comp = ft_componentanalysis(cfg,obs_data_clean1); > >> > >> save (strcat(sb,'comp_all') , 'comp') > >> > >> > >> > >> %% > >> > >> cfg = []; > >> > >> cfg.viewmode = 'component'; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='some'; > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> ft_databrowser(cfg,comp); > >> > >> > >> > >> %% poweranalysis components > >> > >> cfg = []; > >> > >> cfg.output = 'pow'; > >> > >> cfg.channel = 'all';%compute the power spectrum in all ICs > >> > >> cfg.method = 'mtmfft'; > >> > >> cfg.taper = 'hanning'; > >> > >> cfg.foi = 0:0.2:50; > >> > >> obs_freq = ft_freqanalysis(cfg, comp); > >> > >> > >> > >> %And you can plot the spectra: > >> > >> > >> > >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > >> > >> nsubplots = 16; > >> > >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain > >> decimals, type doc subplot > >> > >> > >> > >> Nfigs = ceil(size(comp.topo,1)/nsubplots); > >> > >> tot = Nfigs*nsubplots; > >> > >> > >> > >> rptvect = 1:size(comp.topo,1); > >> > >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); > >> > >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; > >> > >> > >> > >> for r=1:size(rptvect,1); > >> > >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 > >> 1]);%full screen > >> > >> k=0; > >> > >> for j=1:size(rptvect,2); > >> > >> if~(rptvect(r,j)==0); > >> > >> k=k+1; > >> > >> cfg=[]; > >> > >> cfg.channel = rptvect(r,j); > >> > >> cfg.ylim =[0 500] > >> > >> cfg.xlim =[0 50] > >> > >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); > >> > >> end > >> > >> end > >> > >> end > >> > >> > >> > >> %For the IC topos you'll follow the same logic as above but with: > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [1:20]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [21:40]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [41:60]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> figure > >> > >> cfg = []; > >> > >> cfg.component = [61:80]; % specify the component(s) that > >> should be plotted > >> > >> cfg.layout = 'GSN128.sfp'; > >> > >> cfg.comment = 'no'; > >> > >> ft_topoplotIC(cfg, comp) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% Seperate observation conditions > >> > >> > >> > >> name1= strcat(num2str(sb),'_90.xls'); > >> > >> list1=xlsread (name1) > >> > >> > >> > >> name2= strcat(num2str(sb),'_180.xls'); > >> > >> list2=xlsread (name2) > >> > >> > >> % > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list1] > >> > >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> cfg = [] > >> > >> cfg.trials = [list2] > >> > >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) > >> > >> > >> > >> %%PIPELINE FOR obs90 > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128; > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> > >> > >> comp_1 = ft_componentanalysis(cfg, obs90_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, > >> obs90_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts - final detection > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs90_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); > >> > >> > >> > >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') > >> > >> > >> > >> %% plot it > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP) > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> %% PIPELINE FOR obs180 > >> > >> > >> > >> > >> > >> %% Decompose original data according to the components found before > >> > >> load (strcat(sb,'comp_all')) > >> > >> > >> > >> cfg = []; > >> > >> cfg.numcomponent = 128 > >> > >> cfg.unmixing = comp.unmixing; > >> > >> cfg.topolabel = comp.topolabel; > >> > >> comp_2 = ft_componentanalysis(cfg, obs180_data); > >> > >> > >> > >> > >> > >> %% Reject component > >> > >> cfg = []; > >> > >> cfg.component = []; > >> > >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, > >> obs180_data); > >> > >> > >> > >> > >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') > >> > >> > >> > >> > >> > >> > >> > >> %% Artifacts final 180 > >> > >> > >> > >> > >> > >> cfg.method = 'summary'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.layout = 'GSN128.sfp'; % this allows for plotting > >> > >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); > >> > >> > >> > >> cfg = []; > >> > >> cfg.viewmode = 'vertical'; > >> > >> cfg.latency=[0 1]; > >> > >> cfg.continuous = 'no'; > >> > >> cfg.plotlabels='yes' > >> > >> cfg = ft_databrowser(cfg,obs180_data_clean3); > >> > >> %cfg.artfctdef.reject = 'complete'; > >> > >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); > >> > >> > >> > >> > >> > >> % Save clean data > >> > >> > >> > >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') > >> > >> > >> > >> > >> > >> %% Rereferencing data > >> > >> cfg = []; > >> > >> cfg.channel = 'all'; > >> > >> cfg.preproc.reref = 'yes'; > >> > >> cfg.preproc.refchannel = 'all'; > >> > >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) > >> > >> > >> > >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') > >> > >> %% Snap out smaller pieces (the third second) > >> > >> > >> > >> cfg = [] > >> > >> cfg.toilim = [0 1] > >> > >> > >> > >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) > >> > >> > >> > >> %% TIMELOCK ERP > >> > >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); > >> > >> > >> > >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') > >> > >> > >> > >> %% plot 180 ERP > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, obs180_data_ERP) > >> > >> > >> > >> %% plot both ERPs > >> > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay ; > >> > >> cfg.interactive = 'yes'; > >> > >> cfg.showlabels = 'yes'; > >> > >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) > >> > >> > >> > >> %% plot difference wave > >> > >> > >> > >> difference = obs180_data_ERP; % copy one of > >> the structures > >> > >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % > >> compute the difference ERP > >> > >> > >> cfg = []; > >> > >> cfg.layout = lay; > >> > >> cfg.interactive = 'yes'; > >> > >> ft_multiplotER(cfg, difference) > >> > >> > >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : > >> Hi, > >> I?m one of the main Fieldtrip contributors working on supporting > >> EGI data. A couple things. First of all, exactly which net do > >> you use? If they are 129-channel, there is still the question of > >> whether they are the Hydrocel or the older geodesic nets. > >> Regardless, that shouldn't cause an error like this. Could you > >> send me the file you are trying to process and the script you are > >> using and I?ll try troubleshooting it. > >> > >> Joe > >> > >> > >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini > >> wrote: > >> > >>> Which nets do you use? I use EGI. I tried both the ones you > >>> mention and they didn't work. It was hard to find that exact one > >>> online but it was the only file that actually worked. > >>> > >>> > >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann > >>> wrote: > >>> Dear Ana, dear all, > >>> the layout you used does not correspond to our nets. I tried the > >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't > >>> work. Please can anybody help? > >>> Cheers > >>> Katrin > >>> > >>> > >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini > >>> : > >>> > >>> Try this one I use > >>> > >>> > >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann > >>> wrote: > >>> Dear all, my problems seem neverending. This time however i really > >>> need help. > >>> I implemented a pipeline for ERPs. All works now, trialdefinition, > >>> preprocessing, channelreplacement, ica, componentrejection, final > >>> artifactdetection, timelock of the single subject data. However, > >>> when I wanna compute the grandaverage of the single subjects I get > >>> the following error message: > >>> > >>> computing average of avg over 19 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 3 MB > >>> computing average of avg over 2 subjects > >>> Warning: discarding electrode information because it cannot be > >>> averaged > >>> > In ft_timelockgrandaverage at 249 > >>> the call to "ft_timelockgrandaverage" took 0 seconds and required > >>> the additional allocation of an estimated 0 MB > >>> the call to "ft_prepare_layout" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> the call to "ft_topoplotER" took 0 seconds and required the > >>> additional allocation of an estimated 0 MB > >>> > >>> Furthermore in the plot of the significant clusters, the > >>> channelnames are mixed up (do not correspond to my net) > >>> > >>> > >>> I guess that there is a problem with the layout I use. > >>> Here the code that I use > >>> > >>> %For generating the layout (also in the single subjects): > >>> cfg = []; > >>> > >>> cfg.channel = obs_data.label; > >>> > >>> cfg.layout = 'GSN-HydroCel-129.sfp'; > >>> > >>> cfg.feedback = 'yes'; > >>> > >>> lay = ft_prepare_layout(cfg); > >>> > >>> > >>> cfg_neighb = []; > >>> > >>> cfg_neighb.feedback = 'yes'; > >>> > >>> cfg_neighb.method = 'triangulation'; > >>> > >>> cfg_neighb.layout = lay; > >>> > >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); > >>> > >>> > >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); > >>> > >>> > >>> > >>> %For computing the grand average > >>> > >>> cfg = []; > >>> > >>> cfg.channel = 'all'; > >>> > >>> cfg.latency = 'all'; > >>> > >>> cfg.parameter = 'avg'; > >>> > >>> cfg.keepindividual = 'no' > >>> > >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); > >>> > >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); > >>> > >>> % "{:}" means to use data from all elements of the variable > >>> > >>> > >>> For plotting the significant clusters > >>> > >>> cfg = []; > >>> > >>> cfg.style = 'blank'; > >>> > >>> cfg.layout = lay; > >>> > >>> cfg.channellabels = 'yes'; > >>> > >>> cfg.highlight = 'labels'; > >>> > >>> cfg.highlightchannel = find(stat.mask); > >>> > >>> cfg.comment = 'no'; > >>> > >>> figure; ft_topoplotER(cfg, GA_90) > >>> > >>> title('Nonparametric: significant with cluster multiple comparison > >>> correction') > >>> > >>> > >>> > >>> Do you have ANY idea to this? I am really completely helpless.... > >>> > >>> thanks and best > >>> > >>> Katrin > >>> > >>> > >>> _______________________________________________ > >>> 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 > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> ---------------------------------------------------------------------------- ---- > >> > >> Joseph Dien, PhD > >> Research Associate > >> Cognitive Neurology > >> The Johns Hopkins University School of Medicine > >> > >> Lab E-mail: jdien1 at jhmi.edu > >> Private E-mail: jdien07 at mac.com > >> Office Phone: 410-614-3115 > >> Cell Phone: 202-297-8117 > >> Fax: 410-955-0188 > >> http://joedien.com > >> > >> > >> _______________________________________________ > >> 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 > > > > ---------------------------------------------------------------------------- ---- > > > > Joseph Dien, PhD > > Research Associate > > Cognitive Neurology > > The Johns Hopkins University School of Medicine > > > > Lab E-mail: jdien1 at jhmi.edu > > Private E-mail: jdien07 at mac.com > > Office Phone: 410-614-3115 > > Cell Phone: 202-297-8117 > > Fax: 410-955-0188 > > http://joedien.com > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 4 > > Date: Tue, 9 Sep 2014 06:37:13 +0000 > > From: "Caspar, Emilie" > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > > bad > > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> > > Content-Type: text/plain; charset="iso-8859-1" > > > > Hi Ashley, > > > > Maybe the mistake is you did not integrate in your script the > > command to save the rejection. Normally, with the following command, > > you will see in the Matlab Window that artifacts are correctly > > rejected after the "quit" button. > > > > clean_data = ft_rejectvisual(cfg, interpoldata); > > cfg.artfctdef.reject = 'complete'; > > cfg.artfctdef.feedback = 'yes'; > > cleandata = ft_rejectartifact(cfg,clean_data); > > > > Emilie > > > > > > > > > > > > Le 3 sept. 2014 ? 11:58, Ashley Greene > > > a ?crit : > > > > Hello, > > > > I have used the rejectvisual function in attempt to remove bad > > trials, but after marking them and pressing the quit button, > > although the command window states that the selected trials have > > been removed, there is no obvious change in the data; all of the > > trials are still intact. Have I overlooked something? > > > > Thanks, > > > > Ashley > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > > > > > > ------------------------------ > > > > Message: 5 > > Date: Tue, 09 Sep 2014 14:16:20 +0200 > > From: Patricia Wollstadt > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: <540EEF94.9080601 at gmx.de> > > Content-Type: text/plain; charset="windows-1252" > > > > Hello Max, > > > > I added a few comments to the questions regarding individual > > parameters > > below. To address the general problem of TRENTOOL telling you, that > > there are not enough sample points in your data: From what I can see > > in > > your script, you probably don't have enough data points in each time > > series to robustly estimate TE. You analyze 800 ms of data sampled > > at > > 300 Hz, which gives you 240 samples per time series. Can you maybe > > avoid > > downsampling to 300 Hz and downsample to 600 Hz instead? Or could > > you > > analyze a longer time window of interest? > > Note that you also 'lose' data to embedding and the interaction > > delay: > > The first point that can be used for TE estimation is at max. > > embedding > > length + max. interaction delay in samples. For example: max. > > embedding > > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the > > max > > interaction delay of 30 ms = 9 samples. In this example, you would > > be > > left with 240 - 29 samples for TE estimation per trial. There is > > also > > the possibility to estimate time resolved TE/TE for shorter time > > windows > > of interest (see section 4.4 in the manual); however, this method > > requires the use of a GPU for TE estimation. > > > > I would further recommend to use the new pipeline for group > > statistics > > described in the manual in section 4.5 (the function > > 'TEgroup_calculate' > > is deprecated). The new pipeline allows you to reconstruct the > > interaction delay and uses the following functions (see also > > comments in > > the script): > > > > TEgroup_prepare -> prepares all data sets (all subjects/all > > conditions) for group analysis (this means finding common embedding > > parameters such that estimates are not biased between groups) > > InteractionDelayReconstruction_calculate -> estimates TE for > > individual data sets and all assumed interaction delays u > > InteractionDelayReconstruction_analyze -> reconstructs the > > interaction delay by selecting the u that maximizes TE for each > > channel > > TEgroup_stats -> calculate group statistics using a permutation test > > > > I can send you an example script for group TE analysis using this > > pipeline to get you started. I hope this helps you to get the group > > analysis running. Just write again if you're having trouble setting > > up > > the pipeline or something is not clear about the parameters/my > > comments. > > > > Best, > > Patricia > > > > > > > > > > On 09/04/2014 08:30 PM, Max Cantor wrote: > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not > >> 100% sure if it is appropriate to ask questions about it here, but > >> to > >> the best of my knowledge they do not have a mailing list and I saw > >> a > >> few trentool questions in the archives, so I'm going to assume it's > >> ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present > >> in the pipeline. Sorry in advance for the long post! Any help would > >> be > >> greatly appreciated as I'm a bit over my head on this but I think > >> I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data > >> that was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi is > >> in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within the toi, but beyond that are there any benefits to it being > >> earlier or later?* PW: The predictiontime_u is in milliseconds and > >> the > >> toi is in seconds. The prediction time is the assumed interaction > >> delay between your two sources and should fit within your toi. In > >> general it is preferable to use the method for interaction delay > >> reconstruction for TE estimation, because it allows you to > >> reconstruct > >> the actual delay between your source and target times series. A > >> non-optimal u/interaction delay may cause an underestimation of TE, > >> so > >> it is recommended to use the pipeline for interaction delay > >> reconstruction whenever estimating TE for unknown delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, so it is best to limit the u range to values that are > >> physiologically plausible. > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the > >> sample rate and filters are used to determine the actthrvalue, but > >> I > >> don't actually know the calculation. 7.5 was a rough guess just to > >> test the pipeline. I'm also uncertain of what minnrtrials should > >> be.* > >> PW: You can set the actthrvalue based on the filtering you did > >> prior > >> to TE analysis. If you for example highpass filtered at 10 Hz, you > >> shouldn't find an ACT higher than 30 samples, because you filtered > >> out > >> any components of the signal slower than 10 Hz/30 samples (given > >> your > >> sampling frequency of 300 Hz). So in this scenario the actthrvalue > >> would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> * > >> * > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm > >> yet to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* > >> PW: The Ragwitz criterion tries to find optimal embedding > >> parameters > >> dim and tau for the data. To do that, the method iteratively takes > >> all > >> possible combinations of dim and tau values that are provided in > >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well > >> these > >> combinations embed the data. To test an embedding, the method > >> builds > >> the embedding vectors from the data; it then tests for each point > >> how > >> well the next point in time can be predicted from the reference > >> point's nearest neighbours. So for each embedded point, the method > >> searches for the nearest neighbours and calculates the average of > >> those nearest neighbours. The difference between the > >> averaged/predicted point and the actual next point is the error of > >> the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested > >> by the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together with 'ragtausteps' specifies the tau values to be tested > >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, > >> that > >> the values here are factors that are later multiplied with the ACT > >> to > >> obtain the actual tau. 'repPred' is the number of points that will > >> be > >> used for the local prediction, i.e. the Ragwitz criterion will test > >> the local prediction and calculate the error for the first 100 > >> points > >> in your time series. The two parameters 'flagNei' ans 'sizeNei' > >> below > >> specify the type of neighbour search conducted by the Ragwitz > >> criterion: 'flagNei' tells the method to either conduct a kNN or > >> range > >> search; 'sizeNei' specifies the number of neighbours or the radius > >> to > >> be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> * > >> * > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> * > >> * > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.*TRENTOOL seems to handle data output very differently > >> from > >> fieldtrip and I've had trouble thinking through the most logical > >> way > >> to handle the data so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> * > >> * > >> *For clarification, fileCell is a cell with the name of each > >> condition > >> x subject .mat file, which as I said before is collectively the > >> same > >> as the 3 x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> * > >> * > >> *At this step I get the following error: > >> > >> Error using transferentropy (line 337) > >> \nTRENTOOL ERROR: not enough data points left after embedding > >> > >> Error in TEgroup_calculate (line 133) > >> [TEresult] = transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate > >> is a pipeline issue* (I noticed the example pipeline in trentool, > >> the > >> manual, and published methods articles all seem to have slightly or > >> significantly different pipeline compositions), *or if the error > >> is* > >> due to ACT, ragwitz optimization, or some other faulty > >> parameterization *on my part due to a lack of understanding of how > >> transfer entropy works on a more theoretical/mathematical level*. > >> If > >> the latter is the case, is there any relatively straightforward way > >> to > >> conceptualize this, or is this something where I'm just going to > >> have > >> to keep reading and rereading until it eventually makes sense? I've > >> already done quite a bit of that and it hasn't pierced my thick > >> skull > >> yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> 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: > > > > > > ------------------------------ > > > > Message: 6 > > Date: Tue, 9 Sep 2014 15:21:20 +0200 > > From: Holger Krause > > To: FieldTrip discussion list > > Subject: [FieldTrip] Latest FT version on ftp-server is from three > > days ago > > Message-ID: > > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> > > Content-Type: text/plain; charset="us-ascii" > > > > Dear developers, > > > > Could you please check the process for creation/publication of > > zip-files on > > the FTP server? The latest file I can find there is > > fieldtrip-20140906.zip. > > > > Thanks in advance, > > > > Holger > > > > > > ------------------------------ > > > > Message: 7 > > Date: Tue, 9 Sep 2014 09:19:55 -0400 > > From: Max Cantor > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] TRENTOOL pipeline help > > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > > > This is immensely helpful, thank you. I was very confused about why > > some > > versions of the pipeline I saw were using group calculate and others > > were > > using interaction delay reconstruction and what that meant, and I > > think I > > have a more clear idea of what the different steps of the pipeline > > are > > doing. There are still a few things I'm a bit confused about though > > in > > terms of the pipeline. For instance, whether or not I need to do > > TEprepare > > before group prepare, and if I need to do graph analysis (which I'm > > not > > sure I fully understand but also haven't looked deeply into) before > > group > > stats. > > > > If you don't mind me taking you up on your offer, I think seeing > > your > > example script might help clarify some of these issues. > > > > Thank you! > > > > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < > > Patricia.Wollstadt at gmx.de> wrote: > > > >> Hello Max, > >> > >> I added a few comments to the questions regarding individual > >> parameters > >> below. To address the general problem of TRENTOOL telling you, that > >> there > >> are not enough sample points in your data: From what I can see in > >> your > >> script, you probably don't have enough data points in each time > >> series to > >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, > >> which > >> gives you 240 samples per time series. Can you maybe avoid > >> downsampling to > >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a > >> longer time > >> window of interest? > >> Note that you also 'lose' data to embedding and the interaction > >> delay: The > >> first point that can be used for TE estimation is at max. embedding > >> length > >> + max. interaction delay in samples. For example: max. embedding > >> length = > >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max > >> interaction > >> delay of 30 ms = 9 samples. In this example, you would be left with > >> 240 - > >> 29 samples for TE estimation per trial. There is also the > >> possibility to > >> estimate time resolved TE/TE for shorter time windows of interest > >> (see > >> section 4.4 in the manual); however, this method requires the use > >> of a GPU > >> for TE estimation. > >> > >> I would further recommend to use the new pipeline for group > >> statistics > >> described in the manual in section 4.5 (the function > >> 'TEgroup_calculate' is > >> deprecated). The new pipeline allows you to reconstruct the > >> interaction > >> delay and uses the following functions (see also comments in the > >> script): > >> > >> TEgroup_prepare -> prepares all data sets (all subjects/all > >> conditions) > >> for group analysis (this means finding common embedding parameters > >> such > >> that estimates are not biased between groups) > >> InteractionDelayReconstruction_calculate -> estimates TE for > >> individual data sets and all assumed interaction delays u > >> InteractionDelayReconstruction_analyze -> reconstructs the > >> interaction delay by selecting the u that maximizes TE for each > >> channel > >> TEgroup_stats -> calculate group statistics using a permutation > >> test > >> > >> I can send you an example script for group TE analysis using this > >> pipeline > >> to get you started. I hope this helps you to get the group analysis > >> running. Just write again if you're having trouble setting up the > >> pipeline > >> or something is not clear about the parameters/my comments. > >> > >> Best, > >> Patricia > >> > >> > >> > >> > >> On 09/04/2014 08:30 PM, Max Cantor wrote: > >> > >> Hi fieldtrippers, > >> > >> I know trentool is not produced by the Donders Institute, so I'm > >> not 100% > >> sure if it is appropriate to ask questions about it here, but to > >> the best > >> of my knowledge they do not have a mailing list and I saw a few > >> trentool > >> questions in the archives, so I'm going to assume it's ok... > >> > >> In any case, below is my current pipeline (slightly modified for > >> comprehensibility): > >> > >> (notes in bold are comments/questions made in this email, not > >> present in > >> the pipeline. Sorry in advance for the long post! Any help would be > >> greatly > >> appreciated as I'm a bit over my head on this but I think I'm > >> close!) > >> > >> ***** > >> > >> % Prepare group TE data > >> > >> cfgP = []; > >> cfgP.Path2TSTOOL = *TSTOOLPATH* > >> cfgP.TEcalctype = 'VW_ds'; > >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; > >> > >> *I'm trying to find the transfer entropy between the left and right > >> auditory cortices in my experiment. The input is virtual sensor > >> data that > >> was produced using SAM in fieldtrip on real MEG data. * > >> > >> % specify u to be scanned > >> > >> cfgP.predicttime_u = 30; > >> cfgP.toi = [-0.4 0.4]; > >> > >> *For clarification, the predicttime_u is in seconds but the toi > >> is in > >> milliseconds. If I understand correctly, the predicttime_u must fit > >> within > >> the toi, but beyond that are there any benefits to it being earlier > >> or > >> later?* PW: The predictiontime_u is in milliseconds and the toi is > >> in > >> seconds. The prediction time is the assumed interaction delay > >> between your > >> two sources and should fit within your toi. In general it is > >> preferable to > >> use the method for interaction delay reconstruction for TE > >> estimation, > >> because it allows you to reconstruct the actual delay between your > >> source > >> and target times series. A non-optimal u/interaction delay may > >> cause an > >> underestimation of TE, so it is recommended to use the pipeline for > >> interaction delay reconstruction whenever estimating TE for unknown > >> delays. > >> If you use the methods for interaction delay reconstruction > >> 'predicttime_u' is replaced by > >> cfgTEP.predicttimemin_u % minimum u to be scanned > >> cfgTEP.predicttimemax_u % maximum u to be scanned > >> cfgTEP.predicttimestepsize % time steps between u to be scanned > >> A large range for u values to be scanned increases computing time a > >> lot, > >> so it is best to limit the u range to values that are > >> physiologically > >> plausible. > >> > >> > >> % ACT (Autocorrelation Time) estimation and constraints > >> > >> cfgP.maxlag = 150; > >> cfgP.actthrvalue = 7.5; > >> cfgP.minnrtrials = 5; > >> > >> *My understanding is maxlag should be 1/2 the sampling rate, so > >> since > >> the data are downsampled to 300hz, it should be 150. I know that > >> the sample > >> rate and filters are used to determine the actthrvalue, but I don't > >> actually know the calculation. 7.5 was a rough guess just to test > >> the > >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: > >> You can > >> set the actthrvalue based on the filtering you did prior to TE > >> analysis. If > >> you for example highpass filtered at 10 Hz, you shouldn't find an > >> ACT > >> higher than 30 samples, because you filtered out any components of > >> the > >> signal slower than 10 Hz/30 samples (given your sampling frequency > >> of 300 > >> Hz). So in this scenario the actthrvalue would be 30. > >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials > >> is > >> needed to realize the permutation test for estimated TE values). > >> > >> > >> % Optimization > >> > >> cfgP.optimizemethod = 'ragwitz'; > >> cfgP.ragdim = 4:8; > >> cfgP.ragtaurange = [0.2 0.4]; > >> cfgP.ragtausteps = 15; > >> cfgP.repPred = 100; > >> > >> *I am completely at a loss for this. I've done some reading into > >> transfer entropy, mutual information, etc., cited in trentool, but > >> I'm yet > >> to understand how exactly this optimization works and what the > >> configuration should be, given my data and experimental > >> intentions.* PW: > >> The Ragwitz criterion tries to find optimal embedding parameters > >> dim and > >> tau for the data. To do that, the method iteratively takes all > >> possible > >> combinations of dim and tau values that are provided in cfgP.ragdim > >> and > >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations > >> embed > >> the data. To test an embedding, the method builds the embedding > >> vectors > >> from the data; it then tests for each point how well the next point > >> in time > >> can be predicted from the reference point's nearest neighbours. So > >> for each > >> embedded point, the method searches for the nearest neighbours and > >> calculates the average of those nearest neighbours. The difference > >> between > >> the averaged/predicted point and the actual next point is the error > >> of the > >> local predictor. The Ragwitz criterion will then return the > >> parameter > >> combination for which this error over all points is minimal. > >> The parameters set the following: 'ragdim' are dimensions to be > >> tested by > >> the method (I would reccomend to start with 2:10), 'ragtaurange' > >> together > >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL > >> will > >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values > >> here are > >> factors that are later multiplied with the ACT to obtain the actual > >> tau. > >> 'repPred' is the number of points that will be used for the local > >> prediction, i.e. the Ragwitz criterion will test the local > >> prediction and > >> calculate the error for the first 100 points in your time series. > >> The two > >> parameters 'flagNei' ans 'sizeNei' below specify the type of > >> neighbour > >> search conducted by the Ragwitz criterion: 'flagNei' tells the > >> method to > >> either conduct a kNN or range search; 'sizeNei' specifies the > >> number of > >> neighbours or the radius to be searched by a range search. > >> > >> > >> % Kernel-based TE estimation > >> > >> cfgP.flagNei = 'Mass'; > >> cfgP.sizeNei = 4; % Default > >> > >> cfgP.ensemblemethod = 'no'; > >> cfgP.outputpath = *OUTPUT PATH*; > >> > >> if ~exist(*Path for TEprepare data object*) > >> load VSdat; > >> TE_Wrd = {}; > >> for i = 1:nConds > >> for j = 1:Nsub > >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); > >> end > >> end > >> clear VSdat; > >> save('TE_Wrd', 'TE_Wrd'); > >> end > >> > >> *The configuration and virtual sensor data, organized in a 3 x 15 > >> cell > >> of structures (condition by subject) are the input. The TEprepare > >> substructure is added to each individual condition x subject .mat > >> files' > >> data structure which are stored on disk independently.* > >> > >> % Use object_to_mat_conversion.m to replace individual condition x > >> subject > >> virtual sensor data > >> % .mat files with their TE_Wrd equivalent > >> > >> *I'm using a separate script to make some manipulations to the > >> objects > >> from disk; this will all eventually be integrated into the main > >> pipeline*.* > >> TRENTOOL seems to handle data output very differently from > >> fieldtrip and > >> I've had trouble thinking through the most logical way to handle > >> the data > >> so it's a bit haphazard right now.* > >> > >> load cond080sub01.mat > >> > >> cfgG = []; > >> cfgG.dim = cond080sub01.TEprepare.optdim; > >> cfgG.tau = cond080sub01.TEprepare.opttau; > >> > >> if isfield(cond080sub01, 'TEprepare') > >> TEgroup_prepare(cfgG, fileCell); > >> else > >> error('Need to run TEprepare before TEgroup_prepare'); > >> end > >> > >> *For clarification, fileCell is a cell with the name of each > >> condition x > >> subject .mat file, which as I said before is collectively the same > >> as the 3 > >> x 15 VSdat structure (condition x subject).* > >> > >> % Replace .mat files with '_for_TEgroup_calculate' version in > >> % object_to_mat_conversion.m > >> > >> % TE Group Calculate > >> > >> load cond080sub01.mat > >> if isfield(cond080sub01, 'TEgroupprepare') > >> for i = 1:length(fileCell) > >> TEgroup_calculate(fileCell{i}); > >> end > >> else > >> error('Need to run TEgroup_prepare before TEgroup_calculate'); > >> end > >> > >> > >> > >> > >> > >> > >> > >> *At this step I get the following error: Error using > >> transferentropy (line > >> 337) \nTRENTOOL ERROR: not enough data points left after embedding > >> Error in > >> TEgroup_calculate (line 133) [TEresult] = > >> transferentropy(cfg,data);* > >> > >> % TE Group Stats > >> > >> cfgGSTAT = []; > >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > >> > >> cfgGSTAT.uvar = 1; > >> cfgGSTAT.ivar = 2; > >> cfgGSTAT.fileidout = 'test_groupstats'; > >> > >> TEgroup_stats(cfgGSTAT, fileCell); > >> > >> *Given the error above, I am yet to get to this step, but it does > >> not > >> seem fundamentally different from normal fieldtrip stats.* > >> > >> ***** > >> > >> In case my notes were not clear or you skipped to the bottom, *my > >> primary concern is whether the error I'm getting in > >> TEgroup_calculate is a > >> pipeline issue* (I noticed the example pipeline in trentool, the > >> manual, > >> and published methods articles all seem to have slightly or > >> significantly > >> different pipeline compositions), *or if the error is* due to ACT, > >> ragwitz optimization, or some other faulty parameterization *on my > >> part > >> due to a lack of understanding of how transfer entropy works on a > >> more > >> theoretical/mathematical level*. If the latter is the case, is > >> there any > >> relatively straightforward way to conceptualize this, or is this > >> something > >> where I'm just going to have to keep reading and rereading until it > >> eventually makes sense? I've already done quite a bit of that and > >> it hasn't > >> pierced my thick skull yet but I'm sure it will eventually! > >> > >> Thank you so much, > >> > >> Max Cantor > >> > >> > >> -- > >> Max Cantor > >> Lab Manager > >> Computational Neurolinguistics Lab > >> University of Michigan > >> > >> > >> _______________________________________________ > >> fieldtrip mailing > >> listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie ldtrip > >> > >> > >> -- > >> ------------------------------------------------------------ > >> > >> 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 > >> > > > > > > > > -- > > Max Cantor > > Lab Manager > > Computational Neurolinguistics Lab > > University of Michigan > > -------------- 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 46, Issue 3 > > **************************************** > > > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jim Herring, MSc. Neuronal Oscillations Group Centre for Cognitive Neuroimaging Donders Institute for Brain, Cognition and Behaviour Radboud University Nijmegen _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gamaliel.ghu at gmail.com Tue Sep 16 06:49:37 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Tue, 16 Sep 2014 01:49:37 -0300 Subject: [FieldTrip] dipole simulation on head model Message-ID: Hi all I followed the tips above to simulate a dipole source on my own head model generated from MRIs. However, using information from: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit I could not simulate anything. Only one image is blank. The code I am using is as follows: cfg = []; cfg.vol = vol; % See above cfg.elec = elec; % See above cfg.dip.pos = [0 0 0]; cfg.dip.mom = [2 2 2]; % Note, it Should be transposed cfg.dip.frequency = 10; cfg.ntrials = 10; cfg.triallength = 1; % seconds cfg.fsample = 25; % Hz raw1 = ft_dipolesimulation (cfg); ft_timelockanalysis avg1 = ([], raw1); plot (avg1.time, avg1.avg); % Plot the timecourse where: vol = ft_prepare_headmodel volumes generated from the segmentation of my resonances. and ft_read_sens elec = ('standard_1020.elc'); to run the script the result is a blank image. and Matlab tells me the following: using headmodel specified in the configuration using electrodes specified in the configuration Determining source compartment (1) projecting electrodes on skin surface electrode and system combine combining transfer matrix computing simulated data computing simulated trial data for 10 RMS value of simulated data is NaN the call to "ft_dipolesimulation" took 4 seconds the input is raw Data with 97 channels and 10 trials Warning: the data does not Contain a definition trial > In utilities \ private \ warning_once at 158 In utilities \ private \ fixsampleinfo at 66 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 Warning: sampleinfo by reconstructing Assuming That the trials are consecutive segments of a continuous recording > In utilities \ private \ warning_once at 158 In utilities \ private \ fixsampleinfo at 79 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 averaging trials trial averaging 10 of 10 the call to "ft_timelockanalysis" took 1 seconds I hope you can help greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Tue Sep 16 08:07:19 2014 From: a.stolk8 at gmail.com (a.stolk) Date: Tue, 16 Sep 2014 08:07:19 +0200 Subject: [FieldTrip] dipole simulation on head model Message-ID: Hi Gamaliel, can you try avg = ft_timelockanalysis([], raw1);  Instead of ft_timelockanalysis avg1 = ([], raw1);  Hope this helps, arjen -------- Oorspronkelijk bericht -------- Van: gamaliel huerta urrea Datum: Aan: fieldtrip at science.ru.nl Onderwerp: [FieldTrip] dipole simulation on head model Hi all I followed the tips above to simulate a dipole source on my own head model generated from MRIs. However, using information from:  http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit I could not simulate anything. Only one image is blank. The code I am using is as follows:  cfg = [];  cfg.vol = vol; % See above  cfg.elec = elec; % See above  cfg.dip.pos = [0 0 0];  cfg.dip.mom = [2 2 2]; % Note, it Should be transposed  cfg.dip.frequency = 10;  cfg.ntrials = 10;  cfg.triallength = 1; % seconds  cfg.fsample = 25; % Hz  raw1 = ft_dipolesimulation (cfg);  ft_timelockanalysis avg1 = ([], raw1);  plot (avg1.time, avg1.avg); % Plot the timecourse  where:  vol = ft_prepare_headmodel volumes generated from the segmentation of my resonances.  and  ft_read_sens elec = ('standard_1020.elc');  to run the script the result is a blank image.  and Matlab tells me the following:  using headmodel specified in the configuration  using electrodes specified in the configuration  Determining source compartment (1)  projecting electrodes on skin surface  electrode and system combine combining transfer matrix  computing simulated data  computing simulated trial data for 10  RMS value of simulated data is NaN  the call to "ft_dipolesimulation" took 4 seconds  the input is raw Data with 97 channels and 10 trials  Warning: the data does not Contain a definition trial  > In utilities \ private \ warning_once at 158     In utilities \ private \ fixsampleinfo at 66     In ft_datatype_raw at 157     In ft_checkdata at 224     In ft_timelockanalysis at 105     In codgen at 50  Warning: sampleinfo by reconstructing Assuming That the trials are consecutive segments of  a continuous recording  > In utilities \ private \ warning_once at 158     In utilities \ private \ fixsampleinfo at 79     In ft_datatype_raw at 157     In ft_checkdata at 224     In ft_timelockanalysis at 105     In codgen at 50  averaging trials  trial averaging 10 of 10  the call to "ft_timelockanalysis" took 1 seconds  I hope you can help  greetings -- Gamaliel Huerta Ingeniería Civil Biomédica Universidad de Valparaíso -------------- next part -------------- An HTML attachment was scrubbed... URL: From Holger.Krause at med.uni-duesseldorf.de Tue Sep 16 11:35:30 2014 From: Holger.Krause at med.uni-duesseldorf.de (Holger Krause) Date: Tue, 16 Sep 2014 11:35:30 +0200 Subject: [FieldTrip] Latest FT version on ftp-server is from three days ago In-Reply-To: <201409091521.22589.Holger.Krause@med.uni-duesseldorf.de> Message-ID: <201409161135.32594.Holger.Krause@med.uni-duesseldorf.de> Hi! Again, same situation as last week :-( The latest file I can find on the FTP server is fieldtrip-20140913.zip. Thanks for taking care of this issue, 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 r.oostenveld at donders.ru.nl Tue Sep 16 12:15:11 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 16 Sep 2014 12:15:11 +0200 Subject: [FieldTrip] Latest FT version on ftp-server is from three days ago In-Reply-To: <201409161135.32594.Holger.Krause@med.uni-duesseldorf.de> References: <201409161135.32594.Holger.Krause@med.uni-duesseldorf.de> Message-ID: <4C0CDFB7-782E-49C1-9659-B85ABB918486@donders.ru.nl> Hi Holger, Thanks for notifying. We had a server crash a few days ago. One of the consequences seems to have been that the automatic svn update script blocked. I did a cleanup and the automatic releases on the ftp should start coming again. Note that alternative ways to access the code are explained on http://fieldtrip.fcdonders.nl/faq/i_would_like_an_automatic_daily_updated_version_of_the_code_can_i_get_access_to_the_cvs_or_snv_server best regards, Robert On 16 Sep 2014, at 11:35, Holger Krause wrote: > Hi! > > Again, same situation as last week :-( The latest file I can find on the FTP > server is fieldtrip-20140913.zip. > > Thanks for taking care of this issue, > > 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 gauthierb.ens at gmail.com Tue Sep 16 14:27:15 2014 From: gauthierb.ens at gmail.com (Baptiste Gauthier) Date: Tue, 16 Sep 2014 14:27:15 +0200 Subject: [FieldTrip] difference in raw time sample values for .fif files read by fieldtrip vs mne-python Message-ID: Dear fieldtrippers, I recently observed that reading a raw neuromag .fif file with fieldtrip and mne-python (with default settings for both) give exactly the same events separated by the same time (which is good!) but with a different time offset: the zero-point definition for the recording differ between the two softwares. I hypothesize that this difference comes from the convention adopted: fieldtrip would use the "record raw" trigger as a zero-point and mne the "start" trigger that occur earlier (i.e. you can follow the signal but it will be not saved in the file), but I'm not perfectly sure. As someone already observed this difference? It's harmless because it doesn't affect relative timing of the event but become problematic to transfer recoded events trl from fieldtrip to mne-python with a time-sample matching strategy. Best, Baptiste -- Baptiste Gauthier Postdoctoral Research Fellow INSERM-CEA Cognitive Neuroimaging unit CEA/SAC/DSV/DRM/Neurospin center Bât 145, Point Courier 156 F-91191 Gif-sur-Yvette Cedex FRANCE -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.gerhold at gmail.com Tue Sep 16 17:03:33 2014 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Tue, 16 Sep 2014 17:03:33 +0200 Subject: [FieldTrip] ft_connectivityanalysis vs MATLAB Message-ID: Hi, I've compared the non-parametric calculation of the coherence spectrum using ft_connectivityanalysis to mscohere (MATLAB). The FT function provides inflated coherence values in comparison to the MATLAB function. I've also referenced this to a implementation of the original calculation which equates to the MATLAB output. Any advice would be appreciated. Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.gerhold at gmail.com Tue Sep 16 17:16:00 2014 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Tue, 16 Sep 2014 17:16:00 +0200 Subject: [FieldTrip] ft_connectivity_pdc Message-ID: When computing pdc in FT, line 67 of ft_connectivity_pdc appears to invert the spectral transfer func. When inverting I received the following error: Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 6.358859e-18. Will this impact on the final spectrum calculated by the method. If so, is there a possible workaround/solution? Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From gamaliel.ghu at gmail.com Tue Sep 16 19:20:36 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Tue, 16 Sep 2014 14:20:36 -0300 Subject: [FieldTrip] dipole simulation on head model Message-ID: Hi all I followed the tips above to simulate a dipole source on my own head model generated from MRIs. However, using information from: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit I could not simulate anything. Only one image is blank. The code I am using is as follows: cfg = []; cfg.vol = vol; % See above cfg.elec = elec; % See above cfg.dip.pos = [0 0 0]; cfg.dip.mom = [2 2 2]; % Note, it Should be transposed cfg.dip.frequency = 10; cfg.ntrials = 10; cfg.triallength = 1; % seconds cfg.fsample = 25; % Hz raw1 = ft_dipolesimulation (cfg); avg1 = ft_timelockanalysis([], raw1); plot (avg1.time, avg1.avg); % Plot the timecourse where: vol = ft_prepare_headmodel volumes generated from the segmentation of my resonances. and ft_read_sens elec = ('standard_1020.elc'); to run the script the result is a blank image. and Matlab tells me the following: using headmodel specified in the configuration using electrodes specified in the configuration Determining source compartment (1) projecting electrodes on skin surface electrode and system combine combining transfer matrix computing simulated data computing simulated trial data for 10 RMS value of simulated data is NaN the call to "ft_dipolesimulation" took 4 seconds the input is raw Data with 97 channels and 10 trials Warning: the data does not Contain a definition trial >* In utilities \ private \ warning_once at 158 * In utilities \ private \ fixsampleinfo at 66 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 Warning: sampleinfo by reconstructing Assuming That the trials are consecutive segments of a continuous recording >* In utilities \ private \ warning_once at 158 * In utilities \ private \ fixsampleinfo at 79 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 averaging trials trial averaging 10 of 10 the call to "ft_timelockanalysis" took 1 seconds I hope you can help greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc.lalancette at sickkids.ca Tue Sep 16 20:42:21 2014 From: marc.lalancette at sickkids.ca (Marc Lalancette) Date: Tue, 16 Sep 2014 18:42:21 +0000 Subject: [FieldTrip] MEG lead field units Message-ID: <2A2B6A5B8C4C174CBCCE0B45E548DEB229FBB67F@SKMBXX01.sickkids.ca> Hello Fieldtrippies, Regarding a question I asked some months ago about the physical units of the lead field in Fieldtrip, I wanted to share the fact that I was wrong, and that it might be good to either document this in the code and possibly to add a factor. When using 'cm' units, the lead field is in Wb/cm^2/(A*m) = 1e4 T/Am = 1e2 T/(A*cm). I started to realize my original assumption was wrong while working on my Biomag poster since I was getting very low SNR values (around 1) for typical source and system parameters. So I looked closer at the single sphere code and my own old spherical forward solution code, and here is where the extra factor comes in: Skipping to the last step, my formula is: B = UnitConversion * (1e-7) * ( (QxrQ/F - (QxrQ * rv') * GradF/F^2) * SensorOrient' ); The second factor is the constant mu0/(4*pi) = 10^-7 Wb/Am. Assuming a source (Q) in units of Am and distances in cm, the complicated bit has units of Am*cm/cm^3. Thus without the first factor, B would have units of Wb/cm^2 = 1e4 T, and so I was using UnitConversion = 1e4 in my code, to get B in Tesla. If we don't put in a specific source amplitude (as in Fieldtrip), and still using UnitConversion, then B would be in T/(Am). I guess units can be different than 'cm' though, so the factor would have to take that into account. Note that the single shell forward solution gives the same units as single sphere and would need the same factor. I haven't looked at other forward methods. I also haven't verified if this is correctly dealt with when obtaining reconstructed source amplitudes, say with a beamformer. Cheers, Marc Lalancette Lab Research Project Manager The Hospital for Sick Children, Toronto, Canada ________________________________ This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. -------------- next part -------------- An HTML attachment was scrubbed... URL: From barbara.schorr at uni-ulm.de Wed Sep 17 11:22:19 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Wed, 17 Sep 2014 11:22:19 +0200 Subject: [FieldTrip] ft_globalmeanfield : Undefined function of variable In-Reply-To: References: Message-ID: <20140917112219.crkxv6dgoo0skccc@imap.uni-ulm.de> Dear Jim, I now downloaded the newest fieldtrip version but I still get the same error messag. Is there anything else I need to know? Thanks a lot! Best, Barbara Zitat von 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: ft_rejectvisual: removing trials marked as bad (Ashley Greene) > 2. Read only EEG data from combined MEG/EEG ctf file (Tobias Trame) > 3. Re: ft_globalmeanfield : Undefined function of variable > 'abort' (Herring, J.D. (Jim)) > 4. using ft_megplanar with sinle-trial TFRs (Fr?d?ric Roux) > 5. dipole simulation on head model (gamaliel huerta urrea) > 6. Re: dipole simulation on head model (Tzvetan Popov) > 7. Re: ft_globalmeanfield : Undefined function of variable > 'abort' (Jing Fan) > 8. Re: ft_globalmeanfield : Undefined function of variable > 'abort' (Jing Fan) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 12 Sep 2014 21:39:43 +0900 > From: Ashley Greene > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as > bad > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi Emilie, > > Thanks!! I, of course, completely overlooked that. > > Ashley > > On Tue, Sep 9, 2014 at 3:37 PM, Caspar, Emilie wrote: > >> Hi Ashley, >> >> Maybe the mistake is you did not integrate in your script the command to >> save the rejection. Normally, with the following command, you will see in >> the Matlab Window that artifacts are correctly rejected after the "quit" >> button. >> >> clean_data = ft_rejectvisual(cfg, interpoldata); >> cfg.artfctdef.reject = 'complete'; >> cfg.artfctdef.feedback = 'yes'; >> cleandata = ft_rejectartifact(cfg,clean_data); >> >> Emilie >> >> >> >> >> >> Le 3 sept. 2014 ? 11:58, Ashley Greene a ?crit : >> >> Hello, >> >> I have used the rejectvisual function in attempt to remove bad trials, >> but after marking them and pressing the quit button, although the command >> window states that the selected trials have been removed, there is no >> obvious change in the data; all of the trials are still intact. Have I >> overlooked something? >> >> Thanks, >> >> Ashley >> _______________________________________________ >> 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: > > > ------------------------------ > > Message: 2 > Date: Fri, 12 Sep 2014 18:23:17 +0200 (CEST) > From: Tobias Trame > To: > Subject: [FieldTrip] Read only EEG data from combined MEG/EEG ctf file > Message-ID: > > > Content-Type: text/plain; charset=us-ascii > > Hi everybody! > > I'm trying to read only the EEG data from a combined MEG/EEG ctf > file in order > to create leadfields later on, but the function "ft_read_sens" just returns > the gradiometer information in a 'grad' field. It searches for an > 'elec'-field > in the header of the data which is not present. Is there a configuration to > get the EEG-elecrodes by using "ft_read_sens"? > > My first attempt was to write the EEG-Information from the header by hand > using the following code: > > hdr = ft_read_header('subject.ds', 'headerformat', 'ctf_ds'); > elec.elecpos = [hdr.orig.eeg.pos]'; > elec.chanpos = [hdr.orig.eeg.pos]'; > elec.label = {hdr.orig.eeg.name}'; > elec.type = 'eeg'; > elec.unit = 'cm'; > > But now I get a similar problem if I want to create leadfields from timelock > data. After doing the timelock analysis using > > timelock_data = ft_timelockanalysis(cfg, mydata); > > the structure timelock_data contains just a 'grad' and no 'elec' > field so that > ft_prepare_leadfield(cfg, timelock_data) always ignores the EEG-elecrodes and > tries to use the gradiometes - even if I put the electrodes defined > above into > cfg.elec. > > Thanks for any suggestions! > > Tobias > > > ------------------------------ > > Message: 3 > Date: Mon, 15 Sep 2014 12:01:02 +0200 (CEST) > From: "Herring, J.D. (Jim)" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of > variable 'abort' > Message-ID: > <2103383764.4690548.1410775262514.JavaMail.root at draco.zimbra.ru.nl> > Content-Type: text/plain; charset=utf-8 > > Dear Barbara, > > The error seems to be related to a bug that pops up now and then > (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be > due to a corrupt installation of fieldtrip and/or the need to update > fieldtrip. > > Could you please try downloading the most recent version of > fieldtrip and see if the problem persists? > > For an example of what can be expected from this function see: Esser > SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A > direct demonstration of cortical LTP in humans: a combined TMS/EEG > study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. > PubMed PMID: 16464689. > > Best, > > Jim > > > ----- Oorspronkelijk bericht ----- >> Van: "barbara schorr" >> Aan: fieldtrip at science.ru.nl >> Verzonden: Woensdag 10 september 2014 14:07:14 >> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of >> variable 'abort' >> Dear fieldtripers. >> >> as mentioned in the subject line I would like to anaylse my timelocked >> ERP Data with the function ft_globalmeanfield. >> >> I get the Error: Undefined function or variable 'abort' >> Error in ft_globalmeanfield (line84) >> if abort >> >> in the function it says: >> >> %the abort variable is set to true or false in ft_preamble_inti >> if abort >> % do not continue function execution in case the outputfile is >> present and the user indicated to keep it >> return >> end >> >> >> I don't understand what this means. I would really appreciate your >> help to get this running. >> >> Also, what is the result when I run this function on my data? (This >> method was proposed from a reviewer. I never used it before, so I >> don't exactly know what it does and what the result will look like). >> >> Thank you very much in advance! >> >> Best, >> >> Barbara Schorr >> >> >> >> >> Zitat von 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: Question regarding nonparametric testing for coherence >> > differences (Eric Maris) >> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >> > 4. Re: ft_rejectvisual: removing trials marked as bad >> > (Caspar, Emilie) >> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >> > 6. Latest FT version on ftp-server is from three days ago >> > (Holger Krause) >> > 7. Re: TRENTOOL pipeline help (Max Cantor) >> > >> > >> > ---------------------------------------------------------------------- >> > >> > Message: 1 >> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >> > From: "Eric Maris" >> > To: , "'FieldTrip discussion list'" >> > >> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >> > for >> > coherence differences >> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Hwee Ling, >> > >> > >> > >> > In the paper you refer to (Maris et al, JNM, 2007), I did not >> > perform a >> > cluster-based permutation test at the level of the channel pairs. >> > Instead, >> > all coherences mentioned in the paper are coherence between a single >> > EMG >> > channel (2 electrodes mounted on the forearm) and all MEG >> > electrodes. Thus, >> > there are as many EMG-MEG coherences as there are MEG channels (275 >> > in our >> > lab), and the clustering of these coherences involves the same >> > neighbourhood >> > structure as the clustering of channel-specific statistics on power >> > or >> > evoked response. The analysis you propose involves clustering in a >> > much more >> > complex space, namely the formed by all (MEG,MEG) channel pairs >> > (275*275=75625 pairs). In the early days of cluster-based >> > permutation >> > statistics, I have worked on this problem but did not pursue it >> > because the >> > resulting clusters are very hard to interpret. >> > >> > >> > >> > Best, >> > >> > >> > >> > Eric Maris >> > >> > >> > >> > >> > >> > Dear all and Prof Maris, >> > >> > I'm re-posting this question again, as I didn't get any replies >> > previously. >> > >> > I?m interested to investigate if there are any differences in phase >> > synchronization in resting state data at timepoint 2 versus >> > timepoint 1. The >> > EEG data was collected using 64 EEG channels, resting state, eyes >> > opened and >> > eyes closed. I?ve arbitrarily segmented the resting state data into >> > epochs >> > of 2s each, and the epochs with artifacts are excluded completely >> > from >> > further analyses. I then performed mtmfft to get the fourier >> > representation >> > of the data, extracted the coherence, and compared the coherence >> > difference >> > of timepoint 2 versus timepoint 1 of all channels paired with all >> > other >> > channels. >> > >> > I figured that if I extract the connectivity analyses without >> > specifying the >> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >> > allow me to >> > perform cluster-based statistical analyses. I get an output with >> > ?chan_chan? >> > dimord variable. However, I was not 100% sure that this is correct, >> > hence, I?ve >> > inserted my code (see below). It?ll be great if you could tell me if >> > what I?m >> > doing makes any sense at all. Also, I don?t know how I can plot the >> > results >> > to see if it make any sense at all. >> > >> > Also, I checked the values obtained from when I specified >> > "cfg.channelcmb" >> > and when I did not specify "cfg.channelcmb", I noticed that the >> > values were >> > somehow different. I would assume that the values to be similar, >> > although >> > I'm not sure why they would have differences in the values obtained >> > from >> > specifying "cfg.channelcmb". >> > >> > This is my code that I've used thus far: >> > >> > for sub = 1:5 >> > >> > cfg = []; >> > >> > cfg.output = 'fourier'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.keeptrials = 'yes'; >> > >> > cfg.tapsmofrq = 5; >> > >> > cfg.foilim = [0 100]; >> > >> > cfg.taper = 'dpss'; >> > >> > % find the index for the c200 condition >> > >> > pre_c200_idx = find(data5.trialinfo == 201); >> > >> > cfg.trials = pre_c200_idx; >> > >> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >> > >> > post_c200_idx = find(data5.trialinfo == 200); >> > >> > cfg.trials = post_c200_idx; >> > >> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >> > >> > >> > >> > cfg = []; >> > >> > cfg.keeptrials = 'no'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.removemean = 'yes'; >> > >> > cfg.method = 'coh'; >> > >> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_pre_c200); >> > >> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_post_c200); >> > >> > end >> > >> > >> > >> > >> load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); >> > >> > cfg_neighb.method = 'template'; >> > >> > cfg_neighb.layout = lay; >> > >> > cfg_neighb.channel = 'all'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, >> > sub_HLF_pre_c200coh{1}); >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.neighbours = neighbours; >> > >> > cfg.channel = 'all'; >> > >> > cfg.channelcmb = {cfg.channel, cfg.channel}; >> > >> > cfg.latency = 'all'; >> > >> > cfg.avgovertime = 'no'; >> > >> > cfg.avgoverchan = 'no'; >> > >> > cfg.parameter = 'cohspctrm'; >> > >> > cfg.method = 'montecarlo'; >> > >> > cfg.statistic = 'depsamplesT'; >> > >> > cfg.correctm = 'cluster'; >> > >> > cfg.tail = 0; >> > >> > % cfg.clustertail = 0; >> > >> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >> > frequency >> > bands. >> > >> > cfg.numrandomization = 10000; >> > >> > cfg.ivar = 2; >> > >> > cfg.uvar = 1; >> > >> > >> > >> > % design matrices >> > >> > clear design; >> > >> > design(1,:) = [1:5, 1:5]; >> > >> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >> > >> > cfg.design = design; >> > >> > % for theta band >> > >> > cfg.avgoverfreq = 'yes'; >> > >> > cfg.frequency = [4 8]; % I also performed the statistics for delta >> > (2-4), >> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >> > (30-40), >> > and gamma (40-100). >> > >> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >> > sub_HLF_post_c200coh{:}, >> > sub_HLF_pre_c200coh{:}); >> > >> > >> > >> > When I tried to plot the results, I used this code: >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.layout = 'lay'; >> > >> > cfg.zlim = [-1 1]; >> > >> > cfg.alpha = 0.05; >> > >> > cfg.refchannel = 'all'; >> > >> > ft_clusterplot(cfg, diffc200_theta_stat); >> > >> > However, I was not sure how I could plot the results. I get an error >> > message >> > from Fieldtrip when using ft_clusterplot: >> > >> > Error using topoplot_common (line 366) >> > >> > no reference channel is specified >> > >> > Error in ft_topoplotTFR (line 192) >> > >> > [cfg] = topoplot_common(cfg, varargin{:}); >> > >> > Error in ft_clusterplot (line 372) >> > >> > ft_topoplotTFR(cfgtopo, stat); >> > >> > >> > >> > According to your paper in 2007, the topoplot of the results were >> > masked by >> > the spatio-spectral pattern of the significant clusters. I don't >> > know how to >> > do this, and I would really appreciate if you can show me how to >> > make such a >> > plot. >> > >> > Thank you very much. >> > >> > Kind regards, >> > >> > Hweeling >> > >> > >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > >> >> > >> > ------------------------------ >> > >> > Message: 2 >> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >> > From: KatrinH Heimann >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Joseph, thanks so much, I really appreciate your help. I was >> > also >> > wandering, if maybe there is another bug in my code. >> > Our nets are 128 channels, Hydrocel, but as a colleague of me >> > adviced me to >> > do so, I also tried the 129 layout. >> > My code you find below (without selection of bad channels etc.) >> > If you need also the data of two subjects to have a look, let me >> > know!!! >> > Best and thanks really! >> > Katrin >> > >> > >> > subject=input('Which subject do you want to analyse? ','s'); >> > >> > name = strcat(subject,'.raw'); >> > >> > subjectnumber=input('Which is the subjectnumber?', 's'); >> > >> > sb=subjectnumber >> > >> > %subjectnumber = strcat(subjectnumber, '.txt') >> > >> > %% >> > >> > >> > cfg = []; >> > >> > cfg.dataset = name; >> > >> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >> > >> > cfg.trialdef.eventtype = 'trigger'; >> > >> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> > trigger >> > >> > cfg.trialdef.prestim = 0.234; % in seconds >> > >> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> > observation, but maybe we need less) >> > >> > cfg = ft_definetrial(cfg); >> > >> > >> > cfg.trl([1:7],:) = []; >> > >> > >> > %change timeline according to constant offset of 16 ms = 8 samples >> > (because >> > recorded with 500 hz)in >> > >> > %structure trial >> > >> > cfg.trl(:,3)=cfg.trl(:,3)-8 >> > >> > >> > %change timeline to make the cut the zeropoint >> > >> > >> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> > >> > >> > >> > %% preprocess data >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.detrend = 'yes'; >> > >> > cfg.preproc.demean = 'yes'; >> > >> > cfg.preproc.baselinewindow = [-2.1 -2.0] >> > >> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> > filtered >> > >> > %(0.1-45) and bad channels have to be replaced!!!! >> > >> > %cfg.preproc.bpfreq = [6 32]; >> > >> > % >> > >> > % >> > >> > obs_data = ft_preprocessing(cfg); >> > >> > % >> > >> > save (strcat(sb,'obs_data') , 'obs_data') >> > >> > >> > %% determining channel neighbours (necessary for Artifact detection) >> > >> > cfg = []; >> > >> > cfg.channel = obs_data.label; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.feedback = 'yes'; >> > >> > lay = ft_prepare_layout(cfg); >> > >> > >> > >> > cfg_neighb = []; >> > >> > cfg_neighb.feedback = 'yes'; >> > >> > >> > cfg_neighb.method = 'triangulation'; >> > >> > cfg_neighb.layout = 'GSN128.sfp'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > obs_data.elec = ft_read_sens('GSN128.sfp'); >> > >> > >> > %% Artifacts - to detect bad channels - is not saved!!! >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs_data_try = ft_rejectvisual(cfg, obs_data); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_try = ft_rejectartifact (cfg,obs_data); >> > >> > >> > >> > %% Preparing neighbours for channel repair - but bad channel info >> > in!!! >> > >> > >> > % cfg_neighb = []; >> > >> > % cfg_neighb.feedback = 'yes'; >> > >> > % cfg_neighb.method = 'triangulation'; >> > >> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> > >> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > % Interpolate and put into new data structure >> > >> > cfg = []; >> > >> > cfg.badchannel = {}; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.method = 'nearest'; >> > >> > cfg.neighbours = neighbours; >> > >> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> > >> > >> > % Check reconstruction >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > % dat1=obs_data; >> > >> > % dat2=obs_data_channelrepaired; >> > >> > % >> > >> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> > >> > % y=dat2.trial{1}(62,:); >> > >> > % plot(x);hold on;plot(y,'r'); >> > >> > % >> > >> > % x=dat1.trial{1}(72,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > % >> > >> > % x=dat1.trial{1}(75,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > %% artifact rejection/trial inspection - throw out electrode jumps >> > etc. >> > >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> > according to >> > channels interpolated %% 128-number of interp. channels) >> > >> > >> > >> > cfg = []; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.numcomponent = 128 >> > >> > comp = ft_componentanalysis(cfg,obs_data_clean1); >> > >> > save (strcat(sb,'comp_all') , 'comp') >> > >> > >> > %% >> > >> > cfg = []; >> > >> > cfg.viewmode = 'component'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='some'; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > ft_databrowser(cfg,comp); >> > >> > >> > %% poweranalysis components >> > >> > cfg = []; >> > >> > cfg.output = 'pow'; >> > >> > cfg.channel = 'all';%compute the power spectrum in all ICs >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.taper = 'hanning'; >> > >> > cfg.foi = 0:0.2:50; >> > >> > obs_freq = ft_freqanalysis(cfg, comp); >> > >> > >> > %And you can plot the spectra: >> > >> > >> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> > >> > nsubplots = 16; >> > >> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> > decimals, type >> > doc subplot >> > >> > >> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >> > >> > tot = Nfigs*nsubplots; >> > >> > >> > rptvect = 1:size(comp.topo,1); >> > >> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> > >> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> > >> > >> > for r=1:size(rptvect,1); >> > >> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> > 1]);%full >> > screen >> > >> > k=0; >> > >> > for j=1:size(rptvect,2); >> > >> > if~(rptvect(r,j)==0); >> > >> > k=k+1; >> > >> > cfg=[]; >> > >> > cfg.channel = rptvect(r,j); >> > >> > cfg.ylim =[0 500] >> > >> > cfg.xlim =[0 50] >> > >> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> > >> > end >> > >> > end >> > >> > end >> > >> > >> > %For the IC topos you'll follow the same logic as above but with: >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [1:20]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [21:40]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [41:60]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [61:80]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > >> > >> > >> > >> > %% Seperate observation conditions >> > >> > >> > name1= strcat(num2str(sb),'_90.xls'); >> > >> > list1=xlsread (name1) >> > >> > >> > >> > >> > >> > name2= strcat(num2str(sb),'_180.xls'); >> > >> > list2=xlsread (name2) >> > >> > >> > >> > % >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list1] >> > >> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list2] >> > >> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > %%PIPELINE FOR obs90 >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128; >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > >> > comp_1 = ft_componentanalysis(cfg, obs90_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> > obs90_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts - final detection >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs90_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> > >> > >> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> > >> > >> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> > >> > >> > %% plot it >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP) >> > >> > >> > >> > >> > >> > >> > >> > %% PIPELINE FOR obs180 >> > >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128 >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > comp_2 = ft_componentanalysis(cfg, obs180_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> > obs180_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts final 180 >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs180_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> > >> > >> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> > >> > >> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> > >> > >> > %% plot 180 ERP >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs180_data_ERP) >> > >> > >> > %% plot both ERPs >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > cfg.showlabels = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> > >> > >> > %% plot difference wave >> > >> > >> > difference = obs180_data_ERP; % copy one of the >> > structures >> > >> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >> > the >> > difference ERP >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, difference) >> > >> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> > >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI >> >> data. A couple things. First of all, exactly which net do you use? >> >> If >> >> they are 129-channel, there is still the question of whether they >> >> are the >> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >> >> cause an >> >> error like this. Could you send me the file you are trying to >> >> process and >> >> the script you are using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >> >> diezmartini at gmail.com> wrote: >> >> >> >> Which nets do you use? I use EGI. I tried both the ones you mention >> >> and >> >> they didn't work. It was hard to find that exact one online but it >> >> was the >> >> only file that actually worked. >> >> >> >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >> >> >> wrote: >> >> >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. >> >>> Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one >> >>> >> >>>> I use >> >>>> >> >>>> >> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >> >>>> katrinheimann at gmail.com> wrote: >> >>>> >> >>>>> Dear all, my problems seem neverending. This time however i >> >>>>> really need >> >>>>> help. >> >>>>> I implemented a pipeline for ERPs. All works now, >> >>>>> trialdefinition, >> >>>>> preprocessing, channelreplacement, ica, componentrejection, >> >>>>> final >> >>>>> artifactdetection, timelock of the single subject data. However, >> >>>>> when I >> >>>>> wanna compute the grandaverage of the single subjects I get the >> >>>>> following >> >>>>> error message: >> >>>>> >> >>>>> computing average of avg over 19 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 3 MB >> >>>>> computing average of avg over 2 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >> >>>>> additional >> >>>>> allocation of an estimated 0 MB >> >>>>> >> >>>>> Furthermore in the plot of the significant clusters, the >> >>>>> channelnames >> >>>>> are mixed up (do not correspond to my net) >> >>>>> >> >>>>> >> >>>>> I guess that there is a problem with the layout I use. >> >>>>> Here the code that I use >> >>>>> >> >>>>> %For generating the layout (also in the single subjects): >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = obs_data.label; >> >>>>> >> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>>> >> >>>>> cfg.feedback = 'yes'; >> >>>>> >> >>>>> lay = ft_prepare_layout(cfg); >> >>>>> >> >>>>> >> >>>>> cfg_neighb = []; >> >>>>> >> >>>>> cfg_neighb.feedback = 'yes'; >> >>>>> >> >>>>> cfg_neighb.method = 'triangulation'; >> >>>>> >> >>>>> cfg_neighb.layout = lay; >> >>>>> >> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>>> >> >>>>> >> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>>>> >> >>>>> >> >>>>> %For computing the grand average >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = 'all'; >> >>>>> >> >>>>> cfg.latency = 'all'; >> >>>>> >> >>>>> cfg.parameter = 'avg'; >> >>>>> >> >>>>> cfg.keepindividual = 'no' >> >>>>> >> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>>>> >> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>>>> >> >>>>> % "{:}" means to use data from all elements of the variable >> >>>>> >> >>>>> >> >>>>> For plotting the significant clusters >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.style = 'blank'; >> >>>>> >> >>>>> cfg.layout = lay; >> >>>>> >> >>>>> cfg.channellabels = 'yes'; >> >>>>> >> >>>>> cfg.highlight = 'labels'; >> >>>>> >> >>>>> cfg.highlightchannel = find(stat.mask); >> >>>>> >> >>>>> cfg.comment = 'no'; >> >>>>> >> >>>>> figure; ft_topoplotER(cfg, GA_90) >> >>>>> >> >>>>> title('Nonparametric: significant with cluster multiple >> >>>>> comparison >> >>>>> correction') >> >>>>> >> >>>>> >> >>>>> Do you have ANY idea to this? I am really completely >> >>>>> helpless.... >> >>>>> >> >>>>> thanks and best >> >>>>> >> >>>>> Katrin >> >>>>> >> >>>>> _______________________________________________ >> >>>>> 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 >> >>> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> >> >> >> -------------------------------------------------------------------------------- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.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: >> > >> >> > >> > ------------------------------ >> > >> > Message: 3 >> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >> > From: Joseph Dien >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > yes, please do send me the data. >> > >> > Thanks! >> > >> > Joe >> > >> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >> > wrote: >> > >> >> Dear Joseph, thanks so much, I really appreciate your help. I was >> >> also wandering, if maybe there is another bug in my code. >> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >> >> adviced me to do so, I also tried the 129 layout. >> >> My code you find below (without selection of bad channels etc.) >> >> If you need also the data of two subjects to have a look, let me >> >> know!!! >> >> Best and thanks really! >> >> Katrin >> >> >> >> >> >> >> >> subject=input('Which subject do you want to analyse? ','s'); >> >> >> >> name = strcat(subject,'.raw'); >> >> >> >> subjectnumber=input('Which is the subjectnumber?', 's'); >> >> >> >> sb=subjectnumber >> >> >> >> %subjectnumber = strcat(subjectnumber, '.txt') >> >> >> >> %% >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.dataset = name; >> >> >> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> >> >> >> cfg.trialdef.eventtype = 'trigger'; >> >> >> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> >> trigger >> >> >> >> cfg.trialdef.prestim = 0.234; % in seconds >> >> >> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> >> observation, but maybe we need less) >> >> >> >> cfg = ft_definetrial(cfg); >> >> >> >> >> >> >> >> cfg.trl([1:7],:) = []; >> >> >> >> >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> >> (because recorded with 500 hz)in >> >> >> >> %structure trial >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >> >> >> >> >> >> >> >> %change timeline to make the cut the zeropoint >> >> >> >> >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> >> >> >> >> >> >> >> >> >> >> >> %% preprocess data >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.detrend = 'yes'; >> >> >> >> cfg.preproc.demean = 'yes'; >> >> >> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >> >> >> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> >> filtered >> >> >> >> %(0.1-45) and bad channels have to be replaced!!!! >> >> >> >> %cfg.preproc.bpfreq = [6 32]; >> >> >> >> % >> >> >> >> % >> >> >> >> obs_data = ft_preprocessing(cfg); >> >> >> >> % >> >> >> >> save (strcat(sb,'obs_data') , 'obs_data') >> >> >> >> >> >> >> >> %% determining channel neighbours (necessary for Artifact >> >> detection) >> >> >> >> cfg = []; >> >> >> >> cfg.channel = obs_data.label; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.feedback = 'yes'; >> >> >> >> lay = ft_prepare_layout(cfg); >> >> >> >> >> >> cfg_neighb = []; >> >> >> >> cfg_neighb.feedback = 'yes'; >> >> >> >> >> >> >> >> cfg_neighb.method = 'triangulation'; >> >> >> >> cfg_neighb.layout = 'GSN128.sfp'; >> >> >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >> >> >> >> >> >> >> >> %% Artifacts - to detect bad channels - is not saved!!! >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Preparing neighbours for channel repair - but bad channel info >> >> in!!! >> >> >> >> >> >> >> >> % cfg_neighb = []; >> >> >> >> % cfg_neighb.feedback = 'yes'; >> >> >> >> % cfg_neighb.method = 'triangulation'; >> >> >> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> >> >> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> % Interpolate and put into new data structure >> >> >> >> cfg = []; >> >> >> >> cfg.badchannel = {}; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.method = 'nearest'; >> >> >> >> cfg.neighbours = neighbours; >> >> >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> >> >> >> >> >> % Check reconstruction >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> % dat1=obs_data; >> >> >> >> % dat2=obs_data_channelrepaired; >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> >> >> >> % y=dat2.trial{1}(62,:); >> >> >> >> % plot(x);hold on;plot(y,'r'); >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(72,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(75,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> %% artifact rejection/trial inspection - throw out electrode jumps >> >> etc. >> >> >> >> >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> >> according to channels interpolated %% 128-number of interp. >> >> channels) >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.channel = {'all'}; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >> >> >> >> save (strcat(sb,'comp_all') , 'comp') >> >> >> >> >> >> >> >> %% >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'component'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='some'; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> ft_databrowser(cfg,comp); >> >> >> >> >> >> >> >> %% poweranalysis components >> >> >> >> cfg = []; >> >> >> >> cfg.output = 'pow'; >> >> >> >> cfg.channel = 'all';%compute the power spectrum in all ICs >> >> >> >> cfg.method = 'mtmfft'; >> >> >> >> cfg.taper = 'hanning'; >> >> >> >> cfg.foi = 0:0.2:50; >> >> >> >> obs_freq = ft_freqanalysis(cfg, comp); >> >> >> >> >> >> >> >> %And you can plot the spectra: >> >> >> >> >> >> >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> >> >> nsubplots = 16; >> >> >> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> >> decimals, type doc subplot >> >> >> >> >> >> >> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >> >> >> >> tot = Nfigs*nsubplots; >> >> >> >> >> >> >> >> rptvect = 1:size(comp.topo,1); >> >> >> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> >> >> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> >> >> >> >> >> >> >> for r=1:size(rptvect,1); >> >> >> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> >> 1]);%full screen >> >> >> >> k=0; >> >> >> >> for j=1:size(rptvect,2); >> >> >> >> if~(rptvect(r,j)==0); >> >> >> >> k=k+1; >> >> >> >> cfg=[]; >> >> >> >> cfg.channel = rptvect(r,j); >> >> >> >> cfg.ylim =[0 500] >> >> >> >> cfg.xlim =[0 50] >> >> >> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> >> >> >> end >> >> >> >> end >> >> >> >> end >> >> >> >> >> >> >> >> %For the IC topos you'll follow the same logic as above but with: >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [1:20]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [21:40]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [41:60]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [61:80]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Seperate observation conditions >> >> >> >> >> >> >> >> name1= strcat(num2str(sb),'_90.xls'); >> >> >> >> list1=xlsread (name1) >> >> >> >> >> >> >> >> name2= strcat(num2str(sb),'_180.xls'); >> >> >> >> list2=xlsread (name2) >> >> >> >> >> >> % >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list1] >> >> >> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list2] >> >> >> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> %%PIPELINE FOR obs90 >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128; >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> >> >> >> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> >> obs90_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts - final detection >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> >> >> >> >> >> >> >> %% plot it >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% PIPELINE FOR obs180 >> >> >> >> >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> >> obs180_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts final 180 >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> >> >> >> >> >> >> >> %% plot 180 ERP >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot both ERPs >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> cfg.showlabels = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot difference wave >> >> >> >> >> >> >> >> difference = obs180_data_ERP; % copy one of >> >> the structures >> >> >> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >> >> compute the difference ERP >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, difference) >> >> >> >> >> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI data. A couple things. First of all, exactly which net do >> >> you use? If they are 129-channel, there is still the question of >> >> whether they are the Hydrocel or the older geodesic nets. >> >> Regardless, that shouldn't cause an error like this. Could you >> >> send me the file you are trying to process and the script you are >> >> using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >> >> wrote: >> >> >> >>> Which nets do you use? I use EGI. I tried both the ones you >> >>> mention and they didn't work. It was hard to find that exact one >> >>> online but it was the only file that actually worked. >> >>> >> >>> >> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one I use >> >>> >> >>> >> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear all, my problems seem neverending. This time however i really >> >>> need help. >> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >> >>> preprocessing, channelreplacement, ica, componentrejection, final >> >>> artifactdetection, timelock of the single subject data. However, >> >>> when I wanna compute the grandaverage of the single subjects I get >> >>> the following error message: >> >>> >> >>> computing average of avg over 19 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 3 MB >> >>> computing average of avg over 2 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 0 MB >> >>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> the call to "ft_topoplotER" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> >> >>> Furthermore in the plot of the significant clusters, the >> >>> channelnames are mixed up (do not correspond to my net) >> >>> >> >>> >> >>> I guess that there is a problem with the layout I use. >> >>> Here the code that I use >> >>> >> >>> %For generating the layout (also in the single subjects): >> >>> cfg = []; >> >>> >> >>> cfg.channel = obs_data.label; >> >>> >> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>> >> >>> cfg.feedback = 'yes'; >> >>> >> >>> lay = ft_prepare_layout(cfg); >> >>> >> >>> >> >>> cfg_neighb = []; >> >>> >> >>> cfg_neighb.feedback = 'yes'; >> >>> >> >>> cfg_neighb.method = 'triangulation'; >> >>> >> >>> cfg_neighb.layout = lay; >> >>> >> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>> >> >>> >> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>> >> >>> >> >>> >> >>> %For computing the grand average >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.channel = 'all'; >> >>> >> >>> cfg.latency = 'all'; >> >>> >> >>> cfg.parameter = 'avg'; >> >>> >> >>> cfg.keepindividual = 'no' >> >>> >> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>> >> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>> >> >>> % "{:}" means to use data from all elements of the variable >> >>> >> >>> >> >>> For plotting the significant clusters >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.style = 'blank'; >> >>> >> >>> cfg.layout = lay; >> >>> >> >>> cfg.channellabels = 'yes'; >> >>> >> >>> cfg.highlight = 'labels'; >> >>> >> >>> cfg.highlightchannel = find(stat.mask); >> >>> >> >>> cfg.comment = 'no'; >> >>> >> >>> figure; ft_topoplotER(cfg, GA_90) >> >>> >> >>> title('Nonparametric: significant with cluster multiple comparison >> >>> correction') >> >>> >> >>> >> >>> >> >>> Do you have ANY idea to this? I am really completely helpless.... >> >>> >> >>> thanks and best >> >>> >> >>> Katrin >> >>> >> >>> >> >>> _______________________________________________ >> >>> 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 >> >>> >> >>> _______________________________________________ >> >>> fieldtrip mailing list >> >>> fieldtrip at donders.ru.nl >> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> -------------------------------------------------------------------------------- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.com >> >> >> >> >> >> _______________________________________________ >> >> 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 >> > >> > >> -------------------------------------------------------------------------------- >> > >> > Joseph Dien, PhD >> > Research Associate >> > Cognitive Neurology >> > The Johns Hopkins University School of Medicine >> > >> > Lab E-mail: jdien1 at jhmi.edu >> > Private E-mail: jdien07 at mac.com >> > Office Phone: 410-614-3115 >> > Cell Phone: 202-297-8117 >> > Fax: 410-955-0188 >> > http://joedien.com >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > >> >> > >> > ------------------------------ >> > >> > Message: 4 >> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >> > From: "Caspar, Emilie" >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >> > bad >> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >> > Content-Type: text/plain; charset="iso-8859-1" >> > >> > Hi Ashley, >> > >> > Maybe the mistake is you did not integrate in your script the >> > command to save the rejection. Normally, with the following command, >> > you will see in the Matlab Window that artifacts are correctly >> > rejected after the "quit" button. >> > >> > clean_data = ft_rejectvisual(cfg, interpoldata); >> > cfg.artfctdef.reject = 'complete'; >> > cfg.artfctdef.feedback = 'yes'; >> > cleandata = ft_rejectartifact(cfg,clean_data); >> > >> > Emilie >> > >> > >> > >> > >> > >> > Le 3 sept. 2014 ? 11:58, Ashley Greene >> > > a ?crit : >> > >> > Hello, >> > >> > I have used the rejectvisual function in attempt to remove bad >> > trials, but after marking them and pressing the quit button, >> > although the command window states that the selected trials have >> > been removed, there is no obvious change in the data; all of the >> > trials are still intact. Have I overlooked something? >> > >> > Thanks, >> > >> > Ashley >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > >> >> > >> > ------------------------------ >> > >> > Message: 5 >> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >> > From: Patricia Wollstadt >> > To: fieldtrip at science.ru.nl >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: <540EEF94.9080601 at gmx.de> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > Hello Max, >> > >> > I added a few comments to the questions regarding individual >> > parameters >> > below. To address the general problem of TRENTOOL telling you, that >> > there are not enough sample points in your data: From what I can see >> > in >> > your script, you probably don't have enough data points in each time >> > series to robustly estimate TE. You analyze 800 ms of data sampled >> > at >> > 300 Hz, which gives you 240 samples per time series. Can you maybe >> > avoid >> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >> > you >> > analyze a longer time window of interest? >> > Note that you also 'lose' data to embedding and the interaction >> > delay: >> > The first point that can be used for TE estimation is at max. >> > embedding >> > length + max. interaction delay in samples. For example: max. >> > embedding >> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >> > max >> > interaction delay of 30 ms = 9 samples. In this example, you would >> > be >> > left with 240 - 29 samples for TE estimation per trial. There is >> > also >> > the possibility to estimate time resolved TE/TE for shorter time >> > windows >> > of interest (see section 4.4 in the manual); however, this method >> > requires the use of a GPU for TE estimation. >> > >> > I would further recommend to use the new pipeline for group >> > statistics >> > described in the manual in section 4.5 (the function >> > 'TEgroup_calculate' >> > is deprecated). The new pipeline allows you to reconstruct the >> > interaction delay and uses the following functions (see also >> > comments in >> > the script): >> > >> > TEgroup_prepare -> prepares all data sets (all subjects/all >> > conditions) for group analysis (this means finding common embedding >> > parameters such that estimates are not biased between groups) >> > InteractionDelayReconstruction_calculate -> estimates TE for >> > individual data sets and all assumed interaction delays u >> > InteractionDelayReconstruction_analyze -> reconstructs the >> > interaction delay by selecting the u that maximizes TE for each >> > channel >> > TEgroup_stats -> calculate group statistics using a permutation test >> > >> > I can send you an example script for group TE analysis using this >> > pipeline to get you started. I hope this helps you to get the group >> > analysis running. Just write again if you're having trouble setting >> > up >> > the pipeline or something is not clear about the parameters/my >> > comments. >> > >> > Best, >> > Patricia >> > >> > >> > >> > >> > On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not >> >> 100% sure if it is appropriate to ask questions about it here, but >> >> to >> >> the best of my knowledge they do not have a mailing list and I saw >> >> a >> >> few trentool questions in the archives, so I'm going to assume it's >> >> ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present >> >> in the pipeline. Sorry in advance for the long post! Any help would >> >> be >> >> greatly appreciated as I'm a bit over my head on this but I think >> >> I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data >> >> that was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi is >> >> in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within the toi, but beyond that are there any benefits to it being >> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >> >> the >> >> toi is in seconds. The prediction time is the assumed interaction >> >> delay between your two sources and should fit within your toi. In >> >> general it is preferable to use the method for interaction delay >> >> reconstruction for TE estimation, because it allows you to >> >> reconstruct >> >> the actual delay between your source and target times series. A >> >> non-optimal u/interaction delay may cause an underestimation of TE, >> >> so >> >> it is recommended to use the pipeline for interaction delay >> >> reconstruction whenever estimating TE for unknown delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, so it is best to limit the u range to values that are >> >> physiologically plausible. >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the >> >> sample rate and filters are used to determine the actthrvalue, but >> >> I >> >> don't actually know the calculation. 7.5 was a rough guess just to >> >> test the pipeline. I'm also uncertain of what minnrtrials should >> >> be.* >> >> PW: You can set the actthrvalue based on the filtering you did >> >> prior >> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >> >> shouldn't find an ACT higher than 30 samples, because you filtered >> >> out >> >> any components of the signal slower than 10 Hz/30 samples (given >> >> your >> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >> >> would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> * >> >> * >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm >> >> yet to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* >> >> PW: The Ragwitz criterion tries to find optimal embedding >> >> parameters >> >> dim and tau for the data. To do that, the method iteratively takes >> >> all >> >> possible combinations of dim and tau values that are provided in >> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >> >> these >> >> combinations embed the data. To test an embedding, the method >> >> builds >> >> the embedding vectors from the data; it then tests for each point >> >> how >> >> well the next point in time can be predicted from the reference >> >> point's nearest neighbours. So for each embedded point, the method >> >> searches for the nearest neighbours and calculates the average of >> >> those nearest neighbours. The difference between the >> >> averaged/predicted point and the actual next point is the error of >> >> the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested >> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together with 'ragtausteps' specifies the tau values to be tested >> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >> >> that >> >> the values here are factors that are later multiplied with the ACT >> >> to >> >> obtain the actual tau. 'repPred' is the number of points that will >> >> be >> >> used for the local prediction, i.e. the Ragwitz criterion will test >> >> the local prediction and calculate the error for the first 100 >> >> points >> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >> >> below >> >> specify the type of neighbour search conducted by the Ragwitz >> >> criterion: 'flagNei' tells the method to either conduct a kNN or >> >> range >> >> search; 'sizeNei' specifies the number of neighbours or the radius >> >> to >> >> be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> * >> >> * >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> * >> >> * >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.*TRENTOOL seems to handle data output very differently >> >> from >> >> fieldtrip and I've had trouble thinking through the most logical >> >> way >> >> to handle the data so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> * >> >> * >> >> *For clarification, fileCell is a cell with the name of each >> >> condition >> >> x subject .mat file, which as I said before is collectively the >> >> same >> >> as the 3 x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> * >> >> * >> >> *At this step I get the following error: >> >> >> >> Error using transferentropy (line 337) >> >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> >> >> Error in TEgroup_calculate (line 133) >> >> [TEresult] = transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate >> >> is a pipeline issue* (I noticed the example pipeline in trentool, >> >> the >> >> manual, and published methods articles all seem to have slightly or >> >> significantly different pipeline compositions), *or if the error >> >> is* >> >> due to ACT, ragwitz optimization, or some other faulty >> >> parameterization *on my part due to a lack of understanding of how >> >> transfer entropy works on a more theoretical/mathematical level*. >> >> If >> >> the latter is the case, is there any relatively straightforward way >> >> to >> >> conceptualize this, or is this something where I'm just going to >> >> have >> >> to keep reading and rereading until it eventually makes sense? I've >> >> already done quite a bit of that and it hasn't pierced my thick >> >> skull >> >> yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> 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: >> > >> >> > >> > ------------------------------ >> > >> > Message: 6 >> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >> > From: Holger Krause >> > To: FieldTrip discussion list >> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >> > days ago >> > Message-ID: >> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >> > Content-Type: text/plain; charset="us-ascii" >> > >> > Dear developers, >> > >> > Could you please check the process for creation/publication of >> > zip-files on >> > the FTP server? The latest file I can find there is >> > fieldtrip-20140906.zip. >> > >> > Thanks in advance, >> > >> > Holger >> > >> > >> > ------------------------------ >> > >> > Message: 7 >> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >> > From: Max Cantor >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > This is immensely helpful, thank you. I was very confused about why >> > some >> > versions of the pipeline I saw were using group calculate and others >> > were >> > using interaction delay reconstruction and what that meant, and I >> > think I >> > have a more clear idea of what the different steps of the pipeline >> > are >> > doing. There are still a few things I'm a bit confused about though >> > in >> > terms of the pipeline. For instance, whether or not I need to do >> > TEprepare >> > before group prepare, and if I need to do graph analysis (which I'm >> > not >> > sure I fully understand but also haven't looked deeply into) before >> > group >> > stats. >> > >> > If you don't mind me taking you up on your offer, I think seeing >> > your >> > example script might help clarify some of these issues. >> > >> > Thank you! >> > >> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >> > Patricia.Wollstadt at gmx.de> wrote: >> > >> >> Hello Max, >> >> >> >> I added a few comments to the questions regarding individual >> >> parameters >> >> below. To address the general problem of TRENTOOL telling you, that >> >> there >> >> are not enough sample points in your data: From what I can see in >> >> your >> >> script, you probably don't have enough data points in each time >> >> series to >> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >> >> which >> >> gives you 240 samples per time series. Can you maybe avoid >> >> downsampling to >> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >> >> longer time >> >> window of interest? >> >> Note that you also 'lose' data to embedding and the interaction >> >> delay: The >> >> first point that can be used for TE estimation is at max. embedding >> >> length >> >> + max. interaction delay in samples. For example: max. embedding >> >> length = >> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >> >> interaction >> >> delay of 30 ms = 9 samples. In this example, you would be left with >> >> 240 - >> >> 29 samples for TE estimation per trial. There is also the >> >> possibility to >> >> estimate time resolved TE/TE for shorter time windows of interest >> >> (see >> >> section 4.4 in the manual); however, this method requires the use >> >> of a GPU >> >> for TE estimation. >> >> >> >> I would further recommend to use the new pipeline for group >> >> statistics >> >> described in the manual in section 4.5 (the function >> >> 'TEgroup_calculate' is >> >> deprecated). The new pipeline allows you to reconstruct the >> >> interaction >> >> delay and uses the following functions (see also comments in the >> >> script): >> >> >> >> TEgroup_prepare -> prepares all data sets (all subjects/all >> >> conditions) >> >> for group analysis (this means finding common embedding parameters >> >> such >> >> that estimates are not biased between groups) >> >> InteractionDelayReconstruction_calculate -> estimates TE for >> >> individual data sets and all assumed interaction delays u >> >> InteractionDelayReconstruction_analyze -> reconstructs the >> >> interaction delay by selecting the u that maximizes TE for each >> >> channel >> >> TEgroup_stats -> calculate group statistics using a permutation >> >> test >> >> >> >> I can send you an example script for group TE analysis using this >> >> pipeline >> >> to get you started. I hope this helps you to get the group analysis >> >> running. Just write again if you're having trouble setting up the >> >> pipeline >> >> or something is not clear about the parameters/my comments. >> >> >> >> Best, >> >> Patricia >> >> >> >> >> >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not 100% >> >> sure if it is appropriate to ask questions about it here, but to >> >> the best >> >> of my knowledge they do not have a mailing list and I saw a few >> >> trentool >> >> questions in the archives, so I'm going to assume it's ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present in >> >> the pipeline. Sorry in advance for the long post! Any help would be >> >> greatly >> >> appreciated as I'm a bit over my head on this but I think I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data that >> >> was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi >> >> is in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within >> >> the toi, but beyond that are there any benefits to it being earlier >> >> or >> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >> >> in >> >> seconds. The prediction time is the assumed interaction delay >> >> between your >> >> two sources and should fit within your toi. In general it is >> >> preferable to >> >> use the method for interaction delay reconstruction for TE >> >> estimation, >> >> because it allows you to reconstruct the actual delay between your >> >> source >> >> and target times series. A non-optimal u/interaction delay may >> >> cause an >> >> underestimation of TE, so it is recommended to use the pipeline for >> >> interaction delay reconstruction whenever estimating TE for unknown >> >> delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, >> >> so it is best to limit the u range to values that are >> >> physiologically >> >> plausible. >> >> >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the sample >> >> rate and filters are used to determine the actthrvalue, but I don't >> >> actually know the calculation. 7.5 was a rough guess just to test >> >> the >> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >> >> You can >> >> set the actthrvalue based on the filtering you did prior to TE >> >> analysis. If >> >> you for example highpass filtered at 10 Hz, you shouldn't find an >> >> ACT >> >> higher than 30 samples, because you filtered out any components of >> >> the >> >> signal slower than 10 Hz/30 samples (given your sampling frequency >> >> of 300 >> >> Hz). So in this scenario the actthrvalue would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm yet >> >> to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* PW: >> >> The Ragwitz criterion tries to find optimal embedding parameters >> >> dim and >> >> tau for the data. To do that, the method iteratively takes all >> >> possible >> >> combinations of dim and tau values that are provided in cfgP.ragdim >> >> and >> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >> >> embed >> >> the data. To test an embedding, the method builds the embedding >> >> vectors >> >> from the data; it then tests for each point how well the next point >> >> in time >> >> can be predicted from the reference point's nearest neighbours. So >> >> for each >> >> embedded point, the method searches for the nearest neighbours and >> >> calculates the average of those nearest neighbours. The difference >> >> between >> >> the averaged/predicted point and the actual next point is the error >> >> of the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested by >> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together >> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >> >> will >> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >> >> here are >> >> factors that are later multiplied with the ACT to obtain the actual >> >> tau. >> >> 'repPred' is the number of points that will be used for the local >> >> prediction, i.e. the Ragwitz criterion will test the local >> >> prediction and >> >> calculate the error for the first 100 points in your time series. >> >> The two >> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >> >> neighbour >> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >> >> method to >> >> either conduct a kNN or range search; 'sizeNei' specifies the >> >> number of >> >> neighbours or the radius to be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' >> >> data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject >> >> virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.* >> >> TRENTOOL seems to handle data output very differently from >> >> fieldtrip and >> >> I've had trouble thinking through the most logical way to handle >> >> the data >> >> so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> >> >> *For clarification, fileCell is a cell with the name of each >> >> condition x >> >> subject .mat file, which as I said before is collectively the same >> >> as the 3 >> >> x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> *At this step I get the following error: Error using >> >> transferentropy (line >> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in >> >> TEgroup_calculate (line 133) [TEresult] = >> >> transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate is a >> >> pipeline issue* (I noticed the example pipeline in trentool, the >> >> manual, >> >> and published methods articles all seem to have slightly or >> >> significantly >> >> different pipeline compositions), *or if the error is* due to ACT, >> >> ragwitz optimization, or some other faulty parameterization *on my >> >> part >> >> due to a lack of understanding of how transfer entropy works on a >> >> more >> >> theoretical/mathematical level*. If the latter is the case, is >> >> there any >> >> relatively straightforward way to conceptualize this, or is this >> >> something >> >> where I'm just going to have to keep reading and rereading until it >> >> eventually makes sense? I've already done quite a bit of that and >> >> it hasn't >> >> pierced my thick skull yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing >> >> >> listfieldtrip at donders.ru.nlhttp://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 >> >> >> > >> > >> > >> > -- >> > Max Cantor >> > Lab Manager >> > Computational Neurolinguistics Lab >> > University of Michigan >> > -------------- 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 46, Issue 3 >> > **************************************** >> > >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jim Herring, MSc. > Neuronal Oscillations Group > Centre for Cognitive Neuroimaging > Donders Institute for Brain, Cognition and Behaviour > Radboud University Nijmegen > > > ------------------------------ > > Message: 4 > Date: Mon, 15 Sep 2014 12:09:24 +0200 (CEST) > From: Fr?d?ric Roux > To: FieldTrip discussion list > Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs > Message-ID: <867006743.3066178.1410775764568.JavaMail.root at bcbl.eu> > Content-Type: text/plain; charset=utf-8 > > Dear all, > > my question relates to the computation of combined planar gradients > using the ft_combineplanar function. > > Our data has been recorded with an Elekta Neuromag 306 channel system, > and I would like to know if it is "safe" to compute combined gradients > before calling ft_freqstatistics, if the input data contains single > trial TFRs. > > The reason why I am asking is because in the documentation of the > function it says > % Use as > % [data] = ft_combineplanar(cfg, data) > % where data contains an averaged planar gradient (either ERF or TFR). > > However, the following tutorial suggests that this can be safely applied if > the input data contains TFRs which have been computed with the > cfg.keeptrials = 'yes' option: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > > I am bit confused as both information (the fieldtrip documentation > and the tutorial) > seem to contradict each other. > > The 2 options that are see are: > > 1) compute TFRs with cfg.keeptrials = 'yes', then call > ft_frestatistics, then call ft_combineplanar > by using the output of ft_freqstatistics as input for the > ft_combineplanar function. > 2) compute TFRs with cfg.keeptrials = 'yes', then call > ft_combineplanar, then call ft_freqstatistics > > Could anyone with experience on this issue please let me know what > the best way > to proceed would be? > > Fred > --------------------------------------------------------------------------- > > > > > ------------------------------ > > Message: 5 > Date: Mon, 15 Sep 2014 13:12:38 -0300 > From: gamaliel huerta urrea > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] dipole simulation on head model > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > hi all > > I hope you can help my problem. > > I have generated a model of head fieldtrip, and now I need to simulate > sources at different positions within the crust generated. I followed the > tutorial head model generation for EEG. However I have not found > information on how to simulate a source. Any help would be welcome. > > Thank you > greetings > > -- > *Gamaliel Huerta* > *Ingenier?a Civil Biom?dica* > *Universidad de Valpara?so* > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 6 > Date: Mon, 15 Sep 2014 18:38:26 +0200 > From: Tzvetan Popov > To: FieldTrip discussion list > Subject: Re: [FieldTrip] dipole simulation on head model > Message-ID: <6677301D-D72C-4C12-BC84-779D5E4DF8F3 at uni-konstanz.de> > Content-Type: text/plain; charset="iso-8859-1" > > > Dear Gamaliel, > you might try something like this: > > http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit > > good luck > tzvetan > > Am 15.09.2014 um 18:12 schrieb gamaliel huerta urrea > : > >> hi all >> >> I hope you can help my problem. >> >> I have generated a model of head fieldtrip, and now I need to >> simulate sources at different positions within the crust generated. >> I followed the tutorial head model generation for EEG. However I >> have not found information on how to simulate a source. Any help >> would be welcome. >> >> Thank you >> greetings >> >> -- >> Gamaliel Huerta >> Ingenier?a Civil Biom?dica >> Universidad de Valpara?so >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 7 > Date: Mon, 15 Sep 2014 12:40:41 -0500 > From: "Jing Fan" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of > variable 'abort' > Message-ID: <000001cfd10c$2b7786a0$826693e0$@gmail.com> > Content-Type: text/plain; charset="us-ascii" > > Hi Jim, > > I download the latest .zip file from FTP. > I received the same error message when calling function ft_definetrial(cfg). > It seems to me that ft_preamble init command will go to script ft_preamble.m > instead of ft_preamble_init.m. > Any help to resolve this issue will be appreciated. > > Best, > Jing > > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) > Sent: Monday, September 15, 2014 5:01 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable > 'abort' > > Dear Barbara, > > The error seems to be related to a bug that pops up now and then > (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a > corrupt installation of fieldtrip and/or the need to update fieldtrip. > > Could you please try downloading the most recent version of fieldtrip and > see if the problem persists? > > For an example of what can be expected from this function see: Esser SK, > Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct > demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res > Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. > > Best, > > Jim > > > ----- Oorspronkelijk bericht ----- >> Van: "barbara schorr" >> Aan: fieldtrip at science.ru.nl >> Verzonden: Woensdag 10 september 2014 14:07:14 >> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable > 'abort' >> Dear fieldtripers. >> >> as mentioned in the subject line I would like to anaylse my timelocked >> ERP Data with the function ft_globalmeanfield. >> >> I get the Error: Undefined function or variable 'abort' >> Error in ft_globalmeanfield (line84) >> if abort >> >> in the function it says: >> >> %the abort variable is set to true or false in ft_preamble_inti >> if abort >> % do not continue function execution in case the outputfile is >> present and the user indicated to keep it >> return >> end >> >> >> I don't understand what this means. I would really appreciate your >> help to get this running. >> >> Also, what is the result when I run this function on my data? (This >> method was proposed from a reviewer. I never used it before, so I >> don't exactly know what it does and what the result will look like). >> >> Thank you very much in advance! >> >> Best, >> >> Barbara Schorr >> >> >> >> >> Zitat von 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: Question regarding nonparametric testing for coherence >> > differences (Eric Maris) >> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >> > 4. Re: ft_rejectvisual: removing trials marked as bad >> > (Caspar, Emilie) >> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >> > 6. Latest FT version on ftp-server is from three days ago >> > (Holger Krause) >> > 7. Re: TRENTOOL pipeline help (Max Cantor) >> > >> > >> > ---------------------------------------------------------------------- >> > >> > Message: 1 >> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >> > From: "Eric Maris" >> > To: , "'FieldTrip discussion list'" >> > >> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >> > for >> > coherence differences >> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Hwee Ling, >> > >> > >> > >> > In the paper you refer to (Maris et al, JNM, 2007), I did not >> > perform a >> > cluster-based permutation test at the level of the channel pairs. >> > Instead, >> > all coherences mentioned in the paper are coherence between a single >> > EMG >> > channel (2 electrodes mounted on the forearm) and all MEG >> > electrodes. Thus, >> > there are as many EMG-MEG coherences as there are MEG channels (275 >> > in our >> > lab), and the clustering of these coherences involves the same >> > neighbourhood >> > structure as the clustering of channel-specific statistics on power >> > or >> > evoked response. The analysis you propose involves clustering in a >> > much more >> > complex space, namely the formed by all (MEG,MEG) channel pairs >> > (275*275=75625 pairs). In the early days of cluster-based >> > permutation >> > statistics, I have worked on this problem but did not pursue it >> > because the >> > resulting clusters are very hard to interpret. >> > >> > >> > >> > Best, >> > >> > >> > >> > Eric Maris >> > >> > >> > >> > >> > >> > Dear all and Prof Maris, >> > >> > I'm re-posting this question again, as I didn't get any replies >> > previously. >> > >> > I?m interested to investigate if there are any differences in phase >> > synchronization in resting state data at timepoint 2 versus >> > timepoint 1. The >> > EEG data was collected using 64 EEG channels, resting state, eyes >> > opened and >> > eyes closed. I?ve arbitrarily segmented the resting state data into >> > epochs >> > of 2s each, and the epochs with artifacts are excluded completely >> > from >> > further analyses. I then performed mtmfft to get the fourier >> > representation >> > of the data, extracted the coherence, and compared the coherence >> > difference >> > of timepoint 2 versus timepoint 1 of all channels paired with all >> > other >> > channels. >> > >> > I figured that if I extract the connectivity analyses without >> > specifying the >> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >> > allow me to >> > perform cluster-based statistical analyses. I get an output with >> > ?chan_chan? >> > dimord variable. However, I was not 100% sure that this is correct, >> > hence, I?ve >> > inserted my code (see below). It?ll be great if you could tell me if >> > what I?m >> > doing makes any sense at all. Also, I don?t know how I can plot the >> > results >> > to see if it make any sense at all. >> > >> > Also, I checked the values obtained from when I specified >> > "cfg.channelcmb" >> > and when I did not specify "cfg.channelcmb", I noticed that the >> > values were >> > somehow different. I would assume that the values to be similar, >> > although >> > I'm not sure why they would have differences in the values obtained >> > from >> > specifying "cfg.channelcmb". >> > >> > This is my code that I've used thus far: >> > >> > for sub = 1:5 >> > >> > cfg = []; >> > >> > cfg.output = 'fourier'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.keeptrials = 'yes'; >> > >> > cfg.tapsmofrq = 5; >> > >> > cfg.foilim = [0 100]; >> > >> > cfg.taper = 'dpss'; >> > >> > % find the index for the c200 condition >> > >> > pre_c200_idx = find(data5.trialinfo == 201); >> > >> > cfg.trials = pre_c200_idx; >> > >> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >> > >> > post_c200_idx = find(data5.trialinfo == 200); >> > >> > cfg.trials = post_c200_idx; >> > >> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >> > >> > >> > >> > cfg = []; >> > >> > cfg.keeptrials = 'no'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.removemean = 'yes'; >> > >> > cfg.method = 'coh'; >> > >> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_pre_c200); >> > >> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_post_c200); >> > >> > end >> > >> > >> > >> > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat > '); >> > >> > cfg_neighb.method = 'template'; >> > >> > cfg_neighb.layout = lay; >> > >> > cfg_neighb.channel = 'all'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, >> > sub_HLF_pre_c200coh{1}); >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.neighbours = neighbours; >> > >> > cfg.channel = 'all'; >> > >> > cfg.channelcmb = {cfg.channel, cfg.channel}; >> > >> > cfg.latency = 'all'; >> > >> > cfg.avgovertime = 'no'; >> > >> > cfg.avgoverchan = 'no'; >> > >> > cfg.parameter = 'cohspctrm'; >> > >> > cfg.method = 'montecarlo'; >> > >> > cfg.statistic = 'depsamplesT'; >> > >> > cfg.correctm = 'cluster'; >> > >> > cfg.tail = 0; >> > >> > % cfg.clustertail = 0; >> > >> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >> > frequency >> > bands. >> > >> > cfg.numrandomization = 10000; >> > >> > cfg.ivar = 2; >> > >> > cfg.uvar = 1; >> > >> > >> > >> > % design matrices >> > >> > clear design; >> > >> > design(1,:) = [1:5, 1:5]; >> > >> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >> > >> > cfg.design = design; >> > >> > % for theta band >> > >> > cfg.avgoverfreq = 'yes'; >> > >> > cfg.frequency = [4 8]; % I also performed the statistics for delta >> > (2-4), >> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >> > (30-40), >> > and gamma (40-100). >> > >> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >> > sub_HLF_post_c200coh{:}, >> > sub_HLF_pre_c200coh{:}); >> > >> > >> > >> > When I tried to plot the results, I used this code: >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.layout = 'lay'; >> > >> > cfg.zlim = [-1 1]; >> > >> > cfg.alpha = 0.05; >> > >> > cfg.refchannel = 'all'; >> > >> > ft_clusterplot(cfg, diffc200_theta_stat); >> > >> > However, I was not sure how I could plot the results. I get an error >> > message >> > from Fieldtrip when using ft_clusterplot: >> > >> > Error using topoplot_common (line 366) >> > >> > no reference channel is specified >> > >> > Error in ft_topoplotTFR (line 192) >> > >> > [cfg] = topoplot_common(cfg, varargin{:}); >> > >> > Error in ft_clusterplot (line 372) >> > >> > ft_topoplotTFR(cfgtopo, stat); >> > >> > >> > >> > According to your paper in 2007, the topoplot of the results were >> > masked by >> > the spatio-spectral pattern of the significant clusters. I don't >> > know how to >> > do this, and I would really appreciate if you can show me how to >> > make such a >> > plot. >> > >> > Thank you very much. >> > >> > Kind regards, >> > >> > Hweeling >> > >> > >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 280/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 2 >> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >> > From: KatrinH Heimann >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Joseph, thanks so much, I really appreciate your help. I was >> > also >> > wandering, if maybe there is another bug in my code. >> > Our nets are 128 channels, Hydrocel, but as a colleague of me >> > adviced me to >> > do so, I also tried the 129 layout. >> > My code you find below (without selection of bad channels etc.) >> > If you need also the data of two subjects to have a look, let me >> > know!!! >> > Best and thanks really! >> > Katrin >> > >> > >> > subject=input('Which subject do you want to analyse? ','s'); >> > >> > name = strcat(subject,'.raw'); >> > >> > subjectnumber=input('Which is the subjectnumber?', 's'); >> > >> > sb=subjectnumber >> > >> > %subjectnumber = strcat(subjectnumber, '.txt') >> > >> > %% >> > >> > >> > cfg = []; >> > >> > cfg.dataset = name; >> > >> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >> > >> > cfg.trialdef.eventtype = 'trigger'; >> > >> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> > trigger >> > >> > cfg.trialdef.prestim = 0.234; % in seconds >> > >> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> > observation, but maybe we need less) >> > >> > cfg = ft_definetrial(cfg); >> > >> > >> > cfg.trl([1:7],:) = []; >> > >> > >> > %change timeline according to constant offset of 16 ms = 8 samples >> > (because >> > recorded with 500 hz)in >> > >> > %structure trial >> > >> > cfg.trl(:,3)=cfg.trl(:,3)-8 >> > >> > >> > %change timeline to make the cut the zeropoint >> > >> > >> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> > >> > >> > >> > %% preprocess data >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.detrend = 'yes'; >> > >> > cfg.preproc.demean = 'yes'; >> > >> > cfg.preproc.baselinewindow = [-2.1 -2.0] >> > >> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> > filtered >> > >> > %(0.1-45) and bad channels have to be replaced!!!! >> > >> > %cfg.preproc.bpfreq = [6 32]; >> > >> > % >> > >> > % >> > >> > obs_data = ft_preprocessing(cfg); >> > >> > % >> > >> > save (strcat(sb,'obs_data') , 'obs_data') >> > >> > >> > %% determining channel neighbours (necessary for Artifact detection) >> > >> > cfg = []; >> > >> > cfg.channel = obs_data.label; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.feedback = 'yes'; >> > >> > lay = ft_prepare_layout(cfg); >> > >> > >> > >> > cfg_neighb = []; >> > >> > cfg_neighb.feedback = 'yes'; >> > >> > >> > cfg_neighb.method = 'triangulation'; >> > >> > cfg_neighb.layout = 'GSN128.sfp'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > obs_data.elec = ft_read_sens('GSN128.sfp'); >> > >> > >> > %% Artifacts - to detect bad channels - is not saved!!! >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs_data_try = ft_rejectvisual(cfg, obs_data); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_try = ft_rejectartifact (cfg,obs_data); >> > >> > >> > >> > %% Preparing neighbours for channel repair - but bad channel info >> > in!!! >> > >> > >> > % cfg_neighb = []; >> > >> > % cfg_neighb.feedback = 'yes'; >> > >> > % cfg_neighb.method = 'triangulation'; >> > >> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> > >> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > % Interpolate and put into new data structure >> > >> > cfg = []; >> > >> > cfg.badchannel = {}; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.method = 'nearest'; >> > >> > cfg.neighbours = neighbours; >> > >> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> > >> > >> > % Check reconstruction >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > % dat1=obs_data; >> > >> > % dat2=obs_data_channelrepaired; >> > >> > % >> > >> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> > >> > % y=dat2.trial{1}(62,:); >> > >> > % plot(x);hold on;plot(y,'r'); >> > >> > % >> > >> > % x=dat1.trial{1}(72,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > % >> > >> > % x=dat1.trial{1}(75,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > %% artifact rejection/trial inspection - throw out electrode jumps >> > etc. >> > >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> > according to >> > channels interpolated %% 128-number of interp. channels) >> > >> > >> > >> > cfg = []; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.numcomponent = 128 >> > >> > comp = ft_componentanalysis(cfg,obs_data_clean1); >> > >> > save (strcat(sb,'comp_all') , 'comp') >> > >> > >> > %% >> > >> > cfg = []; >> > >> > cfg.viewmode = 'component'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='some'; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > ft_databrowser(cfg,comp); >> > >> > >> > %% poweranalysis components >> > >> > cfg = []; >> > >> > cfg.output = 'pow'; >> > >> > cfg.channel = 'all';%compute the power spectrum in all ICs >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.taper = 'hanning'; >> > >> > cfg.foi = 0:0.2:50; >> > >> > obs_freq = ft_freqanalysis(cfg, comp); >> > >> > >> > %And you can plot the spectra: >> > >> > >> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> > >> > nsubplots = 16; >> > >> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> > decimals, type >> > doc subplot >> > >> > >> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >> > >> > tot = Nfigs*nsubplots; >> > >> > >> > rptvect = 1:size(comp.topo,1); >> > >> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> > >> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> > >> > >> > for r=1:size(rptvect,1); >> > >> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> > 1]);%full >> > screen >> > >> > k=0; >> > >> > for j=1:size(rptvect,2); >> > >> > if~(rptvect(r,j)==0); >> > >> > k=k+1; >> > >> > cfg=[]; >> > >> > cfg.channel = rptvect(r,j); >> > >> > cfg.ylim =[0 500] >> > >> > cfg.xlim =[0 50] >> > >> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> > >> > end >> > >> > end >> > >> > end >> > >> > >> > %For the IC topos you'll follow the same logic as above but with: >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [1:20]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [21:40]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [41:60]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [61:80]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > >> > >> > >> > >> > %% Seperate observation conditions >> > >> > >> > name1= strcat(num2str(sb),'_90.xls'); >> > >> > list1=xlsread (name1) >> > >> > >> > >> > >> > >> > name2= strcat(num2str(sb),'_180.xls'); >> > >> > list2=xlsread (name2) >> > >> > >> > >> > % >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list1] >> > >> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list2] >> > >> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > %%PIPELINE FOR obs90 >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128; >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > >> > comp_1 = ft_componentanalysis(cfg, obs90_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> > obs90_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts - final detection >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs90_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> > >> > >> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> > >> > >> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> > >> > >> > %% plot it >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP) >> > >> > >> > >> > >> > >> > >> > >> > %% PIPELINE FOR obs180 >> > >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128 >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > comp_2 = ft_componentanalysis(cfg, obs180_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> > obs180_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts final 180 >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs180_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> > >> > >> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> > >> > >> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> > >> > >> > %% plot 180 ERP >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs180_data_ERP) >> > >> > >> > %% plot both ERPs >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > cfg.showlabels = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> > >> > >> > %% plot difference wave >> > >> > >> > difference = obs180_data_ERP; % copy one of the >> > structures >> > >> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >> > the >> > difference ERP >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, difference) >> > >> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> > >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI >> >> data. A couple things. First of all, exactly which net do you use? >> >> If >> >> they are 129-channel, there is still the question of whether they >> >> are the >> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >> >> cause an >> >> error like this. Could you send me the file you are trying to >> >> process and >> >> the script you are using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >> >> diezmartini at gmail.com> wrote: >> >> >> >> Which nets do you use? I use EGI. I tried both the ones you mention >> >> and >> >> they didn't work. It was hard to find that exact one online but it >> >> was the >> >> only file that actually worked. >> >> >> >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >> >> >> wrote: >> >> >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. >> >>> Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one >> >>> >> >>>> I use >> >>>> >> >>>> >> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >> >>>> katrinheimann at gmail.com> wrote: >> >>>> >> >>>>> Dear all, my problems seem neverending. This time however i >> >>>>> really need >> >>>>> help. >> >>>>> I implemented a pipeline for ERPs. All works now, >> >>>>> trialdefinition, >> >>>>> preprocessing, channelreplacement, ica, componentrejection, >> >>>>> final >> >>>>> artifactdetection, timelock of the single subject data. However, >> >>>>> when I >> >>>>> wanna compute the grandaverage of the single subjects I get the >> >>>>> following >> >>>>> error message: >> >>>>> >> >>>>> computing average of avg over 19 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 3 MB >> >>>>> computing average of avg over 2 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >> >>>>> additional >> >>>>> allocation of an estimated 0 MB >> >>>>> >> >>>>> Furthermore in the plot of the significant clusters, the >> >>>>> channelnames >> >>>>> are mixed up (do not correspond to my net) >> >>>>> >> >>>>> >> >>>>> I guess that there is a problem with the layout I use. >> >>>>> Here the code that I use >> >>>>> >> >>>>> %For generating the layout (also in the single subjects): >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = obs_data.label; >> >>>>> >> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>>> >> >>>>> cfg.feedback = 'yes'; >> >>>>> >> >>>>> lay = ft_prepare_layout(cfg); >> >>>>> >> >>>>> >> >>>>> cfg_neighb = []; >> >>>>> >> >>>>> cfg_neighb.feedback = 'yes'; >> >>>>> >> >>>>> cfg_neighb.method = 'triangulation'; >> >>>>> >> >>>>> cfg_neighb.layout = lay; >> >>>>> >> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>>> >> >>>>> >> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>>>> >> >>>>> >> >>>>> %For computing the grand average >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = 'all'; >> >>>>> >> >>>>> cfg.latency = 'all'; >> >>>>> >> >>>>> cfg.parameter = 'avg'; >> >>>>> >> >>>>> cfg.keepindividual = 'no' >> >>>>> >> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>>>> >> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>>>> >> >>>>> % "{:}" means to use data from all elements of the variable >> >>>>> >> >>>>> >> >>>>> For plotting the significant clusters >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.style = 'blank'; >> >>>>> >> >>>>> cfg.layout = lay; >> >>>>> >> >>>>> cfg.channellabels = 'yes'; >> >>>>> >> >>>>> cfg.highlight = 'labels'; >> >>>>> >> >>>>> cfg.highlightchannel = find(stat.mask); >> >>>>> >> >>>>> cfg.comment = 'no'; >> >>>>> >> >>>>> figure; ft_topoplotER(cfg, GA_90) >> >>>>> >> >>>>> title('Nonparametric: significant with cluster multiple >> >>>>> comparison >> >>>>> correction') >> >>>>> >> >>>>> >> >>>>> Do you have ANY idea to this? I am really completely >> >>>>> helpless.... >> >>>>> >> >>>>> thanks and best >> >>>>> >> >>>>> Katrin >> >>>>> >> >>>>> _______________________________________________ >> >>>>> 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 >> >>> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> >> >> > ---------------------------------------------------------------------------- > ---- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.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: >> > > b61/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 3 >> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >> > From: Joseph Dien >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > yes, please do send me the data. >> > >> > Thanks! >> > >> > Joe >> > >> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >> > wrote: >> > >> >> Dear Joseph, thanks so much, I really appreciate your help. I was >> >> also wandering, if maybe there is another bug in my code. >> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >> >> adviced me to do so, I also tried the 129 layout. >> >> My code you find below (without selection of bad channels etc.) >> >> If you need also the data of two subjects to have a look, let me >> >> know!!! >> >> Best and thanks really! >> >> Katrin >> >> >> >> >> >> >> >> subject=input('Which subject do you want to analyse? ','s'); >> >> >> >> name = strcat(subject,'.raw'); >> >> >> >> subjectnumber=input('Which is the subjectnumber?', 's'); >> >> >> >> sb=subjectnumber >> >> >> >> %subjectnumber = strcat(subjectnumber, '.txt') >> >> >> >> %% >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.dataset = name; >> >> >> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> >> >> >> cfg.trialdef.eventtype = 'trigger'; >> >> >> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> >> trigger >> >> >> >> cfg.trialdef.prestim = 0.234; % in seconds >> >> >> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> >> observation, but maybe we need less) >> >> >> >> cfg = ft_definetrial(cfg); >> >> >> >> >> >> >> >> cfg.trl([1:7],:) = []; >> >> >> >> >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> >> (because recorded with 500 hz)in >> >> >> >> %structure trial >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >> >> >> >> >> >> >> >> %change timeline to make the cut the zeropoint >> >> >> >> >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> >> >> >> >> >> >> >> >> >> >> >> %% preprocess data >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.detrend = 'yes'; >> >> >> >> cfg.preproc.demean = 'yes'; >> >> >> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >> >> >> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> >> filtered >> >> >> >> %(0.1-45) and bad channels have to be replaced!!!! >> >> >> >> %cfg.preproc.bpfreq = [6 32]; >> >> >> >> % >> >> >> >> % >> >> >> >> obs_data = ft_preprocessing(cfg); >> >> >> >> % >> >> >> >> save (strcat(sb,'obs_data') , 'obs_data') >> >> >> >> >> >> >> >> %% determining channel neighbours (necessary for Artifact >> >> detection) >> >> >> >> cfg = []; >> >> >> >> cfg.channel = obs_data.label; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.feedback = 'yes'; >> >> >> >> lay = ft_prepare_layout(cfg); >> >> >> >> >> >> cfg_neighb = []; >> >> >> >> cfg_neighb.feedback = 'yes'; >> >> >> >> >> >> >> >> cfg_neighb.method = 'triangulation'; >> >> >> >> cfg_neighb.layout = 'GSN128.sfp'; >> >> >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >> >> >> >> >> >> >> >> %% Artifacts - to detect bad channels - is not saved!!! >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Preparing neighbours for channel repair - but bad channel info >> >> in!!! >> >> >> >> >> >> >> >> % cfg_neighb = []; >> >> >> >> % cfg_neighb.feedback = 'yes'; >> >> >> >> % cfg_neighb.method = 'triangulation'; >> >> >> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> >> >> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> % Interpolate and put into new data structure >> >> >> >> cfg = []; >> >> >> >> cfg.badchannel = {}; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.method = 'nearest'; >> >> >> >> cfg.neighbours = neighbours; >> >> >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> >> >> >> >> >> % Check reconstruction >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> % dat1=obs_data; >> >> >> >> % dat2=obs_data_channelrepaired; >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> >> >> >> % y=dat2.trial{1}(62,:); >> >> >> >> % plot(x);hold on;plot(y,'r'); >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(72,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(75,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> %% artifact rejection/trial inspection - throw out electrode jumps >> >> etc. >> >> >> >> >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> >> according to channels interpolated %% 128-number of interp. >> >> channels) >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.channel = {'all'}; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >> >> >> >> save (strcat(sb,'comp_all') , 'comp') >> >> >> >> >> >> >> >> %% >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'component'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='some'; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> ft_databrowser(cfg,comp); >> >> >> >> >> >> >> >> %% poweranalysis components >> >> >> >> cfg = []; >> >> >> >> cfg.output = 'pow'; >> >> >> >> cfg.channel = 'all';%compute the power spectrum in all ICs >> >> >> >> cfg.method = 'mtmfft'; >> >> >> >> cfg.taper = 'hanning'; >> >> >> >> cfg.foi = 0:0.2:50; >> >> >> >> obs_freq = ft_freqanalysis(cfg, comp); >> >> >> >> >> >> >> >> %And you can plot the spectra: >> >> >> >> >> >> >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> >> >> nsubplots = 16; >> >> >> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> >> decimals, type doc subplot >> >> >> >> >> >> >> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >> >> >> >> tot = Nfigs*nsubplots; >> >> >> >> >> >> >> >> rptvect = 1:size(comp.topo,1); >> >> >> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> >> >> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> >> >> >> >> >> >> >> for r=1:size(rptvect,1); >> >> >> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> >> 1]);%full screen >> >> >> >> k=0; >> >> >> >> for j=1:size(rptvect,2); >> >> >> >> if~(rptvect(r,j)==0); >> >> >> >> k=k+1; >> >> >> >> cfg=[]; >> >> >> >> cfg.channel = rptvect(r,j); >> >> >> >> cfg.ylim =[0 500] >> >> >> >> cfg.xlim =[0 50] >> >> >> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> >> >> >> end >> >> >> >> end >> >> >> >> end >> >> >> >> >> >> >> >> %For the IC topos you'll follow the same logic as above but with: >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [1:20]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [21:40]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [41:60]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [61:80]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Seperate observation conditions >> >> >> >> >> >> >> >> name1= strcat(num2str(sb),'_90.xls'); >> >> >> >> list1=xlsread (name1) >> >> >> >> >> >> >> >> name2= strcat(num2str(sb),'_180.xls'); >> >> >> >> list2=xlsread (name2) >> >> >> >> >> >> % >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list1] >> >> >> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list2] >> >> >> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> %%PIPELINE FOR obs90 >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128; >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> >> >> >> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> >> obs90_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts - final detection >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> >> >> >> >> >> >> >> %% plot it >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% PIPELINE FOR obs180 >> >> >> >> >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> >> obs180_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts final 180 >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> >> >> >> >> >> >> >> %% plot 180 ERP >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot both ERPs >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> cfg.showlabels = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot difference wave >> >> >> >> >> >> >> >> difference = obs180_data_ERP; % copy one of >> >> the structures >> >> >> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >> >> compute the difference ERP >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, difference) >> >> >> >> >> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI data. A couple things. First of all, exactly which net do >> >> you use? If they are 129-channel, there is still the question of >> >> whether they are the Hydrocel or the older geodesic nets. >> >> Regardless, that shouldn't cause an error like this. Could you >> >> send me the file you are trying to process and the script you are >> >> using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >> >> wrote: >> >> >> >>> Which nets do you use? I use EGI. I tried both the ones you >> >>> mention and they didn't work. It was hard to find that exact one >> >>> online but it was the only file that actually worked. >> >>> >> >>> >> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one I use >> >>> >> >>> >> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear all, my problems seem neverending. This time however i really >> >>> need help. >> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >> >>> preprocessing, channelreplacement, ica, componentrejection, final >> >>> artifactdetection, timelock of the single subject data. However, >> >>> when I wanna compute the grandaverage of the single subjects I get >> >>> the following error message: >> >>> >> >>> computing average of avg over 19 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 3 MB >> >>> computing average of avg over 2 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 0 MB >> >>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> the call to "ft_topoplotER" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> >> >>> Furthermore in the plot of the significant clusters, the >> >>> channelnames are mixed up (do not correspond to my net) >> >>> >> >>> >> >>> I guess that there is a problem with the layout I use. >> >>> Here the code that I use >> >>> >> >>> %For generating the layout (also in the single subjects): >> >>> cfg = []; >> >>> >> >>> cfg.channel = obs_data.label; >> >>> >> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>> >> >>> cfg.feedback = 'yes'; >> >>> >> >>> lay = ft_prepare_layout(cfg); >> >>> >> >>> >> >>> cfg_neighb = []; >> >>> >> >>> cfg_neighb.feedback = 'yes'; >> >>> >> >>> cfg_neighb.method = 'triangulation'; >> >>> >> >>> cfg_neighb.layout = lay; >> >>> >> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>> >> >>> >> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>> >> >>> >> >>> >> >>> %For computing the grand average >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.channel = 'all'; >> >>> >> >>> cfg.latency = 'all'; >> >>> >> >>> cfg.parameter = 'avg'; >> >>> >> >>> cfg.keepindividual = 'no' >> >>> >> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>> >> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>> >> >>> % "{:}" means to use data from all elements of the variable >> >>> >> >>> >> >>> For plotting the significant clusters >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.style = 'blank'; >> >>> >> >>> cfg.layout = lay; >> >>> >> >>> cfg.channellabels = 'yes'; >> >>> >> >>> cfg.highlight = 'labels'; >> >>> >> >>> cfg.highlightchannel = find(stat.mask); >> >>> >> >>> cfg.comment = 'no'; >> >>> >> >>> figure; ft_topoplotER(cfg, GA_90) >> >>> >> >>> title('Nonparametric: significant with cluster multiple comparison >> >>> correction') >> >>> >> >>> >> >>> >> >>> Do you have ANY idea to this? I am really completely helpless.... >> >>> >> >>> thanks and best >> >>> >> >>> Katrin >> >>> >> >>> >> >>> _______________________________________________ >> >>> 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 >> >>> >> >>> _______________________________________________ >> >>> fieldtrip mailing list >> >>> fieldtrip at donders.ru.nl >> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> > ---------------------------------------------------------------------------- > ---- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.com >> >> >> >> >> >> _______________________________________________ >> >> 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 >> > >> > > ---------------------------------------------------------------------------- > ---- >> > >> > Joseph Dien, PhD >> > Research Associate >> > Cognitive Neurology >> > The Johns Hopkins University School of Medicine >> > >> > Lab E-mail: jdien1 at jhmi.edu >> > Private E-mail: jdien07 at mac.com >> > Office Phone: 410-614-3115 >> > Cell Phone: 202-297-8117 >> > Fax: 410-955-0188 >> > http://joedien.com >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > ad2/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 4 >> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >> > From: "Caspar, Emilie" >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >> > bad >> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >> > Content-Type: text/plain; charset="iso-8859-1" >> > >> > Hi Ashley, >> > >> > Maybe the mistake is you did not integrate in your script the >> > command to save the rejection. Normally, with the following command, >> > you will see in the Matlab Window that artifacts are correctly >> > rejected after the "quit" button. >> > >> > clean_data = ft_rejectvisual(cfg, interpoldata); >> > cfg.artfctdef.reject = 'complete'; >> > cfg.artfctdef.feedback = 'yes'; >> > cleandata = ft_rejectartifact(cfg,clean_data); >> > >> > Emilie >> > >> > >> > >> > >> > >> > Le 3 sept. 2014 ? 11:58, Ashley Greene >> > > a ?crit : >> > >> > Hello, >> > >> > I have used the rejectvisual function in attempt to remove bad >> > trials, but after marking them and pressing the quit button, >> > although the command window states that the selected trials have >> > been removed, there is no obvious change in the data; all of the >> > trials are still intact. Have I overlooked something? >> > >> > Thanks, >> > >> > Ashley >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 985/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 5 >> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >> > From: Patricia Wollstadt >> > To: fieldtrip at science.ru.nl >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: <540EEF94.9080601 at gmx.de> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > Hello Max, >> > >> > I added a few comments to the questions regarding individual >> > parameters >> > below. To address the general problem of TRENTOOL telling you, that >> > there are not enough sample points in your data: From what I can see >> > in >> > your script, you probably don't have enough data points in each time >> > series to robustly estimate TE. You analyze 800 ms of data sampled >> > at >> > 300 Hz, which gives you 240 samples per time series. Can you maybe >> > avoid >> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >> > you >> > analyze a longer time window of interest? >> > Note that you also 'lose' data to embedding and the interaction >> > delay: >> > The first point that can be used for TE estimation is at max. >> > embedding >> > length + max. interaction delay in samples. For example: max. >> > embedding >> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >> > max >> > interaction delay of 30 ms = 9 samples. In this example, you would >> > be >> > left with 240 - 29 samples for TE estimation per trial. There is >> > also >> > the possibility to estimate time resolved TE/TE for shorter time >> > windows >> > of interest (see section 4.4 in the manual); however, this method >> > requires the use of a GPU for TE estimation. >> > >> > I would further recommend to use the new pipeline for group >> > statistics >> > described in the manual in section 4.5 (the function >> > 'TEgroup_calculate' >> > is deprecated). The new pipeline allows you to reconstruct the >> > interaction delay and uses the following functions (see also >> > comments in >> > the script): >> > >> > TEgroup_prepare -> prepares all data sets (all subjects/all >> > conditions) for group analysis (this means finding common embedding >> > parameters such that estimates are not biased between groups) >> > InteractionDelayReconstruction_calculate -> estimates TE for >> > individual data sets and all assumed interaction delays u >> > InteractionDelayReconstruction_analyze -> reconstructs the >> > interaction delay by selecting the u that maximizes TE for each >> > channel >> > TEgroup_stats -> calculate group statistics using a permutation test >> > >> > I can send you an example script for group TE analysis using this >> > pipeline to get you started. I hope this helps you to get the group >> > analysis running. Just write again if you're having trouble setting >> > up >> > the pipeline or something is not clear about the parameters/my >> > comments. >> > >> > Best, >> > Patricia >> > >> > >> > >> > >> > On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not >> >> 100% sure if it is appropriate to ask questions about it here, but >> >> to >> >> the best of my knowledge they do not have a mailing list and I saw >> >> a >> >> few trentool questions in the archives, so I'm going to assume it's >> >> ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present >> >> in the pipeline. Sorry in advance for the long post! Any help would >> >> be >> >> greatly appreciated as I'm a bit over my head on this but I think >> >> I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data >> >> that was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi is >> >> in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within the toi, but beyond that are there any benefits to it being >> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >> >> the >> >> toi is in seconds. The prediction time is the assumed interaction >> >> delay between your two sources and should fit within your toi. In >> >> general it is preferable to use the method for interaction delay >> >> reconstruction for TE estimation, because it allows you to >> >> reconstruct >> >> the actual delay between your source and target times series. A >> >> non-optimal u/interaction delay may cause an underestimation of TE, >> >> so >> >> it is recommended to use the pipeline for interaction delay >> >> reconstruction whenever estimating TE for unknown delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, so it is best to limit the u range to values that are >> >> physiologically plausible. >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the >> >> sample rate and filters are used to determine the actthrvalue, but >> >> I >> >> don't actually know the calculation. 7.5 was a rough guess just to >> >> test the pipeline. I'm also uncertain of what minnrtrials should >> >> be.* >> >> PW: You can set the actthrvalue based on the filtering you did >> >> prior >> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >> >> shouldn't find an ACT higher than 30 samples, because you filtered >> >> out >> >> any components of the signal slower than 10 Hz/30 samples (given >> >> your >> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >> >> would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> * >> >> * >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm >> >> yet to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* >> >> PW: The Ragwitz criterion tries to find optimal embedding >> >> parameters >> >> dim and tau for the data. To do that, the method iteratively takes >> >> all >> >> possible combinations of dim and tau values that are provided in >> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >> >> these >> >> combinations embed the data. To test an embedding, the method >> >> builds >> >> the embedding vectors from the data; it then tests for each point >> >> how >> >> well the next point in time can be predicted from the reference >> >> point's nearest neighbours. So for each embedded point, the method >> >> searches for the nearest neighbours and calculates the average of >> >> those nearest neighbours. The difference between the >> >> averaged/predicted point and the actual next point is the error of >> >> the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested >> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together with 'ragtausteps' specifies the tau values to be tested >> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >> >> that >> >> the values here are factors that are later multiplied with the ACT >> >> to >> >> obtain the actual tau. 'repPred' is the number of points that will >> >> be >> >> used for the local prediction, i.e. the Ragwitz criterion will test >> >> the local prediction and calculate the error for the first 100 >> >> points >> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >> >> below >> >> specify the type of neighbour search conducted by the Ragwitz >> >> criterion: 'flagNei' tells the method to either conduct a kNN or >> >> range >> >> search; 'sizeNei' specifies the number of neighbours or the radius >> >> to >> >> be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> * >> >> * >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> * >> >> * >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.*TRENTOOL seems to handle data output very differently >> >> from >> >> fieldtrip and I've had trouble thinking through the most logical >> >> way >> >> to handle the data so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> * >> >> * >> >> *For clarification, fileCell is a cell with the name of each >> >> condition >> >> x subject .mat file, which as I said before is collectively the >> >> same >> >> as the 3 x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> * >> >> * >> >> *At this step I get the following error: >> >> >> >> Error using transferentropy (line 337) >> >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> >> >> Error in TEgroup_calculate (line 133) >> >> [TEresult] = transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate >> >> is a pipeline issue* (I noticed the example pipeline in trentool, >> >> the >> >> manual, and published methods articles all seem to have slightly or >> >> significantly different pipeline compositions), *or if the error >> >> is* >> >> due to ACT, ragwitz optimization, or some other faulty >> >> parameterization *on my part due to a lack of understanding of how >> >> transfer entropy works on a more theoretical/mathematical level*. >> >> If >> >> the latter is the case, is there any relatively straightforward way >> >> to >> >> conceptualize this, or is this something where I'm just going to >> >> have >> >> to keep reading and rereading until it eventually makes sense? I've >> >> already done quite a bit of that and it hasn't pierced my thick >> >> skull >> >> yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> 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: >> > > 97f/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 6 >> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >> > From: Holger Krause >> > To: FieldTrip discussion list >> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >> > days ago >> > Message-ID: >> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >> > Content-Type: text/plain; charset="us-ascii" >> > >> > Dear developers, >> > >> > Could you please check the process for creation/publication of >> > zip-files on >> > the FTP server? The latest file I can find there is >> > fieldtrip-20140906.zip. >> > >> > Thanks in advance, >> > >> > Holger >> > >> > >> > ------------------------------ >> > >> > Message: 7 >> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >> > From: Max Cantor >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > This is immensely helpful, thank you. I was very confused about why >> > some >> > versions of the pipeline I saw were using group calculate and others >> > were >> > using interaction delay reconstruction and what that meant, and I >> > think I >> > have a more clear idea of what the different steps of the pipeline >> > are >> > doing. There are still a few things I'm a bit confused about though >> > in >> > terms of the pipeline. For instance, whether or not I need to do >> > TEprepare >> > before group prepare, and if I need to do graph analysis (which I'm >> > not >> > sure I fully understand but also haven't looked deeply into) before >> > group >> > stats. >> > >> > If you don't mind me taking you up on your offer, I think seeing >> > your >> > example script might help clarify some of these issues. >> > >> > Thank you! >> > >> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >> > Patricia.Wollstadt at gmx.de> wrote: >> > >> >> Hello Max, >> >> >> >> I added a few comments to the questions regarding individual >> >> parameters >> >> below. To address the general problem of TRENTOOL telling you, that >> >> there >> >> are not enough sample points in your data: From what I can see in >> >> your >> >> script, you probably don't have enough data points in each time >> >> series to >> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >> >> which >> >> gives you 240 samples per time series. Can you maybe avoid >> >> downsampling to >> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >> >> longer time >> >> window of interest? >> >> Note that you also 'lose' data to embedding and the interaction >> >> delay: The >> >> first point that can be used for TE estimation is at max. embedding >> >> length >> >> + max. interaction delay in samples. For example: max. embedding >> >> length = >> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >> >> interaction >> >> delay of 30 ms = 9 samples. In this example, you would be left with >> >> 240 - >> >> 29 samples for TE estimation per trial. There is also the >> >> possibility to >> >> estimate time resolved TE/TE for shorter time windows of interest >> >> (see >> >> section 4.4 in the manual); however, this method requires the use >> >> of a GPU >> >> for TE estimation. >> >> >> >> I would further recommend to use the new pipeline for group >> >> statistics >> >> described in the manual in section 4.5 (the function >> >> 'TEgroup_calculate' is >> >> deprecated). The new pipeline allows you to reconstruct the >> >> interaction >> >> delay and uses the following functions (see also comments in the >> >> script): >> >> >> >> TEgroup_prepare -> prepares all data sets (all subjects/all >> >> conditions) >> >> for group analysis (this means finding common embedding parameters >> >> such >> >> that estimates are not biased between groups) >> >> InteractionDelayReconstruction_calculate -> estimates TE for >> >> individual data sets and all assumed interaction delays u >> >> InteractionDelayReconstruction_analyze -> reconstructs the >> >> interaction delay by selecting the u that maximizes TE for each >> >> channel >> >> TEgroup_stats -> calculate group statistics using a permutation >> >> test >> >> >> >> I can send you an example script for group TE analysis using this >> >> pipeline >> >> to get you started. I hope this helps you to get the group analysis >> >> running. Just write again if you're having trouble setting up the >> >> pipeline >> >> or something is not clear about the parameters/my comments. >> >> >> >> Best, >> >> Patricia >> >> >> >> >> >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not 100% >> >> sure if it is appropriate to ask questions about it here, but to >> >> the best >> >> of my knowledge they do not have a mailing list and I saw a few >> >> trentool >> >> questions in the archives, so I'm going to assume it's ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present in >> >> the pipeline. Sorry in advance for the long post! Any help would be >> >> greatly >> >> appreciated as I'm a bit over my head on this but I think I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data that >> >> was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi >> >> is in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within >> >> the toi, but beyond that are there any benefits to it being earlier >> >> or >> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >> >> in >> >> seconds. The prediction time is the assumed interaction delay >> >> between your >> >> two sources and should fit within your toi. In general it is >> >> preferable to >> >> use the method for interaction delay reconstruction for TE >> >> estimation, >> >> because it allows you to reconstruct the actual delay between your >> >> source >> >> and target times series. A non-optimal u/interaction delay may >> >> cause an >> >> underestimation of TE, so it is recommended to use the pipeline for >> >> interaction delay reconstruction whenever estimating TE for unknown >> >> delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, >> >> so it is best to limit the u range to values that are >> >> physiologically >> >> plausible. >> >> >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the sample >> >> rate and filters are used to determine the actthrvalue, but I don't >> >> actually know the calculation. 7.5 was a rough guess just to test >> >> the >> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >> >> You can >> >> set the actthrvalue based on the filtering you did prior to TE >> >> analysis. If >> >> you for example highpass filtered at 10 Hz, you shouldn't find an >> >> ACT >> >> higher than 30 samples, because you filtered out any components of >> >> the >> >> signal slower than 10 Hz/30 samples (given your sampling frequency >> >> of 300 >> >> Hz). So in this scenario the actthrvalue would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm yet >> >> to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* PW: >> >> The Ragwitz criterion tries to find optimal embedding parameters >> >> dim and >> >> tau for the data. To do that, the method iteratively takes all >> >> possible >> >> combinations of dim and tau values that are provided in cfgP.ragdim >> >> and >> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >> >> embed >> >> the data. To test an embedding, the method builds the embedding >> >> vectors >> >> from the data; it then tests for each point how well the next point >> >> in time >> >> can be predicted from the reference point's nearest neighbours. So >> >> for each >> >> embedded point, the method searches for the nearest neighbours and >> >> calculates the average of those nearest neighbours. The difference >> >> between >> >> the averaged/predicted point and the actual next point is the error >> >> of the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested by >> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together >> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >> >> will >> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >> >> here are >> >> factors that are later multiplied with the ACT to obtain the actual >> >> tau. >> >> 'repPred' is the number of points that will be used for the local >> >> prediction, i.e. the Ragwitz criterion will test the local >> >> prediction and >> >> calculate the error for the first 100 points in your time series. >> >> The two >> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >> >> neighbour >> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >> >> method to >> >> either conduct a kNN or range search; 'sizeNei' specifies the >> >> number of >> >> neighbours or the radius to be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' >> >> data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject >> >> virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.* >> >> TRENTOOL seems to handle data output very differently from >> >> fieldtrip and >> >> I've had trouble thinking through the most logical way to handle >> >> the data >> >> so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> >> >> *For clarification, fileCell is a cell with the name of each >> >> condition x >> >> subject .mat file, which as I said before is collectively the same >> >> as the 3 >> >> x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> *At this step I get the following error: Error using >> >> transferentropy (line >> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in >> >> TEgroup_calculate (line 133) [TEresult] = >> >> transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate is a >> >> pipeline issue* (I noticed the example pipeline in trentool, the >> >> manual, >> >> and published methods articles all seem to have slightly or >> >> significantly >> >> different pipeline compositions), *or if the error is* due to ACT, >> >> ragwitz optimization, or some other faulty parameterization *on my >> >> part >> >> due to a lack of understanding of how transfer entropy works on a >> >> more >> >> theoretical/mathematical level*. If the latter is the case, is >> >> there any >> >> relatively straightforward way to conceptualize this, or is this >> >> something >> >> where I'm just going to have to keep reading and rereading until it >> >> eventually makes sense? I've already done quite a bit of that and >> >> it hasn't >> >> pierced my thick skull yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing >> >> > listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie > ldtrip >> >> >> >> >> >> -- >> >> ------------------------------------------------------------ >> >> >> >> 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 >> >> >> > >> > >> > >> > -- >> > Max Cantor >> > Lab Manager >> > Computational Neurolinguistics Lab >> > University of Michigan >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 024/attachment.html> >> > >> > ------------------------------ >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > End of fieldtrip Digest, Vol 46, Issue 3 >> > **************************************** >> > >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jim Herring, MSc. > Neuronal Oscillations Group > Centre for Cognitive Neuroimaging > Donders Institute for Brain, Cognition and Behaviour > Radboud University Nijmegen > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > ------------------------------ > > Message: 8 > Date: Mon, 15 Sep 2014 12:53:19 -0500 > From: "Jing Fan" > To: "'FieldTrip discussion list'" > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of > variable 'abort' > Message-ID: <000301cfd10d$ef53cba0$cdfb62e0$@gmail.com> > Content-Type: text/plain; charset="us-ascii" > > Hi Barbara and Jim, > > I added path your/path/to/fieldtrip/utilities and now it worked. > Hope it helps solve the problem. > > Best, > Jing > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) > Sent: Monday, September 15, 2014 5:01 AM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable > 'abort' > > Dear Barbara, > > The error seems to be related to a bug that pops up now and then > (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a > corrupt installation of fieldtrip and/or the need to update fieldtrip. > > Could you please try downloading the most recent version of fieldtrip and > see if the problem persists? > > For an example of what can be expected from this function see: Esser SK, > Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct > demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res > Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. > > Best, > > Jim > > > ----- Oorspronkelijk bericht ----- >> Van: "barbara schorr" >> Aan: fieldtrip at science.ru.nl >> Verzonden: Woensdag 10 september 2014 14:07:14 >> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable > 'abort' >> Dear fieldtripers. >> >> as mentioned in the subject line I would like to anaylse my timelocked >> ERP Data with the function ft_globalmeanfield. >> >> I get the Error: Undefined function or variable 'abort' >> Error in ft_globalmeanfield (line84) >> if abort >> >> in the function it says: >> >> %the abort variable is set to true or false in ft_preamble_inti >> if abort >> % do not continue function execution in case the outputfile is >> present and the user indicated to keep it >> return >> end >> >> >> I don't understand what this means. I would really appreciate your >> help to get this running. >> >> Also, what is the result when I run this function on my data? (This >> method was proposed from a reviewer. I never used it before, so I >> don't exactly know what it does and what the result will look like). >> >> Thank you very much in advance! >> >> Best, >> >> Barbara Schorr >> >> >> >> >> Zitat von 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: Question regarding nonparametric testing for coherence >> > differences (Eric Maris) >> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >> > 4. Re: ft_rejectvisual: removing trials marked as bad >> > (Caspar, Emilie) >> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >> > 6. Latest FT version on ftp-server is from three days ago >> > (Holger Krause) >> > 7. Re: TRENTOOL pipeline help (Max Cantor) >> > >> > >> > ---------------------------------------------------------------------- >> > >> > Message: 1 >> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >> > From: "Eric Maris" >> > To: , "'FieldTrip discussion list'" >> > >> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >> > for >> > coherence differences >> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Hwee Ling, >> > >> > >> > >> > In the paper you refer to (Maris et al, JNM, 2007), I did not >> > perform a >> > cluster-based permutation test at the level of the channel pairs. >> > Instead, >> > all coherences mentioned in the paper are coherence between a single >> > EMG >> > channel (2 electrodes mounted on the forearm) and all MEG >> > electrodes. Thus, >> > there are as many EMG-MEG coherences as there are MEG channels (275 >> > in our >> > lab), and the clustering of these coherences involves the same >> > neighbourhood >> > structure as the clustering of channel-specific statistics on power >> > or >> > evoked response. The analysis you propose involves clustering in a >> > much more >> > complex space, namely the formed by all (MEG,MEG) channel pairs >> > (275*275=75625 pairs). In the early days of cluster-based >> > permutation >> > statistics, I have worked on this problem but did not pursue it >> > because the >> > resulting clusters are very hard to interpret. >> > >> > >> > >> > Best, >> > >> > >> > >> > Eric Maris >> > >> > >> > >> > >> > >> > Dear all and Prof Maris, >> > >> > I'm re-posting this question again, as I didn't get any replies >> > previously. >> > >> > I?m interested to investigate if there are any differences in phase >> > synchronization in resting state data at timepoint 2 versus >> > timepoint 1. The >> > EEG data was collected using 64 EEG channels, resting state, eyes >> > opened and >> > eyes closed. I?ve arbitrarily segmented the resting state data into >> > epochs >> > of 2s each, and the epochs with artifacts are excluded completely >> > from >> > further analyses. I then performed mtmfft to get the fourier >> > representation >> > of the data, extracted the coherence, and compared the coherence >> > difference >> > of timepoint 2 versus timepoint 1 of all channels paired with all >> > other >> > channels. >> > >> > I figured that if I extract the connectivity analyses without >> > specifying the >> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >> > allow me to >> > perform cluster-based statistical analyses. I get an output with >> > ?chan_chan? >> > dimord variable. However, I was not 100% sure that this is correct, >> > hence, I?ve >> > inserted my code (see below). It?ll be great if you could tell me if >> > what I?m >> > doing makes any sense at all. Also, I don?t know how I can plot the >> > results >> > to see if it make any sense at all. >> > >> > Also, I checked the values obtained from when I specified >> > "cfg.channelcmb" >> > and when I did not specify "cfg.channelcmb", I noticed that the >> > values were >> > somehow different. I would assume that the values to be similar, >> > although >> > I'm not sure why they would have differences in the values obtained >> > from >> > specifying "cfg.channelcmb". >> > >> > This is my code that I've used thus far: >> > >> > for sub = 1:5 >> > >> > cfg = []; >> > >> > cfg.output = 'fourier'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.keeptrials = 'yes'; >> > >> > cfg.tapsmofrq = 5; >> > >> > cfg.foilim = [0 100]; >> > >> > cfg.taper = 'dpss'; >> > >> > % find the index for the c200 condition >> > >> > pre_c200_idx = find(data5.trialinfo == 201); >> > >> > cfg.trials = pre_c200_idx; >> > >> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >> > >> > post_c200_idx = find(data5.trialinfo == 200); >> > >> > cfg.trials = post_c200_idx; >> > >> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >> > >> > >> > >> > cfg = []; >> > >> > cfg.keeptrials = 'no'; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.removemean = 'yes'; >> > >> > cfg.method = 'coh'; >> > >> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_pre_c200); >> > >> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >> > HLF_post_c200); >> > >> > end >> > >> > >> > >> > > load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat > '); >> > >> > cfg_neighb.method = 'template'; >> > >> > cfg_neighb.layout = lay; >> > >> > cfg_neighb.channel = 'all'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, >> > sub_HLF_pre_c200coh{1}); >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.neighbours = neighbours; >> > >> > cfg.channel = 'all'; >> > >> > cfg.channelcmb = {cfg.channel, cfg.channel}; >> > >> > cfg.latency = 'all'; >> > >> > cfg.avgovertime = 'no'; >> > >> > cfg.avgoverchan = 'no'; >> > >> > cfg.parameter = 'cohspctrm'; >> > >> > cfg.method = 'montecarlo'; >> > >> > cfg.statistic = 'depsamplesT'; >> > >> > cfg.correctm = 'cluster'; >> > >> > cfg.tail = 0; >> > >> > % cfg.clustertail = 0; >> > >> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >> > frequency >> > bands. >> > >> > cfg.numrandomization = 10000; >> > >> > cfg.ivar = 2; >> > >> > cfg.uvar = 1; >> > >> > >> > >> > % design matrices >> > >> > clear design; >> > >> > design(1,:) = [1:5, 1:5]; >> > >> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >> > >> > cfg.design = design; >> > >> > % for theta band >> > >> > cfg.avgoverfreq = 'yes'; >> > >> > cfg.frequency = [4 8]; % I also performed the statistics for delta >> > (2-4), >> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >> > (30-40), >> > and gamma (40-100). >> > >> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >> > sub_HLF_post_c200coh{:}, >> > sub_HLF_pre_c200coh{:}); >> > >> > >> > >> > When I tried to plot the results, I used this code: >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.layout = 'lay'; >> > >> > cfg.zlim = [-1 1]; >> > >> > cfg.alpha = 0.05; >> > >> > cfg.refchannel = 'all'; >> > >> > ft_clusterplot(cfg, diffc200_theta_stat); >> > >> > However, I was not sure how I could plot the results. I get an error >> > message >> > from Fieldtrip when using ft_clusterplot: >> > >> > Error using topoplot_common (line 366) >> > >> > no reference channel is specified >> > >> > Error in ft_topoplotTFR (line 192) >> > >> > [cfg] = topoplot_common(cfg, varargin{:}); >> > >> > Error in ft_clusterplot (line 372) >> > >> > ft_topoplotTFR(cfgtopo, stat); >> > >> > >> > >> > According to your paper in 2007, the topoplot of the results were >> > masked by >> > the spatio-spectral pattern of the significant clusters. I don't >> > know how to >> > do this, and I would really appreciate if you can show me how to >> > make such a >> > plot. >> > >> > Thank you very much. >> > >> > Kind regards, >> > >> > Hweeling >> > >> > >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 280/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 2 >> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >> > From: KatrinH Heimann >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > Dear Joseph, thanks so much, I really appreciate your help. I was >> > also >> > wandering, if maybe there is another bug in my code. >> > Our nets are 128 channels, Hydrocel, but as a colleague of me >> > adviced me to >> > do so, I also tried the 129 layout. >> > My code you find below (without selection of bad channels etc.) >> > If you need also the data of two subjects to have a look, let me >> > know!!! >> > Best and thanks really! >> > Katrin >> > >> > >> > subject=input('Which subject do you want to analyse? ','s'); >> > >> > name = strcat(subject,'.raw'); >> > >> > subjectnumber=input('Which is the subjectnumber?', 's'); >> > >> > sb=subjectnumber >> > >> > %subjectnumber = strcat(subjectnumber, '.txt') >> > >> > %% >> > >> > >> > cfg = []; >> > >> > cfg.dataset = name; >> > >> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >> > >> > cfg.trialdef.eventtype = 'trigger'; >> > >> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> > trigger >> > >> > cfg.trialdef.prestim = 0.234; % in seconds >> > >> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> > observation, but maybe we need less) >> > >> > cfg = ft_definetrial(cfg); >> > >> > >> > cfg.trl([1:7],:) = []; >> > >> > >> > %change timeline according to constant offset of 16 ms = 8 samples >> > (because >> > recorded with 500 hz)in >> > >> > %structure trial >> > >> > cfg.trl(:,3)=cfg.trl(:,3)-8 >> > >> > >> > %change timeline to make the cut the zeropoint >> > >> > >> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> > >> > >> > >> > %% preprocess data >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.detrend = 'yes'; >> > >> > cfg.preproc.demean = 'yes'; >> > >> > cfg.preproc.baselinewindow = [-2.1 -2.0] >> > >> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> > filtered >> > >> > %(0.1-45) and bad channels have to be replaced!!!! >> > >> > %cfg.preproc.bpfreq = [6 32]; >> > >> > % >> > >> > % >> > >> > obs_data = ft_preprocessing(cfg); >> > >> > % >> > >> > save (strcat(sb,'obs_data') , 'obs_data') >> > >> > >> > %% determining channel neighbours (necessary for Artifact detection) >> > >> > cfg = []; >> > >> > cfg.channel = obs_data.label; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.feedback = 'yes'; >> > >> > lay = ft_prepare_layout(cfg); >> > >> > >> > >> > cfg_neighb = []; >> > >> > cfg_neighb.feedback = 'yes'; >> > >> > >> > cfg_neighb.method = 'triangulation'; >> > >> > cfg_neighb.layout = 'GSN128.sfp'; >> > >> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > obs_data.elec = ft_read_sens('GSN128.sfp'); >> > >> > >> > %% Artifacts - to detect bad channels - is not saved!!! >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs_data_try = ft_rejectvisual(cfg, obs_data); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_try = ft_rejectartifact (cfg,obs_data); >> > >> > >> > >> > %% Preparing neighbours for channel repair - but bad channel info >> > in!!! >> > >> > >> > % cfg_neighb = []; >> > >> > % cfg_neighb.feedback = 'yes'; >> > >> > % cfg_neighb.method = 'triangulation'; >> > >> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> > >> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> > >> > >> > % Interpolate and put into new data structure >> > >> > cfg = []; >> > >> > cfg.badchannel = {}; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.method = 'nearest'; >> > >> > cfg.neighbours = neighbours; >> > >> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> > >> > >> > % Check reconstruction >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > % dat1=obs_data; >> > >> > % dat2=obs_data_channelrepaired; >> > >> > % >> > >> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> > >> > % y=dat2.trial{1}(62,:); >> > >> > % plot(x);hold on;plot(y,'r'); >> > >> > % >> > >> > % x=dat1.trial{1}(72,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > % >> > >> > % x=dat1.trial{1}(75,:); >> > >> > % y=dat2.trial{1}(75,:); >> > >> > % figure; >> > >> > % plot(x);hold on;plot(y,'r') >> > >> > %% artifact rejection/trial inspection - throw out electrode jumps >> > etc. >> > >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> > >> > >> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> > according to >> > channels interpolated %% 128-number of interp. channels) >> > >> > >> > >> > cfg = []; >> > >> > cfg.channel = {'all'}; >> > >> > cfg.numcomponent = 128 >> > >> > comp = ft_componentanalysis(cfg,obs_data_clean1); >> > >> > save (strcat(sb,'comp_all') , 'comp') >> > >> > >> > %% >> > >> > cfg = []; >> > >> > cfg.viewmode = 'component'; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='some'; >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > ft_databrowser(cfg,comp); >> > >> > >> > %% poweranalysis components >> > >> > cfg = []; >> > >> > cfg.output = 'pow'; >> > >> > cfg.channel = 'all';%compute the power spectrum in all ICs >> > >> > cfg.method = 'mtmfft'; >> > >> > cfg.taper = 'hanning'; >> > >> > cfg.foi = 0:0.2:50; >> > >> > obs_freq = ft_freqanalysis(cfg, comp); >> > >> > >> > %And you can plot the spectra: >> > >> > >> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> > >> > nsubplots = 16; >> > >> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> > decimals, type >> > doc subplot >> > >> > >> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >> > >> > tot = Nfigs*nsubplots; >> > >> > >> > rptvect = 1:size(comp.topo,1); >> > >> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> > >> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> > >> > >> > for r=1:size(rptvect,1); >> > >> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> > 1]);%full >> > screen >> > >> > k=0; >> > >> > for j=1:size(rptvect,2); >> > >> > if~(rptvect(r,j)==0); >> > >> > k=k+1; >> > >> > cfg=[]; >> > >> > cfg.channel = rptvect(r,j); >> > >> > cfg.ylim =[0 500] >> > >> > cfg.xlim =[0 50] >> > >> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> > >> > end >> > >> > end >> > >> > end >> > >> > >> > %For the IC topos you'll follow the same logic as above but with: >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [1:20]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [21:40]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [41:60]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > figure >> > >> > cfg = []; >> > >> > cfg.component = [61:80]; % specify the component(s) that should be >> > plotted >> > >> > cfg.layout = 'GSN128.sfp'; >> > >> > cfg.comment = 'no'; >> > >> > ft_topoplotIC(cfg, comp) >> > >> > >> > >> > >> > >> > >> > %% Seperate observation conditions >> > >> > >> > name1= strcat(num2str(sb),'_90.xls'); >> > >> > list1=xlsread (name1) >> > >> > >> > >> > >> > >> > name2= strcat(num2str(sb),'_180.xls'); >> > >> > list2=xlsread (name2) >> > >> > >> > >> > % >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list1] >> > >> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > cfg = [] >> > >> > cfg.trials = [list2] >> > >> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> > >> > >> > %%PIPELINE FOR obs90 >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128; >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > >> > comp_1 = ft_componentanalysis(cfg, obs90_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> > obs90_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts - final detection >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs90_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> > >> > >> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> > >> > >> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> > >> > >> > %% plot it >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP) >> > >> > >> > >> > >> > >> > >> > >> > %% PIPELINE FOR obs180 >> > >> > >> > >> > %% Decompose original data according to the components found before >> > >> > load (strcat(sb,'comp_all')) >> > >> > >> > cfg = []; >> > >> > cfg.numcomponent = 128 >> > >> > cfg.unmixing = comp.unmixing; >> > >> > cfg.topolabel = comp.topolabel; >> > >> > comp_2 = ft_componentanalysis(cfg, obs180_data); >> > >> > >> > >> > %% Reject component >> > >> > cfg = []; >> > >> > cfg.component = []; >> > >> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> > obs180_data); >> > >> > >> > >> > >> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> > >> > >> > >> > >> > %% Artifacts final 180 >> > >> > >> > >> > cfg.method = 'summary'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >> > >> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> > >> > >> > cfg = []; >> > >> > cfg.viewmode = 'vertical'; >> > >> > cfg.latency=[0 1]; >> > >> > cfg.continuous = 'no'; >> > >> > cfg.plotlabels='yes' >> > >> > cfg = ft_databrowser(cfg,obs180_data_clean3); >> > >> > %cfg.artfctdef.reject = 'complete'; >> > >> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> > >> > >> > >> > % Save clean data >> > >> > >> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> > >> > >> > >> > %% Rereferencing data >> > >> > cfg = []; >> > >> > cfg.channel = 'all'; >> > >> > cfg.preproc.reref = 'yes'; >> > >> > cfg.preproc.refchannel = 'all'; >> > >> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> > >> > >> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> > >> > %% Snap out smaller pieces (the third second) >> > >> > >> > cfg = [] >> > >> > cfg.toilim = [0 1] >> > >> > >> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> > >> > >> > %% TIMELOCK ERP >> > >> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> > >> > >> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> > >> > >> > %% plot 180 ERP >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, obs180_data_ERP) >> > >> > >> > %% plot both ERPs >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay ; >> > >> > cfg.interactive = 'yes'; >> > >> > cfg.showlabels = 'yes'; >> > >> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> > >> > >> > %% plot difference wave >> > >> > >> > difference = obs180_data_ERP; % copy one of the >> > structures >> > >> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >> > the >> > difference ERP >> > >> > >> > >> > cfg = []; >> > >> > cfg.layout = lay; >> > >> > cfg.interactive = 'yes'; >> > >> > ft_multiplotER(cfg, difference) >> > >> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> > >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI >> >> data. A couple things. First of all, exactly which net do you use? >> >> If >> >> they are 129-channel, there is still the question of whether they >> >> are the >> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >> >> cause an >> >> error like this. Could you send me the file you are trying to >> >> process and >> >> the script you are using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >> >> diezmartini at gmail.com> wrote: >> >> >> >> Which nets do you use? I use EGI. I tried both the ones you mention >> >> and >> >> they didn't work. It was hard to find that exact one online but it >> >> was the >> >> only file that actually worked. >> >> >> >> >> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >> >> >> wrote: >> >> >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. >> >>> Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one >> >>> >> >>>> I use >> >>>> >> >>>> >> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >> >>>> katrinheimann at gmail.com> wrote: >> >>>> >> >>>>> Dear all, my problems seem neverending. This time however i >> >>>>> really need >> >>>>> help. >> >>>>> I implemented a pipeline for ERPs. All works now, >> >>>>> trialdefinition, >> >>>>> preprocessing, channelreplacement, ica, componentrejection, >> >>>>> final >> >>>>> artifactdetection, timelock of the single subject data. However, >> >>>>> when I >> >>>>> wanna compute the grandaverage of the single subjects I get the >> >>>>> following >> >>>>> error message: >> >>>>> >> >>>>> computing average of avg over 19 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 3 MB >> >>>>> computing average of avg over 2 subjects >> >>>>> Warning: discarding electrode information because it cannot be >> >>>>> averaged >> >>>>> > In ft_timelockgrandaverage at 249 >> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >> >>>>> required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>>>> additional allocation of an estimated 0 MB >> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >> >>>>> additional >> >>>>> allocation of an estimated 0 MB >> >>>>> >> >>>>> Furthermore in the plot of the significant clusters, the >> >>>>> channelnames >> >>>>> are mixed up (do not correspond to my net) >> >>>>> >> >>>>> >> >>>>> I guess that there is a problem with the layout I use. >> >>>>> Here the code that I use >> >>>>> >> >>>>> %For generating the layout (also in the single subjects): >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = obs_data.label; >> >>>>> >> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>>>> >> >>>>> cfg.feedback = 'yes'; >> >>>>> >> >>>>> lay = ft_prepare_layout(cfg); >> >>>>> >> >>>>> >> >>>>> cfg_neighb = []; >> >>>>> >> >>>>> cfg_neighb.feedback = 'yes'; >> >>>>> >> >>>>> cfg_neighb.method = 'triangulation'; >> >>>>> >> >>>>> cfg_neighb.layout = lay; >> >>>>> >> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>>>> >> >>>>> >> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>>>> >> >>>>> >> >>>>> %For computing the grand average >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.channel = 'all'; >> >>>>> >> >>>>> cfg.latency = 'all'; >> >>>>> >> >>>>> cfg.parameter = 'avg'; >> >>>>> >> >>>>> cfg.keepindividual = 'no' >> >>>>> >> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>>>> >> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>>>> >> >>>>> % "{:}" means to use data from all elements of the variable >> >>>>> >> >>>>> >> >>>>> For plotting the significant clusters >> >>>>> >> >>>>> cfg = []; >> >>>>> >> >>>>> cfg.style = 'blank'; >> >>>>> >> >>>>> cfg.layout = lay; >> >>>>> >> >>>>> cfg.channellabels = 'yes'; >> >>>>> >> >>>>> cfg.highlight = 'labels'; >> >>>>> >> >>>>> cfg.highlightchannel = find(stat.mask); >> >>>>> >> >>>>> cfg.comment = 'no'; >> >>>>> >> >>>>> figure; ft_topoplotER(cfg, GA_90) >> >>>>> >> >>>>> title('Nonparametric: significant with cluster multiple >> >>>>> comparison >> >>>>> correction') >> >>>>> >> >>>>> >> >>>>> Do you have ANY idea to this? I am really completely >> >>>>> helpless.... >> >>>>> >> >>>>> thanks and best >> >>>>> >> >>>>> Katrin >> >>>>> >> >>>>> _______________________________________________ >> >>>>> 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 >> >>> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing list >> >> fieldtrip at donders.ru.nl >> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> >> >> >> >> > ---------------------------------------------------------------------------- > ---- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.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: >> > > b61/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 3 >> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >> > From: Joseph Dien >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > yes, please do send me the data. >> > >> > Thanks! >> > >> > Joe >> > >> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >> > wrote: >> > >> >> Dear Joseph, thanks so much, I really appreciate your help. I was >> >> also wandering, if maybe there is another bug in my code. >> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >> >> adviced me to do so, I also tried the 129 layout. >> >> My code you find below (without selection of bad channels etc.) >> >> If you need also the data of two subjects to have a look, let me >> >> know!!! >> >> Best and thanks really! >> >> Katrin >> >> >> >> >> >> >> >> subject=input('Which subject do you want to analyse? ','s'); >> >> >> >> name = strcat(subject,'.raw'); >> >> >> >> subjectnumber=input('Which is the subjectnumber?', 's'); >> >> >> >> sb=subjectnumber >> >> >> >> %subjectnumber = strcat(subjectnumber, '.txt') >> >> >> >> %% >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.dataset = name; >> >> >> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >> >> >> >> cfg.trialdef.eventtype = 'trigger'; >> >> >> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >> >> trigger >> >> >> >> cfg.trialdef.prestim = 0.234; % in seconds >> >> >> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >> >> observation, but maybe we need less) >> >> >> >> cfg = ft_definetrial(cfg); >> >> >> >> >> >> >> >> cfg.trl([1:7],:) = []; >> >> >> >> >> >> >> >> %change timeline according to constant offset of 16 ms = 8 samples >> >> (because recorded with 500 hz)in >> >> >> >> %structure trial >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >> >> >> >> >> >> >> >> %change timeline to make the cut the zeropoint >> >> >> >> >> >> >> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >> >> >> >> >> >> >> >> >> >> >> >> %% preprocess data >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.detrend = 'yes'; >> >> >> >> cfg.preproc.demean = 'yes'; >> >> >> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >> >> >> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >> >> filtered >> >> >> >> %(0.1-45) and bad channels have to be replaced!!!! >> >> >> >> %cfg.preproc.bpfreq = [6 32]; >> >> >> >> % >> >> >> >> % >> >> >> >> obs_data = ft_preprocessing(cfg); >> >> >> >> % >> >> >> >> save (strcat(sb,'obs_data') , 'obs_data') >> >> >> >> >> >> >> >> %% determining channel neighbours (necessary for Artifact >> >> detection) >> >> >> >> cfg = []; >> >> >> >> cfg.channel = obs_data.label; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.feedback = 'yes'; >> >> >> >> lay = ft_prepare_layout(cfg); >> >> >> >> >> >> cfg_neighb = []; >> >> >> >> cfg_neighb.feedback = 'yes'; >> >> >> >> >> >> >> >> cfg_neighb.method = 'triangulation'; >> >> >> >> cfg_neighb.layout = 'GSN128.sfp'; >> >> >> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >> >> >> >> >> >> >> >> %% Artifacts - to detect bad channels - is not saved!!! >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Preparing neighbours for channel repair - but bad channel info >> >> in!!! >> >> >> >> >> >> >> >> % cfg_neighb = []; >> >> >> >> % cfg_neighb.feedback = 'yes'; >> >> >> >> % cfg_neighb.method = 'triangulation'; >> >> >> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >> >> >> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >> >> >> >> >> >> >> % Interpolate and put into new data structure >> >> >> >> cfg = []; >> >> >> >> cfg.badchannel = {}; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.method = 'nearest'; >> >> >> >> cfg.neighbours = neighbours; >> >> >> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >> >> >> >> >> >> >> >> % Check reconstruction >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> % dat1=obs_data; >> >> >> >> % dat2=obs_data_channelrepaired; >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >> >> >> >> % y=dat2.trial{1}(62,:); >> >> >> >> % plot(x);hold on;plot(y,'r'); >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(72,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> % >> >> >> >> % x=dat1.trial{1}(75,:); >> >> >> >> % y=dat2.trial{1}(75,:); >> >> >> >> % figure; >> >> >> >> % plot(x);hold on;plot(y,'r') >> >> >> >> %% artifact rejection/trial inspection - throw out electrode jumps >> >> etc. >> >> >> >> >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >> >> >> >> >> >> >> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >> >> according to channels interpolated %% 128-number of interp. >> >> channels) >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.channel = {'all'}; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >> >> >> >> save (strcat(sb,'comp_all') , 'comp') >> >> >> >> >> >> >> >> %% >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'component'; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='some'; >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> ft_databrowser(cfg,comp); >> >> >> >> >> >> >> >> %% poweranalysis components >> >> >> >> cfg = []; >> >> >> >> cfg.output = 'pow'; >> >> >> >> cfg.channel = 'all';%compute the power spectrum in all ICs >> >> >> >> cfg.method = 'mtmfft'; >> >> >> >> cfg.taper = 'hanning'; >> >> >> >> cfg.foi = 0:0.2:50; >> >> >> >> obs_freq = ft_freqanalysis(cfg, comp); >> >> >> >> >> >> >> >> %And you can plot the spectra: >> >> >> >> >> >> >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> >> >> >> nsubplots = 16; >> >> >> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >> >> decimals, type doc subplot >> >> >> >> >> >> >> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >> >> >> >> tot = Nfigs*nsubplots; >> >> >> >> >> >> >> >> rptvect = 1:size(comp.topo,1); >> >> >> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >> >> >> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >> >> >> >> >> >> >> >> for r=1:size(rptvect,1); >> >> >> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >> >> 1]);%full screen >> >> >> >> k=0; >> >> >> >> for j=1:size(rptvect,2); >> >> >> >> if~(rptvect(r,j)==0); >> >> >> >> k=k+1; >> >> >> >> cfg=[]; >> >> >> >> cfg.channel = rptvect(r,j); >> >> >> >> cfg.ylim =[0 500] >> >> >> >> cfg.xlim =[0 50] >> >> >> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >> >> >> >> end >> >> >> >> end >> >> >> >> end >> >> >> >> >> >> >> >> %For the IC topos you'll follow the same logic as above but with: >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [1:20]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [21:40]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [41:60]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> figure >> >> >> >> cfg = []; >> >> >> >> cfg.component = [61:80]; % specify the component(s) that >> >> should be plotted >> >> >> >> cfg.layout = 'GSN128.sfp'; >> >> >> >> cfg.comment = 'no'; >> >> >> >> ft_topoplotIC(cfg, comp) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Seperate observation conditions >> >> >> >> >> >> >> >> name1= strcat(num2str(sb),'_90.xls'); >> >> >> >> list1=xlsread (name1) >> >> >> >> >> >> >> >> name2= strcat(num2str(sb),'_180.xls'); >> >> >> >> list2=xlsread (name2) >> >> >> >> >> >> % >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list1] >> >> >> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.trials = [list2] >> >> >> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >> >> >> >> >> >> >> >> %%PIPELINE FOR obs90 >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128; >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> >> >> >> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >> >> obs90_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts - final detection >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >> >> >> >> >> >> >> >> %% plot it >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP) >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% PIPELINE FOR obs180 >> >> >> >> >> >> >> >> >> >> >> >> %% Decompose original data according to the components found before >> >> >> >> load (strcat(sb,'comp_all')) >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.numcomponent = 128 >> >> >> >> cfg.unmixing = comp.unmixing; >> >> >> >> cfg.topolabel = comp.topolabel; >> >> >> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >> >> >> >> >> >> >> >> >> >> >> >> %% Reject component >> >> >> >> cfg = []; >> >> >> >> cfg.component = []; >> >> >> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >> >> obs180_data); >> >> >> >> >> >> >> >> >> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> %% Artifacts final 180 >> >> >> >> >> >> >> >> >> >> >> >> cfg.method = 'summary'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >> >> >> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.viewmode = 'vertical'; >> >> >> >> cfg.latency=[0 1]; >> >> >> >> cfg.continuous = 'no'; >> >> >> >> cfg.plotlabels='yes' >> >> >> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >> >> >> >> %cfg.artfctdef.reject = 'complete'; >> >> >> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >> >> >> >> >> >> >> >> >> >> >> >> % Save clean data >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >> >> >> >> >> >> >> >> >> >> >> >> %% Rereferencing data >> >> >> >> cfg = []; >> >> >> >> cfg.channel = 'all'; >> >> >> >> cfg.preproc.reref = 'yes'; >> >> >> >> cfg.preproc.refchannel = 'all'; >> >> >> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >> >> >> >> %% Snap out smaller pieces (the third second) >> >> >> >> >> >> >> >> cfg = [] >> >> >> >> cfg.toilim = [0 1] >> >> >> >> >> >> >> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >> >> >> >> >> >> >> >> %% TIMELOCK ERP >> >> >> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >> >> >> >> >> >> >> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >> >> >> >> >> >> >> >> %% plot 180 ERP >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot both ERPs >> >> >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay ; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> cfg.showlabels = 'yes'; >> >> >> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >> >> >> >> >> >> >> >> %% plot difference wave >> >> >> >> >> >> >> >> difference = obs180_data_ERP; % copy one of >> >> the structures >> >> >> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >> >> compute the difference ERP >> >> >> >> >> >> cfg = []; >> >> >> >> cfg.layout = lay; >> >> >> >> cfg.interactive = 'yes'; >> >> >> >> ft_multiplotER(cfg, difference) >> >> >> >> >> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >> >> Hi, >> >> I?m one of the main Fieldtrip contributors working on supporting >> >> EGI data. A couple things. First of all, exactly which net do >> >> you use? If they are 129-channel, there is still the question of >> >> whether they are the Hydrocel or the older geodesic nets. >> >> Regardless, that shouldn't cause an error like this. Could you >> >> send me the file you are trying to process and the script you are >> >> using and I?ll try troubleshooting it. >> >> >> >> Joe >> >> >> >> >> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >> >> wrote: >> >> >> >>> Which nets do you use? I use EGI. I tried both the ones you >> >>> mention and they didn't work. It was hard to find that exact one >> >>> online but it was the only file that actually worked. >> >>> >> >>> >> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear Ana, dear all, >> >>> the layout you used does not correspond to our nets. I tried the >> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >> >>> work. Please can anybody help? >> >>> Cheers >> >>> Katrin >> >>> >> >>> >> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >> >>> : >> >>> >> >>> Try this one I use >> >>> >> >>> >> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >> >>> wrote: >> >>> Dear all, my problems seem neverending. This time however i really >> >>> need help. >> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >> >>> preprocessing, channelreplacement, ica, componentrejection, final >> >>> artifactdetection, timelock of the single subject data. However, >> >>> when I wanna compute the grandaverage of the single subjects I get >> >>> the following error message: >> >>> >> >>> computing average of avg over 19 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 3 MB >> >>> computing average of avg over 2 subjects >> >>> Warning: discarding electrode information because it cannot be >> >>> averaged >> >>> > In ft_timelockgrandaverage at 249 >> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >> >>> the additional allocation of an estimated 0 MB >> >>> the call to "ft_prepare_layout" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> the call to "ft_topoplotER" took 0 seconds and required the >> >>> additional allocation of an estimated 0 MB >> >>> >> >>> Furthermore in the plot of the significant clusters, the >> >>> channelnames are mixed up (do not correspond to my net) >> >>> >> >>> >> >>> I guess that there is a problem with the layout I use. >> >>> Here the code that I use >> >>> >> >>> %For generating the layout (also in the single subjects): >> >>> cfg = []; >> >>> >> >>> cfg.channel = obs_data.label; >> >>> >> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >> >>> >> >>> cfg.feedback = 'yes'; >> >>> >> >>> lay = ft_prepare_layout(cfg); >> >>> >> >>> >> >>> cfg_neighb = []; >> >>> >> >>> cfg_neighb.feedback = 'yes'; >> >>> >> >>> cfg_neighb.method = 'triangulation'; >> >>> >> >>> cfg_neighb.layout = lay; >> >>> >> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >> >>> >> >>> >> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >> >>> >> >>> >> >>> >> >>> %For computing the grand average >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.channel = 'all'; >> >>> >> >>> cfg.latency = 'all'; >> >>> >> >>> cfg.parameter = 'avg'; >> >>> >> >>> cfg.keepindividual = 'no' >> >>> >> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >> >>> >> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >> >>> >> >>> % "{:}" means to use data from all elements of the variable >> >>> >> >>> >> >>> For plotting the significant clusters >> >>> >> >>> cfg = []; >> >>> >> >>> cfg.style = 'blank'; >> >>> >> >>> cfg.layout = lay; >> >>> >> >>> cfg.channellabels = 'yes'; >> >>> >> >>> cfg.highlight = 'labels'; >> >>> >> >>> cfg.highlightchannel = find(stat.mask); >> >>> >> >>> cfg.comment = 'no'; >> >>> >> >>> figure; ft_topoplotER(cfg, GA_90) >> >>> >> >>> title('Nonparametric: significant with cluster multiple comparison >> >>> correction') >> >>> >> >>> >> >>> >> >>> Do you have ANY idea to this? I am really completely helpless.... >> >>> >> >>> thanks and best >> >>> >> >>> Katrin >> >>> >> >>> >> >>> _______________________________________________ >> >>> 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 >> >>> >> >>> _______________________________________________ >> >>> fieldtrip mailing list >> >>> fieldtrip at donders.ru.nl >> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> > ---------------------------------------------------------------------------- > ---- >> >> >> >> Joseph Dien, PhD >> >> Research Associate >> >> Cognitive Neurology >> >> The Johns Hopkins University School of Medicine >> >> >> >> Lab E-mail: jdien1 at jhmi.edu >> >> Private E-mail: jdien07 at mac.com >> >> Office Phone: 410-614-3115 >> >> Cell Phone: 202-297-8117 >> >> Fax: 410-955-0188 >> >> http://joedien.com >> >> >> >> >> >> _______________________________________________ >> >> 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 >> > >> > > ---------------------------------------------------------------------------- > ---- >> > >> > Joseph Dien, PhD >> > Research Associate >> > Cognitive Neurology >> > The Johns Hopkins University School of Medicine >> > >> > Lab E-mail: jdien1 at jhmi.edu >> > Private E-mail: jdien07 at mac.com >> > Office Phone: 410-614-3115 >> > Cell Phone: 202-297-8117 >> > Fax: 410-955-0188 >> > http://joedien.com >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > ad2/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 4 >> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >> > From: "Caspar, Emilie" >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >> > bad >> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >> > Content-Type: text/plain; charset="iso-8859-1" >> > >> > Hi Ashley, >> > >> > Maybe the mistake is you did not integrate in your script the >> > command to save the rejection. Normally, with the following command, >> > you will see in the Matlab Window that artifacts are correctly >> > rejected after the "quit" button. >> > >> > clean_data = ft_rejectvisual(cfg, interpoldata); >> > cfg.artfctdef.reject = 'complete'; >> > cfg.artfctdef.feedback = 'yes'; >> > cleandata = ft_rejectartifact(cfg,clean_data); >> > >> > Emilie >> > >> > >> > >> > >> > >> > Le 3 sept. 2014 ? 11:58, Ashley Greene >> > > a ?crit : >> > >> > Hello, >> > >> > I have used the rejectvisual function in attempt to remove bad >> > trials, but after marking them and pressing the quit button, >> > although the command window states that the selected trials have >> > been removed, there is no obvious change in the data; all of the >> > trials are still intact. Have I overlooked something? >> > >> > Thanks, >> > >> > Ashley >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 985/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 5 >> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >> > From: Patricia Wollstadt >> > To: fieldtrip at science.ru.nl >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: <540EEF94.9080601 at gmx.de> >> > Content-Type: text/plain; charset="windows-1252" >> > >> > Hello Max, >> > >> > I added a few comments to the questions regarding individual >> > parameters >> > below. To address the general problem of TRENTOOL telling you, that >> > there are not enough sample points in your data: From what I can see >> > in >> > your script, you probably don't have enough data points in each time >> > series to robustly estimate TE. You analyze 800 ms of data sampled >> > at >> > 300 Hz, which gives you 240 samples per time series. Can you maybe >> > avoid >> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >> > you >> > analyze a longer time window of interest? >> > Note that you also 'lose' data to embedding and the interaction >> > delay: >> > The first point that can be used for TE estimation is at max. >> > embedding >> > length + max. interaction delay in samples. For example: max. >> > embedding >> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >> > max >> > interaction delay of 30 ms = 9 samples. In this example, you would >> > be >> > left with 240 - 29 samples for TE estimation per trial. There is >> > also >> > the possibility to estimate time resolved TE/TE for shorter time >> > windows >> > of interest (see section 4.4 in the manual); however, this method >> > requires the use of a GPU for TE estimation. >> > >> > I would further recommend to use the new pipeline for group >> > statistics >> > described in the manual in section 4.5 (the function >> > 'TEgroup_calculate' >> > is deprecated). The new pipeline allows you to reconstruct the >> > interaction delay and uses the following functions (see also >> > comments in >> > the script): >> > >> > TEgroup_prepare -> prepares all data sets (all subjects/all >> > conditions) for group analysis (this means finding common embedding >> > parameters such that estimates are not biased between groups) >> > InteractionDelayReconstruction_calculate -> estimates TE for >> > individual data sets and all assumed interaction delays u >> > InteractionDelayReconstruction_analyze -> reconstructs the >> > interaction delay by selecting the u that maximizes TE for each >> > channel >> > TEgroup_stats -> calculate group statistics using a permutation test >> > >> > I can send you an example script for group TE analysis using this >> > pipeline to get you started. I hope this helps you to get the group >> > analysis running. Just write again if you're having trouble setting >> > up >> > the pipeline or something is not clear about the parameters/my >> > comments. >> > >> > Best, >> > Patricia >> > >> > >> > >> > >> > On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not >> >> 100% sure if it is appropriate to ask questions about it here, but >> >> to >> >> the best of my knowledge they do not have a mailing list and I saw >> >> a >> >> few trentool questions in the archives, so I'm going to assume it's >> >> ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present >> >> in the pipeline. Sorry in advance for the long post! Any help would >> >> be >> >> greatly appreciated as I'm a bit over my head on this but I think >> >> I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data >> >> that was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi is >> >> in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within the toi, but beyond that are there any benefits to it being >> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >> >> the >> >> toi is in seconds. The prediction time is the assumed interaction >> >> delay between your two sources and should fit within your toi. In >> >> general it is preferable to use the method for interaction delay >> >> reconstruction for TE estimation, because it allows you to >> >> reconstruct >> >> the actual delay between your source and target times series. A >> >> non-optimal u/interaction delay may cause an underestimation of TE, >> >> so >> >> it is recommended to use the pipeline for interaction delay >> >> reconstruction whenever estimating TE for unknown delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, so it is best to limit the u range to values that are >> >> physiologically plausible. >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the >> >> sample rate and filters are used to determine the actthrvalue, but >> >> I >> >> don't actually know the calculation. 7.5 was a rough guess just to >> >> test the pipeline. I'm also uncertain of what minnrtrials should >> >> be.* >> >> PW: You can set the actthrvalue based on the filtering you did >> >> prior >> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >> >> shouldn't find an ACT higher than 30 samples, because you filtered >> >> out >> >> any components of the signal slower than 10 Hz/30 samples (given >> >> your >> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >> >> would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> * >> >> * >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm >> >> yet to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* >> >> PW: The Ragwitz criterion tries to find optimal embedding >> >> parameters >> >> dim and tau for the data. To do that, the method iteratively takes >> >> all >> >> possible combinations of dim and tau values that are provided in >> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >> >> these >> >> combinations embed the data. To test an embedding, the method >> >> builds >> >> the embedding vectors from the data; it then tests for each point >> >> how >> >> well the next point in time can be predicted from the reference >> >> point's nearest neighbours. So for each embedded point, the method >> >> searches for the nearest neighbours and calculates the average of >> >> those nearest neighbours. The difference between the >> >> averaged/predicted point and the actual next point is the error of >> >> the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested >> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together with 'ragtausteps' specifies the tau values to be tested >> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >> >> that >> >> the values here are factors that are later multiplied with the ACT >> >> to >> >> obtain the actual tau. 'repPred' is the number of points that will >> >> be >> >> used for the local prediction, i.e. the Ragwitz criterion will test >> >> the local prediction and calculate the error for the first 100 >> >> points >> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >> >> below >> >> specify the type of neighbour search conducted by the Ragwitz >> >> criterion: 'flagNei' tells the method to either conduct a kNN or >> >> range >> >> search; 'sizeNei' specifies the number of neighbours or the radius >> >> to >> >> be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> * >> >> * >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> * >> >> * >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.*TRENTOOL seems to handle data output very differently >> >> from >> >> fieldtrip and I've had trouble thinking through the most logical >> >> way >> >> to handle the data so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> * >> >> * >> >> *For clarification, fileCell is a cell with the name of each >> >> condition >> >> x subject .mat file, which as I said before is collectively the >> >> same >> >> as the 3 x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> * >> >> * >> >> *At this step I get the following error: >> >> >> >> Error using transferentropy (line 337) >> >> \nTRENTOOL ERROR: not enough data points left after embedding >> >> >> >> Error in TEgroup_calculate (line 133) >> >> [TEresult] = transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate >> >> is a pipeline issue* (I noticed the example pipeline in trentool, >> >> the >> >> manual, and published methods articles all seem to have slightly or >> >> significantly different pipeline compositions), *or if the error >> >> is* >> >> due to ACT, ragwitz optimization, or some other faulty >> >> parameterization *on my part due to a lack of understanding of how >> >> transfer entropy works on a more theoretical/mathematical level*. >> >> If >> >> the latter is the case, is there any relatively straightforward way >> >> to >> >> conceptualize this, or is this something where I'm just going to >> >> have >> >> to keep reading and rereading until it eventually makes sense? I've >> >> already done quite a bit of that and it hasn't pierced my thick >> >> skull >> >> yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> 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: >> > > 97f/attachment-0001.html> >> > >> > ------------------------------ >> > >> > Message: 6 >> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >> > From: Holger Krause >> > To: FieldTrip discussion list >> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >> > days ago >> > Message-ID: >> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >> > Content-Type: text/plain; charset="us-ascii" >> > >> > Dear developers, >> > >> > Could you please check the process for creation/publication of >> > zip-files on >> > the FTP server? The latest file I can find there is >> > fieldtrip-20140906.zip. >> > >> > Thanks in advance, >> > >> > Holger >> > >> > >> > ------------------------------ >> > >> > Message: 7 >> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >> > From: Max Cantor >> > To: FieldTrip discussion list >> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >> > Message-ID: >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > This is immensely helpful, thank you. I was very confused about why >> > some >> > versions of the pipeline I saw were using group calculate and others >> > were >> > using interaction delay reconstruction and what that meant, and I >> > think I >> > have a more clear idea of what the different steps of the pipeline >> > are >> > doing. There are still a few things I'm a bit confused about though >> > in >> > terms of the pipeline. For instance, whether or not I need to do >> > TEprepare >> > before group prepare, and if I need to do graph analysis (which I'm >> > not >> > sure I fully understand but also haven't looked deeply into) before >> > group >> > stats. >> > >> > If you don't mind me taking you up on your offer, I think seeing >> > your >> > example script might help clarify some of these issues. >> > >> > Thank you! >> > >> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >> > Patricia.Wollstadt at gmx.de> wrote: >> > >> >> Hello Max, >> >> >> >> I added a few comments to the questions regarding individual >> >> parameters >> >> below. To address the general problem of TRENTOOL telling you, that >> >> there >> >> are not enough sample points in your data: From what I can see in >> >> your >> >> script, you probably don't have enough data points in each time >> >> series to >> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >> >> which >> >> gives you 240 samples per time series. Can you maybe avoid >> >> downsampling to >> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >> >> longer time >> >> window of interest? >> >> Note that you also 'lose' data to embedding and the interaction >> >> delay: The >> >> first point that can be used for TE estimation is at max. embedding >> >> length >> >> + max. interaction delay in samples. For example: max. embedding >> >> length = >> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >> >> interaction >> >> delay of 30 ms = 9 samples. In this example, you would be left with >> >> 240 - >> >> 29 samples for TE estimation per trial. There is also the >> >> possibility to >> >> estimate time resolved TE/TE for shorter time windows of interest >> >> (see >> >> section 4.4 in the manual); however, this method requires the use >> >> of a GPU >> >> for TE estimation. >> >> >> >> I would further recommend to use the new pipeline for group >> >> statistics >> >> described in the manual in section 4.5 (the function >> >> 'TEgroup_calculate' is >> >> deprecated). The new pipeline allows you to reconstruct the >> >> interaction >> >> delay and uses the following functions (see also comments in the >> >> script): >> >> >> >> TEgroup_prepare -> prepares all data sets (all subjects/all >> >> conditions) >> >> for group analysis (this means finding common embedding parameters >> >> such >> >> that estimates are not biased between groups) >> >> InteractionDelayReconstruction_calculate -> estimates TE for >> >> individual data sets and all assumed interaction delays u >> >> InteractionDelayReconstruction_analyze -> reconstructs the >> >> interaction delay by selecting the u that maximizes TE for each >> >> channel >> >> TEgroup_stats -> calculate group statistics using a permutation >> >> test >> >> >> >> I can send you an example script for group TE analysis using this >> >> pipeline >> >> to get you started. I hope this helps you to get the group analysis >> >> running. Just write again if you're having trouble setting up the >> >> pipeline >> >> or something is not clear about the parameters/my comments. >> >> >> >> Best, >> >> Patricia >> >> >> >> >> >> >> >> >> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >> >> >> >> Hi fieldtrippers, >> >> >> >> I know trentool is not produced by the Donders Institute, so I'm >> >> not 100% >> >> sure if it is appropriate to ask questions about it here, but to >> >> the best >> >> of my knowledge they do not have a mailing list and I saw a few >> >> trentool >> >> questions in the archives, so I'm going to assume it's ok... >> >> >> >> In any case, below is my current pipeline (slightly modified for >> >> comprehensibility): >> >> >> >> (notes in bold are comments/questions made in this email, not >> >> present in >> >> the pipeline. Sorry in advance for the long post! Any help would be >> >> greatly >> >> appreciated as I'm a bit over my head on this but I think I'm >> >> close!) >> >> >> >> ***** >> >> >> >> % Prepare group TE data >> >> >> >> cfgP = []; >> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >> >> cfgP.TEcalctype = 'VW_ds'; >> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >> >> >> >> *I'm trying to find the transfer entropy between the left and right >> >> auditory cortices in my experiment. The input is virtual sensor >> >> data that >> >> was produced using SAM in fieldtrip on real MEG data. * >> >> >> >> % specify u to be scanned >> >> >> >> cfgP.predicttime_u = 30; >> >> cfgP.toi = [-0.4 0.4]; >> >> >> >> *For clarification, the predicttime_u is in seconds but the toi >> >> is in >> >> milliseconds. If I understand correctly, the predicttime_u must fit >> >> within >> >> the toi, but beyond that are there any benefits to it being earlier >> >> or >> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >> >> in >> >> seconds. The prediction time is the assumed interaction delay >> >> between your >> >> two sources and should fit within your toi. In general it is >> >> preferable to >> >> use the method for interaction delay reconstruction for TE >> >> estimation, >> >> because it allows you to reconstruct the actual delay between your >> >> source >> >> and target times series. A non-optimal u/interaction delay may >> >> cause an >> >> underestimation of TE, so it is recommended to use the pipeline for >> >> interaction delay reconstruction whenever estimating TE for unknown >> >> delays. >> >> If you use the methods for interaction delay reconstruction >> >> 'predicttime_u' is replaced by >> >> cfgTEP.predicttimemin_u % minimum u to be scanned >> >> cfgTEP.predicttimemax_u % maximum u to be scanned >> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >> >> A large range for u values to be scanned increases computing time a >> >> lot, >> >> so it is best to limit the u range to values that are >> >> physiologically >> >> plausible. >> >> >> >> >> >> % ACT (Autocorrelation Time) estimation and constraints >> >> >> >> cfgP.maxlag = 150; >> >> cfgP.actthrvalue = 7.5; >> >> cfgP.minnrtrials = 5; >> >> >> >> *My understanding is maxlag should be 1/2 the sampling rate, so >> >> since >> >> the data are downsampled to 300hz, it should be 150. I know that >> >> the sample >> >> rate and filters are used to determine the actthrvalue, but I don't >> >> actually know the calculation. 7.5 was a rough guess just to test >> >> the >> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >> >> You can >> >> set the actthrvalue based on the filtering you did prior to TE >> >> analysis. If >> >> you for example highpass filtered at 10 Hz, you shouldn't find an >> >> ACT >> >> higher than 30 samples, because you filtered out any components of >> >> the >> >> signal slower than 10 Hz/30 samples (given your sampling frequency >> >> of 300 >> >> Hz). So in this scenario the actthrvalue would be 30. >> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >> >> is >> >> needed to realize the permutation test for estimated TE values). >> >> >> >> >> >> % Optimization >> >> >> >> cfgP.optimizemethod = 'ragwitz'; >> >> cfgP.ragdim = 4:8; >> >> cfgP.ragtaurange = [0.2 0.4]; >> >> cfgP.ragtausteps = 15; >> >> cfgP.repPred = 100; >> >> >> >> *I am completely at a loss for this. I've done some reading into >> >> transfer entropy, mutual information, etc., cited in trentool, but >> >> I'm yet >> >> to understand how exactly this optimization works and what the >> >> configuration should be, given my data and experimental >> >> intentions.* PW: >> >> The Ragwitz criterion tries to find optimal embedding parameters >> >> dim and >> >> tau for the data. To do that, the method iteratively takes all >> >> possible >> >> combinations of dim and tau values that are provided in cfgP.ragdim >> >> and >> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >> >> embed >> >> the data. To test an embedding, the method builds the embedding >> >> vectors >> >> from the data; it then tests for each point how well the next point >> >> in time >> >> can be predicted from the reference point's nearest neighbours. So >> >> for each >> >> embedded point, the method searches for the nearest neighbours and >> >> calculates the average of those nearest neighbours. The difference >> >> between >> >> the averaged/predicted point and the actual next point is the error >> >> of the >> >> local predictor. The Ragwitz criterion will then return the >> >> parameter >> >> combination for which this error over all points is minimal. >> >> The parameters set the following: 'ragdim' are dimensions to be >> >> tested by >> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >> >> together >> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >> >> will >> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >> >> here are >> >> factors that are later multiplied with the ACT to obtain the actual >> >> tau. >> >> 'repPred' is the number of points that will be used for the local >> >> prediction, i.e. the Ragwitz criterion will test the local >> >> prediction and >> >> calculate the error for the first 100 points in your time series. >> >> The two >> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >> >> neighbour >> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >> >> method to >> >> either conduct a kNN or range search; 'sizeNei' specifies the >> >> number of >> >> neighbours or the radius to be searched by a range search. >> >> >> >> >> >> % Kernel-based TE estimation >> >> >> >> cfgP.flagNei = 'Mass'; >> >> cfgP.sizeNei = 4; % Default >> >> >> >> cfgP.ensemblemethod = 'no'; >> >> cfgP.outputpath = *OUTPUT PATH*; >> >> >> >> if ~exist(*Path for TEprepare data object*) >> >> load VSdat; >> >> TE_Wrd = {}; >> >> for i = 1:nConds >> >> for j = 1:Nsub >> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >> >> end >> >> end >> >> clear VSdat; >> >> save('TE_Wrd', 'TE_Wrd'); >> >> end >> >> >> >> *The configuration and virtual sensor data, organized in a 3 x 15 >> >> cell >> >> of structures (condition by subject) are the input. The TEprepare >> >> substructure is added to each individual condition x subject .mat >> >> files' >> >> data structure which are stored on disk independently.* >> >> >> >> % Use object_to_mat_conversion.m to replace individual condition x >> >> subject >> >> virtual sensor data >> >> % .mat files with their TE_Wrd equivalent >> >> >> >> *I'm using a separate script to make some manipulations to the >> >> objects >> >> from disk; this will all eventually be integrated into the main >> >> pipeline*.* >> >> TRENTOOL seems to handle data output very differently from >> >> fieldtrip and >> >> I've had trouble thinking through the most logical way to handle >> >> the data >> >> so it's a bit haphazard right now.* >> >> >> >> load cond080sub01.mat >> >> >> >> cfgG = []; >> >> cfgG.dim = cond080sub01.TEprepare.optdim; >> >> cfgG.tau = cond080sub01.TEprepare.opttau; >> >> >> >> if isfield(cond080sub01, 'TEprepare') >> >> TEgroup_prepare(cfgG, fileCell); >> >> else >> >> error('Need to run TEprepare before TEgroup_prepare'); >> >> end >> >> >> >> *For clarification, fileCell is a cell with the name of each >> >> condition x >> >> subject .mat file, which as I said before is collectively the same >> >> as the 3 >> >> x 15 VSdat structure (condition x subject).* >> >> >> >> % Replace .mat files with '_for_TEgroup_calculate' version in >> >> % object_to_mat_conversion.m >> >> >> >> % TE Group Calculate >> >> >> >> load cond080sub01.mat >> >> if isfield(cond080sub01, 'TEgroupprepare') >> >> for i = 1:length(fileCell) >> >> TEgroup_calculate(fileCell{i}); >> >> end >> >> else >> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >> >> end >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> *At this step I get the following error: Error using >> >> transferentropy (line >> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >> >> Error in >> >> TEgroup_calculate (line 133) [TEresult] = >> >> transferentropy(cfg,data);* >> >> >> >> % TE Group Stats >> >> >> >> cfgGSTAT = []; >> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >> >> >> >> cfgGSTAT.uvar = 1; >> >> cfgGSTAT.ivar = 2; >> >> cfgGSTAT.fileidout = 'test_groupstats'; >> >> >> >> TEgroup_stats(cfgGSTAT, fileCell); >> >> >> >> *Given the error above, I am yet to get to this step, but it does >> >> not >> >> seem fundamentally different from normal fieldtrip stats.* >> >> >> >> ***** >> >> >> >> In case my notes were not clear or you skipped to the bottom, *my >> >> primary concern is whether the error I'm getting in >> >> TEgroup_calculate is a >> >> pipeline issue* (I noticed the example pipeline in trentool, the >> >> manual, >> >> and published methods articles all seem to have slightly or >> >> significantly >> >> different pipeline compositions), *or if the error is* due to ACT, >> >> ragwitz optimization, or some other faulty parameterization *on my >> >> part >> >> due to a lack of understanding of how transfer entropy works on a >> >> more >> >> theoretical/mathematical level*. If the latter is the case, is >> >> there any >> >> relatively straightforward way to conceptualize this, or is this >> >> something >> >> where I'm just going to have to keep reading and rereading until it >> >> eventually makes sense? I've already done quite a bit of that and >> >> it hasn't >> >> pierced my thick skull yet but I'm sure it will eventually! >> >> >> >> Thank you so much, >> >> >> >> Max Cantor >> >> >> >> >> >> -- >> >> Max Cantor >> >> Lab Manager >> >> Computational Neurolinguistics Lab >> >> University of Michigan >> >> >> >> >> >> _______________________________________________ >> >> fieldtrip mailing >> >> > listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie > ldtrip >> >> >> >> >> >> -- >> >> ------------------------------------------------------------ >> >> >> >> 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 >> >> >> > >> > >> > >> > -- >> > Max Cantor >> > Lab Manager >> > Computational Neurolinguistics Lab >> > University of Michigan >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: >> > > 024/attachment.html> >> > >> > ------------------------------ >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > End of fieldtrip Digest, Vol 46, Issue 3 >> > **************************************** >> > >> >> >> >> Barbara Schorr, MSc >> Clinical and Biological Psychology >> University of Ulm >> Albert-Einstein-Allee 47 >> 89069 Ulm >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Jim Herring, MSc. > Neuronal Oscillations Group > Centre for Cognitive Neuroimaging > Donders Institute for Brain, Cognition and Behaviour > Radboud University Nijmegen > _______________________________________________ > 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 > > End of fieldtrip Digest, Vol 46, Issue 5 > **************************************** > Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From barbara.schorr at uni-ulm.de Wed Sep 17 12:13:04 2014 From: barbara.schorr at uni-ulm.de (barbara.schorr at uni-ulm.de) Date: Wed, 17 Sep 2014 12:13:04 +0200 Subject: [FieldTrip] ft_globalmeanfield works In-Reply-To: References: Message-ID: <20140917121304.oegwu3yyo4004s8c@imap.uni-ulm.de> Dear Jim, I found the problem. I still had an older Fieldtrip version on my computer and this interfered somehow. I deleted that version and now it works. Best, Barbara Zitat von 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. dipole simulation on head model (gamaliel huerta urrea) > 2. Re: dipole simulation on head model (a.stolk) > 3. Re: Latest FT version on ftp-server is from three days ago > (Holger Krause) > 4. Re: Latest FT version on ftp-server is from three days ago > (Robert Oostenveld) > 5. difference in raw time sample values for .fif files read by > fieldtrip vs mne-python (Baptiste Gauthier) > 6. ft_connectivityanalysis vs MATLAB (Matt Gerhold) > 7. ft_connectivity_pdc (Matt Gerhold) > 8. dipole simulation on head model (gamaliel huerta urrea) > 9. Re: MEG lead field units (Marc Lalancette) > 10. Re: ft_globalmeanfield : Undefined function of variable > (barbara.schorr at uni-ulm.de) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 16 Sep 2014 01:49:37 -0300 > From: gamaliel huerta urrea > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] dipole simulation on head model > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi all > > I followed the tips above to simulate a dipole source on my own head model > generated from MRIs. However, using information from: > > http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit > > I could not simulate anything. Only one image is blank. The code I am using > is as follows: > > cfg = []; > cfg.vol = vol; % See above > cfg.elec = elec; % See above > cfg.dip.pos = [0 0 0]; > cfg.dip.mom = [2 2 2]; % Note, it Should be transposed > cfg.dip.frequency = 10; > cfg.ntrials = 10; > cfg.triallength = 1; % seconds > cfg.fsample = 25; % Hz > raw1 = ft_dipolesimulation (cfg); > ft_timelockanalysis avg1 = ([], raw1); > plot (avg1.time, avg1.avg); % Plot the timecourse > > where: > > vol = ft_prepare_headmodel volumes generated from the segmentation of my > resonances. > > and > > ft_read_sens elec = ('standard_1020.elc'); > > to run the script the result is a blank image. > > and Matlab tells me the following: > > using headmodel specified in the configuration > using electrodes specified in the configuration > Determining source compartment (1) > projecting electrodes on skin surface > electrode and system combine combining transfer matrix > computing simulated data > computing simulated trial data for 10 > > RMS value of simulated data is NaN > the call to "ft_dipolesimulation" took 4 seconds > the input is raw Data with 97 channels and 10 trials > Warning: the data does not Contain a definition trial >> In utilities \ private \ warning_once at 158 > In utilities \ private \ fixsampleinfo at 66 > In ft_datatype_raw at 157 > In ft_checkdata at 224 > In ft_timelockanalysis at 105 > In codgen at 50 > Warning: sampleinfo by reconstructing Assuming That the trials are > consecutive segments of > a continuous recording >> In utilities \ private \ warning_once at 158 > In utilities \ private \ fixsampleinfo at 79 > In ft_datatype_raw at 157 > In ft_checkdata at 224 > In ft_timelockanalysis at 105 > In codgen at 50 > averaging trials > trial averaging 10 of 10 > > the call to "ft_timelockanalysis" took 1 seconds > > > I hope you can help > > > greetings > -- > *Gamaliel Huerta* > *Ingenier?a Civil Biom?dica* > *Universidad de Valpara?so* > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 2 > Date: Tue, 16 Sep 2014 08:07:19 +0200 > From: "a.stolk" > To: FieldTrip discussion list > Subject: Re: [FieldTrip] dipole simulation on head model > Message-ID: > Content-Type: text/plain; charset="utf-8" > > Hi Gamaliel, can you try > avg = ft_timelockanalysis([], raw1);? > Instead of > ft_timelockanalysis avg1 = ([], raw1);? > Hope this helps, arjen > > > > -------- Oorspronkelijk bericht -------- > Van: gamaliel huerta urrea > Datum: > Aan: fieldtrip at science.ru.nl > Onderwerp: [FieldTrip] dipole simulation on head model > > > Hi all > > I followed the tips above to simulate a dipole source on my own head > model generated from MRIs. However, using information from:? > > http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit > > I could not simulate anything. Only one image is blank. The code I > am using is as follows:? > > cfg = [];? > cfg.vol = vol; % See above? > cfg.elec = elec; % See above? > cfg.dip.pos = [0 0 0];? > cfg.dip.mom = [2 2 2]; % Note, it Should be transposed? > cfg.dip.frequency = 10;? > cfg.ntrials = 10;? > cfg.triallength = 1; % seconds? > cfg.fsample = 25; % Hz? > raw1 = ft_dipolesimulation (cfg);? > ft_timelockanalysis avg1 = ([], raw1);? > plot (avg1.time, avg1.avg); % Plot the timecourse? > > where:? > > vol = ft_prepare_headmodel volumes generated from the segmentation > of my resonances.? > > and? > > ft_read_sens elec = ('standard_1020.elc');? > > to run the script the result is a blank image.? > > and Matlab tells me the following:? > > using headmodel specified in the configuration? > using electrodes specified in the configuration? > Determining source compartment (1)? > projecting electrodes on skin surface? > electrode and system combine combining transfer matrix? > computing simulated data? > computing simulated trial data for 10? > > RMS value of simulated data is NaN? > the call to "ft_dipolesimulation" took 4 seconds? > the input is raw Data with 97 channels and 10 trials? > Warning: the data does not Contain a definition trial? >> In utilities \ private \ warning_once at 158? > ? ?In utilities \ private \ fixsampleinfo at 66? > ? ?In ft_datatype_raw at 157? > ? ?In ft_checkdata at 224? > ? ?In ft_timelockanalysis at 105? > ? ?In codgen at 50? > Warning: sampleinfo by reconstructing Assuming That the trials are > consecutive segments of? > a continuous recording? >> In utilities \ private \ warning_once at 158? > ? ?In utilities \ private \ fixsampleinfo at 79? > ? ?In ft_datatype_raw at 157? > ? ?In ft_checkdata at 224? > ? ?In ft_timelockanalysis at 105? > ? ?In codgen at 50? > averaging trials? > trial averaging 10 of 10? > > the call to "ft_timelockanalysis" took 1 seconds? > > > I hope you can help? > > > greetings > -- > Gamaliel Huerta > Ingenier?a Civil Biom?dica > Universidad de Valpara?so > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 3 > Date: Tue, 16 Sep 2014 11:35:30 +0200 > From: Holger Krause > To: > Subject: Re: [FieldTrip] Latest FT version on ftp-server is from three > days ago > Message-ID: <201409161135.32594.Holger.Krause at med.uni-duesseldorf.de> > Content-Type: text/plain; charset="iso-8859-15" > > Hi! > > Again, same situation as last week :-( The latest file I can find on the FTP > server is fieldtrip-20140913.zip. > > Thanks for taking care of this issue, > > 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 > > > > ------------------------------ > > Message: 4 > Date: Tue, 16 Sep 2014 12:15:11 +0200 > From: Robert Oostenveld > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Latest FT version on ftp-server is from three > days ago > Message-ID: <4C0CDFB7-782E-49C1-9659-B85ABB918486 at donders.ru.nl> > Content-Type: text/plain; charset=iso-8859-1 > > Hi Holger, > > Thanks for notifying. We had a server crash a few days ago. One of > the consequences seems to have been that the automatic svn update > script blocked. I did a cleanup and the automatic releases on the > ftp should start coming again. Note that alternative ways to access > the code are explained on > http://fieldtrip.fcdonders.nl/faq/i_would_like_an_automatic_daily_updated_version_of_the_code_can_i_get_access_to_the_cvs_or_snv_server > > best regards, > Robert > > > > On 16 Sep 2014, at 11:35, Holger Krause > wrote: > >> Hi! >> >> Again, same situation as last week :-( The latest file I can find on the FTP >> server is fieldtrip-20140913.zip. >> >> Thanks for taking care of this issue, >> >> 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 > > > > > ------------------------------ > > Message: 5 > Date: Tue, 16 Sep 2014 14:27:15 +0200 > From: Baptiste Gauthier > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] difference in raw time sample values for .fif > files read by fieldtrip vs mne-python > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Dear fieldtrippers, > > I recently observed that reading a raw neuromag .fif file with fieldtrip > and mne-python (with default settings for both) give exactly the same > events separated by the same time (which is good!) but with a different > time offset: the zero-point definition for the recording differ between the > two softwares. I hypothesize that this difference comes from the convention > adopted: fieldtrip would use the "record raw" trigger as a zero-point and > mne the "start" trigger that occur earlier (i.e. you can follow the signal > but it will be not saved in the file), but I'm not perfectly sure. > > As someone already observed this difference? > It's harmless because it doesn't affect relative timing of the event but > become problematic to transfer recoded events trl from fieldtrip to > mne-python with a time-sample matching strategy. > > Best, > > Baptiste > > -- > Baptiste Gauthier > Postdoctoral Research Fellow > > INSERM-CEA Cognitive Neuroimaging unit > CEA/SAC/DSV/DRM/Neurospin center > B?t 145, Point Courier 156 > F-91191 Gif-sur-Yvette Cedex FRANCE > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 6 > Date: Tue, 16 Sep 2014 17:03:33 +0200 > From: Matt Gerhold > To: fieldtrip at science.ru.nl, fieldtrip-request at science.ru.nl > Subject: [FieldTrip] ft_connectivityanalysis vs MATLAB > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi, > > I've compared the non-parametric calculation of the coherence spectrum > using ft_connectivityanalysis to mscohere (MATLAB). The FT function > provides inflated coherence values in comparison to the MATLAB function. > I've also referenced this to a implementation of the original calculation > which equates to the MATLAB output. Any advice would be appreciated. > > Matthew > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 7 > Date: Tue, 16 Sep 2014 17:16:00 +0200 > From: Matt Gerhold > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] ft_connectivity_pdc > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > When computing pdc in FT, line 67 of ft_connectivity_pdc appears to invert > the spectral transfer func. When inverting I received the following error: > > Warning: Matrix is close to singular or badly scaled. Results may be > inaccurate. RCOND = 6.358859e-18. > > Will this impact on the final spectrum calculated by the method. If so, is > there a possible workaround/solution? > > Matthew > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 8 > Date: Tue, 16 Sep 2014 14:20:36 -0300 > From: gamaliel huerta urrea > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] dipole simulation on head model > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Hi all > > I followed the tips above to simulate a dipole source on my own head > model generated from MRIs. However, using information from: > http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit > > I could not simulate anything. Only one image is blank. The code I am > using is as follows: > > cfg = []; > cfg.vol = vol; % See above > cfg.elec = elec; % See above > cfg.dip.pos = [0 0 0]; > cfg.dip.mom = [2 2 2]; % Note, it Should be transposed > cfg.dip.frequency = 10; > cfg.ntrials = 10; > cfg.triallength = 1; % seconds > cfg.fsample = 25; % Hz > raw1 = ft_dipolesimulation (cfg); > avg1 = ft_timelockanalysis([], raw1); > > plot (avg1.time, avg1.avg); % Plot the timecourse > > where: > > vol = ft_prepare_headmodel volumes generated from the segmentation of > my resonances. > > and > > ft_read_sens elec = ('standard_1020.elc'); > > to run the script the result is a blank image. > > and Matlab tells me the following: > > using headmodel specified in the configuration > using electrodes specified in the configuration > Determining source compartment (1) > projecting electrodes on skin surface > electrode and system combine combining transfer matrix > computing simulated data > computing simulated trial data for 10 > > RMS value of simulated data is NaN > the call to "ft_dipolesimulation" took 4 seconds > the input is raw Data with 97 channels and 10 trials > Warning: the data does not Contain a definition trial >> * In utilities \ private \ warning_once at 158 > * In utilities \ private \ fixsampleinfo at 66 > In ft_datatype_raw at 157 > In ft_checkdata at 224 > In ft_timelockanalysis at 105 > In codgen at 50 > Warning: sampleinfo by reconstructing Assuming That the trials are > consecutive segments of > a continuous recording >> * In utilities \ private \ warning_once at 158 > * In utilities \ private \ fixsampleinfo at 79 > In ft_datatype_raw at 157 > In ft_checkdata at 224 > In ft_timelockanalysis at 105 > In codgen at 50 > averaging trials > trial averaging 10 of 10 > > the call to "ft_timelockanalysis" took 1 seconds > > > I hope you can help > > > greetings > > -- > *Gamaliel Huerta* > *Ingenier?a Civil Biom?dica* > *Universidad de Valpara?so* > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 9 > Date: Tue, 16 Sep 2014 18:42:21 +0000 > From: Marc Lalancette > To: "fieldtrip at science.ru.nl" > Subject: Re: [FieldTrip] MEG lead field units > Message-ID: > <2A2B6A5B8C4C174CBCCE0B45E548DEB229FBB67F at SKMBXX01.sickkids.ca> > Content-Type: text/plain; charset="us-ascii" > > Hello Fieldtrippies, > > Regarding a question I asked some months ago about the physical > units of the lead field in Fieldtrip, I wanted to share the fact > that I was wrong, and that it might be good to either document this > in the code and possibly to add a factor. When using 'cm' units, > the lead field is in Wb/cm^2/(A*m) = 1e4 T/Am = 1e2 T/(A*cm). I > started to realize my original assumption was wrong while working on > my Biomag poster since I was getting very low SNR values (around 1) > for typical source and system parameters. So I looked closer at > the single sphere code and my own old spherical forward solution > code, and here is where the extra factor comes in: > > Skipping to the last step, my formula is: > B = UnitConversion * (1e-7) * ( (QxrQ/F - (QxrQ * rv') * GradF/F^2) > * SensorOrient' ); > The second factor is the constant mu0/(4*pi) = 10^-7 Wb/Am. > Assuming a source (Q) in units of Am and distances in cm, the > complicated bit has units of Am*cm/cm^3. > Thus without the first factor, B would have units of Wb/cm^2 = 1e4 > T, and so I was using UnitConversion = 1e4 in my code, to get B in > Tesla. If we don't put in a specific source amplitude (as in > Fieldtrip), and still using UnitConversion, then B would be in T/(Am). > > I guess units can be different than 'cm' though, so the factor would > have to take that into account. Note that the single shell forward > solution gives the same units as single sphere and would need the > same factor. I haven't looked at other forward methods. I also > haven't verified if this is correctly dealt with when obtaining > reconstructed source amplitudes, say with a beamformer. > > Cheers, > Marc Lalancette > Lab Research Project Manager > The Hospital for Sick Children, Toronto, Canada > > > > > ________________________________ > > This e-mail may contain confidential, personal and/or health > information(information which may be subject to legal restrictions > on use, retention and/or disclosure) for the sole use of the > intended recipient. Any review or distribution by anyone other than > the person for whom it was originally intended is strictly > prohibited. If you have received this e-mail in error, please > contact the sender and delete all copies. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > Message: 10 > Date: Wed, 17 Sep 2014 11:22:19 +0200 > From: barbara.schorr at uni-ulm.de > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of > variable > Message-ID: <20140917112219.crkxv6dgoo0skccc at imap.uni-ulm.de> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > Dear Jim, > > I now downloaded the newest fieldtrip version but I still get the same > error messag. Is there anything else I need to know? > > Thanks a lot! > > Best, > Barbara > > > Zitat von 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: ft_rejectvisual: removing trials marked as bad (Ashley Greene) >> 2. Read only EEG data from combined MEG/EEG ctf file (Tobias Trame) >> 3. Re: ft_globalmeanfield : Undefined function of variable >> 'abort' (Herring, J.D. (Jim)) >> 4. using ft_megplanar with sinle-trial TFRs (Fr?d?ric Roux) >> 5. dipole simulation on head model (gamaliel huerta urrea) >> 6. Re: dipole simulation on head model (Tzvetan Popov) >> 7. Re: ft_globalmeanfield : Undefined function of variable >> 'abort' (Jing Fan) >> 8. Re: ft_globalmeanfield : Undefined function of variable >> 'abort' (Jing Fan) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Fri, 12 Sep 2014 21:39:43 +0900 >> From: Ashley Greene >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >> bad >> Message-ID: >> >> Content-Type: text/plain; charset="utf-8" >> >> Hi Emilie, >> >> Thanks!! I, of course, completely overlooked that. >> >> Ashley >> >> On Tue, Sep 9, 2014 at 3:37 PM, Caspar, Emilie wrote: >> >>> Hi Ashley, >>> >>> Maybe the mistake is you did not integrate in your script the command to >>> save the rejection. Normally, with the following command, you will see in >>> the Matlab Window that artifacts are correctly rejected after the "quit" >>> button. >>> >>> clean_data = ft_rejectvisual(cfg, interpoldata); >>> cfg.artfctdef.reject = 'complete'; >>> cfg.artfctdef.feedback = 'yes'; >>> cleandata = ft_rejectartifact(cfg,clean_data); >>> >>> Emilie >>> >>> >>> >>> >>> >>> Le 3 sept. 2014 ? 11:58, Ashley Greene a ?crit : >>> >>> Hello, >>> >>> I have used the rejectvisual function in attempt to remove bad trials, >>> but after marking them and pressing the quit button, although the command >>> window states that the selected trials have been removed, there is no >>> obvious change in the data; all of the trials are still intact. Have I >>> overlooked something? >>> >>> Thanks, >>> >>> Ashley >>> _______________________________________________ >>> 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: >> >> >> ------------------------------ >> >> Message: 2 >> Date: Fri, 12 Sep 2014 18:23:17 +0200 (CEST) >> From: Tobias Trame >> To: >> Subject: [FieldTrip] Read only EEG data from combined MEG/EEG ctf file >> Message-ID: >> >> >> Content-Type: text/plain; charset=us-ascii >> >> Hi everybody! >> >> I'm trying to read only the EEG data from a combined MEG/EEG ctf >> file in order >> to create leadfields later on, but the function "ft_read_sens" just returns >> the gradiometer information in a 'grad' field. It searches for an >> 'elec'-field >> in the header of the data which is not present. Is there a configuration to >> get the EEG-elecrodes by using "ft_read_sens"? >> >> My first attempt was to write the EEG-Information from the header by hand >> using the following code: >> >> hdr = ft_read_header('subject.ds', 'headerformat', 'ctf_ds'); >> elec.elecpos = [hdr.orig.eeg.pos]'; >> elec.chanpos = [hdr.orig.eeg.pos]'; >> elec.label = {hdr.orig.eeg.name}'; >> elec.type = 'eeg'; >> elec.unit = 'cm'; >> >> But now I get a similar problem if I want to create leadfields from timelock >> data. After doing the timelock analysis using >> >> timelock_data = ft_timelockanalysis(cfg, mydata); >> >> the structure timelock_data contains just a 'grad' and no 'elec' >> field so that >> ft_prepare_leadfield(cfg, timelock_data) always ignores the >> EEG-elecrodes and >> tries to use the gradiometes - even if I put the electrodes defined >> above into >> cfg.elec. >> >> Thanks for any suggestions! >> >> Tobias >> >> >> ------------------------------ >> >> Message: 3 >> Date: Mon, 15 Sep 2014 12:01:02 +0200 (CEST) >> From: "Herring, J.D. (Jim)" >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of >> variable 'abort' >> Message-ID: >> <2103383764.4690548.1410775262514.JavaMail.root at draco.zimbra.ru.nl> >> Content-Type: text/plain; charset=utf-8 >> >> Dear Barbara, >> >> The error seems to be related to a bug that pops up now and then >> (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be >> due to a corrupt installation of fieldtrip and/or the need to update >> fieldtrip. >> >> Could you please try downloading the most recent version of >> fieldtrip and see if the problem persists? >> >> For an example of what can be expected from this function see: Esser >> SK, Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A >> direct demonstration of cortical LTP in humans: a combined TMS/EEG >> study. Brain Res Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. >> PubMed PMID: 16464689. >> >> Best, >> >> Jim >> >> >> ----- Oorspronkelijk bericht ----- >>> Van: "barbara schorr" >>> Aan: fieldtrip at science.ru.nl >>> Verzonden: Woensdag 10 september 2014 14:07:14 >>> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of >>> variable 'abort' >>> Dear fieldtripers. >>> >>> as mentioned in the subject line I would like to anaylse my timelocked >>> ERP Data with the function ft_globalmeanfield. >>> >>> I get the Error: Undefined function or variable 'abort' >>> Error in ft_globalmeanfield (line84) >>> if abort >>> >>> in the function it says: >>> >>> %the abort variable is set to true or false in ft_preamble_inti >>> if abort >>> % do not continue function execution in case the outputfile is >>> present and the user indicated to keep it >>> return >>> end >>> >>> >>> I don't understand what this means. I would really appreciate your >>> help to get this running. >>> >>> Also, what is the result when I run this function on my data? (This >>> method was proposed from a reviewer. I never used it before, so I >>> don't exactly know what it does and what the result will look like). >>> >>> Thank you very much in advance! >>> >>> Best, >>> >>> Barbara Schorr >>> >>> >>> >>> >>> Zitat von 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: Question regarding nonparametric testing for coherence >>> > differences (Eric Maris) >>> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >>> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >>> > 4. Re: ft_rejectvisual: removing trials marked as bad >>> > (Caspar, Emilie) >>> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >>> > 6. Latest FT version on ftp-server is from three days ago >>> > (Holger Krause) >>> > 7. Re: TRENTOOL pipeline help (Max Cantor) >>> > >>> > >>> > ---------------------------------------------------------------------- >>> > >>> > Message: 1 >>> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >>> > From: "Eric Maris" >>> > To: , "'FieldTrip discussion list'" >>> > >>> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >>> > for >>> > coherence differences >>> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Hwee Ling, >>> > >>> > >>> > >>> > In the paper you refer to (Maris et al, JNM, 2007), I did not >>> > perform a >>> > cluster-based permutation test at the level of the channel pairs. >>> > Instead, >>> > all coherences mentioned in the paper are coherence between a single >>> > EMG >>> > channel (2 electrodes mounted on the forearm) and all MEG >>> > electrodes. Thus, >>> > there are as many EMG-MEG coherences as there are MEG channels (275 >>> > in our >>> > lab), and the clustering of these coherences involves the same >>> > neighbourhood >>> > structure as the clustering of channel-specific statistics on power >>> > or >>> > evoked response. The analysis you propose involves clustering in a >>> > much more >>> > complex space, namely the formed by all (MEG,MEG) channel pairs >>> > (275*275=75625 pairs). In the early days of cluster-based >>> > permutation >>> > statistics, I have worked on this problem but did not pursue it >>> > because the >>> > resulting clusters are very hard to interpret. >>> > >>> > >>> > >>> > Best, >>> > >>> > >>> > >>> > Eric Maris >>> > >>> > >>> > >>> > >>> > >>> > Dear all and Prof Maris, >>> > >>> > I'm re-posting this question again, as I didn't get any replies >>> > previously. >>> > >>> > I?m interested to investigate if there are any differences in phase >>> > synchronization in resting state data at timepoint 2 versus >>> > timepoint 1. The >>> > EEG data was collected using 64 EEG channels, resting state, eyes >>> > opened and >>> > eyes closed. I?ve arbitrarily segmented the resting state data into >>> > epochs >>> > of 2s each, and the epochs with artifacts are excluded completely >>> > from >>> > further analyses. I then performed mtmfft to get the fourier >>> > representation >>> > of the data, extracted the coherence, and compared the coherence >>> > difference >>> > of timepoint 2 versus timepoint 1 of all channels paired with all >>> > other >>> > channels. >>> > >>> > I figured that if I extract the connectivity analyses without >>> > specifying the >>> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >>> > allow me to >>> > perform cluster-based statistical analyses. I get an output with >>> > ?chan_chan? >>> > dimord variable. However, I was not 100% sure that this is correct, >>> > hence, I?ve >>> > inserted my code (see below). It?ll be great if you could tell me if >>> > what I?m >>> > doing makes any sense at all. Also, I don?t know how I can plot the >>> > results >>> > to see if it make any sense at all. >>> > >>> > Also, I checked the values obtained from when I specified >>> > "cfg.channelcmb" >>> > and when I did not specify "cfg.channelcmb", I noticed that the >>> > values were >>> > somehow different. I would assume that the values to be similar, >>> > although >>> > I'm not sure why they would have differences in the values obtained >>> > from >>> > specifying "cfg.channelcmb". >>> > >>> > This is my code that I've used thus far: >>> > >>> > for sub = 1:5 >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'fourier'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.keeptrials = 'yes'; >>> > >>> > cfg.tapsmofrq = 5; >>> > >>> > cfg.foilim = [0 100]; >>> > >>> > cfg.taper = 'dpss'; >>> > >>> > % find the index for the c200 condition >>> > >>> > pre_c200_idx = find(data5.trialinfo == 201); >>> > >>> > cfg.trials = pre_c200_idx; >>> > >>> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > post_c200_idx = find(data5.trialinfo == 200); >>> > >>> > cfg.trials = post_c200_idx; >>> > >>> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.keeptrials = 'no'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.removemean = 'yes'; >>> > >>> > cfg.method = 'coh'; >>> > >>> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_pre_c200); >>> > >>> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_post_c200); >>> > >>> > end >>> > >>> > >>> > >>> > >>> load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat'); >>> > >>> > cfg_neighb.method = 'template'; >>> > >>> > cfg_neighb.layout = lay; >>> > >>> > cfg_neighb.channel = 'all'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, >>> > sub_HLF_pre_c200coh{1}); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.channelcmb = {cfg.channel, cfg.channel}; >>> > >>> > cfg.latency = 'all'; >>> > >>> > cfg.avgovertime = 'no'; >>> > >>> > cfg.avgoverchan = 'no'; >>> > >>> > cfg.parameter = 'cohspctrm'; >>> > >>> > cfg.method = 'montecarlo'; >>> > >>> > cfg.statistic = 'depsamplesT'; >>> > >>> > cfg.correctm = 'cluster'; >>> > >>> > cfg.tail = 0; >>> > >>> > % cfg.clustertail = 0; >>> > >>> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >>> > frequency >>> > bands. >>> > >>> > cfg.numrandomization = 10000; >>> > >>> > cfg.ivar = 2; >>> > >>> > cfg.uvar = 1; >>> > >>> > >>> > >>> > % design matrices >>> > >>> > clear design; >>> > >>> > design(1,:) = [1:5, 1:5]; >>> > >>> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >>> > >>> > cfg.design = design; >>> > >>> > % for theta band >>> > >>> > cfg.avgoverfreq = 'yes'; >>> > >>> > cfg.frequency = [4 8]; % I also performed the statistics for delta >>> > (2-4), >>> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >>> > (30-40), >>> > and gamma (40-100). >>> > >>> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >>> > sub_HLF_post_c200coh{:}, >>> > sub_HLF_pre_c200coh{:}); >>> > >>> > >>> > >>> > When I tried to plot the results, I used this code: >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.layout = 'lay'; >>> > >>> > cfg.zlim = [-1 1]; >>> > >>> > cfg.alpha = 0.05; >>> > >>> > cfg.refchannel = 'all'; >>> > >>> > ft_clusterplot(cfg, diffc200_theta_stat); >>> > >>> > However, I was not sure how I could plot the results. I get an error >>> > message >>> > from Fieldtrip when using ft_clusterplot: >>> > >>> > Error using topoplot_common (line 366) >>> > >>> > no reference channel is specified >>> > >>> > Error in ft_topoplotTFR (line 192) >>> > >>> > [cfg] = topoplot_common(cfg, varargin{:}); >>> > >>> > Error in ft_clusterplot (line 372) >>> > >>> > ft_topoplotTFR(cfgtopo, stat); >>> > >>> > >>> > >>> > According to your paper in 2007, the topoplot of the results were >>> > masked by >>> > the spatio-spectral pattern of the significant clusters. I don't >>> > know how to >>> > do this, and I would really appreciate if you can show me how to >>> > make such a >>> > plot. >>> > >>> > Thank you very much. >>> > >>> > Kind regards, >>> > >>> > Hweeling >>> > >>> > >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 2 >>> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >>> > From: KatrinH Heimann >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Joseph, thanks so much, I really appreciate your help. I was >>> > also >>> > wandering, if maybe there is another bug in my code. >>> > Our nets are 128 channels, Hydrocel, but as a colleague of me >>> > adviced me to >>> > do so, I also tried the 129 layout. >>> > My code you find below (without selection of bad channels etc.) >>> > If you need also the data of two subjects to have a look, let me >>> > know!!! >>> > Best and thanks really! >>> > Katrin >>> > >>> > >>> > subject=input('Which subject do you want to analyse? ','s'); >>> > >>> > name = strcat(subject,'.raw'); >>> > >>> > subjectnumber=input('Which is the subjectnumber?', 's'); >>> > >>> > sb=subjectnumber >>> > >>> > %subjectnumber = strcat(subjectnumber, '.txt') >>> > >>> > %% >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.dataset = name; >>> > >>> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> > >>> > cfg.trialdef.eventtype = 'trigger'; >>> > >>> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> > trigger >>> > >>> > cfg.trialdef.prestim = 0.234; % in seconds >>> > >>> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> > observation, but maybe we need less) >>> > >>> > cfg = ft_definetrial(cfg); >>> > >>> > >>> > cfg.trl([1:7],:) = []; >>> > >>> > >>> > %change timeline according to constant offset of 16 ms = 8 samples >>> > (because >>> > recorded with 500 hz)in >>> > >>> > %structure trial >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)-8 >>> > >>> > >>> > %change timeline to make the cut the zeropoint >>> > >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> > >>> > >>> > >>> > %% preprocess data >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.detrend = 'yes'; >>> > >>> > cfg.preproc.demean = 'yes'; >>> > >>> > cfg.preproc.baselinewindow = [-2.1 -2.0] >>> > >>> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> > filtered >>> > >>> > %(0.1-45) and bad channels have to be replaced!!!! >>> > >>> > %cfg.preproc.bpfreq = [6 32]; >>> > >>> > % >>> > >>> > % >>> > >>> > obs_data = ft_preprocessing(cfg); >>> > >>> > % >>> > >>> > save (strcat(sb,'obs_data') , 'obs_data') >>> > >>> > >>> > %% determining channel neighbours (necessary for Artifact detection) >>> > >>> > cfg = []; >>> > >>> > cfg.channel = obs_data.label; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.feedback = 'yes'; >>> > >>> > lay = ft_prepare_layout(cfg); >>> > >>> > >>> > >>> > cfg_neighb = []; >>> > >>> > cfg_neighb.feedback = 'yes'; >>> > >>> > >>> > cfg_neighb.method = 'triangulation'; >>> > >>> > cfg_neighb.layout = 'GSN128.sfp'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > obs_data.elec = ft_read_sens('GSN128.sfp'); >>> > >>> > >>> > %% Artifacts - to detect bad channels - is not saved!!! >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs_data_try = ft_rejectvisual(cfg, obs_data); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_try = ft_rejectartifact (cfg,obs_data); >>> > >>> > >>> > >>> > %% Preparing neighbours for channel repair - but bad channel info >>> > in!!! >>> > >>> > >>> > % cfg_neighb = []; >>> > >>> > % cfg_neighb.feedback = 'yes'; >>> > >>> > % cfg_neighb.method = 'triangulation'; >>> > >>> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> > >>> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > % Interpolate and put into new data structure >>> > >>> > cfg = []; >>> > >>> > cfg.badchannel = {}; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.method = 'nearest'; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> > >>> > >>> > % Check reconstruction >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > % dat1=obs_data; >>> > >>> > % dat2=obs_data_channelrepaired; >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> > >>> > % y=dat2.trial{1}(62,:); >>> > >>> > % plot(x);hold on;plot(y,'r'); >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(72,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(75,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > %% artifact rejection/trial inspection - throw out electrode jumps >>> > etc. >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> > according to >>> > channels interpolated %% 128-number of interp. channels) >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > comp = ft_componentanalysis(cfg,obs_data_clean1); >>> > >>> > save (strcat(sb,'comp_all') , 'comp') >>> > >>> > >>> > %% >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'component'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='some'; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > ft_databrowser(cfg,comp); >>> > >>> > >>> > %% poweranalysis components >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'pow'; >>> > >>> > cfg.channel = 'all';%compute the power spectrum in all ICs >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.taper = 'hanning'; >>> > >>> > cfg.foi = 0:0.2:50; >>> > >>> > obs_freq = ft_freqanalysis(cfg, comp); >>> > >>> > >>> > %And you can plot the spectra: >>> > >>> > >>> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> > >>> > nsubplots = 16; >>> > >>> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> > decimals, type >>> > doc subplot >>> > >>> > >>> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> > >>> > tot = Nfigs*nsubplots; >>> > >>> > >>> > rptvect = 1:size(comp.topo,1); >>> > >>> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> > >>> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> > >>> > >>> > for r=1:size(rptvect,1); >>> > >>> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> > 1]);%full >>> > screen >>> > >>> > k=0; >>> > >>> > for j=1:size(rptvect,2); >>> > >>> > if~(rptvect(r,j)==0); >>> > >>> > k=k+1; >>> > >>> > cfg=[]; >>> > >>> > cfg.channel = rptvect(r,j); >>> > >>> > cfg.ylim =[0 500] >>> > >>> > cfg.xlim =[0 50] >>> > >>> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> > >>> > end >>> > >>> > end >>> > >>> > end >>> > >>> > >>> > %For the IC topos you'll follow the same logic as above but with: >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [1:20]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [21:40]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [41:60]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [61:80]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% Seperate observation conditions >>> > >>> > >>> > name1= strcat(num2str(sb),'_90.xls'); >>> > >>> > list1=xlsread (name1) >>> > >>> > >>> > >>> > >>> > >>> > name2= strcat(num2str(sb),'_180.xls'); >>> > >>> > list2=xlsread (name2) >>> > >>> > >>> > >>> > % >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list1] >>> > >>> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list2] >>> > >>> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > %%PIPELINE FOR obs90 >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128; >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > >>> > comp_1 = ft_componentanalysis(cfg, obs90_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> > obs90_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts - final detection >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs90_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> > >>> > >>> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> > >>> > >>> > %% plot it >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP) >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% PIPELINE FOR obs180 >>> > >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > comp_2 = ft_componentanalysis(cfg, obs180_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> > obs180_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts final 180 >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs180_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> > >>> > >>> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> > >>> > >>> > %% plot 180 ERP >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs180_data_ERP) >>> > >>> > >>> > %% plot both ERPs >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > cfg.showlabels = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> > >>> > >>> > %% plot difference wave >>> > >>> > >>> > difference = obs180_data_ERP; % copy one of the >>> > structures >>> > >>> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >>> > the >>> > difference ERP >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, difference) >>> > >>> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> > >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI >>> >> data. A couple things. First of all, exactly which net do you use? >>> >> If >>> >> they are 129-channel, there is still the question of whether they >>> >> are the >>> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >>> >> cause an >>> >> error like this. Could you send me the file you are trying to >>> >> process and >>> >> the script you are using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >>> >> diezmartini at gmail.com> wrote: >>> >> >>> >> Which nets do you use? I use EGI. I tried both the ones you mention >>> >> and >>> >> they didn't work. It was hard to find that exact one online but it >>> >> was the >>> >> only file that actually worked. >>> >> >>> >> >>> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >> >>> >> wrote: >>> >> >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. >>> >>> Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one >>> >>> >>> >>>> I use >>> >>>> >>> >>>> >>> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>> >>>> katrinheimann at gmail.com> wrote: >>> >>>> >>> >>>>> Dear all, my problems seem neverending. This time however i >>> >>>>> really need >>> >>>>> help. >>> >>>>> I implemented a pipeline for ERPs. All works now, >>> >>>>> trialdefinition, >>> >>>>> preprocessing, channelreplacement, ica, componentrejection, >>> >>>>> final >>> >>>>> artifactdetection, timelock of the single subject data. However, >>> >>>>> when I >>> >>>>> wanna compute the grandaverage of the single subjects I get the >>> >>>>> following >>> >>>>> error message: >>> >>>>> >>> >>>>> computing average of avg over 19 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 3 MB >>> >>>>> computing average of avg over 2 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>>>> additional >>> >>>>> allocation of an estimated 0 MB >>> >>>>> >>> >>>>> Furthermore in the plot of the significant clusters, the >>> >>>>> channelnames >>> >>>>> are mixed up (do not correspond to my net) >>> >>>>> >>> >>>>> >>> >>>>> I guess that there is a problem with the layout I use. >>> >>>>> Here the code that I use >>> >>>>> >>> >>>>> %For generating the layout (also in the single subjects): >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = obs_data.label; >>> >>>>> >>> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>>>> >>> >>>>> cfg.feedback = 'yes'; >>> >>>>> >>> >>>>> lay = ft_prepare_layout(cfg); >>> >>>>> >>> >>>>> >>> >>>>> cfg_neighb = []; >>> >>>>> >>> >>>>> cfg_neighb.feedback = 'yes'; >>> >>>>> >>> >>>>> cfg_neighb.method = 'triangulation'; >>> >>>>> >>> >>>>> cfg_neighb.layout = lay; >>> >>>>> >>> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>>>> >>> >>>>> >>> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>>>> >>> >>>>> >>> >>>>> %For computing the grand average >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = 'all'; >>> >>>>> >>> >>>>> cfg.latency = 'all'; >>> >>>>> >>> >>>>> cfg.parameter = 'avg'; >>> >>>>> >>> >>>>> cfg.keepindividual = 'no' >>> >>>>> >>> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>>>> >>> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>>>> >>> >>>>> % "{:}" means to use data from all elements of the variable >>> >>>>> >>> >>>>> >>> >>>>> For plotting the significant clusters >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.style = 'blank'; >>> >>>>> >>> >>>>> cfg.layout = lay; >>> >>>>> >>> >>>>> cfg.channellabels = 'yes'; >>> >>>>> >>> >>>>> cfg.highlight = 'labels'; >>> >>>>> >>> >>>>> cfg.highlightchannel = find(stat.mask); >>> >>>>> >>> >>>>> cfg.comment = 'no'; >>> >>>>> >>> >>>>> figure; ft_topoplotER(cfg, GA_90) >>> >>>>> >>> >>>>> title('Nonparametric: significant with cluster multiple >>> >>>>> comparison >>> >>>>> correction') >>> >>>>> >>> >>>>> >>> >>>>> Do you have ANY idea to this? I am really completely >>> >>>>> helpless.... >>> >>>>> >>> >>>>> thanks and best >>> >>>>> >>> >>>>> Katrin >>> >>>>> >>> >>>>> _______________________________________________ >>> >>>>> 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 >>> >>> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing list >>> >> fieldtrip at donders.ru.nl >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> >> >>> >> >>> -------------------------------------------------------------------------------- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.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: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 3 >>> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >>> > From: Joseph Dien >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > yes, please do send me the data. >>> > >>> > Thanks! >>> > >>> > Joe >>> > >>> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >>> > wrote: >>> > >>> >> Dear Joseph, thanks so much, I really appreciate your help. I was >>> >> also wandering, if maybe there is another bug in my code. >>> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >>> >> adviced me to do so, I also tried the 129 layout. >>> >> My code you find below (without selection of bad channels etc.) >>> >> If you need also the data of two subjects to have a look, let me >>> >> know!!! >>> >> Best and thanks really! >>> >> Katrin >>> >> >>> >> >>> >> >>> >> subject=input('Which subject do you want to analyse? ','s'); >>> >> >>> >> name = strcat(subject,'.raw'); >>> >> >>> >> subjectnumber=input('Which is the subjectnumber?', 's'); >>> >> >>> >> sb=subjectnumber >>> >> >>> >> %subjectnumber = strcat(subjectnumber, '.txt') >>> >> >>> >> %% >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.dataset = name; >>> >> >>> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> >> >>> >> cfg.trialdef.eventtype = 'trigger'; >>> >> >>> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> >> trigger >>> >> >>> >> cfg.trialdef.prestim = 0.234; % in seconds >>> >> >>> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> >> observation, but maybe we need less) >>> >> >>> >> cfg = ft_definetrial(cfg); >>> >> >>> >> >>> >> >>> >> cfg.trl([1:7],:) = []; >>> >> >>> >> >>> >> >>> >> %change timeline according to constant offset of 16 ms = 8 samples >>> >> (because recorded with 500 hz)in >>> >> >>> >> %structure trial >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >>> >> >>> >> >>> >> >>> >> %change timeline to make the cut the zeropoint >>> >> >>> >> >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% preprocess data >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.detrend = 'yes'; >>> >> >>> >> cfg.preproc.demean = 'yes'; >>> >> >>> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >>> >> >>> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> >> filtered >>> >> >>> >> %(0.1-45) and bad channels have to be replaced!!!! >>> >> >>> >> %cfg.preproc.bpfreq = [6 32]; >>> >> >>> >> % >>> >> >>> >> % >>> >> >>> >> obs_data = ft_preprocessing(cfg); >>> >> >>> >> % >>> >> >>> >> save (strcat(sb,'obs_data') , 'obs_data') >>> >> >>> >> >>> >> >>> >> %% determining channel neighbours (necessary for Artifact >>> >> detection) >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = obs_data.label; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.feedback = 'yes'; >>> >> >>> >> lay = ft_prepare_layout(cfg); >>> >> >>> >> >>> >> cfg_neighb = []; >>> >> >>> >> cfg_neighb.feedback = 'yes'; >>> >> >>> >> >>> >> >>> >> cfg_neighb.method = 'triangulation'; >>> >> >>> >> cfg_neighb.layout = 'GSN128.sfp'; >>> >> >>> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >>> >> >>> >> >>> >> >>> >> %% Artifacts - to detect bad channels - is not saved!!! >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Preparing neighbours for channel repair - but bad channel info >>> >> in!!! >>> >> >>> >> >>> >> >>> >> % cfg_neighb = []; >>> >> >>> >> % cfg_neighb.feedback = 'yes'; >>> >> >>> >> % cfg_neighb.method = 'triangulation'; >>> >> >>> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> >> >>> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> % Interpolate and put into new data structure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.badchannel = {}; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.method = 'nearest'; >>> >> >>> >> cfg.neighbours = neighbours; >>> >> >>> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> >> >>> >> >>> >> >>> >> % Check reconstruction >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> % dat1=obs_data; >>> >> >>> >> % dat2=obs_data_channelrepaired; >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> >> >>> >> % y=dat2.trial{1}(62,:); >>> >> >>> >> % plot(x);hold on;plot(y,'r'); >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(72,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(75,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> %% artifact rejection/trial inspection - throw out electrode jumps >>> >> etc. >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> >> according to channels interpolated %% 128-number of interp. >>> >> channels) >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = {'all'}; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >>> >> >>> >> save (strcat(sb,'comp_all') , 'comp') >>> >> >>> >> >>> >> >>> >> %% >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'component'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='some'; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> ft_databrowser(cfg,comp); >>> >> >>> >> >>> >> >>> >> %% poweranalysis components >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.output = 'pow'; >>> >> >>> >> cfg.channel = 'all';%compute the power spectrum in all ICs >>> >> >>> >> cfg.method = 'mtmfft'; >>> >> >>> >> cfg.taper = 'hanning'; >>> >> >>> >> cfg.foi = 0:0.2:50; >>> >> >>> >> obs_freq = ft_freqanalysis(cfg, comp); >>> >> >>> >> >>> >> >>> >> %And you can plot the spectra: >>> >> >>> >> >>> >> >>> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> >> >>> >> nsubplots = 16; >>> >> >>> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> >> decimals, type doc subplot >>> >> >>> >> >>> >> >>> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> >> >>> >> tot = Nfigs*nsubplots; >>> >> >>> >> >>> >> >>> >> rptvect = 1:size(comp.topo,1); >>> >> >>> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> >> >>> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> >> >>> >> >>> >> >>> >> for r=1:size(rptvect,1); >>> >> >>> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> >> 1]);%full screen >>> >> >>> >> k=0; >>> >> >>> >> for j=1:size(rptvect,2); >>> >> >>> >> if~(rptvect(r,j)==0); >>> >> >>> >> k=k+1; >>> >> >>> >> cfg=[]; >>> >> >>> >> cfg.channel = rptvect(r,j); >>> >> >>> >> cfg.ylim =[0 500] >>> >> >>> >> cfg.xlim =[0 50] >>> >> >>> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> >>> >> >>> >> %For the IC topos you'll follow the same logic as above but with: >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [1:20]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [21:40]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [41:60]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [61:80]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Seperate observation conditions >>> >> >>> >> >>> >> >>> >> name1= strcat(num2str(sb),'_90.xls'); >>> >> >>> >> list1=xlsread (name1) >>> >> >>> >> >>> >> >>> >> name2= strcat(num2str(sb),'_180.xls'); >>> >> >>> >> list2=xlsread (name2) >>> >> >>> >> >>> >> % >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list1] >>> >> >>> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list2] >>> >> >>> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> %%PIPELINE FOR obs90 >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128; >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> >>> >> >>> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> >> obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts - final detection >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot it >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% PIPELINE FOR obs180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> >> obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts final 180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot 180 ERP >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot both ERPs >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> cfg.showlabels = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot difference wave >>> >> >>> >> >>> >> >>> >> difference = obs180_data_ERP; % copy one of >>> >> the structures >>> >> >>> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >>> >> compute the difference ERP >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, difference) >>> >> >>> >> >>> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI data. A couple things. First of all, exactly which net do >>> >> you use? If they are 129-channel, there is still the question of >>> >> whether they are the Hydrocel or the older geodesic nets. >>> >> Regardless, that shouldn't cause an error like this. Could you >>> >> send me the file you are trying to process and the script you are >>> >> using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >>> >> wrote: >>> >> >>> >>> Which nets do you use? I use EGI. I tried both the ones you >>> >>> mention and they didn't work. It was hard to find that exact one >>> >>> online but it was the only file that actually worked. >>> >>> >>> >>> >>> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one I use >>> >>> >>> >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear all, my problems seem neverending. This time however i really >>> >>> need help. >>> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> >>> preprocessing, channelreplacement, ica, componentrejection, final >>> >>> artifactdetection, timelock of the single subject data. However, >>> >>> when I wanna compute the grandaverage of the single subjects I get >>> >>> the following error message: >>> >>> >>> >>> computing average of avg over 19 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 3 MB >>> >>> computing average of avg over 2 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 0 MB >>> >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> >>> >>> Furthermore in the plot of the significant clusters, the >>> >>> channelnames are mixed up (do not correspond to my net) >>> >>> >>> >>> >>> >>> I guess that there is a problem with the layout I use. >>> >>> Here the code that I use >>> >>> >>> >>> %For generating the layout (also in the single subjects): >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = obs_data.label; >>> >>> >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> >>> >>> cfg.feedback = 'yes'; >>> >>> >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> >>> >>> >>> cfg_neighb = []; >>> >>> >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> >>> >>> cfg_neighb.layout = lay; >>> >>> >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> >>> >>> >>> >>> >>> %For computing the grand average >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = 'all'; >>> >>> >>> >>> cfg.latency = 'all'; >>> >>> >>> >>> cfg.parameter = 'avg'; >>> >>> >>> >>> cfg.keepindividual = 'no' >>> >>> >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> >>> >>> >>> For plotting the significant clusters >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.style = 'blank'; >>> >>> >>> >>> cfg.layout = lay; >>> >>> >>> >>> cfg.channellabels = 'yes'; >>> >>> >>> >>> cfg.highlight = 'labels'; >>> >>> >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> >>> >>> cfg.comment = 'no'; >>> >>> >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> >>> correction') >>> >>> >>> >>> >>> >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> >>> >>> thanks and best >>> >>> >>> >>> Katrin >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> 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 >>> >>> >>> >>> _______________________________________________ >>> >>> fieldtrip mailing list >>> >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> -------------------------------------------------------------------------------- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.com >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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 >>> > >>> > >>> -------------------------------------------------------------------------------- >>> > >>> > Joseph Dien, PhD >>> > Research Associate >>> > Cognitive Neurology >>> > The Johns Hopkins University School of Medicine >>> > >>> > Lab E-mail: jdien1 at jhmi.edu >>> > Private E-mail: jdien07 at mac.com >>> > Office Phone: 410-614-3115 >>> > Cell Phone: 202-297-8117 >>> > Fax: 410-955-0188 >>> > http://joedien.com >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 4 >>> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >>> > From: "Caspar, Emilie" >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >>> > bad >>> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >>> > Content-Type: text/plain; charset="iso-8859-1" >>> > >>> > Hi Ashley, >>> > >>> > Maybe the mistake is you did not integrate in your script the >>> > command to save the rejection. Normally, with the following command, >>> > you will see in the Matlab Window that artifacts are correctly >>> > rejected after the "quit" button. >>> > >>> > clean_data = ft_rejectvisual(cfg, interpoldata); >>> > cfg.artfctdef.reject = 'complete'; >>> > cfg.artfctdef.feedback = 'yes'; >>> > cleandata = ft_rejectartifact(cfg,clean_data); >>> > >>> > Emilie >>> > >>> > >>> > >>> > >>> > >>> > Le 3 sept. 2014 ? 11:58, Ashley Greene >>> > > a ?crit : >>> > >>> > Hello, >>> > >>> > I have used the rejectvisual function in attempt to remove bad >>> > trials, but after marking them and pressing the quit button, >>> > although the command window states that the selected trials have >>> > been removed, there is no obvious change in the data; all of the >>> > trials are still intact. Have I overlooked something? >>> > >>> > Thanks, >>> > >>> > Ashley >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 5 >>> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >>> > From: Patricia Wollstadt >>> > To: fieldtrip at science.ru.nl >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: <540EEF94.9080601 at gmx.de> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > Hello Max, >>> > >>> > I added a few comments to the questions regarding individual >>> > parameters >>> > below. To address the general problem of TRENTOOL telling you, that >>> > there are not enough sample points in your data: From what I can see >>> > in >>> > your script, you probably don't have enough data points in each time >>> > series to robustly estimate TE. You analyze 800 ms of data sampled >>> > at >>> > 300 Hz, which gives you 240 samples per time series. Can you maybe >>> > avoid >>> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >>> > you >>> > analyze a longer time window of interest? >>> > Note that you also 'lose' data to embedding and the interaction >>> > delay: >>> > The first point that can be used for TE estimation is at max. >>> > embedding >>> > length + max. interaction delay in samples. For example: max. >>> > embedding >>> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >>> > max >>> > interaction delay of 30 ms = 9 samples. In this example, you would >>> > be >>> > left with 240 - 29 samples for TE estimation per trial. There is >>> > also >>> > the possibility to estimate time resolved TE/TE for shorter time >>> > windows >>> > of interest (see section 4.4 in the manual); however, this method >>> > requires the use of a GPU for TE estimation. >>> > >>> > I would further recommend to use the new pipeline for group >>> > statistics >>> > described in the manual in section 4.5 (the function >>> > 'TEgroup_calculate' >>> > is deprecated). The new pipeline allows you to reconstruct the >>> > interaction delay and uses the following functions (see also >>> > comments in >>> > the script): >>> > >>> > TEgroup_prepare -> prepares all data sets (all subjects/all >>> > conditions) for group analysis (this means finding common embedding >>> > parameters such that estimates are not biased between groups) >>> > InteractionDelayReconstruction_calculate -> estimates TE for >>> > individual data sets and all assumed interaction delays u >>> > InteractionDelayReconstruction_analyze -> reconstructs the >>> > interaction delay by selecting the u that maximizes TE for each >>> > channel >>> > TEgroup_stats -> calculate group statistics using a permutation test >>> > >>> > I can send you an example script for group TE analysis using this >>> > pipeline to get you started. I hope this helps you to get the group >>> > analysis running. Just write again if you're having trouble setting >>> > up >>> > the pipeline or something is not clear about the parameters/my >>> > comments. >>> > >>> > Best, >>> > Patricia >>> > >>> > >>> > >>> > >>> > On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not >>> >> 100% sure if it is appropriate to ask questions about it here, but >>> >> to >>> >> the best of my knowledge they do not have a mailing list and I saw >>> >> a >>> >> few trentool questions in the archives, so I'm going to assume it's >>> >> ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present >>> >> in the pipeline. Sorry in advance for the long post! Any help would >>> >> be >>> >> greatly appreciated as I'm a bit over my head on this but I think >>> >> I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data >>> >> that was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi is >>> >> in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within the toi, but beyond that are there any benefits to it being >>> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >>> >> the >>> >> toi is in seconds. The prediction time is the assumed interaction >>> >> delay between your two sources and should fit within your toi. In >>> >> general it is preferable to use the method for interaction delay >>> >> reconstruction for TE estimation, because it allows you to >>> >> reconstruct >>> >> the actual delay between your source and target times series. A >>> >> non-optimal u/interaction delay may cause an underestimation of TE, >>> >> so >>> >> it is recommended to use the pipeline for interaction delay >>> >> reconstruction whenever estimating TE for unknown delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, so it is best to limit the u range to values that are >>> >> physiologically plausible. >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the >>> >> sample rate and filters are used to determine the actthrvalue, but >>> >> I >>> >> don't actually know the calculation. 7.5 was a rough guess just to >>> >> test the pipeline. I'm also uncertain of what minnrtrials should >>> >> be.* >>> >> PW: You can set the actthrvalue based on the filtering you did >>> >> prior >>> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >>> >> shouldn't find an ACT higher than 30 samples, because you filtered >>> >> out >>> >> any components of the signal slower than 10 Hz/30 samples (given >>> >> your >>> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >>> >> would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> * >>> >> * >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm >>> >> yet to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* >>> >> PW: The Ragwitz criterion tries to find optimal embedding >>> >> parameters >>> >> dim and tau for the data. To do that, the method iteratively takes >>> >> all >>> >> possible combinations of dim and tau values that are provided in >>> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >>> >> these >>> >> combinations embed the data. To test an embedding, the method >>> >> builds >>> >> the embedding vectors from the data; it then tests for each point >>> >> how >>> >> well the next point in time can be predicted from the reference >>> >> point's nearest neighbours. So for each embedded point, the method >>> >> searches for the nearest neighbours and calculates the average of >>> >> those nearest neighbours. The difference between the >>> >> averaged/predicted point and the actual next point is the error of >>> >> the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested >>> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together with 'ragtausteps' specifies the tau values to be tested >>> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >>> >> that >>> >> the values here are factors that are later multiplied with the ACT >>> >> to >>> >> obtain the actual tau. 'repPred' is the number of points that will >>> >> be >>> >> used for the local prediction, i.e. the Ragwitz criterion will test >>> >> the local prediction and calculate the error for the first 100 >>> >> points >>> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >>> >> below >>> >> specify the type of neighbour search conducted by the Ragwitz >>> >> criterion: 'flagNei' tells the method to either conduct a kNN or >>> >> range >>> >> search; 'sizeNei' specifies the number of neighbours or the radius >>> >> to >>> >> be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> * >>> >> * >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> * >>> >> * >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.*TRENTOOL seems to handle data output very differently >>> >> from >>> >> fieldtrip and I've had trouble thinking through the most logical >>> >> way >>> >> to handle the data so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> * >>> >> * >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition >>> >> x subject .mat file, which as I said before is collectively the >>> >> same >>> >> as the 3 x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> * >>> >> * >>> >> *At this step I get the following error: >>> >> >>> >> Error using transferentropy (line 337) >>> >> \nTRENTOOL ERROR: not enough data points left after embedding >>> >> >>> >> Error in TEgroup_calculate (line 133) >>> >> [TEresult] = transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate >>> >> is a pipeline issue* (I noticed the example pipeline in trentool, >>> >> the >>> >> manual, and published methods articles all seem to have slightly or >>> >> significantly different pipeline compositions), *or if the error >>> >> is* >>> >> due to ACT, ragwitz optimization, or some other faulty >>> >> parameterization *on my part due to a lack of understanding of how >>> >> transfer entropy works on a more theoretical/mathematical level*. >>> >> If >>> >> the latter is the case, is there any relatively straightforward way >>> >> to >>> >> conceptualize this, or is this something where I'm just going to >>> >> have >>> >> to keep reading and rereading until it eventually makes sense? I've >>> >> already done quite a bit of that and it hasn't pierced my thick >>> >> skull >>> >> yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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: >>> > >>> >>> > >>> > ------------------------------ >>> > >>> > Message: 6 >>> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >>> > From: Holger Krause >>> > To: FieldTrip discussion list >>> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >>> > days ago >>> > Message-ID: >>> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >>> > Content-Type: text/plain; charset="us-ascii" >>> > >>> > Dear developers, >>> > >>> > Could you please check the process for creation/publication of >>> > zip-files on >>> > the FTP server? The latest file I can find there is >>> > fieldtrip-20140906.zip. >>> > >>> > Thanks in advance, >>> > >>> > Holger >>> > >>> > >>> > ------------------------------ >>> > >>> > Message: 7 >>> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >>> > From: Max Cantor >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > This is immensely helpful, thank you. I was very confused about why >>> > some >>> > versions of the pipeline I saw were using group calculate and others >>> > were >>> > using interaction delay reconstruction and what that meant, and I >>> > think I >>> > have a more clear idea of what the different steps of the pipeline >>> > are >>> > doing. There are still a few things I'm a bit confused about though >>> > in >>> > terms of the pipeline. For instance, whether or not I need to do >>> > TEprepare >>> > before group prepare, and if I need to do graph analysis (which I'm >>> > not >>> > sure I fully understand but also haven't looked deeply into) before >>> > group >>> > stats. >>> > >>> > If you don't mind me taking you up on your offer, I think seeing >>> > your >>> > example script might help clarify some of these issues. >>> > >>> > Thank you! >>> > >>> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >>> > Patricia.Wollstadt at gmx.de> wrote: >>> > >>> >> Hello Max, >>> >> >>> >> I added a few comments to the questions regarding individual >>> >> parameters >>> >> below. To address the general problem of TRENTOOL telling you, that >>> >> there >>> >> are not enough sample points in your data: From what I can see in >>> >> your >>> >> script, you probably don't have enough data points in each time >>> >> series to >>> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >>> >> which >>> >> gives you 240 samples per time series. Can you maybe avoid >>> >> downsampling to >>> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >>> >> longer time >>> >> window of interest? >>> >> Note that you also 'lose' data to embedding and the interaction >>> >> delay: The >>> >> first point that can be used for TE estimation is at max. embedding >>> >> length >>> >> + max. interaction delay in samples. For example: max. embedding >>> >> length = >>> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >>> >> interaction >>> >> delay of 30 ms = 9 samples. In this example, you would be left with >>> >> 240 - >>> >> 29 samples for TE estimation per trial. There is also the >>> >> possibility to >>> >> estimate time resolved TE/TE for shorter time windows of interest >>> >> (see >>> >> section 4.4 in the manual); however, this method requires the use >>> >> of a GPU >>> >> for TE estimation. >>> >> >>> >> I would further recommend to use the new pipeline for group >>> >> statistics >>> >> described in the manual in section 4.5 (the function >>> >> 'TEgroup_calculate' is >>> >> deprecated). The new pipeline allows you to reconstruct the >>> >> interaction >>> >> delay and uses the following functions (see also comments in the >>> >> script): >>> >> >>> >> TEgroup_prepare -> prepares all data sets (all subjects/all >>> >> conditions) >>> >> for group analysis (this means finding common embedding parameters >>> >> such >>> >> that estimates are not biased between groups) >>> >> InteractionDelayReconstruction_calculate -> estimates TE for >>> >> individual data sets and all assumed interaction delays u >>> >> InteractionDelayReconstruction_analyze -> reconstructs the >>> >> interaction delay by selecting the u that maximizes TE for each >>> >> channel >>> >> TEgroup_stats -> calculate group statistics using a permutation >>> >> test >>> >> >>> >> I can send you an example script for group TE analysis using this >>> >> pipeline >>> >> to get you started. I hope this helps you to get the group analysis >>> >> running. Just write again if you're having trouble setting up the >>> >> pipeline >>> >> or something is not clear about the parameters/my comments. >>> >> >>> >> Best, >>> >> Patricia >>> >> >>> >> >>> >> >>> >> >>> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not 100% >>> >> sure if it is appropriate to ask questions about it here, but to >>> >> the best >>> >> of my knowledge they do not have a mailing list and I saw a few >>> >> trentool >>> >> questions in the archives, so I'm going to assume it's ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present in >>> >> the pipeline. Sorry in advance for the long post! Any help would be >>> >> greatly >>> >> appreciated as I'm a bit over my head on this but I think I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data that >>> >> was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi >>> >> is in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within >>> >> the toi, but beyond that are there any benefits to it being earlier >>> >> or >>> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >>> >> in >>> >> seconds. The prediction time is the assumed interaction delay >>> >> between your >>> >> two sources and should fit within your toi. In general it is >>> >> preferable to >>> >> use the method for interaction delay reconstruction for TE >>> >> estimation, >>> >> because it allows you to reconstruct the actual delay between your >>> >> source >>> >> and target times series. A non-optimal u/interaction delay may >>> >> cause an >>> >> underestimation of TE, so it is recommended to use the pipeline for >>> >> interaction delay reconstruction whenever estimating TE for unknown >>> >> delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, >>> >> so it is best to limit the u range to values that are >>> >> physiologically >>> >> plausible. >>> >> >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the sample >>> >> rate and filters are used to determine the actthrvalue, but I don't >>> >> actually know the calculation. 7.5 was a rough guess just to test >>> >> the >>> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >>> >> You can >>> >> set the actthrvalue based on the filtering you did prior to TE >>> >> analysis. If >>> >> you for example highpass filtered at 10 Hz, you shouldn't find an >>> >> ACT >>> >> higher than 30 samples, because you filtered out any components of >>> >> the >>> >> signal slower than 10 Hz/30 samples (given your sampling frequency >>> >> of 300 >>> >> Hz). So in this scenario the actthrvalue would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm yet >>> >> to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* PW: >>> >> The Ragwitz criterion tries to find optimal embedding parameters >>> >> dim and >>> >> tau for the data. To do that, the method iteratively takes all >>> >> possible >>> >> combinations of dim and tau values that are provided in cfgP.ragdim >>> >> and >>> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >>> >> embed >>> >> the data. To test an embedding, the method builds the embedding >>> >> vectors >>> >> from the data; it then tests for each point how well the next point >>> >> in time >>> >> can be predicted from the reference point's nearest neighbours. So >>> >> for each >>> >> embedded point, the method searches for the nearest neighbours and >>> >> calculates the average of those nearest neighbours. The difference >>> >> between >>> >> the averaged/predicted point and the actual next point is the error >>> >> of the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested by >>> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together >>> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >>> >> will >>> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >>> >> here are >>> >> factors that are later multiplied with the ACT to obtain the actual >>> >> tau. >>> >> 'repPred' is the number of points that will be used for the local >>> >> prediction, i.e. the Ragwitz criterion will test the local >>> >> prediction and >>> >> calculate the error for the first 100 points in your time series. >>> >> The two >>> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >>> >> neighbour >>> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >>> >> method to >>> >> either conduct a kNN or range search; 'sizeNei' specifies the >>> >> number of >>> >> neighbours or the radius to be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' >>> >> data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject >>> >> virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.* >>> >> TRENTOOL seems to handle data output very differently from >>> >> fieldtrip and >>> >> I've had trouble thinking through the most logical way to handle >>> >> the data >>> >> so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition x >>> >> subject .mat file, which as I said before is collectively the same >>> >> as the 3 >>> >> x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> *At this step I get the following error: Error using >>> >> transferentropy (line >>> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >>> >> Error in >>> >> TEgroup_calculate (line 133) [TEresult] = >>> >> transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate is a >>> >> pipeline issue* (I noticed the example pipeline in trentool, the >>> >> manual, >>> >> and published methods articles all seem to have slightly or >>> >> significantly >>> >> different pipeline compositions), *or if the error is* due to ACT, >>> >> ragwitz optimization, or some other faulty parameterization *on my >>> >> part >>> >> due to a lack of understanding of how transfer entropy works on a >>> >> more >>> >> theoretical/mathematical level*. If the latter is the case, is >>> >> there any >>> >> relatively straightforward way to conceptualize this, or is this >>> >> something >>> >> where I'm just going to have to keep reading and rereading until it >>> >> eventually makes sense? I've already done quite a bit of that and >>> >> it hasn't >>> >> pierced my thick skull yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing >>> >> >>> listfieldtrip at donders.ru.nlhttp://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 >>> >> >>> > >>> > >>> > >>> > -- >>> > Max Cantor >>> > Lab Manager >>> > Computational Neurolinguistics Lab >>> > University of Michigan >>> > -------------- 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 46, Issue 3 >>> > **************************************** >>> > >>> >>> >>> >>> Barbara Schorr, MSc >>> Clinical and Biological Psychology >>> University of Ulm >>> Albert-Einstein-Allee 47 >>> 89069 Ulm >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jim Herring, MSc. >> Neuronal Oscillations Group >> Centre for Cognitive Neuroimaging >> Donders Institute for Brain, Cognition and Behaviour >> Radboud University Nijmegen >> >> >> ------------------------------ >> >> Message: 4 >> Date: Mon, 15 Sep 2014 12:09:24 +0200 (CEST) >> From: Fr?d?ric Roux >> To: FieldTrip discussion list >> Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs >> Message-ID: <867006743.3066178.1410775764568.JavaMail.root at bcbl.eu> >> Content-Type: text/plain; charset=utf-8 >> >> Dear all, >> >> my question relates to the computation of combined planar gradients >> using the ft_combineplanar function. >> >> Our data has been recorded with an Elekta Neuromag 306 channel system, >> and I would like to know if it is "safe" to compute combined gradients >> before calling ft_freqstatistics, if the input data contains single >> trial TFRs. >> >> The reason why I am asking is because in the documentation of the >> function it says >> % Use as >> % [data] = ft_combineplanar(cfg, data) >> % where data contains an averaged planar gradient (either ERF or TFR). >> >> However, the following tutorial suggests that this can be safely applied if >> the input data contains TFRs which have been computed with the >> cfg.keeptrials = 'yes' option: >> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq >> >> I am bit confused as both information (the fieldtrip documentation >> and the tutorial) >> seem to contradict each other. >> >> The 2 options that are see are: >> >> 1) compute TFRs with cfg.keeptrials = 'yes', then call >> ft_frestatistics, then call ft_combineplanar >> by using the output of ft_freqstatistics as input for the >> ft_combineplanar function. >> 2) compute TFRs with cfg.keeptrials = 'yes', then call >> ft_combineplanar, then call ft_freqstatistics >> >> Could anyone with experience on this issue please let me know what >> the best way >> to proceed would be? >> >> Fred >> --------------------------------------------------------------------------- >> >> >> >> >> ------------------------------ >> >> Message: 5 >> Date: Mon, 15 Sep 2014 13:12:38 -0300 >> From: gamaliel huerta urrea >> To: fieldtrip at science.ru.nl >> Subject: [FieldTrip] dipole simulation on head model >> Message-ID: >> >> Content-Type: text/plain; charset="utf-8" >> >> hi all >> >> I hope you can help my problem. >> >> I have generated a model of head fieldtrip, and now I need to simulate >> sources at different positions within the crust generated. I followed the >> tutorial head model generation for EEG. However I have not found >> information on how to simulate a source. Any help would be welcome. >> >> Thank you >> greetings >> >> -- >> *Gamaliel Huerta* >> *Ingenier?a Civil Biom?dica* >> *Universidad de Valpara?so* >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> Message: 6 >> Date: Mon, 15 Sep 2014 18:38:26 +0200 >> From: Tzvetan Popov >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] dipole simulation on head model >> Message-ID: <6677301D-D72C-4C12-BC84-779D5E4DF8F3 at uni-konstanz.de> >> Content-Type: text/plain; charset="iso-8859-1" >> >> >> Dear Gamaliel, >> you might try something like this: >> >> http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit >> >> good luck >> tzvetan >> >> Am 15.09.2014 um 18:12 schrieb gamaliel huerta urrea >> : >> >>> hi all >>> >>> I hope you can help my problem. >>> >>> I have generated a model of head fieldtrip, and now I need to >>> simulate sources at different positions within the crust generated. >>> I followed the tutorial head model generation for EEG. However I >>> have not found information on how to simulate a source. Any help >>> would be welcome. >>> >>> Thank you >>> greetings >>> >>> -- >>> Gamaliel Huerta >>> Ingenier?a Civil Biom?dica >>> Universidad de Valpara?so >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> Message: 7 >> Date: Mon, 15 Sep 2014 12:40:41 -0500 >> From: "Jing Fan" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of >> variable 'abort' >> Message-ID: <000001cfd10c$2b7786a0$826693e0$@gmail.com> >> Content-Type: text/plain; charset="us-ascii" >> >> Hi Jim, >> >> I download the latest .zip file from FTP. >> I received the same error message when calling function ft_definetrial(cfg). >> It seems to me that ft_preamble init command will go to script ft_preamble.m >> instead of ft_preamble_init.m. >> Any help to resolve this issue will be appreciated. >> >> Best, >> Jing >> >> >> >> -----Original Message----- >> From: fieldtrip-bounces at science.ru.nl >> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) >> Sent: Monday, September 15, 2014 5:01 AM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable >> 'abort' >> >> Dear Barbara, >> >> The error seems to be related to a bug that pops up now and then >> (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a >> corrupt installation of fieldtrip and/or the need to update fieldtrip. >> >> Could you please try downloading the most recent version of fieldtrip and >> see if the problem persists? >> >> For an example of what can be expected from this function see: Esser SK, >> Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct >> demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res >> Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. >> >> Best, >> >> Jim >> >> >> ----- Oorspronkelijk bericht ----- >>> Van: "barbara schorr" >>> Aan: fieldtrip at science.ru.nl >>> Verzonden: Woensdag 10 september 2014 14:07:14 >>> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable >> 'abort' >>> Dear fieldtripers. >>> >>> as mentioned in the subject line I would like to anaylse my timelocked >>> ERP Data with the function ft_globalmeanfield. >>> >>> I get the Error: Undefined function or variable 'abort' >>> Error in ft_globalmeanfield (line84) >>> if abort >>> >>> in the function it says: >>> >>> %the abort variable is set to true or false in ft_preamble_inti >>> if abort >>> % do not continue function execution in case the outputfile is >>> present and the user indicated to keep it >>> return >>> end >>> >>> >>> I don't understand what this means. I would really appreciate your >>> help to get this running. >>> >>> Also, what is the result when I run this function on my data? (This >>> method was proposed from a reviewer. I never used it before, so I >>> don't exactly know what it does and what the result will look like). >>> >>> Thank you very much in advance! >>> >>> Best, >>> >>> Barbara Schorr >>> >>> >>> >>> >>> Zitat von 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: Question regarding nonparametric testing for coherence >>> > differences (Eric Maris) >>> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >>> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >>> > 4. Re: ft_rejectvisual: removing trials marked as bad >>> > (Caspar, Emilie) >>> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >>> > 6. Latest FT version on ftp-server is from three days ago >>> > (Holger Krause) >>> > 7. Re: TRENTOOL pipeline help (Max Cantor) >>> > >>> > >>> > ---------------------------------------------------------------------- >>> > >>> > Message: 1 >>> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >>> > From: "Eric Maris" >>> > To: , "'FieldTrip discussion list'" >>> > >>> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >>> > for >>> > coherence differences >>> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Hwee Ling, >>> > >>> > >>> > >>> > In the paper you refer to (Maris et al, JNM, 2007), I did not >>> > perform a >>> > cluster-based permutation test at the level of the channel pairs. >>> > Instead, >>> > all coherences mentioned in the paper are coherence between a single >>> > EMG >>> > channel (2 electrodes mounted on the forearm) and all MEG >>> > electrodes. Thus, >>> > there are as many EMG-MEG coherences as there are MEG channels (275 >>> > in our >>> > lab), and the clustering of these coherences involves the same >>> > neighbourhood >>> > structure as the clustering of channel-specific statistics on power >>> > or >>> > evoked response. The analysis you propose involves clustering in a >>> > much more >>> > complex space, namely the formed by all (MEG,MEG) channel pairs >>> > (275*275=75625 pairs). In the early days of cluster-based >>> > permutation >>> > statistics, I have worked on this problem but did not pursue it >>> > because the >>> > resulting clusters are very hard to interpret. >>> > >>> > >>> > >>> > Best, >>> > >>> > >>> > >>> > Eric Maris >>> > >>> > >>> > >>> > >>> > >>> > Dear all and Prof Maris, >>> > >>> > I'm re-posting this question again, as I didn't get any replies >>> > previously. >>> > >>> > I?m interested to investigate if there are any differences in phase >>> > synchronization in resting state data at timepoint 2 versus >>> > timepoint 1. The >>> > EEG data was collected using 64 EEG channels, resting state, eyes >>> > opened and >>> > eyes closed. I?ve arbitrarily segmented the resting state data into >>> > epochs >>> > of 2s each, and the epochs with artifacts are excluded completely >>> > from >>> > further analyses. I then performed mtmfft to get the fourier >>> > representation >>> > of the data, extracted the coherence, and compared the coherence >>> > difference >>> > of timepoint 2 versus timepoint 1 of all channels paired with all >>> > other >>> > channels. >>> > >>> > I figured that if I extract the connectivity analyses without >>> > specifying the >>> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >>> > allow me to >>> > perform cluster-based statistical analyses. I get an output with >>> > ?chan_chan? >>> > dimord variable. However, I was not 100% sure that this is correct, >>> > hence, I?ve >>> > inserted my code (see below). It?ll be great if you could tell me if >>> > what I?m >>> > doing makes any sense at all. Also, I don?t know how I can plot the >>> > results >>> > to see if it make any sense at all. >>> > >>> > Also, I checked the values obtained from when I specified >>> > "cfg.channelcmb" >>> > and when I did not specify "cfg.channelcmb", I noticed that the >>> > values were >>> > somehow different. I would assume that the values to be similar, >>> > although >>> > I'm not sure why they would have differences in the values obtained >>> > from >>> > specifying "cfg.channelcmb". >>> > >>> > This is my code that I've used thus far: >>> > >>> > for sub = 1:5 >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'fourier'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.keeptrials = 'yes'; >>> > >>> > cfg.tapsmofrq = 5; >>> > >>> > cfg.foilim = [0 100]; >>> > >>> > cfg.taper = 'dpss'; >>> > >>> > % find the index for the c200 condition >>> > >>> > pre_c200_idx = find(data5.trialinfo == 201); >>> > >>> > cfg.trials = pre_c200_idx; >>> > >>> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > post_c200_idx = find(data5.trialinfo == 200); >>> > >>> > cfg.trials = post_c200_idx; >>> > >>> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.keeptrials = 'no'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.removemean = 'yes'; >>> > >>> > cfg.method = 'coh'; >>> > >>> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_pre_c200); >>> > >>> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_post_c200); >>> > >>> > end >>> > >>> > >>> > >>> > >> load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat >> '); >>> > >>> > cfg_neighb.method = 'template'; >>> > >>> > cfg_neighb.layout = lay; >>> > >>> > cfg_neighb.channel = 'all'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, >>> > sub_HLF_pre_c200coh{1}); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.channelcmb = {cfg.channel, cfg.channel}; >>> > >>> > cfg.latency = 'all'; >>> > >>> > cfg.avgovertime = 'no'; >>> > >>> > cfg.avgoverchan = 'no'; >>> > >>> > cfg.parameter = 'cohspctrm'; >>> > >>> > cfg.method = 'montecarlo'; >>> > >>> > cfg.statistic = 'depsamplesT'; >>> > >>> > cfg.correctm = 'cluster'; >>> > >>> > cfg.tail = 0; >>> > >>> > % cfg.clustertail = 0; >>> > >>> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >>> > frequency >>> > bands. >>> > >>> > cfg.numrandomization = 10000; >>> > >>> > cfg.ivar = 2; >>> > >>> > cfg.uvar = 1; >>> > >>> > >>> > >>> > % design matrices >>> > >>> > clear design; >>> > >>> > design(1,:) = [1:5, 1:5]; >>> > >>> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >>> > >>> > cfg.design = design; >>> > >>> > % for theta band >>> > >>> > cfg.avgoverfreq = 'yes'; >>> > >>> > cfg.frequency = [4 8]; % I also performed the statistics for delta >>> > (2-4), >>> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >>> > (30-40), >>> > and gamma (40-100). >>> > >>> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >>> > sub_HLF_post_c200coh{:}, >>> > sub_HLF_pre_c200coh{:}); >>> > >>> > >>> > >>> > When I tried to plot the results, I used this code: >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.layout = 'lay'; >>> > >>> > cfg.zlim = [-1 1]; >>> > >>> > cfg.alpha = 0.05; >>> > >>> > cfg.refchannel = 'all'; >>> > >>> > ft_clusterplot(cfg, diffc200_theta_stat); >>> > >>> > However, I was not sure how I could plot the results. I get an error >>> > message >>> > from Fieldtrip when using ft_clusterplot: >>> > >>> > Error using topoplot_common (line 366) >>> > >>> > no reference channel is specified >>> > >>> > Error in ft_topoplotTFR (line 192) >>> > >>> > [cfg] = topoplot_common(cfg, varargin{:}); >>> > >>> > Error in ft_clusterplot (line 372) >>> > >>> > ft_topoplotTFR(cfgtopo, stat); >>> > >>> > >>> > >>> > According to your paper in 2007, the topoplot of the results were >>> > masked by >>> > the spatio-spectral pattern of the significant clusters. I don't >>> > know how to >>> > do this, and I would really appreciate if you can show me how to >>> > make such a >>> > plot. >>> > >>> > Thank you very much. >>> > >>> > Kind regards, >>> > >>> > Hweeling >>> > >>> > >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 280/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 2 >>> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >>> > From: KatrinH Heimann >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Joseph, thanks so much, I really appreciate your help. I was >>> > also >>> > wandering, if maybe there is another bug in my code. >>> > Our nets are 128 channels, Hydrocel, but as a colleague of me >>> > adviced me to >>> > do so, I also tried the 129 layout. >>> > My code you find below (without selection of bad channels etc.) >>> > If you need also the data of two subjects to have a look, let me >>> > know!!! >>> > Best and thanks really! >>> > Katrin >>> > >>> > >>> > subject=input('Which subject do you want to analyse? ','s'); >>> > >>> > name = strcat(subject,'.raw'); >>> > >>> > subjectnumber=input('Which is the subjectnumber?', 's'); >>> > >>> > sb=subjectnumber >>> > >>> > %subjectnumber = strcat(subjectnumber, '.txt') >>> > >>> > %% >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.dataset = name; >>> > >>> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> > >>> > cfg.trialdef.eventtype = 'trigger'; >>> > >>> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> > trigger >>> > >>> > cfg.trialdef.prestim = 0.234; % in seconds >>> > >>> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> > observation, but maybe we need less) >>> > >>> > cfg = ft_definetrial(cfg); >>> > >>> > >>> > cfg.trl([1:7],:) = []; >>> > >>> > >>> > %change timeline according to constant offset of 16 ms = 8 samples >>> > (because >>> > recorded with 500 hz)in >>> > >>> > %structure trial >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)-8 >>> > >>> > >>> > %change timeline to make the cut the zeropoint >>> > >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> > >>> > >>> > >>> > %% preprocess data >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.detrend = 'yes'; >>> > >>> > cfg.preproc.demean = 'yes'; >>> > >>> > cfg.preproc.baselinewindow = [-2.1 -2.0] >>> > >>> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> > filtered >>> > >>> > %(0.1-45) and bad channels have to be replaced!!!! >>> > >>> > %cfg.preproc.bpfreq = [6 32]; >>> > >>> > % >>> > >>> > % >>> > >>> > obs_data = ft_preprocessing(cfg); >>> > >>> > % >>> > >>> > save (strcat(sb,'obs_data') , 'obs_data') >>> > >>> > >>> > %% determining channel neighbours (necessary for Artifact detection) >>> > >>> > cfg = []; >>> > >>> > cfg.channel = obs_data.label; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.feedback = 'yes'; >>> > >>> > lay = ft_prepare_layout(cfg); >>> > >>> > >>> > >>> > cfg_neighb = []; >>> > >>> > cfg_neighb.feedback = 'yes'; >>> > >>> > >>> > cfg_neighb.method = 'triangulation'; >>> > >>> > cfg_neighb.layout = 'GSN128.sfp'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > obs_data.elec = ft_read_sens('GSN128.sfp'); >>> > >>> > >>> > %% Artifacts - to detect bad channels - is not saved!!! >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs_data_try = ft_rejectvisual(cfg, obs_data); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_try = ft_rejectartifact (cfg,obs_data); >>> > >>> > >>> > >>> > %% Preparing neighbours for channel repair - but bad channel info >>> > in!!! >>> > >>> > >>> > % cfg_neighb = []; >>> > >>> > % cfg_neighb.feedback = 'yes'; >>> > >>> > % cfg_neighb.method = 'triangulation'; >>> > >>> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> > >>> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > % Interpolate and put into new data structure >>> > >>> > cfg = []; >>> > >>> > cfg.badchannel = {}; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.method = 'nearest'; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> > >>> > >>> > % Check reconstruction >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > % dat1=obs_data; >>> > >>> > % dat2=obs_data_channelrepaired; >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> > >>> > % y=dat2.trial{1}(62,:); >>> > >>> > % plot(x);hold on;plot(y,'r'); >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(72,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(75,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > %% artifact rejection/trial inspection - throw out electrode jumps >>> > etc. >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> > according to >>> > channels interpolated %% 128-number of interp. channels) >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > comp = ft_componentanalysis(cfg,obs_data_clean1); >>> > >>> > save (strcat(sb,'comp_all') , 'comp') >>> > >>> > >>> > %% >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'component'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='some'; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > ft_databrowser(cfg,comp); >>> > >>> > >>> > %% poweranalysis components >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'pow'; >>> > >>> > cfg.channel = 'all';%compute the power spectrum in all ICs >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.taper = 'hanning'; >>> > >>> > cfg.foi = 0:0.2:50; >>> > >>> > obs_freq = ft_freqanalysis(cfg, comp); >>> > >>> > >>> > %And you can plot the spectra: >>> > >>> > >>> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> > >>> > nsubplots = 16; >>> > >>> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> > decimals, type >>> > doc subplot >>> > >>> > >>> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> > >>> > tot = Nfigs*nsubplots; >>> > >>> > >>> > rptvect = 1:size(comp.topo,1); >>> > >>> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> > >>> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> > >>> > >>> > for r=1:size(rptvect,1); >>> > >>> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> > 1]);%full >>> > screen >>> > >>> > k=0; >>> > >>> > for j=1:size(rptvect,2); >>> > >>> > if~(rptvect(r,j)==0); >>> > >>> > k=k+1; >>> > >>> > cfg=[]; >>> > >>> > cfg.channel = rptvect(r,j); >>> > >>> > cfg.ylim =[0 500] >>> > >>> > cfg.xlim =[0 50] >>> > >>> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> > >>> > end >>> > >>> > end >>> > >>> > end >>> > >>> > >>> > %For the IC topos you'll follow the same logic as above but with: >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [1:20]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [21:40]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [41:60]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [61:80]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% Seperate observation conditions >>> > >>> > >>> > name1= strcat(num2str(sb),'_90.xls'); >>> > >>> > list1=xlsread (name1) >>> > >>> > >>> > >>> > >>> > >>> > name2= strcat(num2str(sb),'_180.xls'); >>> > >>> > list2=xlsread (name2) >>> > >>> > >>> > >>> > % >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list1] >>> > >>> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list2] >>> > >>> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > %%PIPELINE FOR obs90 >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128; >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > >>> > comp_1 = ft_componentanalysis(cfg, obs90_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> > obs90_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts - final detection >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs90_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> > >>> > >>> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> > >>> > >>> > %% plot it >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP) >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% PIPELINE FOR obs180 >>> > >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > comp_2 = ft_componentanalysis(cfg, obs180_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> > obs180_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts final 180 >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs180_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> > >>> > >>> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> > >>> > >>> > %% plot 180 ERP >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs180_data_ERP) >>> > >>> > >>> > %% plot both ERPs >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > cfg.showlabels = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> > >>> > >>> > %% plot difference wave >>> > >>> > >>> > difference = obs180_data_ERP; % copy one of the >>> > structures >>> > >>> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >>> > the >>> > difference ERP >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, difference) >>> > >>> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> > >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI >>> >> data. A couple things. First of all, exactly which net do you use? >>> >> If >>> >> they are 129-channel, there is still the question of whether they >>> >> are the >>> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >>> >> cause an >>> >> error like this. Could you send me the file you are trying to >>> >> process and >>> >> the script you are using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >>> >> diezmartini at gmail.com> wrote: >>> >> >>> >> Which nets do you use? I use EGI. I tried both the ones you mention >>> >> and >>> >> they didn't work. It was hard to find that exact one online but it >>> >> was the >>> >> only file that actually worked. >>> >> >>> >> >>> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >> >>> >> wrote: >>> >> >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. >>> >>> Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one >>> >>> >>> >>>> I use >>> >>>> >>> >>>> >>> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>> >>>> katrinheimann at gmail.com> wrote: >>> >>>> >>> >>>>> Dear all, my problems seem neverending. This time however i >>> >>>>> really need >>> >>>>> help. >>> >>>>> I implemented a pipeline for ERPs. All works now, >>> >>>>> trialdefinition, >>> >>>>> preprocessing, channelreplacement, ica, componentrejection, >>> >>>>> final >>> >>>>> artifactdetection, timelock of the single subject data. However, >>> >>>>> when I >>> >>>>> wanna compute the grandaverage of the single subjects I get the >>> >>>>> following >>> >>>>> error message: >>> >>>>> >>> >>>>> computing average of avg over 19 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 3 MB >>> >>>>> computing average of avg over 2 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>>>> additional >>> >>>>> allocation of an estimated 0 MB >>> >>>>> >>> >>>>> Furthermore in the plot of the significant clusters, the >>> >>>>> channelnames >>> >>>>> are mixed up (do not correspond to my net) >>> >>>>> >>> >>>>> >>> >>>>> I guess that there is a problem with the layout I use. >>> >>>>> Here the code that I use >>> >>>>> >>> >>>>> %For generating the layout (also in the single subjects): >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = obs_data.label; >>> >>>>> >>> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>>>> >>> >>>>> cfg.feedback = 'yes'; >>> >>>>> >>> >>>>> lay = ft_prepare_layout(cfg); >>> >>>>> >>> >>>>> >>> >>>>> cfg_neighb = []; >>> >>>>> >>> >>>>> cfg_neighb.feedback = 'yes'; >>> >>>>> >>> >>>>> cfg_neighb.method = 'triangulation'; >>> >>>>> >>> >>>>> cfg_neighb.layout = lay; >>> >>>>> >>> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>>>> >>> >>>>> >>> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>>>> >>> >>>>> >>> >>>>> %For computing the grand average >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = 'all'; >>> >>>>> >>> >>>>> cfg.latency = 'all'; >>> >>>>> >>> >>>>> cfg.parameter = 'avg'; >>> >>>>> >>> >>>>> cfg.keepindividual = 'no' >>> >>>>> >>> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>>>> >>> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>>>> >>> >>>>> % "{:}" means to use data from all elements of the variable >>> >>>>> >>> >>>>> >>> >>>>> For plotting the significant clusters >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.style = 'blank'; >>> >>>>> >>> >>>>> cfg.layout = lay; >>> >>>>> >>> >>>>> cfg.channellabels = 'yes'; >>> >>>>> >>> >>>>> cfg.highlight = 'labels'; >>> >>>>> >>> >>>>> cfg.highlightchannel = find(stat.mask); >>> >>>>> >>> >>>>> cfg.comment = 'no'; >>> >>>>> >>> >>>>> figure; ft_topoplotER(cfg, GA_90) >>> >>>>> >>> >>>>> title('Nonparametric: significant with cluster multiple >>> >>>>> comparison >>> >>>>> correction') >>> >>>>> >>> >>>>> >>> >>>>> Do you have ANY idea to this? I am really completely >>> >>>>> helpless.... >>> >>>>> >>> >>>>> thanks and best >>> >>>>> >>> >>>>> Katrin >>> >>>>> >>> >>>>> _______________________________________________ >>> >>>>> 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 >>> >>> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing list >>> >> fieldtrip at donders.ru.nl >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> >> >>> >> >> ---------------------------------------------------------------------------- >> ---- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.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: >>> > >> > b61/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 3 >>> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >>> > From: Joseph Dien >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > yes, please do send me the data. >>> > >>> > Thanks! >>> > >>> > Joe >>> > >>> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >>> > wrote: >>> > >>> >> Dear Joseph, thanks so much, I really appreciate your help. I was >>> >> also wandering, if maybe there is another bug in my code. >>> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >>> >> adviced me to do so, I also tried the 129 layout. >>> >> My code you find below (without selection of bad channels etc.) >>> >> If you need also the data of two subjects to have a look, let me >>> >> know!!! >>> >> Best and thanks really! >>> >> Katrin >>> >> >>> >> >>> >> >>> >> subject=input('Which subject do you want to analyse? ','s'); >>> >> >>> >> name = strcat(subject,'.raw'); >>> >> >>> >> subjectnumber=input('Which is the subjectnumber?', 's'); >>> >> >>> >> sb=subjectnumber >>> >> >>> >> %subjectnumber = strcat(subjectnumber, '.txt') >>> >> >>> >> %% >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.dataset = name; >>> >> >>> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> >> >>> >> cfg.trialdef.eventtype = 'trigger'; >>> >> >>> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> >> trigger >>> >> >>> >> cfg.trialdef.prestim = 0.234; % in seconds >>> >> >>> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> >> observation, but maybe we need less) >>> >> >>> >> cfg = ft_definetrial(cfg); >>> >> >>> >> >>> >> >>> >> cfg.trl([1:7],:) = []; >>> >> >>> >> >>> >> >>> >> %change timeline according to constant offset of 16 ms = 8 samples >>> >> (because recorded with 500 hz)in >>> >> >>> >> %structure trial >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >>> >> >>> >> >>> >> >>> >> %change timeline to make the cut the zeropoint >>> >> >>> >> >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% preprocess data >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.detrend = 'yes'; >>> >> >>> >> cfg.preproc.demean = 'yes'; >>> >> >>> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >>> >> >>> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> >> filtered >>> >> >>> >> %(0.1-45) and bad channels have to be replaced!!!! >>> >> >>> >> %cfg.preproc.bpfreq = [6 32]; >>> >> >>> >> % >>> >> >>> >> % >>> >> >>> >> obs_data = ft_preprocessing(cfg); >>> >> >>> >> % >>> >> >>> >> save (strcat(sb,'obs_data') , 'obs_data') >>> >> >>> >> >>> >> >>> >> %% determining channel neighbours (necessary for Artifact >>> >> detection) >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = obs_data.label; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.feedback = 'yes'; >>> >> >>> >> lay = ft_prepare_layout(cfg); >>> >> >>> >> >>> >> cfg_neighb = []; >>> >> >>> >> cfg_neighb.feedback = 'yes'; >>> >> >>> >> >>> >> >>> >> cfg_neighb.method = 'triangulation'; >>> >> >>> >> cfg_neighb.layout = 'GSN128.sfp'; >>> >> >>> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >>> >> >>> >> >>> >> >>> >> %% Artifacts - to detect bad channels - is not saved!!! >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Preparing neighbours for channel repair - but bad channel info >>> >> in!!! >>> >> >>> >> >>> >> >>> >> % cfg_neighb = []; >>> >> >>> >> % cfg_neighb.feedback = 'yes'; >>> >> >>> >> % cfg_neighb.method = 'triangulation'; >>> >> >>> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> >> >>> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> % Interpolate and put into new data structure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.badchannel = {}; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.method = 'nearest'; >>> >> >>> >> cfg.neighbours = neighbours; >>> >> >>> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> >> >>> >> >>> >> >>> >> % Check reconstruction >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> % dat1=obs_data; >>> >> >>> >> % dat2=obs_data_channelrepaired; >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> >> >>> >> % y=dat2.trial{1}(62,:); >>> >> >>> >> % plot(x);hold on;plot(y,'r'); >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(72,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(75,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> %% artifact rejection/trial inspection - throw out electrode jumps >>> >> etc. >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> >> according to channels interpolated %% 128-number of interp. >>> >> channels) >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = {'all'}; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >>> >> >>> >> save (strcat(sb,'comp_all') , 'comp') >>> >> >>> >> >>> >> >>> >> %% >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'component'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='some'; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> ft_databrowser(cfg,comp); >>> >> >>> >> >>> >> >>> >> %% poweranalysis components >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.output = 'pow'; >>> >> >>> >> cfg.channel = 'all';%compute the power spectrum in all ICs >>> >> >>> >> cfg.method = 'mtmfft'; >>> >> >>> >> cfg.taper = 'hanning'; >>> >> >>> >> cfg.foi = 0:0.2:50; >>> >> >>> >> obs_freq = ft_freqanalysis(cfg, comp); >>> >> >>> >> >>> >> >>> >> %And you can plot the spectra: >>> >> >>> >> >>> >> >>> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> >> >>> >> nsubplots = 16; >>> >> >>> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> >> decimals, type doc subplot >>> >> >>> >> >>> >> >>> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> >> >>> >> tot = Nfigs*nsubplots; >>> >> >>> >> >>> >> >>> >> rptvect = 1:size(comp.topo,1); >>> >> >>> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> >> >>> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> >> >>> >> >>> >> >>> >> for r=1:size(rptvect,1); >>> >> >>> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> >> 1]);%full screen >>> >> >>> >> k=0; >>> >> >>> >> for j=1:size(rptvect,2); >>> >> >>> >> if~(rptvect(r,j)==0); >>> >> >>> >> k=k+1; >>> >> >>> >> cfg=[]; >>> >> >>> >> cfg.channel = rptvect(r,j); >>> >> >>> >> cfg.ylim =[0 500] >>> >> >>> >> cfg.xlim =[0 50] >>> >> >>> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> >>> >> >>> >> %For the IC topos you'll follow the same logic as above but with: >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [1:20]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [21:40]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [41:60]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [61:80]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Seperate observation conditions >>> >> >>> >> >>> >> >>> >> name1= strcat(num2str(sb),'_90.xls'); >>> >> >>> >> list1=xlsread (name1) >>> >> >>> >> >>> >> >>> >> name2= strcat(num2str(sb),'_180.xls'); >>> >> >>> >> list2=xlsread (name2) >>> >> >>> >> >>> >> % >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list1] >>> >> >>> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list2] >>> >> >>> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> %%PIPELINE FOR obs90 >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128; >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> >>> >> >>> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> >> obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts - final detection >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot it >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% PIPELINE FOR obs180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> >> obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts final 180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot 180 ERP >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot both ERPs >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> cfg.showlabels = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot difference wave >>> >> >>> >> >>> >> >>> >> difference = obs180_data_ERP; % copy one of >>> >> the structures >>> >> >>> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >>> >> compute the difference ERP >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, difference) >>> >> >>> >> >>> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI data. A couple things. First of all, exactly which net do >>> >> you use? If they are 129-channel, there is still the question of >>> >> whether they are the Hydrocel or the older geodesic nets. >>> >> Regardless, that shouldn't cause an error like this. Could you >>> >> send me the file you are trying to process and the script you are >>> >> using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >>> >> wrote: >>> >> >>> >>> Which nets do you use? I use EGI. I tried both the ones you >>> >>> mention and they didn't work. It was hard to find that exact one >>> >>> online but it was the only file that actually worked. >>> >>> >>> >>> >>> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one I use >>> >>> >>> >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear all, my problems seem neverending. This time however i really >>> >>> need help. >>> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> >>> preprocessing, channelreplacement, ica, componentrejection, final >>> >>> artifactdetection, timelock of the single subject data. However, >>> >>> when I wanna compute the grandaverage of the single subjects I get >>> >>> the following error message: >>> >>> >>> >>> computing average of avg over 19 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 3 MB >>> >>> computing average of avg over 2 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 0 MB >>> >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> >>> >>> Furthermore in the plot of the significant clusters, the >>> >>> channelnames are mixed up (do not correspond to my net) >>> >>> >>> >>> >>> >>> I guess that there is a problem with the layout I use. >>> >>> Here the code that I use >>> >>> >>> >>> %For generating the layout (also in the single subjects): >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = obs_data.label; >>> >>> >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> >>> >>> cfg.feedback = 'yes'; >>> >>> >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> >>> >>> >>> cfg_neighb = []; >>> >>> >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> >>> >>> cfg_neighb.layout = lay; >>> >>> >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> >>> >>> >>> >>> >>> %For computing the grand average >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = 'all'; >>> >>> >>> >>> cfg.latency = 'all'; >>> >>> >>> >>> cfg.parameter = 'avg'; >>> >>> >>> >>> cfg.keepindividual = 'no' >>> >>> >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> >>> >>> >>> For plotting the significant clusters >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.style = 'blank'; >>> >>> >>> >>> cfg.layout = lay; >>> >>> >>> >>> cfg.channellabels = 'yes'; >>> >>> >>> >>> cfg.highlight = 'labels'; >>> >>> >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> >>> >>> cfg.comment = 'no'; >>> >>> >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> >>> correction') >>> >>> >>> >>> >>> >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> >>> >>> thanks and best >>> >>> >>> >>> Katrin >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> 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 >>> >>> >>> >>> _______________________________________________ >>> >>> fieldtrip mailing list >>> >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >> ---------------------------------------------------------------------------- >> ---- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.com >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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 >>> > >>> > >> ---------------------------------------------------------------------------- >> ---- >>> > >>> > Joseph Dien, PhD >>> > Research Associate >>> > Cognitive Neurology >>> > The Johns Hopkins University School of Medicine >>> > >>> > Lab E-mail: jdien1 at jhmi.edu >>> > Private E-mail: jdien07 at mac.com >>> > Office Phone: 410-614-3115 >>> > Cell Phone: 202-297-8117 >>> > Fax: 410-955-0188 >>> > http://joedien.com >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > ad2/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 4 >>> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >>> > From: "Caspar, Emilie" >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >>> > bad >>> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >>> > Content-Type: text/plain; charset="iso-8859-1" >>> > >>> > Hi Ashley, >>> > >>> > Maybe the mistake is you did not integrate in your script the >>> > command to save the rejection. Normally, with the following command, >>> > you will see in the Matlab Window that artifacts are correctly >>> > rejected after the "quit" button. >>> > >>> > clean_data = ft_rejectvisual(cfg, interpoldata); >>> > cfg.artfctdef.reject = 'complete'; >>> > cfg.artfctdef.feedback = 'yes'; >>> > cleandata = ft_rejectartifact(cfg,clean_data); >>> > >>> > Emilie >>> > >>> > >>> > >>> > >>> > >>> > Le 3 sept. 2014 ? 11:58, Ashley Greene >>> > > a ?crit : >>> > >>> > Hello, >>> > >>> > I have used the rejectvisual function in attempt to remove bad >>> > trials, but after marking them and pressing the quit button, >>> > although the command window states that the selected trials have >>> > been removed, there is no obvious change in the data; all of the >>> > trials are still intact. Have I overlooked something? >>> > >>> > Thanks, >>> > >>> > Ashley >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 985/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 5 >>> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >>> > From: Patricia Wollstadt >>> > To: fieldtrip at science.ru.nl >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: <540EEF94.9080601 at gmx.de> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > Hello Max, >>> > >>> > I added a few comments to the questions regarding individual >>> > parameters >>> > below. To address the general problem of TRENTOOL telling you, that >>> > there are not enough sample points in your data: From what I can see >>> > in >>> > your script, you probably don't have enough data points in each time >>> > series to robustly estimate TE. You analyze 800 ms of data sampled >>> > at >>> > 300 Hz, which gives you 240 samples per time series. Can you maybe >>> > avoid >>> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >>> > you >>> > analyze a longer time window of interest? >>> > Note that you also 'lose' data to embedding and the interaction >>> > delay: >>> > The first point that can be used for TE estimation is at max. >>> > embedding >>> > length + max. interaction delay in samples. For example: max. >>> > embedding >>> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >>> > max >>> > interaction delay of 30 ms = 9 samples. In this example, you would >>> > be >>> > left with 240 - 29 samples for TE estimation per trial. There is >>> > also >>> > the possibility to estimate time resolved TE/TE for shorter time >>> > windows >>> > of interest (see section 4.4 in the manual); however, this method >>> > requires the use of a GPU for TE estimation. >>> > >>> > I would further recommend to use the new pipeline for group >>> > statistics >>> > described in the manual in section 4.5 (the function >>> > 'TEgroup_calculate' >>> > is deprecated). The new pipeline allows you to reconstruct the >>> > interaction delay and uses the following functions (see also >>> > comments in >>> > the script): >>> > >>> > TEgroup_prepare -> prepares all data sets (all subjects/all >>> > conditions) for group analysis (this means finding common embedding >>> > parameters such that estimates are not biased between groups) >>> > InteractionDelayReconstruction_calculate -> estimates TE for >>> > individual data sets and all assumed interaction delays u >>> > InteractionDelayReconstruction_analyze -> reconstructs the >>> > interaction delay by selecting the u that maximizes TE for each >>> > channel >>> > TEgroup_stats -> calculate group statistics using a permutation test >>> > >>> > I can send you an example script for group TE analysis using this >>> > pipeline to get you started. I hope this helps you to get the group >>> > analysis running. Just write again if you're having trouble setting >>> > up >>> > the pipeline or something is not clear about the parameters/my >>> > comments. >>> > >>> > Best, >>> > Patricia >>> > >>> > >>> > >>> > >>> > On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not >>> >> 100% sure if it is appropriate to ask questions about it here, but >>> >> to >>> >> the best of my knowledge they do not have a mailing list and I saw >>> >> a >>> >> few trentool questions in the archives, so I'm going to assume it's >>> >> ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present >>> >> in the pipeline. Sorry in advance for the long post! Any help would >>> >> be >>> >> greatly appreciated as I'm a bit over my head on this but I think >>> >> I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data >>> >> that was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi is >>> >> in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within the toi, but beyond that are there any benefits to it being >>> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >>> >> the >>> >> toi is in seconds. The prediction time is the assumed interaction >>> >> delay between your two sources and should fit within your toi. In >>> >> general it is preferable to use the method for interaction delay >>> >> reconstruction for TE estimation, because it allows you to >>> >> reconstruct >>> >> the actual delay between your source and target times series. A >>> >> non-optimal u/interaction delay may cause an underestimation of TE, >>> >> so >>> >> it is recommended to use the pipeline for interaction delay >>> >> reconstruction whenever estimating TE for unknown delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, so it is best to limit the u range to values that are >>> >> physiologically plausible. >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the >>> >> sample rate and filters are used to determine the actthrvalue, but >>> >> I >>> >> don't actually know the calculation. 7.5 was a rough guess just to >>> >> test the pipeline. I'm also uncertain of what minnrtrials should >>> >> be.* >>> >> PW: You can set the actthrvalue based on the filtering you did >>> >> prior >>> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >>> >> shouldn't find an ACT higher than 30 samples, because you filtered >>> >> out >>> >> any components of the signal slower than 10 Hz/30 samples (given >>> >> your >>> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >>> >> would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> * >>> >> * >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm >>> >> yet to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* >>> >> PW: The Ragwitz criterion tries to find optimal embedding >>> >> parameters >>> >> dim and tau for the data. To do that, the method iteratively takes >>> >> all >>> >> possible combinations of dim and tau values that are provided in >>> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >>> >> these >>> >> combinations embed the data. To test an embedding, the method >>> >> builds >>> >> the embedding vectors from the data; it then tests for each point >>> >> how >>> >> well the next point in time can be predicted from the reference >>> >> point's nearest neighbours. So for each embedded point, the method >>> >> searches for the nearest neighbours and calculates the average of >>> >> those nearest neighbours. The difference between the >>> >> averaged/predicted point and the actual next point is the error of >>> >> the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested >>> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together with 'ragtausteps' specifies the tau values to be tested >>> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >>> >> that >>> >> the values here are factors that are later multiplied with the ACT >>> >> to >>> >> obtain the actual tau. 'repPred' is the number of points that will >>> >> be >>> >> used for the local prediction, i.e. the Ragwitz criterion will test >>> >> the local prediction and calculate the error for the first 100 >>> >> points >>> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >>> >> below >>> >> specify the type of neighbour search conducted by the Ragwitz >>> >> criterion: 'flagNei' tells the method to either conduct a kNN or >>> >> range >>> >> search; 'sizeNei' specifies the number of neighbours or the radius >>> >> to >>> >> be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> * >>> >> * >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> * >>> >> * >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.*TRENTOOL seems to handle data output very differently >>> >> from >>> >> fieldtrip and I've had trouble thinking through the most logical >>> >> way >>> >> to handle the data so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> * >>> >> * >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition >>> >> x subject .mat file, which as I said before is collectively the >>> >> same >>> >> as the 3 x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> * >>> >> * >>> >> *At this step I get the following error: >>> >> >>> >> Error using transferentropy (line 337) >>> >> \nTRENTOOL ERROR: not enough data points left after embedding >>> >> >>> >> Error in TEgroup_calculate (line 133) >>> >> [TEresult] = transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate >>> >> is a pipeline issue* (I noticed the example pipeline in trentool, >>> >> the >>> >> manual, and published methods articles all seem to have slightly or >>> >> significantly different pipeline compositions), *or if the error >>> >> is* >>> >> due to ACT, ragwitz optimization, or some other faulty >>> >> parameterization *on my part due to a lack of understanding of how >>> >> transfer entropy works on a more theoretical/mathematical level*. >>> >> If >>> >> the latter is the case, is there any relatively straightforward way >>> >> to >>> >> conceptualize this, or is this something where I'm just going to >>> >> have >>> >> to keep reading and rereading until it eventually makes sense? I've >>> >> already done quite a bit of that and it hasn't pierced my thick >>> >> skull >>> >> yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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: >>> > >> > 97f/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 6 >>> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >>> > From: Holger Krause >>> > To: FieldTrip discussion list >>> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >>> > days ago >>> > Message-ID: >>> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >>> > Content-Type: text/plain; charset="us-ascii" >>> > >>> > Dear developers, >>> > >>> > Could you please check the process for creation/publication of >>> > zip-files on >>> > the FTP server? The latest file I can find there is >>> > fieldtrip-20140906.zip. >>> > >>> > Thanks in advance, >>> > >>> > Holger >>> > >>> > >>> > ------------------------------ >>> > >>> > Message: 7 >>> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >>> > From: Max Cantor >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > This is immensely helpful, thank you. I was very confused about why >>> > some >>> > versions of the pipeline I saw were using group calculate and others >>> > were >>> > using interaction delay reconstruction and what that meant, and I >>> > think I >>> > have a more clear idea of what the different steps of the pipeline >>> > are >>> > doing. There are still a few things I'm a bit confused about though >>> > in >>> > terms of the pipeline. For instance, whether or not I need to do >>> > TEprepare >>> > before group prepare, and if I need to do graph analysis (which I'm >>> > not >>> > sure I fully understand but also haven't looked deeply into) before >>> > group >>> > stats. >>> > >>> > If you don't mind me taking you up on your offer, I think seeing >>> > your >>> > example script might help clarify some of these issues. >>> > >>> > Thank you! >>> > >>> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >>> > Patricia.Wollstadt at gmx.de> wrote: >>> > >>> >> Hello Max, >>> >> >>> >> I added a few comments to the questions regarding individual >>> >> parameters >>> >> below. To address the general problem of TRENTOOL telling you, that >>> >> there >>> >> are not enough sample points in your data: From what I can see in >>> >> your >>> >> script, you probably don't have enough data points in each time >>> >> series to >>> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >>> >> which >>> >> gives you 240 samples per time series. Can you maybe avoid >>> >> downsampling to >>> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >>> >> longer time >>> >> window of interest? >>> >> Note that you also 'lose' data to embedding and the interaction >>> >> delay: The >>> >> first point that can be used for TE estimation is at max. embedding >>> >> length >>> >> + max. interaction delay in samples. For example: max. embedding >>> >> length = >>> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >>> >> interaction >>> >> delay of 30 ms = 9 samples. In this example, you would be left with >>> >> 240 - >>> >> 29 samples for TE estimation per trial. There is also the >>> >> possibility to >>> >> estimate time resolved TE/TE for shorter time windows of interest >>> >> (see >>> >> section 4.4 in the manual); however, this method requires the use >>> >> of a GPU >>> >> for TE estimation. >>> >> >>> >> I would further recommend to use the new pipeline for group >>> >> statistics >>> >> described in the manual in section 4.5 (the function >>> >> 'TEgroup_calculate' is >>> >> deprecated). The new pipeline allows you to reconstruct the >>> >> interaction >>> >> delay and uses the following functions (see also comments in the >>> >> script): >>> >> >>> >> TEgroup_prepare -> prepares all data sets (all subjects/all >>> >> conditions) >>> >> for group analysis (this means finding common embedding parameters >>> >> such >>> >> that estimates are not biased between groups) >>> >> InteractionDelayReconstruction_calculate -> estimates TE for >>> >> individual data sets and all assumed interaction delays u >>> >> InteractionDelayReconstruction_analyze -> reconstructs the >>> >> interaction delay by selecting the u that maximizes TE for each >>> >> channel >>> >> TEgroup_stats -> calculate group statistics using a permutation >>> >> test >>> >> >>> >> I can send you an example script for group TE analysis using this >>> >> pipeline >>> >> to get you started. I hope this helps you to get the group analysis >>> >> running. Just write again if you're having trouble setting up the >>> >> pipeline >>> >> or something is not clear about the parameters/my comments. >>> >> >>> >> Best, >>> >> Patricia >>> >> >>> >> >>> >> >>> >> >>> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not 100% >>> >> sure if it is appropriate to ask questions about it here, but to >>> >> the best >>> >> of my knowledge they do not have a mailing list and I saw a few >>> >> trentool >>> >> questions in the archives, so I'm going to assume it's ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present in >>> >> the pipeline. Sorry in advance for the long post! Any help would be >>> >> greatly >>> >> appreciated as I'm a bit over my head on this but I think I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data that >>> >> was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi >>> >> is in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within >>> >> the toi, but beyond that are there any benefits to it being earlier >>> >> or >>> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >>> >> in >>> >> seconds. The prediction time is the assumed interaction delay >>> >> between your >>> >> two sources and should fit within your toi. In general it is >>> >> preferable to >>> >> use the method for interaction delay reconstruction for TE >>> >> estimation, >>> >> because it allows you to reconstruct the actual delay between your >>> >> source >>> >> and target times series. A non-optimal u/interaction delay may >>> >> cause an >>> >> underestimation of TE, so it is recommended to use the pipeline for >>> >> interaction delay reconstruction whenever estimating TE for unknown >>> >> delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, >>> >> so it is best to limit the u range to values that are >>> >> physiologically >>> >> plausible. >>> >> >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the sample >>> >> rate and filters are used to determine the actthrvalue, but I don't >>> >> actually know the calculation. 7.5 was a rough guess just to test >>> >> the >>> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >>> >> You can >>> >> set the actthrvalue based on the filtering you did prior to TE >>> >> analysis. If >>> >> you for example highpass filtered at 10 Hz, you shouldn't find an >>> >> ACT >>> >> higher than 30 samples, because you filtered out any components of >>> >> the >>> >> signal slower than 10 Hz/30 samples (given your sampling frequency >>> >> of 300 >>> >> Hz). So in this scenario the actthrvalue would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm yet >>> >> to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* PW: >>> >> The Ragwitz criterion tries to find optimal embedding parameters >>> >> dim and >>> >> tau for the data. To do that, the method iteratively takes all >>> >> possible >>> >> combinations of dim and tau values that are provided in cfgP.ragdim >>> >> and >>> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >>> >> embed >>> >> the data. To test an embedding, the method builds the embedding >>> >> vectors >>> >> from the data; it then tests for each point how well the next point >>> >> in time >>> >> can be predicted from the reference point's nearest neighbours. So >>> >> for each >>> >> embedded point, the method searches for the nearest neighbours and >>> >> calculates the average of those nearest neighbours. The difference >>> >> between >>> >> the averaged/predicted point and the actual next point is the error >>> >> of the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested by >>> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together >>> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >>> >> will >>> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >>> >> here are >>> >> factors that are later multiplied with the ACT to obtain the actual >>> >> tau. >>> >> 'repPred' is the number of points that will be used for the local >>> >> prediction, i.e. the Ragwitz criterion will test the local >>> >> prediction and >>> >> calculate the error for the first 100 points in your time series. >>> >> The two >>> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >>> >> neighbour >>> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >>> >> method to >>> >> either conduct a kNN or range search; 'sizeNei' specifies the >>> >> number of >>> >> neighbours or the radius to be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' >>> >> data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject >>> >> virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.* >>> >> TRENTOOL seems to handle data output very differently from >>> >> fieldtrip and >>> >> I've had trouble thinking through the most logical way to handle >>> >> the data >>> >> so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition x >>> >> subject .mat file, which as I said before is collectively the same >>> >> as the 3 >>> >> x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> *At this step I get the following error: Error using >>> >> transferentropy (line >>> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >>> >> Error in >>> >> TEgroup_calculate (line 133) [TEresult] = >>> >> transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate is a >>> >> pipeline issue* (I noticed the example pipeline in trentool, the >>> >> manual, >>> >> and published methods articles all seem to have slightly or >>> >> significantly >>> >> different pipeline compositions), *or if the error is* due to ACT, >>> >> ragwitz optimization, or some other faulty parameterization *on my >>> >> part >>> >> due to a lack of understanding of how transfer entropy works on a >>> >> more >>> >> theoretical/mathematical level*. If the latter is the case, is >>> >> there any >>> >> relatively straightforward way to conceptualize this, or is this >>> >> something >>> >> where I'm just going to have to keep reading and rereading until it >>> >> eventually makes sense? I've already done quite a bit of that and >>> >> it hasn't >>> >> pierced my thick skull yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing >>> >> >> listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie >> ldtrip >>> >> >>> >> >>> >> -- >>> >> ------------------------------------------------------------ >>> >> >>> >> 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 >>> >> >>> > >>> > >>> > >>> > -- >>> > Max Cantor >>> > Lab Manager >>> > Computational Neurolinguistics Lab >>> > University of Michigan >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 024/attachment.html> >>> > >>> > ------------------------------ >>> > >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > End of fieldtrip Digest, Vol 46, Issue 3 >>> > **************************************** >>> > >>> >>> >>> >>> Barbara Schorr, MSc >>> Clinical and Biological Psychology >>> University of Ulm >>> Albert-Einstein-Allee 47 >>> 89069 Ulm >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jim Herring, MSc. >> Neuronal Oscillations Group >> Centre for Cognitive Neuroimaging >> Donders Institute for Brain, Cognition and Behaviour >> Radboud University Nijmegen >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> ------------------------------ >> >> Message: 8 >> Date: Mon, 15 Sep 2014 12:53:19 -0500 >> From: "Jing Fan" >> To: "'FieldTrip discussion list'" >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of >> variable 'abort' >> Message-ID: <000301cfd10d$ef53cba0$cdfb62e0$@gmail.com> >> Content-Type: text/plain; charset="us-ascii" >> >> Hi Barbara and Jim, >> >> I added path your/path/to/fieldtrip/utilities and now it worked. >> Hope it helps solve the problem. >> >> Best, >> Jing >> >> -----Original Message----- >> From: fieldtrip-bounces at science.ru.nl >> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Herring, J.D. (Jim) >> Sent: Monday, September 15, 2014 5:01 AM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] ft_globalmeanfield : Undefined function of variable >> 'abort' >> >> Dear Barbara, >> >> The error seems to be related to a bug that pops up now and then >> (http://bugzilla.fcdonders.nl/show_bug.cgi?id=2580) which could be due to a >> corrupt installation of fieldtrip and/or the need to update fieldtrip. >> >> Could you please try downloading the most recent version of fieldtrip and >> see if the problem persists? >> >> For an example of what can be expected from this function see: Esser SK, >> Huber R, Massimini M, Peterson MJ, Ferrarelli F, Tononi G. A direct >> demonstration of cortical LTP in humans: a combined TMS/EEG study. Brain Res >> Bull. 2006 Mar 15;69(1):86-94. Epub 2005 Dec 1. PubMed PMID: 16464689. >> >> Best, >> >> Jim >> >> >> ----- Oorspronkelijk bericht ----- >>> Van: "barbara schorr" >>> Aan: fieldtrip at science.ru.nl >>> Verzonden: Woensdag 10 september 2014 14:07:14 >>> Onderwerp: [FieldTrip] ft_globalmeanfield : Undefined function of variable >> 'abort' >>> Dear fieldtripers. >>> >>> as mentioned in the subject line I would like to anaylse my timelocked >>> ERP Data with the function ft_globalmeanfield. >>> >>> I get the Error: Undefined function or variable 'abort' >>> Error in ft_globalmeanfield (line84) >>> if abort >>> >>> in the function it says: >>> >>> %the abort variable is set to true or false in ft_preamble_inti >>> if abort >>> % do not continue function execution in case the outputfile is >>> present and the user indicated to keep it >>> return >>> end >>> >>> >>> I don't understand what this means. I would really appreciate your >>> help to get this running. >>> >>> Also, what is the result when I run this function on my data? (This >>> method was proposed from a reviewer. I never used it before, so I >>> don't exactly know what it does and what the result will look like). >>> >>> Thank you very much in advance! >>> >>> Best, >>> >>> Barbara Schorr >>> >>> >>> >>> >>> Zitat von 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: Question regarding nonparametric testing for coherence >>> > differences (Eric Maris) >>> > 2. Re: Problem with Geodesic 129 layout!! (KatrinH Heimann) >>> > 3. Re: Problem with Geodesic 129 layout!! (Joseph Dien) >>> > 4. Re: ft_rejectvisual: removing trials marked as bad >>> > (Caspar, Emilie) >>> > 5. Re: TRENTOOL pipeline help (Patricia Wollstadt) >>> > 6. Latest FT version on ftp-server is from three days ago >>> > (Holger Krause) >>> > 7. Re: TRENTOOL pipeline help (Max Cantor) >>> > >>> > >>> > ---------------------------------------------------------------------- >>> > >>> > Message: 1 >>> > Date: Mon, 8 Sep 2014 15:46:11 +0200 (CEST) >>> > From: "Eric Maris" >>> > To: , "'FieldTrip discussion list'" >>> > >>> > Subject: Re: [FieldTrip] Question regarding nonparametric testing >>> > for >>> > coherence differences >>> > Message-ID: <015901cfcb6b$3fdf1f00$bf9d5d00$@maris at psych.ru.nl> >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Hwee Ling, >>> > >>> > >>> > >>> > In the paper you refer to (Maris et al, JNM, 2007), I did not >>> > perform a >>> > cluster-based permutation test at the level of the channel pairs. >>> > Instead, >>> > all coherences mentioned in the paper are coherence between a single >>> > EMG >>> > channel (2 electrodes mounted on the forearm) and all MEG >>> > electrodes. Thus, >>> > there are as many EMG-MEG coherences as there are MEG channels (275 >>> > in our >>> > lab), and the clustering of these coherences involves the same >>> > neighbourhood >>> > structure as the clustering of channel-specific statistics on power >>> > or >>> > evoked response. The analysis you propose involves clustering in a >>> > much more >>> > complex space, namely the formed by all (MEG,MEG) channel pairs >>> > (275*275=75625 pairs). In the early days of cluster-based >>> > permutation >>> > statistics, I have worked on this problem but did not pursue it >>> > because the >>> > resulting clusters are very hard to interpret. >>> > >>> > >>> > >>> > Best, >>> > >>> > >>> > >>> > Eric Maris >>> > >>> > >>> > >>> > >>> > >>> > Dear all and Prof Maris, >>> > >>> > I'm re-posting this question again, as I didn't get any replies >>> > previously. >>> > >>> > I?m interested to investigate if there are any differences in phase >>> > synchronization in resting state data at timepoint 2 versus >>> > timepoint 1. The >>> > EEG data was collected using 64 EEG channels, resting state, eyes >>> > opened and >>> > eyes closed. I?ve arbitrarily segmented the resting state data into >>> > epochs >>> > of 2s each, and the epochs with artifacts are excluded completely >>> > from >>> > further analyses. I then performed mtmfft to get the fourier >>> > representation >>> > of the data, extracted the coherence, and compared the coherence >>> > difference >>> > of timepoint 2 versus timepoint 1 of all channels paired with all >>> > other >>> > channels. >>> > >>> > I figured that if I extract the connectivity analyses without >>> > specifying the >>> > channelcmb, I get a 'chan_chan_freq' dimord variable that would >>> > allow me to >>> > perform cluster-based statistical analyses. I get an output with >>> > ?chan_chan? >>> > dimord variable. However, I was not 100% sure that this is correct, >>> > hence, I?ve >>> > inserted my code (see below). It?ll be great if you could tell me if >>> > what I?m >>> > doing makes any sense at all. Also, I don?t know how I can plot the >>> > results >>> > to see if it make any sense at all. >>> > >>> > Also, I checked the values obtained from when I specified >>> > "cfg.channelcmb" >>> > and when I did not specify "cfg.channelcmb", I noticed that the >>> > values were >>> > somehow different. I would assume that the values to be similar, >>> > although >>> > I'm not sure why they would have differences in the values obtained >>> > from >>> > specifying "cfg.channelcmb". >>> > >>> > This is my code that I've used thus far: >>> > >>> > for sub = 1:5 >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'fourier'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.keeptrials = 'yes'; >>> > >>> > cfg.tapsmofrq = 5; >>> > >>> > cfg.foilim = [0 100]; >>> > >>> > cfg.taper = 'dpss'; >>> > >>> > % find the index for the c200 condition >>> > >>> > pre_c200_idx = find(data5.trialinfo == 201); >>> > >>> > cfg.trials = pre_c200_idx; >>> > >>> > HLF_pre_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > post_c200_idx = find(data5.trialinfo == 200); >>> > >>> > cfg.trials = post_c200_idx; >>> > >>> > HLF_post_c200 = ft_freqanalysis(cfg, data5); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.keeptrials = 'no'; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.removemean = 'yes'; >>> > >>> > cfg.method = 'coh'; >>> > >>> > HLF_pre_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_pre_c200); >>> > >>> > HLF_post_c200coh{sub} = ft_connectivityanalysis(cfg, >>> > HLF_post_c200); >>> > >>> > end >>> > >>> > >>> > >>> > >> load('D:\Hweeling_Programs\fieldtrip-20140330\template\layout\easycapM11.mat >> '); >>> > >>> > cfg_neighb.method = 'template'; >>> > >>> > cfg_neighb.layout = lay; >>> > >>> > cfg_neighb.channel = 'all'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, >>> > sub_HLF_pre_c200coh{1}); >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.channelcmb = {cfg.channel, cfg.channel}; >>> > >>> > cfg.latency = 'all'; >>> > >>> > cfg.avgovertime = 'no'; >>> > >>> > cfg.avgoverchan = 'no'; >>> > >>> > cfg.parameter = 'cohspctrm'; >>> > >>> > cfg.method = 'montecarlo'; >>> > >>> > cfg.statistic = 'depsamplesT'; >>> > >>> > cfg.correctm = 'cluster'; >>> > >>> > cfg.tail = 0; >>> > >>> > % cfg.clustertail = 0; >>> > >>> > cfg.alpha = 0.05/8; % to correct for multiple comparisons across 8 >>> > frequency >>> > bands. >>> > >>> > cfg.numrandomization = 10000; >>> > >>> > cfg.ivar = 2; >>> > >>> > cfg.uvar = 1; >>> > >>> > >>> > >>> > % design matrices >>> > >>> > clear design; >>> > >>> > design(1,:) = [1:5, 1:5]; >>> > >>> > design(2,:) = [ones(1,5), ones(1,5) * 2]; >>> > >>> > cfg.design = design; >>> > >>> > % for theta band >>> > >>> > cfg.avgoverfreq = 'yes'; >>> > >>> > cfg.frequency = [4 8]; % I also performed the statistics for delta >>> > (2-4), >>> > alpha (8-10.5), alpha (10.5-13), beta (13-20), beta (20-30), gamma >>> > (30-40), >>> > and gamma (40-100). >>> > >>> > [diffc200_theta_stat] = ft_freqstatistics(cfg, >>> > sub_HLF_post_c200coh{:}, >>> > sub_HLF_pre_c200coh{:}); >>> > >>> > >>> > >>> > When I tried to plot the results, I used this code: >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.layout = 'lay'; >>> > >>> > cfg.zlim = [-1 1]; >>> > >>> > cfg.alpha = 0.05; >>> > >>> > cfg.refchannel = 'all'; >>> > >>> > ft_clusterplot(cfg, diffc200_theta_stat); >>> > >>> > However, I was not sure how I could plot the results. I get an error >>> > message >>> > from Fieldtrip when using ft_clusterplot: >>> > >>> > Error using topoplot_common (line 366) >>> > >>> > no reference channel is specified >>> > >>> > Error in ft_topoplotTFR (line 192) >>> > >>> > [cfg] = topoplot_common(cfg, varargin{:}); >>> > >>> > Error in ft_clusterplot (line 372) >>> > >>> > ft_topoplotTFR(cfgtopo, stat); >>> > >>> > >>> > >>> > According to your paper in 2007, the topoplot of the results were >>> > masked by >>> > the spatio-spectral pattern of the significant clusters. I don't >>> > know how to >>> > do this, and I would really appreciate if you can show me how to >>> > make such a >>> > plot. >>> > >>> > Thank you very much. >>> > >>> > Kind regards, >>> > >>> > Hweeling >>> > >>> > >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 280/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 2 >>> > Date: Mon, 8 Sep 2014 21:38:01 +0200 >>> > From: KatrinH Heimann >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > Dear Joseph, thanks so much, I really appreciate your help. I was >>> > also >>> > wandering, if maybe there is another bug in my code. >>> > Our nets are 128 channels, Hydrocel, but as a colleague of me >>> > adviced me to >>> > do so, I also tried the 129 layout. >>> > My code you find below (without selection of bad channels etc.) >>> > If you need also the data of two subjects to have a look, let me >>> > know!!! >>> > Best and thanks really! >>> > Katrin >>> > >>> > >>> > subject=input('Which subject do you want to analyse? ','s'); >>> > >>> > name = strcat(subject,'.raw'); >>> > >>> > subjectnumber=input('Which is the subjectnumber?', 's'); >>> > >>> > sb=subjectnumber >>> > >>> > %subjectnumber = strcat(subjectnumber, '.txt') >>> > >>> > %% >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.dataset = name; >>> > >>> > cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> > >>> > cfg.trialdef.eventtype = 'trigger'; >>> > >>> > cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> > trigger >>> > >>> > cfg.trialdef.prestim = 0.234; % in seconds >>> > >>> > cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> > observation, but maybe we need less) >>> > >>> > cfg = ft_definetrial(cfg); >>> > >>> > >>> > cfg.trl([1:7],:) = []; >>> > >>> > >>> > %change timeline according to constant offset of 16 ms = 8 samples >>> > (because >>> > recorded with 500 hz)in >>> > >>> > %structure trial >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)-8 >>> > >>> > >>> > %change timeline to make the cut the zeropoint >>> > >>> > >>> > cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> > >>> > >>> > >>> > %% preprocess data >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.detrend = 'yes'; >>> > >>> > cfg.preproc.demean = 'yes'; >>> > >>> > cfg.preproc.baselinewindow = [-2.1 -2.0] >>> > >>> > %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> > filtered >>> > >>> > %(0.1-45) and bad channels have to be replaced!!!! >>> > >>> > %cfg.preproc.bpfreq = [6 32]; >>> > >>> > % >>> > >>> > % >>> > >>> > obs_data = ft_preprocessing(cfg); >>> > >>> > % >>> > >>> > save (strcat(sb,'obs_data') , 'obs_data') >>> > >>> > >>> > %% determining channel neighbours (necessary for Artifact detection) >>> > >>> > cfg = []; >>> > >>> > cfg.channel = obs_data.label; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.feedback = 'yes'; >>> > >>> > lay = ft_prepare_layout(cfg); >>> > >>> > >>> > >>> > cfg_neighb = []; >>> > >>> > cfg_neighb.feedback = 'yes'; >>> > >>> > >>> > cfg_neighb.method = 'triangulation'; >>> > >>> > cfg_neighb.layout = 'GSN128.sfp'; >>> > >>> > neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > obs_data.elec = ft_read_sens('GSN128.sfp'); >>> > >>> > >>> > %% Artifacts - to detect bad channels - is not saved!!! >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs_data_try = ft_rejectvisual(cfg, obs_data); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_try = ft_rejectartifact (cfg,obs_data); >>> > >>> > >>> > >>> > %% Preparing neighbours for channel repair - but bad channel info >>> > in!!! >>> > >>> > >>> > % cfg_neighb = []; >>> > >>> > % cfg_neighb.feedback = 'yes'; >>> > >>> > % cfg_neighb.method = 'triangulation'; >>> > >>> > % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> > >>> > % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> > >>> > >>> > % Interpolate and put into new data structure >>> > >>> > cfg = []; >>> > >>> > cfg.badchannel = {}; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.method = 'nearest'; >>> > >>> > cfg.neighbours = neighbours; >>> > >>> > obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> > >>> > >>> > % Check reconstruction >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > % dat1=obs_data; >>> > >>> > % dat2=obs_data_channelrepaired; >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> > >>> > % y=dat2.trial{1}(62,:); >>> > >>> > % plot(x);hold on;plot(y,'r'); >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(72,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > % >>> > >>> > % x=dat1.trial{1}(75,:); >>> > >>> > % y=dat2.trial{1}(75,:); >>> > >>> > % figure; >>> > >>> > % plot(x);hold on;plot(y,'r') >>> > >>> > %% artifact rejection/trial inspection - throw out electrode jumps >>> > etc. >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> > >>> > >>> > %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> > according to >>> > channels interpolated %% 128-number of interp. channels) >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.channel = {'all'}; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > comp = ft_componentanalysis(cfg,obs_data_clean1); >>> > >>> > save (strcat(sb,'comp_all') , 'comp') >>> > >>> > >>> > %% >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'component'; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='some'; >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > ft_databrowser(cfg,comp); >>> > >>> > >>> > %% poweranalysis components >>> > >>> > cfg = []; >>> > >>> > cfg.output = 'pow'; >>> > >>> > cfg.channel = 'all';%compute the power spectrum in all ICs >>> > >>> > cfg.method = 'mtmfft'; >>> > >>> > cfg.taper = 'hanning'; >>> > >>> > cfg.foi = 0:0.2:50; >>> > >>> > obs_freq = ft_freqanalysis(cfg, comp); >>> > >>> > >>> > %And you can plot the spectra: >>> > >>> > >>> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> > >>> > nsubplots = 16; >>> > >>> > nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> > decimals, type >>> > doc subplot >>> > >>> > >>> > Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> > >>> > tot = Nfigs*nsubplots; >>> > >>> > >>> > rptvect = 1:size(comp.topo,1); >>> > >>> > rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> > >>> > rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> > >>> > >>> > for r=1:size(rptvect,1); >>> > >>> > figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> > 1]);%full >>> > screen >>> > >>> > k=0; >>> > >>> > for j=1:size(rptvect,2); >>> > >>> > if~(rptvect(r,j)==0); >>> > >>> > k=k+1; >>> > >>> > cfg=[]; >>> > >>> > cfg.channel = rptvect(r,j); >>> > >>> > cfg.ylim =[0 500] >>> > >>> > cfg.xlim =[0 50] >>> > >>> > subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> > >>> > end >>> > >>> > end >>> > >>> > end >>> > >>> > >>> > %For the IC topos you'll follow the same logic as above but with: >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [1:20]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [21:40]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [41:60]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > figure >>> > >>> > cfg = []; >>> > >>> > cfg.component = [61:80]; % specify the component(s) that should be >>> > plotted >>> > >>> > cfg.layout = 'GSN128.sfp'; >>> > >>> > cfg.comment = 'no'; >>> > >>> > ft_topoplotIC(cfg, comp) >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% Seperate observation conditions >>> > >>> > >>> > name1= strcat(num2str(sb),'_90.xls'); >>> > >>> > list1=xlsread (name1) >>> > >>> > >>> > >>> > >>> > >>> > name2= strcat(num2str(sb),'_180.xls'); >>> > >>> > list2=xlsread (name2) >>> > >>> > >>> > >>> > % >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list1] >>> > >>> > obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.trials = [list2] >>> > >>> > obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> > >>> > >>> > %%PIPELINE FOR obs90 >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128; >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > >>> > comp_1 = ft_componentanalysis(cfg, obs90_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> > obs90_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts - final detection >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs90_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> > >>> > >>> > save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> > >>> > >>> > %% plot it >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP) >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > %% PIPELINE FOR obs180 >>> > >>> > >>> > >>> > %% Decompose original data according to the components found before >>> > >>> > load (strcat(sb,'comp_all')) >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.numcomponent = 128 >>> > >>> > cfg.unmixing = comp.unmixing; >>> > >>> > cfg.topolabel = comp.topolabel; >>> > >>> > comp_2 = ft_componentanalysis(cfg, obs180_data); >>> > >>> > >>> > >>> > %% Reject component >>> > >>> > cfg = []; >>> > >>> > cfg.component = []; >>> > >>> > obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> > obs180_data); >>> > >>> > >>> > >>> > >>> > save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> > >>> > >>> > >>> > >>> > %% Artifacts final 180 >>> > >>> > >>> > >>> > cfg.method = 'summary'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> > >>> > obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.viewmode = 'vertical'; >>> > >>> > cfg.latency=[0 1]; >>> > >>> > cfg.continuous = 'no'; >>> > >>> > cfg.plotlabels='yes' >>> > >>> > cfg = ft_databrowser(cfg,obs180_data_clean3); >>> > >>> > %cfg.artfctdef.reject = 'complete'; >>> > >>> > obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> > >>> > >>> > >>> > % Save clean data >>> > >>> > >>> > save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> > >>> > >>> > >>> > %% Rereferencing data >>> > >>> > cfg = []; >>> > >>> > cfg.channel = 'all'; >>> > >>> > cfg.preproc.reref = 'yes'; >>> > >>> > cfg.preproc.refchannel = 'all'; >>> > >>> > obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> > >>> > >>> > save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> > >>> > %% Snap out smaller pieces (the third second) >>> > >>> > >>> > cfg = [] >>> > >>> > cfg.toilim = [0 1] >>> > >>> > >>> > obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> > >>> > >>> > %% TIMELOCK ERP >>> > >>> > obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> > >>> > >>> > save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> > >>> > >>> > %% plot 180 ERP >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs180_data_ERP) >>> > >>> > >>> > %% plot both ERPs >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay ; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > cfg.showlabels = 'yes'; >>> > >>> > ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> > >>> > >>> > %% plot difference wave >>> > >>> > >>> > difference = obs180_data_ERP; % copy one of the >>> > structures >>> > >>> > difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % compute >>> > the >>> > difference ERP >>> > >>> > >>> > >>> > cfg = []; >>> > >>> > cfg.layout = lay; >>> > >>> > cfg.interactive = 'yes'; >>> > >>> > ft_multiplotER(cfg, difference) >>> > >>> > 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> > >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI >>> >> data. A couple things. First of all, exactly which net do you use? >>> >> If >>> >> they are 129-channel, there is still the question of whether they >>> >> are the >>> >> Hydrocel or the older geodesic nets. Regardless, that shouldn't >>> >> cause an >>> >> error like this. Could you send me the file you are trying to >>> >> process and >>> >> the script you are using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini < >>> >> diezmartini at gmail.com> wrote: >>> >> >>> >> Which nets do you use? I use EGI. I tried both the ones you mention >>> >> and >>> >> they didn't work. It was hard to find that exact one online but it >>> >> was the >>> >> only file that actually worked. >>> >> >>> >> >>> >> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >> >>> >> wrote: >>> >> >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. >>> >>> Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one >>> >>> >>> >>>> I use >>> >>>> >>> >>>> >>> >>>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann < >>> >>>> katrinheimann at gmail.com> wrote: >>> >>>> >>> >>>>> Dear all, my problems seem neverending. This time however i >>> >>>>> really need >>> >>>>> help. >>> >>>>> I implemented a pipeline for ERPs. All works now, >>> >>>>> trialdefinition, >>> >>>>> preprocessing, channelreplacement, ica, componentrejection, >>> >>>>> final >>> >>>>> artifactdetection, timelock of the single subject data. However, >>> >>>>> when I >>> >>>>> wanna compute the grandaverage of the single subjects I get the >>> >>>>> following >>> >>>>> error message: >>> >>>>> >>> >>>>> computing average of avg over 19 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 3 MB >>> >>>>> computing average of avg over 2 subjects >>> >>>>> Warning: discarding electrode information because it cannot be >>> >>>>> averaged >>> >>>>> > In ft_timelockgrandaverage at 249 >>> >>>>> the call to "ft_timelockgrandaverage" took 0 seconds and >>> >>>>> required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>>>> additional allocation of an estimated 0 MB >>> >>>>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>>>> additional >>> >>>>> allocation of an estimated 0 MB >>> >>>>> >>> >>>>> Furthermore in the plot of the significant clusters, the >>> >>>>> channelnames >>> >>>>> are mixed up (do not correspond to my net) >>> >>>>> >>> >>>>> >>> >>>>> I guess that there is a problem with the layout I use. >>> >>>>> Here the code that I use >>> >>>>> >>> >>>>> %For generating the layout (also in the single subjects): >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = obs_data.label; >>> >>>>> >>> >>>>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>>>> >>> >>>>> cfg.feedback = 'yes'; >>> >>>>> >>> >>>>> lay = ft_prepare_layout(cfg); >>> >>>>> >>> >>>>> >>> >>>>> cfg_neighb = []; >>> >>>>> >>> >>>>> cfg_neighb.feedback = 'yes'; >>> >>>>> >>> >>>>> cfg_neighb.method = 'triangulation'; >>> >>>>> >>> >>>>> cfg_neighb.layout = lay; >>> >>>>> >>> >>>>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>>>> >>> >>>>> >>> >>>>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>>>> >>> >>>>> >>> >>>>> %For computing the grand average >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.channel = 'all'; >>> >>>>> >>> >>>>> cfg.latency = 'all'; >>> >>>>> >>> >>>>> cfg.parameter = 'avg'; >>> >>>>> >>> >>>>> cfg.keepindividual = 'no' >>> >>>>> >>> >>>>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>>>> >>> >>>>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>>>> >>> >>>>> % "{:}" means to use data from all elements of the variable >>> >>>>> >>> >>>>> >>> >>>>> For plotting the significant clusters >>> >>>>> >>> >>>>> cfg = []; >>> >>>>> >>> >>>>> cfg.style = 'blank'; >>> >>>>> >>> >>>>> cfg.layout = lay; >>> >>>>> >>> >>>>> cfg.channellabels = 'yes'; >>> >>>>> >>> >>>>> cfg.highlight = 'labels'; >>> >>>>> >>> >>>>> cfg.highlightchannel = find(stat.mask); >>> >>>>> >>> >>>>> cfg.comment = 'no'; >>> >>>>> >>> >>>>> figure; ft_topoplotER(cfg, GA_90) >>> >>>>> >>> >>>>> title('Nonparametric: significant with cluster multiple >>> >>>>> comparison >>> >>>>> correction') >>> >>>>> >>> >>>>> >>> >>>>> Do you have ANY idea to this? I am really completely >>> >>>>> helpless.... >>> >>>>> >>> >>>>> thanks and best >>> >>>>> >>> >>>>> Katrin >>> >>>>> >>> >>>>> _______________________________________________ >>> >>>>> 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 >>> >>> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing list >>> >> fieldtrip at donders.ru.nl >>> >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >>> >> >>> >> >> ---------------------------------------------------------------------------- >> ---- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.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: >>> > >> > b61/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 3 >>> > Date: Mon, 08 Sep 2014 21:55:44 -0400 >>> > From: Joseph Dien >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] Problem with Geodesic 129 layout!! >>> > Message-ID: <148A801A-8CEA-4F88-A7D0-130637BDAC03 at mac.com> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > yes, please do send me the data. >>> > >>> > Thanks! >>> > >>> > Joe >>> > >>> > On Sep 8, 2014, at 3:38 PM, KatrinH Heimann >>> > wrote: >>> > >>> >> Dear Joseph, thanks so much, I really appreciate your help. I was >>> >> also wandering, if maybe there is another bug in my code. >>> >> Our nets are 128 channels, Hydrocel, but as a colleague of me >>> >> adviced me to do so, I also tried the 129 layout. >>> >> My code you find below (without selection of bad channels etc.) >>> >> If you need also the data of two subjects to have a look, let me >>> >> know!!! >>> >> Best and thanks really! >>> >> Katrin >>> >> >>> >> >>> >> >>> >> subject=input('Which subject do you want to analyse? ','s'); >>> >> >>> >> name = strcat(subject,'.raw'); >>> >> >>> >> subjectnumber=input('Which is the subjectnumber?', 's'); >>> >> >>> >> sb=subjectnumber >>> >> >>> >> %subjectnumber = strcat(subjectnumber, '.txt') >>> >> >>> >> %% >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.dataset = name; >>> >> >>> >> cfg.trialfun = 'ft_trialfun_general'; % this is the default >>> >> >>> >> cfg.trialdef.eventtype = 'trigger'; >>> >> >>> >> cfg.trialdef.eventvalue = 'stim'; % the value of the stimulus >>> >> trigger >>> >> >>> >> cfg.trialdef.prestim = 0.234; % in seconds >>> >> >>> >> cfg.trialdef.poststim = 7.266; % in seconds (whole time of video >>> >> observation, but maybe we need less) >>> >> >>> >> cfg = ft_definetrial(cfg); >>> >> >>> >> >>> >> >>> >> cfg.trl([1:7],:) = []; >>> >> >>> >> >>> >> >>> >> %change timeline according to constant offset of 16 ms = 8 samples >>> >> (because recorded with 500 hz)in >>> >> >>> >> %structure trial >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)-8 >>> >> >>> >> >>> >> >>> >> %change timeline to make the cut the zeropoint >>> >> >>> >> >>> >> >>> >> cfg.trl(:,3)=cfg.trl(:,3)- 1000; >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% preprocess data >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.detrend = 'yes'; >>> >> >>> >> cfg.preproc.demean = 'yes'; >>> >> >>> >> cfg.preproc.baselinewindow = [-2.1 -2.0] >>> >> >>> >> %cfg.preproc.bpfilter = 'yes'; - the data here has to be already >>> >> filtered >>> >> >>> >> %(0.1-45) and bad channels have to be replaced!!!! >>> >> >>> >> %cfg.preproc.bpfreq = [6 32]; >>> >> >>> >> % >>> >> >>> >> % >>> >> >>> >> obs_data = ft_preprocessing(cfg); >>> >> >>> >> % >>> >> >>> >> save (strcat(sb,'obs_data') , 'obs_data') >>> >> >>> >> >>> >> >>> >> %% determining channel neighbours (necessary for Artifact >>> >> detection) >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = obs_data.label; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.feedback = 'yes'; >>> >> >>> >> lay = ft_prepare_layout(cfg); >>> >> >>> >> >>> >> cfg_neighb = []; >>> >> >>> >> cfg_neighb.feedback = 'yes'; >>> >> >>> >> >>> >> >>> >> cfg_neighb.method = 'triangulation'; >>> >> >>> >> cfg_neighb.layout = 'GSN128.sfp'; >>> >> >>> >> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> obs_data.elec = ft_read_sens('GSN128.sfp'); >>> >> >>> >> >>> >> >>> >> %% Artifacts - to detect bad channels - is not saved!!! >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs_data_try = ft_rejectvisual(cfg, obs_data); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_try = ft_rejectartifact (cfg,obs_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Preparing neighbours for channel repair - but bad channel info >>> >> in!!! >>> >> >>> >> >>> >> >>> >> % cfg_neighb = []; >>> >> >>> >> % cfg_neighb.feedback = 'yes'; >>> >> >>> >> % cfg_neighb.method = 'triangulation'; >>> >> >>> >> % cfg_neighb.layout = 'GSN-HydroCel-128.sfp'; >>> >> >>> >> % neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >> >>> >> >>> >> >>> >> % Interpolate and put into new data structure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.badchannel = {}; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.method = 'nearest'; >>> >> >>> >> cfg.neighbours = neighbours; >>> >> >>> >> obs_data_channelrepaired = ft_channelrepair(cfg,obs_data) >>> >> >>> >> >>> >> >>> >> % Check reconstruction >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> % dat1=obs_data; >>> >> >>> >> % dat2=obs_data_channelrepaired; >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(62,:); % 68 is channel index of E68 >>> >> >>> >> % y=dat2.trial{1}(62,:); >>> >> >>> >> % plot(x);hold on;plot(y,'r'); >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(72,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> % >>> >> >>> >> % x=dat1.trial{1}(75,:); >>> >> >>> >> % y=dat2.trial{1}(75,:); >>> >> >>> >> % figure; >>> >> >>> >> % plot(x);hold on;plot(y,'r') >>> >> >>> >> %% artifact rejection/trial inspection - throw out electrode jumps >>> >> etc. >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs_data_channelrepaired); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs_data_clean1 = ft_rejectartifact (cfg,obs_data_channelrepaired); >>> >> >>> >> >>> >> >>> >> %% ICA - Anzahl der Komponenten anpassen!- adapt numcomponent >>> >> according to channels interpolated %% 128-number of interp. >>> >> channels) >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = {'all'}; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> comp = ft_componentanalysis(cfg,obs_data_clean1); >>> >> >>> >> save (strcat(sb,'comp_all') , 'comp') >>> >> >>> >> >>> >> >>> >> %% >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'component'; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='some'; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> ft_databrowser(cfg,comp); >>> >> >>> >> >>> >> >>> >> %% poweranalysis components >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.output = 'pow'; >>> >> >>> >> cfg.channel = 'all';%compute the power spectrum in all ICs >>> >> >>> >> cfg.method = 'mtmfft'; >>> >> >>> >> cfg.taper = 'hanning'; >>> >> >>> >> cfg.foi = 0:0.2:50; >>> >> >>> >> obs_freq = ft_freqanalysis(cfg, comp); >>> >> >>> >> >>> >> >>> >> %And you can plot the spectra: >>> >> >>> >> >>> >> >>> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >>> >> >>> >> nsubplots = 16; >>> >> >>> >> nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain >>> >> decimals, type doc subplot >>> >> >>> >> >>> >> >>> >> Nfigs = ceil(size(comp.topo,1)/nsubplots); >>> >> >>> >> tot = Nfigs*nsubplots; >>> >> >>> >> >>> >> >>> >> rptvect = 1:size(comp.topo,1); >>> >> >>> >> rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); >>> >> >>> >> rptvect = reshape(rptvect,nsubplots,Nfigs)'; >>> >> >>> >> >>> >> >>> >> for r=1:size(rptvect,1); >>> >> >>> >> figure;set(gcf,'units','normalized','outerposition',[0 0 1 >>> >> 1]);%full screen >>> >> >>> >> k=0; >>> >> >>> >> for j=1:size(rptvect,2); >>> >> >>> >> if~(rptvect(r,j)==0); >>> >> >>> >> k=k+1; >>> >> >>> >> cfg=[]; >>> >> >>> >> cfg.channel = rptvect(r,j); >>> >> >>> >> cfg.ylim =[0 500] >>> >> >>> >> cfg.xlim =[0 50] >>> >> >>> >> subplot(nbyn,nbyn,k);ft_singleplotER(cfg,obs_freq); >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> end >>> >> >>> >> >>> >> >>> >> %For the IC topos you'll follow the same logic as above but with: >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [1:20]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [21:40]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [41:60]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> figure >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = [61:80]; % specify the component(s) that >>> >> should be plotted >>> >> >>> >> cfg.layout = 'GSN128.sfp'; >>> >> >>> >> cfg.comment = 'no'; >>> >> >>> >> ft_topoplotIC(cfg, comp) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Seperate observation conditions >>> >> >>> >> >>> >> >>> >> name1= strcat(num2str(sb),'_90.xls'); >>> >> >>> >> list1=xlsread (name1) >>> >> >>> >> >>> >> >>> >> name2= strcat(num2str(sb),'_180.xls'); >>> >> >>> >> list2=xlsread (name2) >>> >> >>> >> >>> >> % >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list1] >>> >> >>> >> obs90_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.trials = [list2] >>> >> >>> >> obs180_data = ft_redefinetrial(cfg,obs_data_channelrepaired) >>> >> >>> >> >>> >> >>> >> %%PIPELINE FOR obs90 >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128; >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> >>> >> >>> >> comp_1 = ft_componentanalysis(cfg, obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, >>> >> obs90_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts - final detection >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs90_data_clean3 = ft_rejectvisual(cfg, obs90_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs90_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs90_data_clean2 = ft_rejectartifact (cfg,obs90_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_clean') , 'obs90_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs90_data_ref= ft_preprocessing(cfg,obs90_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ref') , 'obs90_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs90_data_small = ft_redefinetrial(cfg,obs90_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs90_data_ERP = ft_timelockanalysis(cfg, obs90_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs90_ERP') , 'obs90_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot it >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP) >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% PIPELINE FOR obs180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Decompose original data according to the components found before >>> >> >>> >> load (strcat(sb,'comp_all')) >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.numcomponent = 128 >>> >> >>> >> cfg.unmixing = comp.unmixing; >>> >> >>> >> cfg.topolabel = comp.topolabel; >>> >> >>> >> comp_2 = ft_componentanalysis(cfg, obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Reject component >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.component = []; >>> >> >>> >> obs180_data_ica_cleaned = ft_rejectcomponent(cfg, comp_2, >>> >> obs180_data); >>> >> >>> >> >>> >> >>> >> >>> >> save (strcat(sb,'obs180_ica_cleaned') , 'obs180_data_ica_cleaned') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Artifacts final 180 >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> cfg.method = 'summary'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.layout = 'GSN128.sfp'; % this allows for plotting >>> >> >>> >> obs180_data_clean3 = ft_rejectvisual(cfg, obs180_data_ica_cleaned); >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.viewmode = 'vertical'; >>> >> >>> >> cfg.latency=[0 1]; >>> >> >>> >> cfg.continuous = 'no'; >>> >> >>> >> cfg.plotlabels='yes' >>> >> >>> >> cfg = ft_databrowser(cfg,obs180_data_clean3); >>> >> >>> >> %cfg.artfctdef.reject = 'complete'; >>> >> >>> >> obs180_data_clean2 = ft_rejectartifact (cfg,obs180_data_clean3); >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> % Save clean data >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_clean') , 'obs180_data_clean2') >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> %% Rereferencing data >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.channel = 'all'; >>> >> >>> >> cfg.preproc.reref = 'yes'; >>> >> >>> >> cfg.preproc.refchannel = 'all'; >>> >> >>> >> obs180_data_ref= ft_preprocessing(cfg,obs180_data_clean2) >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ref') , 'obs180_data_ref') >>> >> >>> >> %% Snap out smaller pieces (the third second) >>> >> >>> >> >>> >> >>> >> cfg = [] >>> >> >>> >> cfg.toilim = [0 1] >>> >> >>> >> >>> >> >>> >> obs180_data_small = ft_redefinetrial(cfg,obs180_data_ref) >>> >> >>> >> >>> >> >>> >> %% TIMELOCK ERP >>> >> >>> >> obs180_data_ERP = ft_timelockanalysis(cfg, obs180_data_small); >>> >> >>> >> >>> >> >>> >> save (strcat(subject,'obs180_ERP') , 'obs180_data_ERP') >>> >> >>> >> >>> >> >>> >> %% plot 180 ERP >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot both ERPs >>> >> >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay ; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> cfg.showlabels = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, obs90_data_ERP, obs180_data_ERP) >>> >> >>> >> >>> >> >>> >> %% plot difference wave >>> >> >>> >> >>> >> >>> >> difference = obs180_data_ERP; % copy one of >>> >> the structures >>> >> >>> >> difference.avg = obs180_data_ERP.avg - obs90_data_ERP.avg; % >>> >> compute the difference ERP >>> >> >>> >> >>> >> cfg = []; >>> >> >>> >> cfg.layout = lay; >>> >> >>> >> cfg.interactive = 'yes'; >>> >> >>> >> ft_multiplotER(cfg, difference) >>> >> >>> >> >>> >> 2014-09-07 7:53 GMT+02:00 Joseph Dien : >>> >> Hi, >>> >> I?m one of the main Fieldtrip contributors working on supporting >>> >> EGI data. A couple things. First of all, exactly which net do >>> >> you use? If they are 129-channel, there is still the question of >>> >> whether they are the Hydrocel or the older geodesic nets. >>> >> Regardless, that shouldn't cause an error like this. Could you >>> >> send me the file you are trying to process and the script you are >>> >> using and I?ll try troubleshooting it. >>> >> >>> >> Joe >>> >> >>> >> >>> >> On Aug 26, 2014, at 12:53 AM, Ana Laura Diez Martini >>> >> wrote: >>> >> >>> >>> Which nets do you use? I use EGI. I tried both the ones you >>> >>> mention and they didn't work. It was hard to find that exact one >>> >>> online but it was the only file that actually worked. >>> >>> >>> >>> >>> >>> On Mon, Aug 25, 2014 at 7:52 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear Ana, dear all, >>> >>> the layout you used does not correspond to our nets. I tried the >>> >>> GSN-HydroCel-128.sfp and the GSN-HydroCel-129.sfp. Both don't >>> >>> work. Please can anybody help? >>> >>> Cheers >>> >>> Katrin >>> >>> >>> >>> >>> >>> 2014-08-24 5:40 GMT+02:00 Ana Laura Diez Martini >>> >>> : >>> >>> >>> >>> Try this one I use >>> >>> >>> >>> >>> >>> On Sun, Aug 24, 2014 at 4:08 AM, KatrinH Heimann >>> >>> wrote: >>> >>> Dear all, my problems seem neverending. This time however i really >>> >>> need help. >>> >>> I implemented a pipeline for ERPs. All works now, trialdefinition, >>> >>> preprocessing, channelreplacement, ica, componentrejection, final >>> >>> artifactdetection, timelock of the single subject data. However, >>> >>> when I wanna compute the grandaverage of the single subjects I get >>> >>> the following error message: >>> >>> >>> >>> computing average of avg over 19 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 3 MB >>> >>> computing average of avg over 2 subjects >>> >>> Warning: discarding electrode information because it cannot be >>> >>> averaged >>> >>> > In ft_timelockgrandaverage at 249 >>> >>> the call to "ft_timelockgrandaverage" took 0 seconds and required >>> >>> the additional allocation of an estimated 0 MB >>> >>> the call to "ft_prepare_layout" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> the call to "ft_topoplotER" took 0 seconds and required the >>> >>> additional allocation of an estimated 0 MB >>> >>> >>> >>> Furthermore in the plot of the significant clusters, the >>> >>> channelnames are mixed up (do not correspond to my net) >>> >>> >>> >>> >>> >>> I guess that there is a problem with the layout I use. >>> >>> Here the code that I use >>> >>> >>> >>> %For generating the layout (also in the single subjects): >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = obs_data.label; >>> >>> >>> >>> cfg.layout = 'GSN-HydroCel-129.sfp'; >>> >>> >>> >>> cfg.feedback = 'yes'; >>> >>> >>> >>> lay = ft_prepare_layout(cfg); >>> >>> >>> >>> >>> >>> cfg_neighb = []; >>> >>> >>> >>> cfg_neighb.feedback = 'yes'; >>> >>> >>> >>> cfg_neighb.method = 'triangulation'; >>> >>> >>> >>> cfg_neighb.layout = lay; >>> >>> >>> >>> neighbours = ft_prepare_neighbours(cfg_neighb, obs_data); >>> >>> >>> >>> >>> >>> obs_data.elec = ft_read_sens('GSN-HydroCel-129.sfp'); >>> >>> >>> >>> >>> >>> >>> >>> %For computing the grand average >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.channel = 'all'; >>> >>> >>> >>> cfg.latency = 'all'; >>> >>> >>> >>> cfg.parameter = 'avg'; >>> >>> >>> >>> cfg.keepindividual = 'no' >>> >>> >>> >>> GA_90 = ft_timelockgrandaverage(cfg,all90{:}); >>> >>> >>> >>> GA_180 = ft_timelockgrandaverage(cfg,all180{:}); >>> >>> >>> >>> % "{:}" means to use data from all elements of the variable >>> >>> >>> >>> >>> >>> For plotting the significant clusters >>> >>> >>> >>> cfg = []; >>> >>> >>> >>> cfg.style = 'blank'; >>> >>> >>> >>> cfg.layout = lay; >>> >>> >>> >>> cfg.channellabels = 'yes'; >>> >>> >>> >>> cfg.highlight = 'labels'; >>> >>> >>> >>> cfg.highlightchannel = find(stat.mask); >>> >>> >>> >>> cfg.comment = 'no'; >>> >>> >>> >>> figure; ft_topoplotER(cfg, GA_90) >>> >>> >>> >>> title('Nonparametric: significant with cluster multiple comparison >>> >>> correction') >>> >>> >>> >>> >>> >>> >>> >>> Do you have ANY idea to this? I am really completely helpless.... >>> >>> >>> >>> thanks and best >>> >>> >>> >>> Katrin >>> >>> >>> >>> >>> >>> _______________________________________________ >>> >>> 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 >>> >>> >>> >>> _______________________________________________ >>> >>> fieldtrip mailing list >>> >>> fieldtrip at donders.ru.nl >>> >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >>> >> >> ---------------------------------------------------------------------------- >> ---- >>> >> >>> >> Joseph Dien, PhD >>> >> Research Associate >>> >> Cognitive Neurology >>> >> The Johns Hopkins University School of Medicine >>> >> >>> >> Lab E-mail: jdien1 at jhmi.edu >>> >> Private E-mail: jdien07 at mac.com >>> >> Office Phone: 410-614-3115 >>> >> Cell Phone: 202-297-8117 >>> >> Fax: 410-955-0188 >>> >> http://joedien.com >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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 >>> > >>> > >> ---------------------------------------------------------------------------- >> ---- >>> > >>> > Joseph Dien, PhD >>> > Research Associate >>> > Cognitive Neurology >>> > The Johns Hopkins University School of Medicine >>> > >>> > Lab E-mail: jdien1 at jhmi.edu >>> > Private E-mail: jdien07 at mac.com >>> > Office Phone: 410-614-3115 >>> > Cell Phone: 202-297-8117 >>> > Fax: 410-955-0188 >>> > http://joedien.com >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > ad2/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 4 >>> > Date: Tue, 9 Sep 2014 06:37:13 +0000 >>> > From: "Caspar, Emilie" >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] ft_rejectvisual: removing trials marked as >>> > bad >>> > Message-ID: <3C365782-4B07-4EFE-A921-99489BDD5DA6 at live.ucl.ac.uk> >>> > Content-Type: text/plain; charset="iso-8859-1" >>> > >>> > Hi Ashley, >>> > >>> > Maybe the mistake is you did not integrate in your script the >>> > command to save the rejection. Normally, with the following command, >>> > you will see in the Matlab Window that artifacts are correctly >>> > rejected after the "quit" button. >>> > >>> > clean_data = ft_rejectvisual(cfg, interpoldata); >>> > cfg.artfctdef.reject = 'complete'; >>> > cfg.artfctdef.feedback = 'yes'; >>> > cleandata = ft_rejectartifact(cfg,clean_data); >>> > >>> > Emilie >>> > >>> > >>> > >>> > >>> > >>> > Le 3 sept. 2014 ? 11:58, Ashley Greene >>> > > a ?crit : >>> > >>> > Hello, >>> > >>> > I have used the rejectvisual function in attempt to remove bad >>> > trials, but after marking them and pressing the quit button, >>> > although the command window states that the selected trials have >>> > been removed, there is no obvious change in the data; all of the >>> > trials are still intact. Have I overlooked something? >>> > >>> > Thanks, >>> > >>> > Ashley >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 985/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 5 >>> > Date: Tue, 09 Sep 2014 14:16:20 +0200 >>> > From: Patricia Wollstadt >>> > To: fieldtrip at science.ru.nl >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: <540EEF94.9080601 at gmx.de> >>> > Content-Type: text/plain; charset="windows-1252" >>> > >>> > Hello Max, >>> > >>> > I added a few comments to the questions regarding individual >>> > parameters >>> > below. To address the general problem of TRENTOOL telling you, that >>> > there are not enough sample points in your data: From what I can see >>> > in >>> > your script, you probably don't have enough data points in each time >>> > series to robustly estimate TE. You analyze 800 ms of data sampled >>> > at >>> > 300 Hz, which gives you 240 samples per time series. Can you maybe >>> > avoid >>> > downsampling to 300 Hz and downsample to 600 Hz instead? Or could >>> > you >>> > analyze a longer time window of interest? >>> > Note that you also 'lose' data to embedding and the interaction >>> > delay: >>> > The first point that can be used for TE estimation is at max. >>> > embedding >>> > length + max. interaction delay in samples. For example: max. >>> > embedding >>> > length = dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the >>> > max >>> > interaction delay of 30 ms = 9 samples. In this example, you would >>> > be >>> > left with 240 - 29 samples for TE estimation per trial. There is >>> > also >>> > the possibility to estimate time resolved TE/TE for shorter time >>> > windows >>> > of interest (see section 4.4 in the manual); however, this method >>> > requires the use of a GPU for TE estimation. >>> > >>> > I would further recommend to use the new pipeline for group >>> > statistics >>> > described in the manual in section 4.5 (the function >>> > 'TEgroup_calculate' >>> > is deprecated). The new pipeline allows you to reconstruct the >>> > interaction delay and uses the following functions (see also >>> > comments in >>> > the script): >>> > >>> > TEgroup_prepare -> prepares all data sets (all subjects/all >>> > conditions) for group analysis (this means finding common embedding >>> > parameters such that estimates are not biased between groups) >>> > InteractionDelayReconstruction_calculate -> estimates TE for >>> > individual data sets and all assumed interaction delays u >>> > InteractionDelayReconstruction_analyze -> reconstructs the >>> > interaction delay by selecting the u that maximizes TE for each >>> > channel >>> > TEgroup_stats -> calculate group statistics using a permutation test >>> > >>> > I can send you an example script for group TE analysis using this >>> > pipeline to get you started. I hope this helps you to get the group >>> > analysis running. Just write again if you're having trouble setting >>> > up >>> > the pipeline or something is not clear about the parameters/my >>> > comments. >>> > >>> > Best, >>> > Patricia >>> > >>> > >>> > >>> > >>> > On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not >>> >> 100% sure if it is appropriate to ask questions about it here, but >>> >> to >>> >> the best of my knowledge they do not have a mailing list and I saw >>> >> a >>> >> few trentool questions in the archives, so I'm going to assume it's >>> >> ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present >>> >> in the pipeline. Sorry in advance for the long post! Any help would >>> >> be >>> >> greatly appreciated as I'm a bit over my head on this but I think >>> >> I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data >>> >> that was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi is >>> >> in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within the toi, but beyond that are there any benefits to it being >>> >> earlier or later?* PW: The predictiontime_u is in milliseconds and >>> >> the >>> >> toi is in seconds. The prediction time is the assumed interaction >>> >> delay between your two sources and should fit within your toi. In >>> >> general it is preferable to use the method for interaction delay >>> >> reconstruction for TE estimation, because it allows you to >>> >> reconstruct >>> >> the actual delay between your source and target times series. A >>> >> non-optimal u/interaction delay may cause an underestimation of TE, >>> >> so >>> >> it is recommended to use the pipeline for interaction delay >>> >> reconstruction whenever estimating TE for unknown delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, so it is best to limit the u range to values that are >>> >> physiologically plausible. >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the >>> >> sample rate and filters are used to determine the actthrvalue, but >>> >> I >>> >> don't actually know the calculation. 7.5 was a rough guess just to >>> >> test the pipeline. I'm also uncertain of what minnrtrials should >>> >> be.* >>> >> PW: You can set the actthrvalue based on the filtering you did >>> >> prior >>> >> to TE analysis. If you for example highpass filtered at 10 Hz, you >>> >> shouldn't find an ACT higher than 30 samples, because you filtered >>> >> out >>> >> any components of the signal slower than 10 Hz/30 samples (given >>> >> your >>> >> sampling frequency of 300 Hz). So in this scenario the actthrvalue >>> >> would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> * >>> >> * >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm >>> >> yet to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* >>> >> PW: The Ragwitz criterion tries to find optimal embedding >>> >> parameters >>> >> dim and tau for the data. To do that, the method iteratively takes >>> >> all >>> >> possible combinations of dim and tau values that are provided in >>> >> cfgP.ragdim and cfgP.ragtaurange/.ragtausteps and tests how well >>> >> these >>> >> combinations embed the data. To test an embedding, the method >>> >> builds >>> >> the embedding vectors from the data; it then tests for each point >>> >> how >>> >> well the next point in time can be predicted from the reference >>> >> point's nearest neighbours. So for each embedded point, the method >>> >> searches for the nearest neighbours and calculates the average of >>> >> those nearest neighbours. The difference between the >>> >> averaged/predicted point and the actual next point is the error of >>> >> the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested >>> >> by the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together with 'ragtausteps' specifies the tau values to be tested >>> >> (TRENTOOL will build a vector from 0.2 to 0.4 in 15 steps). Note, >>> >> that >>> >> the values here are factors that are later multiplied with the ACT >>> >> to >>> >> obtain the actual tau. 'repPred' is the number of points that will >>> >> be >>> >> used for the local prediction, i.e. the Ragwitz criterion will test >>> >> the local prediction and calculate the error for the first 100 >>> >> points >>> >> in your time series. The two parameters 'flagNei' ans 'sizeNei' >>> >> below >>> >> specify the type of neighbour search conducted by the Ragwitz >>> >> criterion: 'flagNei' tells the method to either conduct a kNN or >>> >> range >>> >> search; 'sizeNei' specifies the number of neighbours or the radius >>> >> to >>> >> be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> * >>> >> * >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> * >>> >> * >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.*TRENTOOL seems to handle data output very differently >>> >> from >>> >> fieldtrip and I've had trouble thinking through the most logical >>> >> way >>> >> to handle the data so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> * >>> >> * >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition >>> >> x subject .mat file, which as I said before is collectively the >>> >> same >>> >> as the 3 x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> * >>> >> * >>> >> *At this step I get the following error: >>> >> >>> >> Error using transferentropy (line 337) >>> >> \nTRENTOOL ERROR: not enough data points left after embedding >>> >> >>> >> Error in TEgroup_calculate (line 133) >>> >> [TEresult] = transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate >>> >> is a pipeline issue* (I noticed the example pipeline in trentool, >>> >> the >>> >> manual, and published methods articles all seem to have slightly or >>> >> significantly different pipeline compositions), *or if the error >>> >> is* >>> >> due to ACT, ragwitz optimization, or some other faulty >>> >> parameterization *on my part due to a lack of understanding of how >>> >> transfer entropy works on a more theoretical/mathematical level*. >>> >> If >>> >> the latter is the case, is there any relatively straightforward way >>> >> to >>> >> conceptualize this, or is this something where I'm just going to >>> >> have >>> >> to keep reading and rereading until it eventually makes sense? I've >>> >> already done quite a bit of that and it hasn't pierced my thick >>> >> skull >>> >> yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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: >>> > >> > 97f/attachment-0001.html> >>> > >>> > ------------------------------ >>> > >>> > Message: 6 >>> > Date: Tue, 9 Sep 2014 15:21:20 +0200 >>> > From: Holger Krause >>> > To: FieldTrip discussion list >>> > Subject: [FieldTrip] Latest FT version on ftp-server is from three >>> > days ago >>> > Message-ID: >>> > <201409091521.22589.Holger.Krause at med.uni-duesseldorf.de> >>> > Content-Type: text/plain; charset="us-ascii" >>> > >>> > Dear developers, >>> > >>> > Could you please check the process for creation/publication of >>> > zip-files on >>> > the FTP server? The latest file I can find there is >>> > fieldtrip-20140906.zip. >>> > >>> > Thanks in advance, >>> > >>> > Holger >>> > >>> > >>> > ------------------------------ >>> > >>> > Message: 7 >>> > Date: Tue, 9 Sep 2014 09:19:55 -0400 >>> > From: Max Cantor >>> > To: FieldTrip discussion list >>> > Subject: Re: [FieldTrip] TRENTOOL pipeline help >>> > Message-ID: >>> > >>> > Content-Type: text/plain; charset="utf-8" >>> > >>> > This is immensely helpful, thank you. I was very confused about why >>> > some >>> > versions of the pipeline I saw were using group calculate and others >>> > were >>> > using interaction delay reconstruction and what that meant, and I >>> > think I >>> > have a more clear idea of what the different steps of the pipeline >>> > are >>> > doing. There are still a few things I'm a bit confused about though >>> > in >>> > terms of the pipeline. For instance, whether or not I need to do >>> > TEprepare >>> > before group prepare, and if I need to do graph analysis (which I'm >>> > not >>> > sure I fully understand but also haven't looked deeply into) before >>> > group >>> > stats. >>> > >>> > If you don't mind me taking you up on your offer, I think seeing >>> > your >>> > example script might help clarify some of these issues. >>> > >>> > Thank you! >>> > >>> > On Tue, Sep 9, 2014 at 8:16 AM, Patricia Wollstadt < >>> > Patricia.Wollstadt at gmx.de> wrote: >>> > >>> >> Hello Max, >>> >> >>> >> I added a few comments to the questions regarding individual >>> >> parameters >>> >> below. To address the general problem of TRENTOOL telling you, that >>> >> there >>> >> are not enough sample points in your data: From what I can see in >>> >> your >>> >> script, you probably don't have enough data points in each time >>> >> series to >>> >> robustly estimate TE. You analyze 800 ms of data sampled at 300 Hz, >>> >> which >>> >> gives you 240 samples per time series. Can you maybe avoid >>> >> downsampling to >>> >> 300 Hz and downsample to 600 Hz instead? Or could you analyze a >>> >> longer time >>> >> window of interest? >>> >> Note that you also 'lose' data to embedding and the interaction >>> >> delay: The >>> >> first point that can be used for TE estimation is at max. embedding >>> >> length >>> >> + max. interaction delay in samples. For example: max. embedding >>> >> length = >>> >> dim * tau_factor * ACT = 10 * 0.4 * 5 = 20 samples plus the max >>> >> interaction >>> >> delay of 30 ms = 9 samples. In this example, you would be left with >>> >> 240 - >>> >> 29 samples for TE estimation per trial. There is also the >>> >> possibility to >>> >> estimate time resolved TE/TE for shorter time windows of interest >>> >> (see >>> >> section 4.4 in the manual); however, this method requires the use >>> >> of a GPU >>> >> for TE estimation. >>> >> >>> >> I would further recommend to use the new pipeline for group >>> >> statistics >>> >> described in the manual in section 4.5 (the function >>> >> 'TEgroup_calculate' is >>> >> deprecated). The new pipeline allows you to reconstruct the >>> >> interaction >>> >> delay and uses the following functions (see also comments in the >>> >> script): >>> >> >>> >> TEgroup_prepare -> prepares all data sets (all subjects/all >>> >> conditions) >>> >> for group analysis (this means finding common embedding parameters >>> >> such >>> >> that estimates are not biased between groups) >>> >> InteractionDelayReconstruction_calculate -> estimates TE for >>> >> individual data sets and all assumed interaction delays u >>> >> InteractionDelayReconstruction_analyze -> reconstructs the >>> >> interaction delay by selecting the u that maximizes TE for each >>> >> channel >>> >> TEgroup_stats -> calculate group statistics using a permutation >>> >> test >>> >> >>> >> I can send you an example script for group TE analysis using this >>> >> pipeline >>> >> to get you started. I hope this helps you to get the group analysis >>> >> running. Just write again if you're having trouble setting up the >>> >> pipeline >>> >> or something is not clear about the parameters/my comments. >>> >> >>> >> Best, >>> >> Patricia >>> >> >>> >> >>> >> >>> >> >>> >> On 09/04/2014 08:30 PM, Max Cantor wrote: >>> >> >>> >> Hi fieldtrippers, >>> >> >>> >> I know trentool is not produced by the Donders Institute, so I'm >>> >> not 100% >>> >> sure if it is appropriate to ask questions about it here, but to >>> >> the best >>> >> of my knowledge they do not have a mailing list and I saw a few >>> >> trentool >>> >> questions in the archives, so I'm going to assume it's ok... >>> >> >>> >> In any case, below is my current pipeline (slightly modified for >>> >> comprehensibility): >>> >> >>> >> (notes in bold are comments/questions made in this email, not >>> >> present in >>> >> the pipeline. Sorry in advance for the long post! Any help would be >>> >> greatly >>> >> appreciated as I'm a bit over my head on this but I think I'm >>> >> close!) >>> >> >>> >> ***** >>> >> >>> >> % Prepare group TE data >>> >> >>> >> cfgP = []; >>> >> cfgP.Path2TSTOOL = *TSTOOLPATH* >>> >> cfgP.TEcalctype = 'VW_ds'; >>> >> cfgP.channel = {'ctfdip_LAC' 'ctfdip_RAC'}; >>> >> >>> >> *I'm trying to find the transfer entropy between the left and right >>> >> auditory cortices in my experiment. The input is virtual sensor >>> >> data that >>> >> was produced using SAM in fieldtrip on real MEG data. * >>> >> >>> >> % specify u to be scanned >>> >> >>> >> cfgP.predicttime_u = 30; >>> >> cfgP.toi = [-0.4 0.4]; >>> >> >>> >> *For clarification, the predicttime_u is in seconds but the toi >>> >> is in >>> >> milliseconds. If I understand correctly, the predicttime_u must fit >>> >> within >>> >> the toi, but beyond that are there any benefits to it being earlier >>> >> or >>> >> later?* PW: The predictiontime_u is in milliseconds and the toi is >>> >> in >>> >> seconds. The prediction time is the assumed interaction delay >>> >> between your >>> >> two sources and should fit within your toi. In general it is >>> >> preferable to >>> >> use the method for interaction delay reconstruction for TE >>> >> estimation, >>> >> because it allows you to reconstruct the actual delay between your >>> >> source >>> >> and target times series. A non-optimal u/interaction delay may >>> >> cause an >>> >> underestimation of TE, so it is recommended to use the pipeline for >>> >> interaction delay reconstruction whenever estimating TE for unknown >>> >> delays. >>> >> If you use the methods for interaction delay reconstruction >>> >> 'predicttime_u' is replaced by >>> >> cfgTEP.predicttimemin_u % minimum u to be scanned >>> >> cfgTEP.predicttimemax_u % maximum u to be scanned >>> >> cfgTEP.predicttimestepsize % time steps between u to be scanned >>> >> A large range for u values to be scanned increases computing time a >>> >> lot, >>> >> so it is best to limit the u range to values that are >>> >> physiologically >>> >> plausible. >>> >> >>> >> >>> >> % ACT (Autocorrelation Time) estimation and constraints >>> >> >>> >> cfgP.maxlag = 150; >>> >> cfgP.actthrvalue = 7.5; >>> >> cfgP.minnrtrials = 5; >>> >> >>> >> *My understanding is maxlag should be 1/2 the sampling rate, so >>> >> since >>> >> the data are downsampled to 300hz, it should be 150. I know that >>> >> the sample >>> >> rate and filters are used to determine the actthrvalue, but I don't >>> >> actually know the calculation. 7.5 was a rough guess just to test >>> >> the >>> >> pipeline. I'm also uncertain of what minnrtrials should be.* PW: >>> >> You can >>> >> set the actthrvalue based on the filtering you did prior to TE >>> >> analysis. If >>> >> you for example highpass filtered at 10 Hz, you shouldn't find an >>> >> ACT >>> >> higher than 30 samples, because you filtered out any components of >>> >> the >>> >> signal slower than 10 Hz/30 samples (given your sampling frequency >>> >> of 300 >>> >> Hz). So in this scenario the actthrvalue would be 30. >>> >> A good value for cfgP.minnrtrials is 12 (a minimum number of trials >>> >> is >>> >> needed to realize the permutation test for estimated TE values). >>> >> >>> >> >>> >> % Optimization >>> >> >>> >> cfgP.optimizemethod = 'ragwitz'; >>> >> cfgP.ragdim = 4:8; >>> >> cfgP.ragtaurange = [0.2 0.4]; >>> >> cfgP.ragtausteps = 15; >>> >> cfgP.repPred = 100; >>> >> >>> >> *I am completely at a loss for this. I've done some reading into >>> >> transfer entropy, mutual information, etc., cited in trentool, but >>> >> I'm yet >>> >> to understand how exactly this optimization works and what the >>> >> configuration should be, given my data and experimental >>> >> intentions.* PW: >>> >> The Ragwitz criterion tries to find optimal embedding parameters >>> >> dim and >>> >> tau for the data. To do that, the method iteratively takes all >>> >> possible >>> >> combinations of dim and tau values that are provided in cfgP.ragdim >>> >> and >>> >> cfgP.ragtaurange/.ragtausteps and tests how well these combinations >>> >> embed >>> >> the data. To test an embedding, the method builds the embedding >>> >> vectors >>> >> from the data; it then tests for each point how well the next point >>> >> in time >>> >> can be predicted from the reference point's nearest neighbours. So >>> >> for each >>> >> embedded point, the method searches for the nearest neighbours and >>> >> calculates the average of those nearest neighbours. The difference >>> >> between >>> >> the averaged/predicted point and the actual next point is the error >>> >> of the >>> >> local predictor. The Ragwitz criterion will then return the >>> >> parameter >>> >> combination for which this error over all points is minimal. >>> >> The parameters set the following: 'ragdim' are dimensions to be >>> >> tested by >>> >> the method (I would reccomend to start with 2:10), 'ragtaurange' >>> >> together >>> >> with 'ragtausteps' specifies the tau values to be tested (TRENTOOL >>> >> will >>> >> build a vector from 0.2 to 0.4 in 15 steps). Note, that the values >>> >> here are >>> >> factors that are later multiplied with the ACT to obtain the actual >>> >> tau. >>> >> 'repPred' is the number of points that will be used for the local >>> >> prediction, i.e. the Ragwitz criterion will test the local >>> >> prediction and >>> >> calculate the error for the first 100 points in your time series. >>> >> The two >>> >> parameters 'flagNei' ans 'sizeNei' below specify the type of >>> >> neighbour >>> >> search conducted by the Ragwitz criterion: 'flagNei' tells the >>> >> method to >>> >> either conduct a kNN or range search; 'sizeNei' specifies the >>> >> number of >>> >> neighbours or the radius to be searched by a range search. >>> >> >>> >> >>> >> % Kernel-based TE estimation >>> >> >>> >> cfgP.flagNei = 'Mass'; >>> >> cfgP.sizeNei = 4; % Default >>> >> >>> >> cfgP.ensemblemethod = 'no'; >>> >> cfgP.outputpath = *OUTPUT PATH*; >>> >> >>> >> if ~exist(*Path for TEprepare data object*) >>> >> load VSdat; >>> >> TE_Wrd = {}; >>> >> for i = 1:nConds >>> >> for j = 1:Nsub >>> >> TE_Wrd{i}{j} = TEprepare(cfgP, VSdat{i}{j}); >>> >> end >>> >> end >>> >> clear VSdat; >>> >> save('TE_Wrd', 'TE_Wrd'); >>> >> end >>> >> >>> >> *The configuration and virtual sensor data, organized in a 3 x 15 >>> >> cell >>> >> of structures (condition by subject) are the input. The TEprepare >>> >> substructure is added to each individual condition x subject .mat >>> >> files' >>> >> data structure which are stored on disk independently.* >>> >> >>> >> % Use object_to_mat_conversion.m to replace individual condition x >>> >> subject >>> >> virtual sensor data >>> >> % .mat files with their TE_Wrd equivalent >>> >> >>> >> *I'm using a separate script to make some manipulations to the >>> >> objects >>> >> from disk; this will all eventually be integrated into the main >>> >> pipeline*.* >>> >> TRENTOOL seems to handle data output very differently from >>> >> fieldtrip and >>> >> I've had trouble thinking through the most logical way to handle >>> >> the data >>> >> so it's a bit haphazard right now.* >>> >> >>> >> load cond080sub01.mat >>> >> >>> >> cfgG = []; >>> >> cfgG.dim = cond080sub01.TEprepare.optdim; >>> >> cfgG.tau = cond080sub01.TEprepare.opttau; >>> >> >>> >> if isfield(cond080sub01, 'TEprepare') >>> >> TEgroup_prepare(cfgG, fileCell); >>> >> else >>> >> error('Need to run TEprepare before TEgroup_prepare'); >>> >> end >>> >> >>> >> *For clarification, fileCell is a cell with the name of each >>> >> condition x >>> >> subject .mat file, which as I said before is collectively the same >>> >> as the 3 >>> >> x 15 VSdat structure (condition x subject).* >>> >> >>> >> % Replace .mat files with '_for_TEgroup_calculate' version in >>> >> % object_to_mat_conversion.m >>> >> >>> >> % TE Group Calculate >>> >> >>> >> load cond080sub01.mat >>> >> if isfield(cond080sub01, 'TEgroupprepare') >>> >> for i = 1:length(fileCell) >>> >> TEgroup_calculate(fileCell{i}); >>> >> end >>> >> else >>> >> error('Need to run TEgroup_prepare before TEgroup_calculate'); >>> >> end >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> *At this step I get the following error: Error using >>> >> transferentropy (line >>> >> 337) \nTRENTOOL ERROR: not enough data points left after embedding >>> >> Error in >>> >> TEgroup_calculate (line 133) [TEresult] = >>> >> transferentropy(cfg,data);* >>> >> >>> >> % TE Group Stats >>> >> >>> >> cfgGSTAT = []; >>> >> cfgGSTAT.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; >>> >> cfgGSTAT.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; >>> >> >>> >> cfgGSTAT.uvar = 1; >>> >> cfgGSTAT.ivar = 2; >>> >> cfgGSTAT.fileidout = 'test_groupstats'; >>> >> >>> >> TEgroup_stats(cfgGSTAT, fileCell); >>> >> >>> >> *Given the error above, I am yet to get to this step, but it does >>> >> not >>> >> seem fundamentally different from normal fieldtrip stats.* >>> >> >>> >> ***** >>> >> >>> >> In case my notes were not clear or you skipped to the bottom, *my >>> >> primary concern is whether the error I'm getting in >>> >> TEgroup_calculate is a >>> >> pipeline issue* (I noticed the example pipeline in trentool, the >>> >> manual, >>> >> and published methods articles all seem to have slightly or >>> >> significantly >>> >> different pipeline compositions), *or if the error is* due to ACT, >>> >> ragwitz optimization, or some other faulty parameterization *on my >>> >> part >>> >> due to a lack of understanding of how transfer entropy works on a >>> >> more >>> >> theoretical/mathematical level*. If the latter is the case, is >>> >> there any >>> >> relatively straightforward way to conceptualize this, or is this >>> >> something >>> >> where I'm just going to have to keep reading and rereading until it >>> >> eventually makes sense? I've already done quite a bit of that and >>> >> it hasn't >>> >> pierced my thick skull yet but I'm sure it will eventually! >>> >> >>> >> Thank you so much, >>> >> >>> >> Max Cantor >>> >> >>> >> >>> >> -- >>> >> Max Cantor >>> >> Lab Manager >>> >> Computational Neurolinguistics Lab >>> >> University of Michigan >>> >> >>> >> >>> >> _______________________________________________ >>> >> fieldtrip mailing >>> >> >> listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fie >> ldtrip >>> >> >>> >> >>> >> -- >>> >> ------------------------------------------------------------ >>> >> >>> >> 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 >>> >> >>> > >>> > >>> > >>> > -- >>> > Max Cantor >>> > Lab Manager >>> > Computational Neurolinguistics Lab >>> > University of Michigan >>> > -------------- next part -------------- >>> > An HTML attachment was scrubbed... >>> > URL: >>> > >> > 024/attachment.html> >>> > >>> > ------------------------------ >>> > >>> > _______________________________________________ >>> > fieldtrip mailing list >>> > fieldtrip at donders.ru.nl >>> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> > >>> > End of fieldtrip Digest, Vol 46, Issue 3 >>> > **************************************** >>> > >>> >>> >>> >>> Barbara Schorr, MSc >>> Clinical and Biological Psychology >>> University of Ulm >>> Albert-Einstein-Allee 47 >>> 89069 Ulm >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jim Herring, MSc. >> Neuronal Oscillations Group >> Centre for Cognitive Neuroimaging >> Donders Institute for Brain, Cognition and Behaviour >> Radboud University Nijmegen >> _______________________________________________ >> 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 >> >> End of fieldtrip Digest, Vol 46, Issue 5 >> **************************************** >> > > > > Barbara Schorr, MSc > Clinical and Biological Psychology > University of Ulm > Albert-Einstein-Allee 47 > 89069 Ulm > > > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 46, Issue 6 > **************************************** > Barbara Schorr, MSc Clinical and Biological Psychology University of Ulm Albert-Einstein-Allee 47 89069 Ulm From hweeling.lee at gmail.com Thu Sep 18 14:30:16 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Thu, 18 Sep 2014 14:30:16 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity Message-ID: Dear all, I've got a question regarding extracting pairwise phase consistency of individual trials for each subject. Using the connectivity analyses tutorial as a reference, I extracted the PPC using the fourier information from the mtmfft (dpss taper). Here's an example of my code: cfg = []; cfg.output = 'fourier'; cfg.channel = {'all'}; cfg.method = 'mtmfft'; cfg.keeptrials = 'yes'; cfg.tapsmofrq = 5; % find the index for the c200 condition pre_c200_idx = find(data8.trialinfo == 200); cfg.trials = pre_c200_idx; cfg.foilim = [0 100]; % either the full range of frequencies (data2.hdr.Fs/2) or up to 100 Hz cfg.taper = 'dpss'; HLF_pre_c200 = ft_freqanalysis(cfg, data8); The PPC is extracted using this code: cfg = []; cfg.trials = 'all'; cfg.keeptrials = 'yes'; cfg.channel = {'all'}; cfg.removemean = 'yes'; cfg.method = 'wppc'; cfg.channelcmb = {cfg.channel, cfg.channel}; HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); Although I've specified to keep individual trials, my output is still a 'chan_freq' dimord variable. It does not contain any individual trial PPC information. Is there a way to extract the connectivity for individual trials? Thanks. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Thu Sep 18 15:32:54 2014 From: roeysc at gmail.com (Roey Schurr) Date: Thu, 18 Sep 2014 16:32:54 +0300 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: References: Message-ID: Dear Hweeling, Unfortunately I am not yet familiar with the PPC measure, but I guess that being a pairwise phase *consistancy* measure, it is defined over a set of trials, and can not be calculated for any individual trial (like coherence, or PLV)? Just quickly reading through "The pairwise phase consistency: A bias-free measure of rhythmic neuronal synchronization" (Vinck et al., 2010), this seems to be the case. Hope this helps, roey On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee wrote: > Dear all, > > I've got a question regarding extracting pairwise phase consistency of > individual trials for each subject. > > Using the connectivity analyses tutorial as a reference, I extracted the > PPC using the fourier information from the mtmfft (dpss taper). > > Here's an example of my code: > > cfg = []; > cfg.output = 'fourier'; > cfg.channel = {'all'}; > cfg.method = 'mtmfft'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 5; > > % find the index for the c200 condition > pre_c200_idx = find(data8.trialinfo == 200); > > cfg.trials = pre_c200_idx; > cfg.foilim = [0 100]; % either the full range of frequencies > (data2.hdr.Fs/2) or up to 100 Hz > cfg.taper = 'dpss'; > HLF_pre_c200 = ft_freqanalysis(cfg, data8); > > The PPC is extracted using this code: > > cfg = []; > cfg.trials = 'all'; > cfg.keeptrials = 'yes'; > cfg.channel = {'all'}; > cfg.removemean = 'yes'; > > cfg.method = 'wppc'; > cfg.channelcmb = {cfg.channel, cfg.channel}; > > HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); > > Although I've specified to keep individual trials, my output is still a > 'chan_freq' dimord variable. It does not contain any individual trial PPC > information. Is there a way to extract the connectivity for individual > trials? > > Thanks. > > Cheers, > Hweeling > > > _______________________________________________ > 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 julian.keil at gmail.com Thu Sep 18 16:23:15 2014 From: julian.keil at gmail.com (Julian Keil) Date: Thu, 18 Sep 2014 16:23:15 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: References: Message-ID: Dear Hweeling, if you're looking for a single trial measure of phase relationship, you might want to have a look at the attached papers. In both papers, single trial phase relationship between cortical sources is described as the phase difference subtracted from the mean phase difference (i.e. Take the phase difference between two channels, average over trials and take the difference between the single trial phase difference and the mean phase difference). I hope thais goes into the right direction of what you're asking for. Good luck. Julian Keil, J., Müller, N., Hartmann, T., & Weisz, N. (2014). Prestimulus beta power and phase synchrony influence the sound-induced flash illusion. Cerebral Cortex, 24(5), 1278–1288. doi:10.1093/cercor/bhs409 Hanslmayr, S., Aslan, A., Staudigl, T., Klimesch, W., Herrmann, C. S., & Bäuml, K.-H. (2007). Prestimulus oscillations predict visual perception performance between and within subjects. NeuroImage, 37(4), 1465–1473. doi:10.1016/j.neuroimage.2007.07.011 ******************** 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 18.09.2014 um 15:32 schrieb Roey Schurr: > Dear Hweeling, > > Unfortunately I am not yet familiar with the PPC measure, but I guess that being a pairwise phase consistancy measure, it is defined over a set of trials, and can not be calculated for any individual trial (like coherence, or PLV)? > > Just quickly reading through "The pairwise phase consistency: A bias-free measure of rhythmic neuronal synchronization" (Vinck et al., 2010), this seems to be the case. > > Hope this helps, > roey > > On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee wrote: > Dear all, > > I've got a question regarding extracting pairwise phase consistency of individual trials for each subject. > > Using the connectivity analyses tutorial as a reference, I extracted the PPC using the fourier information from the mtmfft (dpss taper). > > Here's an example of my code: > > cfg = []; > cfg.output = 'fourier'; > cfg.channel = {'all'}; > cfg.method = 'mtmfft'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 5; > > % find the index for the c200 condition > pre_c200_idx = find(data8.trialinfo == 200); > > cfg.trials = pre_c200_idx; > cfg.foilim = [0 100]; % either the full range of frequencies (data2.hdr.Fs/2) or up to 100 Hz > cfg.taper = 'dpss'; > HLF_pre_c200 = ft_freqanalysis(cfg, data8); > > The PPC is extracted using this code: > > cfg = []; > cfg.trials = 'all'; > cfg.keeptrials = 'yes'; > cfg.channel = {'all'}; > cfg.removemean = 'yes'; > > cfg.method = 'wppc'; > cfg.channelcmb = {cfg.channel, cfg.channel}; > > HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); > > Although I've specified to keep individual trials, my output is still a 'chan_freq' dimord variable. It does not contain any individual trial PPC information. Is there a way to extract the connectivity for individual trials? > > Thanks. > > Cheers, > Hweeling > > > _______________________________________________ > 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 tobias.staudigl at uni-konstanz.de Thu Sep 18 16:39:58 2014 From: tobias.staudigl at uni-konstanz.de (Tobias Staudigl) Date: Thu, 18 Sep 2014 16:39:58 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: References: Message-ID: <541AEEBE.9090503@uni-konstanz.de> Dear Hweeling, I agree with Roey that coherence/PLV cannot be calculated for individual trials. However, you could try to use the deviation (in each single trial) from the mean phase as an approximation. Good luck! Tobias Am 18.09.2014 15:32, schrieb Roey Schurr: > Dear Hweeling, > > Unfortunately I am not yet familiar with the PPC measure, but I guess > that being a pairwise phase *consistancy* measure, it is defined over > a set of trials, and can not be calculated for any individual trial > (like coherence, or PLV)? > > Just quickly reading through "The pairwise phase consistency: A > bias-free measure of rhythmic neuronal synchronization" (Vinck et al., > 2010), this seems to be the case. > > Hope this helps, > roey > > On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee > wrote: > > Dear all, > > I've got a question regarding extracting pairwise phase > consistency of individual trials for each subject. > > Using the connectivity analyses tutorial as a reference, I > extracted the PPC using the fourier information from the mtmfft > (dpss taper). > > Here's an example of my code: > > cfg = []; > cfg.output = 'fourier'; > cfg.channel = {'all'}; > cfg.method = 'mtmfft'; > cfg.keeptrials = 'yes'; > cfg.tapsmofrq = 5; > % find the index for the c200 condition > pre_c200_idx = find(data8.trialinfo == 200); > cfg.trials = pre_c200_idx; > cfg.foilim = [0 100]; % either the full range of > frequencies (data2.hdr.Fs/2) or up to 100 Hz > cfg.taper = 'dpss'; > HLF_pre_c200 = ft_freqanalysis(cfg, data8); > > The PPC is extracted using this code: > > cfg = []; > cfg.trials = 'all'; > cfg.keeptrials = 'yes'; > cfg.channel = {'all'}; > cfg.removemean = 'yes'; > cfg.method = 'wppc'; > cfg.channelcmb = {cfg.channel, cfg.channel}; > HLF_pre_c200wppc = ft_connectivityanalysis(cfg, > HLF_pre_c200); > > Although I've specified to keep individual trials, my output is > still a 'chan_freq' dimord variable. It does not contain any > individual trial PPC information. Is there a way to extract the > connectivity for individual trials? > > Thanks. > > Cheers, > Hweeling > > > _______________________________________________ > 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 -- Dr. Tobias Staudigl Fachbereich Psychologie - ZPR Postfach ZPR 78457 Konstanz ZPR, Haus 12 Tel.: +49 (0)7531 / 88 - 5703 -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Thu Sep 18 19:36:40 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Thu, 18 Sep 2014 19:36:40 +0200 (CEST) Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs In-Reply-To: <867006743.3066178.1410775764568.JavaMail.root@bcbl.eu> Message-ID: <533541797.8928620.1411061800427.JavaMail.root@sculptor.zimbra.ru.nl> Hi Fred, Thank you for let us know this documentation discrepancy now corrected (https://code.google.com/p/fieldtrip/source/detail?r=9813) Regarding your question, if you're computing induced TFR (power estimates for each single-trial) the cfg.combinemethod='sum' (default) method in ft_combineplanar will sum the vertical and horizontal components of each channel. As power is positive (squared), 1) and 2) options will ended up in the same result (although 2) simplifies the channel representation). Might be you already knew it but you can use fieldtrip functions to test these type of questions and figure out yourself (see tfr.png figure, second and third rows): http://fieldtrip.fcdonders.nl/example/combineplanar_pipelineorder Above I made a simulation that basically tested you question. In addition, I also simulate ERFs asking the very same question. I know you did not ask for it but as the ft_combineplanar documentation did not clarify this issue, I took the chance to test it. You'll see that with ERFs the order of the ft_combineplanar call in the pipeline matters (see erf.png figure and the wiki example url above). The reason is because ft_combineplanar ('sum' method) for raw and timelock time of data, squares the vertical and the horizontal planar components (nonlinear transformation). Then, for ERF computations, one should first compute single-trial average first and the compute the megplanar/combineplanar. This is very important because the alternative (combine planar at single trial and then average) is not an ERF: ft_combineplanar will square the signal and random noise (plus time jittered components) will be (positively) added to the grand-mean (wont be cancelled by the negative components of the signal, as ERF approach assumes). I hope it helps. best, Diego ----- Original Message ----- > From: "Frédéric Roux" > To: "FieldTrip discussion list" > Sent: Monday, 15 September, 2014 12:09:24 PM > Subject: [FieldTrip] using ft_megplanar with sinle-trial TFRs > Dear all, > > my question relates to the computation of combined planar gradients > using the ft_combineplanar function. > > Our data has been recorded with an Elekta Neuromag 306 channel system, > and I would like to know if it is "safe" to compute combined gradients > before calling ft_freqstatistics, if the input data contains single > trial TFRs. > > The reason why I am asking is because in the documentation of the > function it says > % Use as > % [data] = ft_combineplanar(cfg, data) > % where data contains an averaged planar gradient (either ERF or TFR). > > However, the following tutorial suggests that this can be safely > applied if > the input data contains TFRs which have been computed with the > cfg.keeptrials = 'yes' option: > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq > > I am bit confused as both information (the fieldtrip documentation and > the tutorial) > seem to contradict each other. > > The 2 options that are see are: > > 1) compute TFRs with cfg.keeptrials = 'yes', then call > ft_frestatistics, then call ft_combineplanar > by using the output of ft_freqstatistics as input for the > ft_combineplanar function. > 2) compute TFRs with cfg.keeptrials = 'yes', then call > ft_combineplanar, then call ft_freqstatistics > > Could anyone with experience on this issue please let me know what the > best way > to proceed would be? > > 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/ -------------- next part -------------- A non-text attachment was scrubbed... Name: tfr.png Type: image/png Size: 40910 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: erf.png Type: image/png Size: 65168 bytes Desc: not available URL: From v.piai.research at gmail.com Fri Sep 19 01:13:14 2014 From: v.piai.research at gmail.com (Vitoria Piai) Date: Thu, 18 Sep 2014 16:13:14 -0700 Subject: [FieldTrip] weird topo: due to missing sensors? and [Reference to non-existent field 'chanori'] Message-ID: <541B670A.7070902@gmail.com> Hello FT-ers, I was wondering whether anyone has an idea of what could be going on in this topo of the group-averaged ERF (difference between 2 conditions, planar gradient). At first I thought that could be muscle activity, but that pattern seems to hold regardless of the time window I choose (and besides when I plot the EMG of some facial muscles, they don't differ from each other...). What I noted now is that different sensors were excluded for different participants around those areas so I'm suspecting that the missing sensors are causing the problem (because of the way the data is interpolated for plotting?). I tried different options in ft_topoplot but all my attempts were in vain. Next, I tried using ft_channelrepair. I assumed that the correct order of processing steps would be to repair channels first, and then calculate planar gradients after. If I follow that procedure, I get the following error when running ft_megplanar (FT version 20140518): Reference to non-existent field 'chanori'. Error in ft_megplanar (line 242) chanposnans = any(isnan(sens.chanpos(:))) || any(isnan(sens.chanori(:))); If anyone could shed some light on these issues, it would be great! Thanks a lot, Vitoria -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hjahgfhc.png Type: image/png Size: 14934 bytes Desc: not available URL: From stephen.whitmarsh at gmail.com Fri Sep 19 09:03:18 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Fri, 19 Sep 2014 09:03:18 +0200 Subject: [FieldTrip] weird topo: due to missing sensors? and [Reference to non-existent field 'chanori'] In-Reply-To: <541B670A.7070902@gmail.com> References: <541B670A.7070902@gmail.com> Message-ID: Hi Vitoria, Yes, I guess it might be the missing channels somehow. Concerning the missing chanori; I think you throw away more than just the data when you remove a channel, and when you restore it later on, things like the orientation, location etc. is not in the data anymore. I would therefor never throw away a channel, but rather fix it, to avoid these kinds of problems. Anyway, I think you can solve it by copying the .grad structure from an earier point (before having removed channels) into the data after fixing. If this doesn't solve the topo problem, have you tried dividing the difference by the sum of the conditions or otherwise normalizing the difference for each subject? E.g. (Condition A - B) / (Condition A + B). Good luck! STephen On 19 September 2014 01:13, Vitoria Piai wrote: > Hello FT-ers, > > I was wondering whether anyone has an idea of what could be going on in > this topo of the group-averaged ERF (difference between 2 conditions, > planar gradient). At first I thought that could be muscle activity, but > that pattern seems to hold regardless of the time window I choose (and > besides when I plot the EMG of some facial muscles, they don't differ from > each other...). > What I noted now is that different sensors were excluded for different > participants around those areas so I'm suspecting that the missing sensors > are causing the problem (because of the way the data is interpolated for > plotting?). > > > I tried different options in ft_topoplot but all my attempts were in vain. > Next, I tried using ft_channelrepair. I assumed that the correct order of > processing steps would be to repair channels first, and then calculate > planar gradients after. If I follow that procedure, I get the following > error when running ft_megplanar (FT version 20140518): > Reference to non-existent field 'chanori'. > > Error in ft_megplanar (line 242) > chanposnans = any(isnan(sens.chanpos(:))) || any(isnan(sens.chanori(:))); > > If anyone could shed some light on these issues, it would be great! > Thanks a lot, > Vitoria > > _______________________________________________ > 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: hjahgfhc.png Type: image/png Size: 14934 bytes Desc: not available URL: From spa268 at nyu.edu Fri Sep 19 10:59:51 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Fri, 19 Sep 2014 12:59:51 +0400 Subject: [FieldTrip] Choosing a subset of sensors with a uniform distribution over the head Message-ID: Hello, I am trying to plot a multiplot of MEG sensors over the head, but since I have over 200 sensors I don't want to plot them all (it becomes more or less illegible; see http://i.imgur.com/lT93i2T.png). What I would like to do is take half or even a third of the channels, and plot them at double or triple the size, as in http://i.imgur.com/6wcrNFS.png (which I created by just plotting the even-numbered channels). As you can see from this image, simply selecting the even-numbered channels in my array doesn't give a nice symmetrical or uniform distribution. Is there any way (for example, somehow using the neighbours structure) to decimate the channels or to otherwise choose a subset of channels that is uniformly distributed over the head? Thank you very much, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Sep 19 12:15:31 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 19 Sep 2014 12:15:31 +0200 Subject: [FieldTrip] Choosing a subset of sensors with a uniform distribution over the head In-Reply-To: References: Message-ID: <541C0243.5020001@donders.ru.nl> Hi Stephen, there is no predfine FieldTrip way for this. You could try to this via the neighbour template. If you know that the neighbours are well defined and only the nearest neighbours are defined as neighbours (the triangulation method might do that), you can loop through the neighbour definition, and throw out all neighbours of channel i from the neighbour definition, something like: > for i=1:numel(neighbs) > > % find all neighbouring channels of channel i > neighbbix = match_str(neighbs(i).neighblabel, {neighb(:).label}); > > % throw them out > neighb(neighbidx) = []; > > end what you end up with is a neighbour structure with all channels that are not adjacent to one another, i.e. a reduced number of channels. Not sure if this works, but you might give it a try. Best, Jörn On 9/19/2014 10:59 AM, Stephen Politzer-Ahles wrote: > Hello, > > I am trying to plot a multiplot of MEG sensors over the head, but > since I have over 200 sensors I don't want to plot them all (it > becomes more or less illegible; see http://i.imgur.com/lT93i2T.png). > What I would like to do is take half or even a third of the channels, > and plot them at double or triple the size, as in > http://i.imgur.com/6wcrNFS.png (which I created by just plotting the > even-numbered channels). As you can see from this image, simply > selecting the even-numbered channels in my array doesn't give a nice > symmetrical or uniform distribution. Is there any way (for example, > somehow using the neighbours structure) to decimate the channels or to > otherwise choose a subset of channels that is uniformly distributed > over the head? > > Thank you very much, > Steve > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > _______________________________________________ > 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 N.Jain at tudelft.nl Fri Sep 19 16:16:55 2014 From: N.Jain at tudelft.nl (Nishant Jain) Date: Fri, 19 Sep 2014 14:16:55 +0000 Subject: [FieldTrip] Making Layout from Digitizer file Message-ID: <664C5D9FB00A6046B7E9E6EAB9A7EBE2103DB670@SRV384.tudelft.net> Hello, I have a .res digitizer file with 3D electrode positions of a non-standard BioSemi cap. To make a layout, I thought to use ft_prepare_layout. One of the options with that function is to make a structure of the electrode positions, which is possible since I can have the 3D coordinates on MATLAB. However, there is no information on the format of the cfg structure required by this function. I tried making a cfg.elec which contains a 160x3 matrix, but it gives me errors. How can I use the 3D position data to construct a layout? Best regards, Nishant Jain PhD candidate, 4D EEG Project. TU Delft / Department of Biomechatronics & Biorobotics Mekelweg 2 2628 CD Delft E n.jain at tudelft.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Fri Sep 19 16:50:58 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Fri, 19 Sep 2014 16:50:58 +0200 Subject: [FieldTrip] Problem redefining trials with different event as zero point Message-ID: Dear Fieldtrippers, I would like to redefine my trials using another event as zero point. So I defined trials on a certain event and preprocessed them. All trials also contain another event. Now I want to redefine them using this other event as zero point and cutting 1 sec before and 1 sec after. I tried simply using the definetrial function again: cfg = [] cfg.dataset= strcat(sb,'mov_ica_cleaned.mat') cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'resp' cfg.trialdef.prestim = -1 cfg.trialdef.poststim = 1 mov_data_small = ft_definetrial(cfg) But then I get the error message Error using ft_read_header (line 1833) unsupported header format (matlab) Error in ft_trialfun_general (line 71) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); Error in ft_definetrial (line 169) [trl, event] = feval(cfg.trialfun, cfg); Somebody able to help me? Thanks and best Katrin >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Fri Sep 19 23:31:12 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Fri, 19 Sep 2014 17:31:12 -0400 Subject: [FieldTrip] Problem redefining trials with different event as zero point In-Reply-To: References: Message-ID: Hi Katrin, Perhaps you should be using the ft_redefinetrial instead. Best, Raquel On Fri, Sep 19, 2014 at 10:50 AM, KatrinH Heimann wrote: > Dear Fieldtrippers, > > I would like to redefine my trials using another event as zero point. So I > defined trials on a certain event and preprocessed them. All trials also > contain another event. Now I want to redefine them using this other event > as zero point and cutting 1 sec before and 1 sec after. > I tried simply using the definetrial function again: > > cfg = [] > > cfg.dataset= strcat(sb,'mov_ica_cleaned.mat') > > cfg.trialdef.eventtype = 'trigger'; > > cfg.trialdef.eventvalue = 'resp' > > cfg.trialdef.prestim = -1 > > cfg.trialdef.poststim = 1 > > > > mov_data_small = ft_definetrial(cfg) > > > > But then I get the error message > > Error using ft_read_header (line 1833) > unsupported header format (matlab) > > Error in ft_trialfun_general (line 71) > hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); > > Error in ft_definetrial (line 169) > [trl, event] = feval(cfg.trialfun, cfg); > > > Somebody able to help me? > > Thanks and best > Katrin > > >> > > _______________________________________________ > 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 gamaliel.ghu at gmail.com Sat Sep 20 07:10:14 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Sat, 20 Sep 2014 02:10:14 -0300 Subject: [FieldTrip] problem in dipole simulation Message-ID: Hi all I followed the tips above to simulate a dipole source on my own head model generated from MRIs. However, using information from:http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit I could not simulate anything. Only one image is blank. The code I am using is as follows: cfg = []; cfg.vol = vol; % See above cfg.elec = elec; % See above cfg.dip.pos = [0 0 0]; cfg.dip.mom = [2 2 2]; % Note, it Should be transposed cfg.dip.frequency = 10; cfg.ntrials = 10; cfg.triallength = 1; % seconds cfg.fsample = 25; % Hz raw1 = ft_dipolesimulation (cfg); avg1 = ft_timelockanalysis([], raw1); plot (avg1.time, avg1.avg); % Plot the timecourse where: vol = ft_prepare_headmodel volumes generated from the segmentation of my resonances. and ft_read_sens elec = ('standard_1020.elc'); to run the script the result is a blank image. and Matlab tells me the following: using headmodel specified in the configuration using electrodes specified in the configuration Determining source compartment (1) projecting electrodes on skin surface electrode and system combine combining transfer matrix computing simulated data computing simulated trial data for 10 RMS value of simulated data is NaN the call to "ft_dipolesimulation" took 4 seconds the input is raw Data with 97 channels and 10 trials Warning: the data does not Contain a definition trial >** In utilities \ private \ warning_once at 158 ** In utilities \ private \ fixsampleinfo at 66 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 Warning: sampleinfo by reconstructing Assuming That the trials are consecutive segments of a continuous recording >** In utilities \ private \ warning_once at 158 ** In utilities \ private \ fixsampleinfo at 79 In ft_datatype_raw at 157 In ft_checkdata at 224 In ft_timelockanalysis at 105 In codgen at 50 averaging trials trial averaging 10 of 10 the call to "ft_timelockanalysis" took 1 seconds I hope you can help greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Sun Sep 21 14:19:16 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Sun, 21 Sep 2014 14:19:16 +0200 Subject: [FieldTrip] Fwd: Real-time Functional Imaging and Neurofeedback conference In-Reply-To: References: Message-ID: <29946EDE-11E8-40BA-B103-BB8B0DC02D6F@donders.ru.nl> On 21 Sep 2014, at 10:10, Blefari Maria Laura wrote: > Dear all, > > We are very glad to announce that the abstract submission for the Real-time Functional Imaging and Neurofeedback (rtFIN) conference is now open! > > The conference would be held in Gainesville (Florida, USA) during 12-13 February, 2015. > > You may find all relevant information regarding conference, registration and abstract submission here:http://reg.conferences.dce.ufl.edu/rtFIN. > > Note that the abstracts are due on or before October 17th, 2014. The format of the abstract is similar to that of the Society for Neuroscience (2300 characters). > > We are looking forward to seeing you all in Gainesville in February! > > > Best regards, your co-organizers, > > > Ranganatha Sitaram, University of Florida > Maria Laura Blefari, Swiss Federal Institute of Technology Lausanne > Sven Haller, University of Geneva > Jarrod Lewis-Peacock, University of Texas at Austin > Frank Scharnowski, University of Geneva > Luke Stoeckel, Harvard University / National Institutes of Health > James Sulzer, University of Texas at Austin > Nikolaus Weiskopf, University College London -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Mon Sep 22 10:32:07 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Mon, 22 Sep 2014 10:32:07 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: <541AEEBE.9090503@uni-konstanz.de> References: <541AEEBE.9090503@uni-konstanz.de> Message-ID: Dear Roey, Julian and Tobias, Thanks for the feedback. Given your suggestions, I now intend to try to calculate the deviation of single trials from the mean phase difference (PLV). Pardon my ignorance, however, I still experience some problems with calculating plv for single trials. Using this code to extract PLV: cfg = []; cfg.trials = 'all'; cfg.keeptrials = 'yes'; cfg.channel = {'all'}; cfg.removemean = 'yes'; cfg.method = 'plv'; cfg.channelcmb = {cfg.channel, cfg.channel}; HLF_pre_c200plv = ft_connectivityanalysis(cfg, HLF_pre_c200); Although I've specified to keep individual trials, ft_connectivityanalysis still show averaged PLV across trials for the output. Could anyone of you, or someone else, kindly highlight my mistake in my calculation? Thank you very much! Best wishes, Hweeling On 18 September 2014 16:39, Tobias Staudigl wrote: > Dear Hweeling, > > I agree with Roey that coherence/PLV cannot be calculated for individual > trials. > However, you could try to use the deviation (in each single trial) from > the mean phase as an approximation. > > Good luck! > Tobias > > > > Am 18.09.2014 15:32, schrieb Roey Schurr: > > Dear Hweeling, > > Unfortunately I am not yet familiar with the PPC measure, but I guess > that being a pairwise phase *consistancy* measure, it is defined over a > set of trials, and can not be calculated for any individual trial (like > coherence, or PLV)? > > Just quickly reading through "The pairwise phase consistency: A > bias-free measure of rhythmic neuronal synchronization" (Vinck et al., > 2010), this seems to be the case. > > Hope this helps, > roey > > On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee > wrote: > >> Dear all, >> >> I've got a question regarding extracting pairwise phase consistency of >> individual trials for each subject. >> >> Using the connectivity analyses tutorial as a reference, I extracted >> the PPC using the fourier information from the mtmfft (dpss taper). >> >> Here's an example of my code: >> >> cfg = []; >> cfg.output = 'fourier'; >> cfg.channel = {'all'}; >> cfg.method = 'mtmfft'; >> cfg.keeptrials = 'yes'; >> cfg.tapsmofrq = 5; >> >> % find the index for the c200 condition >> pre_c200_idx = find(data8.trialinfo == 200); >> >> cfg.trials = pre_c200_idx; >> cfg.foilim = [0 100]; % either the full range of frequencies >> (data2.hdr.Fs/2) or up to 100 Hz >> cfg.taper = 'dpss'; >> HLF_pre_c200 = ft_freqanalysis(cfg, data8); >> >> The PPC is extracted using this code: >> >> cfg = []; >> cfg.trials = 'all'; >> cfg.keeptrials = 'yes'; >> cfg.channel = {'all'}; >> cfg.removemean = 'yes'; >> >> cfg.method = 'wppc'; >> cfg.channelcmb = {cfg.channel, cfg.channel}; >> >> HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); >> >> Although I've specified to keep individual trials, my output is still a >> 'chan_freq' dimord variable. It does not contain any individual trial PPC >> information. Is there a way to extract the connectivity for individual >> trials? >> >> Thanks. >> >> Cheers, >> Hweeling >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > > > _______________________________________________ > fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Dr. Tobias Staudigl > Fachbereich Psychologie - ZPR > Postfach ZPR > 78457 Konstanz > ZPR, Haus 12 > Tel.: +49 (0)7531 / 88 - 5703 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- ================================================= 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 julian.keil at gmail.com Mon Sep 22 11:09:29 2014 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 22 Sep 2014 11:09:29 +0200 Subject: [FieldTrip] extracting individual trial phase connectivity In-Reply-To: References: <541AEEBE.9090503@uni-konstanz.de> Message-ID: <85CB4B7D-8FA5-4FE7-9DE1-CDBC5E01FA07@gmail.com> Dear Hweeling, sorry to have been so unclear. Unfortunately, you'll have to leave the prepared field trip code a bit to compute the phase deviance. What you'll want to do is: 1. Compute the Phase for all channels and trials: Do a mtmfft with ft_freqanalysis and take the angle 2. For each trial, compute the phase difference between all channels: Use the circa_dist-function from the CircStat-Toolbox (Ask Google for the link) 3. For each combination, compute the mean over trials: Use the circa_mean function from the above mentioned toolbox 4. For each combination, compute the deviance from the mean Again, circa_dist is your friend here. Again, PLV or Coherence don't work on the single trial level, thus ft_connectivityanalysis will not work for you. Good Luck, Julian Am 22.09.2014 um 10:32 schrieb Hwee Ling Lee: > Dear Roey, Julian and Tobias, > > Thanks for the feedback. > > Given your suggestions, I now intend to try to calculate the deviation of single trials from the mean phase difference (PLV). Pardon my ignorance, however, I still experience some problems with calculating plv for single trials. > > Using this code to extract PLV: > > cfg = []; > cfg.trials = 'all'; > cfg.keeptrials = 'yes'; > cfg.channel = {'all'}; > cfg.removemean = 'yes'; > cfg.method = 'plv'; > cfg.channelcmb = {cfg.channel, cfg.channel}; > HLF_pre_c200plv = ft_connectivityanalysis(cfg, HLF_pre_c200); > > Although I've specified to keep individual trials, ft_connectivityanalysis still show averaged PLV across trials for the output. Could anyone of you, or someone else, kindly highlight my mistake in my calculation? > > Thank you very much! > > Best wishes, > Hweeling > > > > On 18 September 2014 16:39, Tobias Staudigl wrote: > Dear Hweeling, > > I agree with Roey that coherence/PLV cannot be calculated for individual trials. > However, you could try to use the deviation (in each single trial) from the mean phase as an approximation. > > Good luck! > Tobias > > > > Am 18.09.2014 15:32, schrieb Roey Schurr: >> Dear Hweeling, >> >> Unfortunately I am not yet familiar with the PPC measure, but I guess that being a pairwise phase consistancy measure, it is defined over a set of trials, and can not be calculated for any individual trial (like coherence, or PLV)? >> >> Just quickly reading through "The pairwise phase consistency: A bias-free measure of rhythmic neuronal synchronization" (Vinck et al., 2010), this seems to be the case. >> >> Hope this helps, >> roey >> >> On Thu, Sep 18, 2014 at 3:30 PM, Hwee Ling Lee wrote: >> Dear all, >> >> I've got a question regarding extracting pairwise phase consistency of individual trials for each subject. >> >> Using the connectivity analyses tutorial as a reference, I extracted the PPC using the fourier information from the mtmfft (dpss taper). >> >> Here's an example of my code: >> >> cfg = []; >> cfg.output = 'fourier'; >> cfg.channel = {'all'}; >> cfg.method = 'mtmfft'; >> cfg.keeptrials = 'yes'; >> cfg.tapsmofrq = 5; >> >> % find the index for the c200 condition >> pre_c200_idx = find(data8.trialinfo == 200); >> >> cfg.trials = pre_c200_idx; >> cfg.foilim = [0 100]; % either the full range of frequencies (data2.hdr.Fs/2) or up to 100 Hz >> cfg.taper = 'dpss'; >> HLF_pre_c200 = ft_freqanalysis(cfg, data8); >> >> The PPC is extracted using this code: >> >> cfg = []; >> cfg.trials = 'all'; >> cfg.keeptrials = 'yes'; >> cfg.channel = {'all'}; >> cfg.removemean = 'yes'; >> >> cfg.method = 'wppc'; >> cfg.channelcmb = {cfg.channel, cfg.channel}; >> >> HLF_pre_c200wppc = ft_connectivityanalysis(cfg, HLF_pre_c200); >> >> Although I've specified to keep individual trials, my output is still a 'chan_freq' dimord variable. It does not contain any individual trial PPC information. Is there a way to extract the connectivity for individual trials? >> >> Thanks. >> >> Cheers, >> Hweeling >> >> >> _______________________________________________ >> 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 > > > -- > Dr. Tobias Staudigl > Fachbereich Psychologie - ZPR > Postfach ZPR > 78457 Konstanz > ZPR, Haus 12 > Tel.: +49 (0)7531 / 88 - 5703 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > ================================================= > 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 tzvetan.popov at uni-konstanz.de Mon Sep 22 11:22:14 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 22 Sep 2014 11:22:14 +0200 Subject: [FieldTrip] Making Layout from Digitizer file In-Reply-To: <664C5D9FB00A6046B7E9E6EAB9A7EBE2103DB670@SRV384.tudelft.net> References: <664C5D9FB00A6046B7E9E6EAB9A7EBE2103DB670@SRV384.tudelft.net> Message-ID: <9E29C938-1CFC-4639-8727-085E8889D3C6@uni-konstanz.de> Hi Nishant, > However, there is no information on the format of the cfg structure required by this function. I tried making a cfg.elec which contains a 160x3 matrix, but it gives me errors. > > How can I use the 3D position data to construct a layout? could you try some of the steps explained here http://fieldtrip.fcdonders.nl/tutorial/layout It sounds like this is what you need. best tzvetan -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at psych.ru.nl Mon Sep 22 12:44:11 2014 From: s.vanpelt at psych.ru.nl (Stan van Pelt) Date: Mon, 22 Sep 2014 12:44:11 +0200 (CEST) Subject: [FieldTrip] leadfields MNI-coordinates Message-ID: <035901cfd652$2557ff20$7007fd60$@vanpelt@psych.ru.nl> Dear FieldTrippers, For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to compute leadfields at specific (MNI-)coordinates in the brain. I am trying to find out how that is most easily done using FieldTrip - The most intuitive way seems to me to warp the MNI template to the individual's brain (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_indi vidual_head_space_that_are_all_aligned_in_mni_space) , and then apply the warping parameters to the ROI's MNI-coordinates, and enter the subsequent CTF-coordinates into ft_prepare_leadfield. However, I am not sure where exactly I can find these parameters, and how to apply them. Are these the ones in [gridsrc].params (output ft_sourcemodel)? - Alternatively, should I run ft_volumenormalise to warp the brain to MNI-space, and then inversely apply the warping parameters to the ROI's MNI-coordinates? Again, where can I find the warping parameters in this case, and how should they be applied? Best, Stan - Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Centre for Cognition Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Sep 22 13:19:38 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 22 Sep 2014 13:19:38 +0200 Subject: [FieldTrip] leadfields MNI-coordinates In-Reply-To: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> References: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Hi Stan, Have a look at this recent thread on the list (4 messages, Tom and me, this is the starting message): http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008362.html I think that might help you. Groetjes, Eelke On 22 September 2014 12:44, Stan van Pelt wrote: > Dear FieldTrippers, > > > > For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to compute > leadfields at specific (MNI-)coordinates in the brain. I am trying to find > out how that is most easily done using FieldTrip > > > > - The most intuitive way seems to me to warp the MNI template to the > individual’s brain > (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) > , and then apply the warping parameters to the ROI’s MNI-coordinates, and > enter the subsequent CTF-coordinates into ft_prepare_leadfield. However, I > am not sure where exactly I can find these parameters, and how to apply > them. Are these the ones in [gridsrc].params (output ft_sourcemodel)? > > - Alternatively, should I run ft_volumenormalise to warp the brain to > MNI-space, and then inversely apply the warping parameters to the ROI’s > MNI-coordinates? Again, where can I find the warping parameters in this > case, and how should they be applied? > > > > Best, > > Stan > > > > - > Stan van Pelt, PhD > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > Montessorilaan 3, B.01.34 > 6525 HR Nijmegen, the Netherlands > tel: +31 24 3616288 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From agreene24 at gmail.com Mon Sep 22 15:27:43 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Mon, 22 Sep 2014 22:27:43 +0900 Subject: [FieldTrip] denoise_pca error Message-ID: Hello all, I hope someone will be able to help with this. I'm trying to run the denoise_pca function on data after preprocessing, but I continue to get the following error: Error using ./ Matrix dimensions must agree. Error in ft_denoise_pca (line 193) s1 = s./max(s(:)); Could it be due to the use of the default for refchannel? Forgive me for asking such simple questions, but how do I go about choosing the reference channel? Do I just choose the cleanest channel from that particular set of preprocessed data? Thanks in advance, Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL: From gamaliel.ghu at gmail.com Mon Sep 22 16:32:21 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Mon, 22 Sep 2014 11:32:21 -0300 Subject: [FieldTrip] Questions about matrix lead field Message-ID: Hi Experts My problem is as follows: I need generate a 3D head model from a resonance, then co register this head model with 10-20 electrode system to create my lead field matrix. According to the tutorial: "Creating a volume conduction model of the head for source reconstruction of EEG-data" I have generated head model but I do not have the lead field correctly done, because I do not know that function gives me the coregistration with the electrode system and tutorial only goes to show the volume generated with the electrodes on the surface. Finally I need is to know how I can co-register my head model with my electrode system to generate my lead field matrix. I also need to know how into matrix can I simulate dipole sources for then perform analysis of source reverse. I hope you can help greetings Bless -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.braukmann at donders.ru.nl Mon Sep 22 16:43:19 2014 From: r.braukmann at donders.ru.nl (Ricarda Braukmann) Date: Mon, 22 Sep 2014 16:43:19 +0200 Subject: [FieldTrip] Reading in .bdf files Message-ID: Hi everyone, I have a question regarding reading in Biosemi .bdf files. I followed the example on the ft website to read in a .bdf file, and - although it does not give an error- , the data looks very odd. In the ft_databrowser for example the vertical scale is [ -178000 178000 ] which seems very werid to me. I tried re-referencing the data, like in the example, using channel 'EXG5', but this did not help. Is there anyone who has experience with reading in biosemi files who could give me some advice? It would also be great if someone could explain to me what these EXG channels are exactly. I have for now turned to converting the .bdf file to .edf file (using the converter from www.biosemi.com/download/ ). Then the data looks normal, but it created some other issues with my markers and I would rather not use the converted files. More than anything, I am very curious what is going on with the original file, so any help is much appreciated! Thanks in advance! Ricarda -- Ricarda Braukmann, MSc PhD student Radboud University Medical Centre & Baby Research Center Donders Institute for Brain, Cognition and Behaviour, Centre for Neuroscience & Centre for Cognition Room B.01.22 Phone: +31 (0) 24 36 12652 Email: r.braukmann at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Mon Sep 22 16:49:59 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Mon, 22 Sep 2014 16:49:59 +0200 Subject: [FieldTrip] (no subject) Message-ID: Dear all, I encounter a strange problem using ft_databrowser for artifact detection. Basically I can't see all channels anymore, because the distance between the single channels is so wide that some get out of the window. I did not have this problem before. The only thing I changed until it worked is that I added a filter (before I filtered the data in another program). Did somebody encounter this problem before? thanks and best Katrin Below my (simple) code. cfg = []; cfg.dataset = name; cfg.trialfun = 'ft_trialfun_general'; cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'stim'; cfg.trialdef.prestim = 0.216; % in seconds cfg.trialdef.poststim = 7.284; % in seconds (whole time of video observation plus resynch phase) cfg = ft_definetrial(cfg); cfg.channel = 'all'; cfg.preproc.detrend = 'yes'; cfg.preproc.demean = 'yes'; cfg.preproc.baselinewindow = [-2.1 -2.0] cfg.preproc.bpfilter = 'yes'; cfg.preproc.bpfreq = [0.1 45]; % % obs_data = ft_preprocessing(cfg); cfg = []; cfg.viewmode = 'vertical'; cfg.continuous = 'no'; cfg.plotlabels='yes' cfg = ft_databrowser(cfg,obs_data); obs_data_try = ft_rejectartifact (cfg,obs_data); -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at psych.ru.nl Mon Sep 22 17:12:33 2014 From: s.vanpelt at psych.ru.nl (Stan van Pelt) Date: Mon, 22 Sep 2014 17:12:33 +0200 (CEST) Subject: [FieldTrip] leadfields MNI-coordinates In-Reply-To: References: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: <03a401cfd677$a2538ab0$e6faa010$@vanpelt@psych.ru.nl> Hi Eelke, Thanks a lot, I seem to have missed that thread, very informative! However, I seem not able yet to do the inverse warping, from MNI-coordinates to CTF-coordinates. - First I do mri_realign_mni=ft_volumenormalise([],mri_realign) - This gives me the transformation/normalization parameters from ctf->mni - As an example, I apply them to a random coordinate, here [3 5 6]: mnipos=ft_warp_apply(mri_realign_mni.params,ft_warp_apply(mri_realign_mni.initial,[3 5 6]),'individual2sn') - This gives me mni-coordinates -6.0652 -21.7174 -57.2273 - But how can I do the reverse? - If I do round(ft_warp_apply(pinv(mri_realign_mni.transform),mnipos)) I don't get [3 5 6] - It seems to me I should do something like ctfpos=ft_warp_apply(pinv(mri_realign_mni.params, mnipos),mnipos,'individual2sn') or so, but I am not getting it right... Best, Stan -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Eelke Spaak Sent: maandag 22 september 2014 13:20 To: FieldTrip discussion list Subject: Re: [FieldTrip] leadfields MNI-coordinates Hi Stan, Have a look at this recent thread on the list (4 messages, Tom and me, this is the starting message): http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008362.html I think that might help you. Groetjes, Eelke On 22 September 2014 12:44, Stan van Pelt wrote: > Dear FieldTrippers, > > > > For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to > compute leadfields at specific (MNI-)coordinates in the brain. I am > trying to find out how that is most easily done using FieldTrip > > > > - The most intuitive way seems to me to warp the MNI template to the > individual’s brain > (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_ > individual_head_space_that_are_all_aligned_in_mni_space) > , and then apply the warping parameters to the ROI’s MNI-coordinates, > and enter the subsequent CTF-coordinates into ft_prepare_leadfield. > However, I am not sure where exactly I can find these parameters, and > how to apply them. Are these the ones in [gridsrc].params (output > ft_sourcemodel)? > > - Alternatively, should I run ft_volumenormalise to warp the brain to > MNI-space, and then inversely apply the warping parameters to the > ROI’s MNI-coordinates? Again, where can I find the warping parameters > in this case, and how should they be applied? > > > > Best, > > Stan > > > > - > Stan van Pelt, PhD > Donders Institute for Brain, Cognition and Behaviour Centre for > Cognition Montessorilaan 3, B.01.34 > 6525 HR Nijmegen, the Netherlands > tel: +31 24 3616288 > > > _______________________________________________ > 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 tzvetan.popov at uni-konstanz.de Mon Sep 22 17:14:32 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Mon, 22 Sep 2014 17:14:32 +0200 Subject: [FieldTrip] Questions about matrix lead field In-Reply-To: References: Message-ID: Hi Gamaliel, > Hi Experts > > My problem is as follows: > > I need generate a 3D head model from a resonance, then co register this head model with 10-20 electrode system to create my lead field matrix. this will work if you have the 3D position of the electrodes. > According to the tutorial: > > "Creating a volume conduction model of the head for source reconstruction of EEG-data" > > I have generated head model but I do not have the lead field correctly done, because I do not know that function gives me the coregistration with the electrode system and tutorial only goes to show the volume generated with the electrodes on the surface. see here how to co-register the electrodes (scroll down to the bottom of the page): http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg?s[]=coregister&s[]=electrodes please note that using the search field with search terms “coregister electrodes” leads you to this page ;-). Also check the help of the function ft_electroderealign > > Finally I need is to know how I can co-register my head model with my electrode system to generate my lead field matrix. see above > I also need to know how into matrix can I simulate dipole sources for then perform analysis of source reverse. simulating a dipole is usually done with ft_dipolesimulation. Also the first part of this recently introduced FAQ gives you an example how to do this: http://fieldtrip.fcdonders.nl/example/combineplanar_pipelineorder?s[]=planar&s[]=gradient good luck tzvetan > > I hope you can help > > > greetings > > Bless > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 gamaliel.ghu at gmail.com Mon Sep 22 21:34:03 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Mon, 22 Sep 2014 16:34:03 -0300 Subject: [FieldTrip] Questions about matrix lead field Message-ID: *According to:* *"I need generate a 3D head model from a resonance, then co register this head model with 10-20 electrode system to create my lead field matrix. *this will work if you have the 3D position of the electrodes". I have only the patient MRIs, but no 3D positions of electrodes, just know that the system used in the acquisition is the 10-20 system with a number of fixed electrodes . Can i make my matrix Leadfield electrode using a template as standard_1020.elc? Regards -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Tue Sep 23 07:21:38 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 23 Sep 2014 07:21:38 +0200 Subject: [FieldTrip] leadfields MNI-coordinates In-Reply-To: <03a401cfd677$a2538ab0$e6faa010$@vanpelt@psych.ru.nl> References: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> <03a401cfd677$a2538ab0$e6faa010$@vanpelt@psych.ru.nl> Message-ID: Hi Stan, Part of the solution you’re looking for probably lies in the fact that both the forward and inverse warp are non-linear transformations (when the volumetric normalization is done with cfg.nonlinear = ‘yes’). In other words, the inverse warp cannot be achieved by a simple linear transformation (i.e. the (p)inv of a xxx.transform matrix). Fortunately, ft_warp_apply supports both ft_warp_apply(params, pos, ‘individual2sn’), and ft_warp_apply(params, pos, ‘sn2individual’). The latter aims to achieve the inverse warp you’re looking for. Probably you need to then also still apply the inverse of mri_realign_mni.initial. Best, JM On Sep 22, 2014, at 5:12 PM, Stan van Pelt wrote: > Hi Eelke, > > Thanks a lot, I seem to have missed that thread, very informative! > However, I seem not able yet to do the inverse warping, from MNI-coordinates > to CTF-coordinates. > > - First I do > mri_realign_mni=ft_volumenormalise([],mri_realign) > > - This gives me the transformation/normalization parameters from ctf->mni > - As an example, I apply them to a random coordinate, here [3 5 6]: > mnipos=ft_warp_apply(mri_realign_mni.params,ft_warp_apply(mri_realign_mni.initial,[3 > 5 6]),'individual2sn') > > - This gives me mni-coordinates -6.0652 -21.7174 -57.2273 > - But how can I do the reverse? > - If I do > round(ft_warp_apply(pinv(mri_realign_mni.transform),mnipos)) > I don't get [3 5 6] > > - It seems to me I should do something like > ctfpos=ft_warp_apply(pinv(mri_realign_mni.params, > mnipos),mnipos,'individual2sn') > or so, but I am not getting it right... > > Best, > Stan > > > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl > [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Eelke Spaak > Sent: maandag 22 september 2014 13:20 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] leadfields MNI-coordinates > > Hi Stan, > > Have a look at this recent thread on the list (4 messages, Tom and me, this > is the starting message): > http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008362.html > I think that might help you. > > Groetjes, > Eelke > > On 22 September 2014 12:44, Stan van Pelt wrote: >> Dear FieldTrippers, >> >> >> >> For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to >> compute leadfields at specific (MNI-)coordinates in the brain. I am >> trying to find out how that is most easily done using FieldTrip >> >> >> >> - The most intuitive way seems to me to warp the MNI template to the >> individual’s brain >> (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_ >> individual_head_space_that_are_all_aligned_in_mni_space) >> , and then apply the warping parameters to the ROI’s MNI-coordinates, >> and enter the subsequent CTF-coordinates into ft_prepare_leadfield. >> However, I am not sure where exactly I can find these parameters, and >> how to apply them. Are these the ones in [gridsrc].params (output >> ft_sourcemodel)? >> >> - Alternatively, should I run ft_volumenormalise to warp the brain to >> MNI-space, and then inversely apply the warping parameters to the >> ROI’s MNI-coordinates? Again, where can I find the warping parameters >> in this case, and how should they be applied? >> >> >> >> Best, >> >> Stan >> >> >> >> - >> Stan van Pelt, PhD >> Donders Institute for Brain, Cognition and Behaviour Centre for >> Cognition Montessorilaan 3, B.01.34 >> 6525 HR Nijmegen, the Netherlands >> tel: +31 24 3616288 >> >> >> _______________________________________________ >> 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 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 Tue Sep 23 07:31:14 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Tue, 23 Sep 2014 07:31:14 +0200 Subject: [FieldTrip] denoise_pca error In-Reply-To: References: Message-ID: <3A35A4D9-0586-4E5F-AD0F-D07985BEA275@donders.ru.nl> Hi Ashley, Since your e-mail did not contain any background information with respect to the acquisition system you are using, I cannot be really to-the-point in my answer. Ft_denoise_pca has been designed to operate on 1) MEG data, that 2) has been acquired on a system that has external reference channels. I don’t know what reference channel you specified, but it seems you didn’t, and the function probably indeed defaulted to a value that caused the selection to be empty or so. But again, without additional info it’s hard to tell. Best and good luck, Jan-Mathijs On Sep 22, 2014, at 3:27 PM, Ashley Greene wrote: > Hello all, > > I hope someone will be able to help with this. I'm trying to run the denoise_pca function on data after preprocessing, but I continue to get the following error: > > Error using ./ > Matrix dimensions must agree. > > Error in ft_denoise_pca (line 193) > s1 = s./max(s(:)); > > Could it be due to the use of the default for refchannel? Forgive me for asking such simple questions, but how do I go about choosing the reference channel? Do I just choose the cleanest channel from that particular set of preprocessed data? > > Thanks in advance, > > Ashley > _______________________________________________ > 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 tzvetan.popov at uni-konstanz.de Tue Sep 23 09:52:24 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Tue, 23 Sep 2014 09:52:24 +0200 Subject: [FieldTrip] Questions about matrix lead field In-Reply-To: References: Message-ID: <1A0A6C2B-E384-45DE-81D4-1D90B91C3FFD@uni-konstanz.de> Hi, > According to: > "I need generate a 3D head model from a resonance, then co register this head model with 10-20 electrode system to create my lead field matrix. > this will work if you have the 3D position of the electrodes". > > I have only the patient MRIs, but no 3D positions of electrodes, just know that the system used in the acquisition is the 10-20 system with a number of fixed electrodes . Can i make my matrix Leadfield electrode using a template as standard_1020.elc? yes, yet on the expense of accuracy. See for instance here: http://journal.frontiersin.org/Journal/10.3389/fnins.2014.00042/full best tzvetan > > Regards > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 s.vanpelt at psych.ru.nl Tue Sep 23 09:55:22 2014 From: s.vanpelt at psych.ru.nl (Stan van Pelt) Date: Tue, 23 Sep 2014 09:55:22 +0200 (CEST) Subject: [FieldTrip] leadfields MNI-coordinates In-Reply-To: References: <541ffe26.8364b40a.79a3.2459SMTPIN_ADDED_BROKEN@mx.google.com> <03a401cfd677$a2538ab0$e6faa010$@vanpelt@psych.ru.nl> Message-ID: <042201cfd703$bab76a90$30263fb0$@vanpelt@psych.ru.nl> Hi Jan-Mathijs, Thanks, this indeed did the trick! Ergo, forward warping of coordinates 'pos' work like this: - mri_realign_mni=ft_volumenormalise([],mri_realign) - mnipos=ft_warp_apply(mri_realign_mni.params,ft_warp_apply(mri_realign_mni. initial, pos,'individual2sn') Inverse warping returns coordinates of mnipos in subject space (ctfpos): - posback=ft_warp_apply(mri_realign_mni.params,mnipos,'sn2individual') - ctfpos= ft_warp_apply(pinv(mri_realign_mni.initial),posback) Best, Stan From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of jan-mathijs schoffelen Sent: dinsdag 23 september 2014 7:22 To: FieldTrip discussion list Subject: Re: [FieldTrip] leadfields MNI-coordinates Hi Stan, Part of the solution you're looking for probably lies in the fact that both the forward and inverse warp are non-linear transformations (when the volumetric normalization is done with cfg.nonlinear = 'yes'). In other words, the inverse warp cannot be achieved by a simple linear transformation (i.e. the (p)inv of a xxx.transform matrix). Fortunately, ft_warp_apply supports both ft_warp_apply(params, pos, 'individual2sn'), and ft_warp_apply(params, pos, 'sn2individual'). The latter aims to achieve the inverse warp you're looking for. Probably you need to then also still apply the inverse of mri_realign_mni.initial. Best, JM On Sep 22, 2014, at 5:12 PM, Stan van Pelt wrote: Hi Eelke, Thanks a lot, I seem to have missed that thread, very informative! However, I seem not able yet to do the inverse warping, from MNI-coordinates to CTF-coordinates. - First I do mri_realign_mni=ft_volumenormalise([],mri_realign) - This gives me the transformation/normalization parameters from ctf->mni - As an example, I apply them to a random coordinate, here [3 5 6]: mnipos=ft_warp_apply(mri_realign_mni.params,ft_warp_apply(mri_realign_mni. initial,[3 5 6]),'individual2sn') - This gives me mni-coordinates -6.0652 -21.7174 -57.2273 - But how can I do the reverse? - If I do round(ft_warp_apply(pinv(mri_realign_mni.transform),mnipos)) I don't get [3 5 6] - It seems to me I should do something like ctfpos=ft_warp_apply(pinv(mri_realign_mni.params, mnipos),mnipos,'individual2sn') or so, but I am not getting it right... Best, Stan -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Eelke Spaak Sent: maandag 22 september 2014 13:20 To: FieldTrip discussion list Subject: Re: [FieldTrip] leadfields MNI-coordinates Hi Stan, Have a look at this recent thread on the list (4 messages, Tom and me, this is the starting message): http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008362.html I think that might help you. Groetjes, Eelke On 22 September 2014 12:44, Stan van Pelt wrote: Dear FieldTrippers, For sourceconstruction (CTF275 MEG data) at specific ROIs, I want to compute leadfields at specific (MNI-)coordinates in the brain. I am trying to find out how that is most easily done using FieldTrip - The most intuitive way seems to me to warp the MNI template to the individual's brain (http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_ individual_head_space_that_are_all_aligned_in_mni_space) , and then apply the warping parameters to the ROI's MNI-coordinates, and enter the subsequent CTF-coordinates into ft_prepare_leadfield. However, I am not sure where exactly I can find these parameters, and how to apply them. Are these the ones in [gridsrc].params (output ft_sourcemodel)? - Alternatively, should I run ft_volumenormalise to warp the brain to MNI-space, and then inversely apply the warping parameters to the ROI's MNI-coordinates? Again, where can I find the warping parameters in this case, and how should they be applied? Best, Stan - Stan van Pelt, PhD Donders Institute for Brain, Cognition and Behaviour Centre for Cognition Montessorilaan 3, B.01.34 6525 HR Nijmegen, the Netherlands tel: +31 24 3616288 _______________________________________________ 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 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 agreene24 at gmail.com Tue Sep 23 10:10:10 2014 From: agreene24 at gmail.com (Ashley Greene) Date: Tue, 23 Sep 2014 17:10:10 +0900 Subject: [FieldTrip] denoise_pca error In-Reply-To: <3A35A4D9-0586-4E5F-AD0F-D07985BEA275@donders.ru.nl> References: <3A35A4D9-0586-4E5F-AD0F-D07985BEA275@donders.ru.nl> Message-ID: Hi Jan, I've done electrophysiological research but am a beginner with MEG, and I'm using the data from the Centre for Cognitive Neuroimaging provided from and used in the fieldtrip tutorial website. Ashley On Tue, Sep 23, 2014 at 2:31 PM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Ashley, > Since your e-mail did not contain any background information with respect > to the acquisition system you are using, I cannot be really to-the-point in > my answer. > Ft_denoise_pca has been designed to operate on > 1) MEG data, that > 2) has been acquired on a system that has external reference channels. > I don’t know what reference channel you specified, but it seems you > didn’t, and the function probably indeed defaulted to a value that caused > the selection to be empty or so. But again, without additional info it’s > hard to tell. > Best and good luck, > Jan-Mathijs > > > > On Sep 22, 2014, at 3:27 PM, Ashley Greene wrote: > > Hello all, > > I hope someone will be able to help with this. I'm trying to run the > denoise_pca function on data after preprocessing, but I continue to get the > following error: > > Error using ./ > Matrix dimensions must agree. > > Error in ft_denoise_pca (line 193) > s1 = s./max(s(:)); > > Could it be due to the use of the default for refchannel? Forgive me for > asking such simple questions, but how do I go about choosing the reference > channel? Do I just choose the cleanest channel from that particular set of > preprocessed data? > > Thanks in advance, > > Ashley > _______________________________________________ > 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 bibi.raquel at gmail.com Tue Sep 23 16:33:44 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Tue, 23 Sep 2014 10:33:44 -0400 Subject: [FieldTrip] Reading in .bdf files In-Reply-To: References: Message-ID: Hi Ricarda, The Biosemi system uses CMS & DRL during acquisition as the common mode for the ground electrode. Are you re-referencing your EEG signals, before viewing them in ft_databrowser? Best, Raquel On Mon, Sep 22, 2014 at 10:43 AM, Ricarda Braukmann < r.braukmann at donders.ru.nl> wrote: > Hi everyone, > > > I have a question regarding reading in Biosemi .bdf files. > > > I followed the example on the ft website to read in a .bdf file, and - > although it does not give an error- , the data looks very odd. In the > ft_databrowser for example the vertical scale is [ -178000 178000 ] > which seems very werid to me. > > > I tried re-referencing the data, like in the example, using channel > 'EXG5', but this did not help. > > > Is there anyone who has experience with reading in biosemi files who could > give me some advice? > > It would also be great if someone could explain to me what these EXG > channels are exactly. > > > I have for now turned to converting the .bdf file to .edf file (using the > converter from www.biosemi.com/download/ > ). > Then the data looks normal, but it created some other issues with my > markers and I would rather not use the converted files. > > More than anything, I am very curious what is going on with the original > file, so any help is much appreciated! > > > Thanks in advance! > > Ricarda > > > -- > > Ricarda Braukmann, MSc > PhD student > > > Radboud University Medical Centre & Baby Research Center > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Neuroscience & Centre for Cognition > > Room B.01.22 > Phone: +31 (0) 24 36 12652 > Email: r.braukmann at donders.ru.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 recasensmarc at gmail.com Tue Sep 23 16:45:18 2014 From: recasensmarc at gmail.com (Marc Recasens) Date: Tue, 23 Sep 2014 16:45:18 +0200 Subject: [FieldTrip] PhD and Postdoctoral positions in Majorca, Spain In-Reply-To: References: Message-ID: Hola Francisco, Soy Marc Recasens, del Grup de Recerca en Neurociència Cognitiva (*Brainlab*) de la UB. Te escribo en relació a la plaza posdoctoral que se ofrece en tu laboratorio. Estoy muy interesado en buscar una plaza posdoc ya que voy a hacer la defensa de mi tesis en los próximos meses. Me gustaría que tuvierais en cuenta mi perfil para cubrir dicha plaza.Creo que podría encajar muy bien y el proyecto que describes en la oferta es muy atractivos para mi (connectivity, M/EEG, clinical population...). Adjunto CV actualizado y la *motivation letter*. En el CV incluyo los nombres y datos de contacto de tres posibles referees que pueden dar cuenta del trabajo que he realizado hasta la fecha como *PhD student*. Carles entre ellos. Estoy 100% disponible para realizar una entrevista por Skype o presencial cuando sea. Atentamente, Marc Recasens. On Sat, Aug 23, 2014 at 12:33 AM, Francisco Barcelo wrote: > One PhD and one Postdoctoral research positions are available at the > Department of Psychology (University of Balearic Islands, Spain) to join an > ongoing project on the Cognitive neuroscience of executive control aimed to > assess functional and effective connectivity (e.g., Dynamic Causal > Modeling) in M/EEG data sets from healthy controls and brain injured > patients. The project aims to develop state-of-the-art neuropsychological > tools for a more valid and cost-effective evaluation of dysexecutive > symptoms in elderly adults and patients with frontal lobe lesions (cf., > Barceló & Knight, Cereb. Cortex, 2007; Nyhus & Barceló, Brain & Cognition, > 2009). > > Successful pre/postdoctoral candidates will hold a MSc/PhD in Psychology, > Biology, Cognitive Neuroscience, Physics, or related fields, and will play > a key role in designing, conducting, analyzing and reporting M/EEG studies, > with a focus on event-related potentials, oscillatory neural activity and > synchrony. Candidates will be fluent in English (knowledge of Spanish is > not required), and will prove good interpersonal and communication skills, > including writing to a high standard. Both positions are funded by the > Spanish Government (MINECO’s grant PSI2013-44760-R), as well as other local > research agencies. > > Requirements for the PhD student position: 1) EU citizenship; 2) a Master > degree and excellent academic marks; 3) Programming skills (eg., Matlab > will be a plus); and 4) Demonstrated ability and high motivation to conduct > high-quality research publishable in quality international peer-reviewed > journals. > > Requirements for the Postdoc position: 1) Strong background publishing EEG > and/or MEG studies; 2) Advanced programming skills (eg., Matlab, C, > Python); 3) Excellent command of EEG/MEG data analysis software (EEGLAB, > SPM8, Brainstorm, etc); and 4) demonstrate creative and independent work. > > Applicants must submit an updated CV in pdf format, a letter of > motivation, and the names and emails of two referees to the grant holder: > Francisco Barceló (f.barcelo at uib.es). The PhD studentship is for 3 years, > and the postdoc position is for one year, with the possibility of renewal. > Starting date October 1st 2014, or until the positions are filled. Informal > inquires are welcomed. For more information visit: www.mcst.es, or > www.neuropsicologiaclinica.es. > > ><><><><><><><><><><><><><>< > Francisco Barceló, PhD > Full Professor of Neuropsychology > University of Illes Balears (UIB) > Ctra. Valldemossa, km 7.5 > E-07122 Palma de Mallorca - Spain > Personal: www.mcst.es > Lab: www.neuropsicologiaclinica.es > Phone: 971 172750 > Fax: 971 172309 > ><><><><><><><><><><><><><>< > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Marc Recasens Tel.: +34 639 24 15 98 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CV2014b_english.pdf Type: application/pdf Size: 39360 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MOTIVATION LETTER.pdf Type: application/pdf Size: 12745 bytes Desc: not available URL: From matt.craddock at uni-leipzig.de Tue Sep 23 17:12:14 2014 From: matt.craddock at uni-leipzig.de (Matt Craddock) Date: Tue, 23 Sep 2014 16:12:14 +0100 Subject: [FieldTrip] Reading in .bdf files In-Reply-To: References: Message-ID: <54218DCE.803@uni-leipzig.de> Hi Ricarda, The EXG channels are for external electrodes - typically they are used for things like eye movements (for example we always placed EXG1-4 at points around the eyes) and additional reference points (e.g. mastoids, earlobes). You'd need to check with whoever recorded the dataset to be sure which channel is which. I have not tried to read .bdfs using fieldtrip, as i usually do a lot of pre-processing in eeglab and port over to fieldtrip later on, but subtracting the mean of each channel (DC) as well as re-referencing may help. BDFs have a very high dynamic range which can have some unfortunate side effects at times: http://sccn.ucsd.edu/pipermail/eeglablist/2008/002147.html http://sccn.ucsd.edu/pipermail/eeglablist/2008/002229.html Cheers, Matt On 22/09/2014 15:43, Ricarda Braukmann wrote: > Hi everyone, > > > I have a question regarding reading in Biosemi .bdf files. > > > I followed the example on the ft website to read in a .bdf file, and - > although it does not give an error- , the data looks very odd. In the > ft_databrowser for example the vertical scale is [ -178000178000 ] which > seems very werid to me. > > > I tried re-referencing the data, like in the example, using channel > 'EXG5', but this did not help. > > > Is there anyone who has experience with reading in biosemi files who > could give me some advice? > > It would also be great if someone could explain to me what these EXG > channels are exactly. > > > I have for now turned to converting the .bdf file to .edf file (using > the converter from www.biosemi.com/download/ > ). > Then the data looks normal, but it created some other issues with my > markers and I would rather not use the converted files. > > More than anything, I am very curious what is going on with the original > file, so any help is much appreciated! > > > Thanks in advance! > > Ricarda -- Dr. Matt Craddock From r.braukmann at donders.ru.nl Tue Sep 23 17:11:26 2014 From: r.braukmann at donders.ru.nl (Ricarda Braukmann) Date: Tue, 23 Sep 2014 17:11:26 +0200 Subject: [FieldTrip] Reading in .bdf files Message-ID: Hi Rachel, Yes, I was wondering about the re-referencing because I indeed read that this was the necessary first step for Biosemi data. What would one usually re-reference the data to? I tried re-referencing to all electrodes (since no mastoid etc. has been collected) but this did not solve the issue for the .bdf file. It works for the converted .edf file in which the data looks much better from the start but I am not sure whether everything is going correctly. The data is quite noisy and also when trying to apply a high-pass filter later Matlab gives an error of unstable poles. I am not sure whether this is due to the actual properties of my data or whether it is still related to the way I read it in, so any suggestions are very welcome! Thanks a lot! Best, Ricarda On Tue, Sep 23, 2014 at 4:33 PM, Raquel Bibi wrote: > >> Hi Ricarda, >> The Biosemi system uses CMS & DRL during acquisition as the common mode >> for the ground electrode. Are you re-referencing your EEG signals, before >> viewing them in ft_databrowser? >> >> Best, >> >> Raquel >> >> On Mon, Sep 22, 2014 at 10:43 AM, Ricarda Braukmann < >> r.braukmann at donders.ru.nl> wrote: >> >>> Hi everyone, >>> >>> >>> I have a question regarding reading in Biosemi .bdf files. >>> >>> >>> I followed the example on the ft website to read in a .bdf file, and - >>> although it does not give an error- , the data looks very odd. In the >>> ft_databrowser for example the vertical scale is [ -178000 178000 ] >>> which seems very werid to me. >>> >>> >>> I tried re-referencing the data, like in the example, using channel >>> 'EXG5', but this did not help. >>> >>> >>> Is there anyone who has experience with reading in biosemi files who >>> could give me some advice? >>> >>> It would also be great if someone could explain to me what these EXG >>> channels are exactly. >>> >>> >>> I have for now turned to converting the .bdf file to .edf file (using >>> the converter from www.biosemi.com/download/ >>> ). >>> Then the data looks normal, but it created some other issues with my >>> markers and I would rather not use the converted files. >>> >>> More than anything, I am very curious what is going on with the original >>> file, so any help is much appreciated! >>> >>> >>> Thanks in advance! >>> >>> Ricarda >>> >>> >>> -- >>> >>> Ricarda Braukmann, MSc >>> PhD student >>> >>> >>> Radboud University Medical Centre & Baby Research Center >>> >>> Donders Institute for Brain, Cognition and Behaviour, >>> Centre for Neuroscience & Centre for Cognition >>> >>> Room B.01.22 >>> Phone: +31 (0) 24 36 12652 >>> Email: r.braukmann at donders.ru.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 >> > > > > -- Ricarda Braukmann, MSc PhD student Radboud University Medical Centre & Baby Research Center Donders Institute for Brain, Cognition and Behaviour, Centre for Neuroscience & Centre for Cognition Room B.01.22 Phone: +31 (0) 24 36 12652 Email: r.braukmann at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Tue Sep 23 18:02:36 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Tue, 23 Sep 2014 12:02:36 -0400 Subject: [FieldTrip] Reading in .bdf files In-Reply-To: References: Message-ID: Hi Ricarda, Some suggestions: 1. Did you include your EXG electrodes in the re-referenced channels? Perhaps you could remove these? 2.Review and exclude bad channels before re-referencing? I used the Biosemi Viewer before analyzing the data in Fieldtrip. 3. Re-reference to a single channel, like CZ(A1). I haven't worked with bdfs in a while, I had the same problems you're describing initially with my data. Here are a few solutions I remember offhand. I was able to resolve them without converting them to .cnt. Best, Raquel On Tue, Sep 23, 2014 at 11:11 AM, Ricarda Braukmann < r.braukmann at donders.ru.nl> wrote: > Hi Rachel, > > Yes, I was wondering about the re-referencing because I indeed read that > this was the necessary first step for Biosemi data. > What would one usually re-reference the data to? > > I tried re-referencing to all electrodes (since no mastoid etc. has been > collected) but this did not solve the issue for the .bdf file. > > It works for the converted .edf file in which the data looks much better > from the start but I am not sure whether everything is going correctly. > The data is quite noisy and also when trying to apply a high-pass filter > later Matlab gives an error of unstable poles. I am not sure whether this > is due to the actual properties of my data or whether it is still related > to the way I read it in, so any suggestions are very welcome! > > Thanks a lot! > Best, > Ricarda > > > On Tue, Sep 23, 2014 at 4:33 PM, Raquel Bibi >> wrote: >> >>> Hi Ricarda, >>> The Biosemi system uses CMS & DRL during acquisition as the common mode >>> for the ground electrode. Are you re-referencing your EEG signals, before >>> viewing them in ft_databrowser? >>> >>> Best, >>> >>> Raquel >>> >>> On Mon, Sep 22, 2014 at 10:43 AM, Ricarda Braukmann < >>> r.braukmann at donders.ru.nl> wrote: >>> >>>> Hi everyone, >>>> >>>> >>>> I have a question regarding reading in Biosemi .bdf files. >>>> >>>> >>>> I followed the example on the ft website to read in a .bdf file, and - >>>> although it does not give an error- , the data looks very odd. In the >>>> ft_databrowser for example the vertical scale is [ -178000 178000 ] >>>> which seems very werid to me. >>>> >>>> >>>> I tried re-referencing the data, like in the example, using channel >>>> 'EXG5', but this did not help. >>>> >>>> >>>> Is there anyone who has experience with reading in biosemi files who >>>> could give me some advice? >>>> >>>> It would also be great if someone could explain to me what these EXG >>>> channels are exactly. >>>> >>>> >>>> I have for now turned to converting the .bdf file to .edf file (using >>>> the converter from www.biosemi.com/download/ >>>> ). >>>> Then the data looks normal, but it created some other issues with my >>>> markers and I would rather not use the converted files. >>>> >>>> More than anything, I am very curious what is going on with the >>>> original file, so any help is much appreciated! >>>> >>>> >>>> Thanks in advance! >>>> >>>> Ricarda >>>> >>>> >>>> -- >>>> >>>> Ricarda Braukmann, MSc >>>> PhD student >>>> >>>> >>>> Radboud University Medical Centre & Baby Research Center >>>> >>>> Donders Institute for Brain, Cognition and Behaviour, >>>> Centre for Neuroscience & Centre for Cognition >>>> >>>> Room B.01.22 >>>> Phone: +31 (0) 24 36 12652 >>>> Email: r.braukmann at donders.ru.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 >>> >> >> >> >> > -- > > Ricarda Braukmann, MSc > PhD student > > > Radboud University Medical Centre & Baby Research Center > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Neuroscience & Centre for Cognition > > Room B.01.22 > Phone: +31 (0) 24 36 12652 > Email: r.braukmann at donders.ru.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 gamaliel.ghu at gmail.com Tue Sep 23 18:35:01 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Tue, 23 Sep 2014 13:35:01 -0300 Subject: [FieldTrip] Questions about matriz lead field Message-ID: Hi experts I hope you can help me prior information 1) I pretend work with EEG data simulation 2) I pretend use a template of sensor same as system 10-20 3) I have the anatomy of the patient in MRIs T2 contrast for generate the volume conduction I have the volume conduction model that I performed with the tutorial: " creating a volume conduction model of the head for source-reconstruction of eeg data" Now, I need simulate a dipole source into brain generated (volume conduction model). I have sent repeated questions about how to do this and you responded me with two reference pages: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit?s[]=ft&s[]=dipolesimulation and http://fieldtrip.fcdonders.nl/example/combineplanar_pipelineorder?s%20[%20]%20=%20planar%20&%20s%20[]%20=%20gradiente Now my questions are the next: In the first case (page 1): Can i add my own volume conduction instead of the concentric spheres describes in the example? I tried this but, i have not good results In the second case (page 2): This reference page says that the script is specific to MEG, and not use a vol especific (use a concentric sphere). Can i use the sript as example for generate my personal dipole source in my volume conduction model? Sorry for my continuous questions, but i am new in this world, the final objective of this is try of generate my own sources to generate my own simulate eeg data, and next aplicate the source analysis to found the same position of the dipole best -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From dylan.delosangeles at gmail.com Wed Sep 24 02:32:41 2014 From: dylan.delosangeles at gmail.com (Dylan DeLosAngeles) Date: Wed, 24 Sep 2014 10:02:41 +0930 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design Message-ID: Hello, So far, the tutorial on "Cluster-based permutation tests on time-frequency data" has been very helpful. Out of the four combinations from the two UO-types (subjects and trials) and the two experimental designs (between- and within-UO), the tutorial covers statistics on data in two conditions in a between-trials, in a within-trials and in a within-subjects design. However, I am wondering if there is any information about the fourth type of experiment design: between-subjects. I have data for 2 groups with 12 subjects in each group. Both groups are measured during 11 conditions. Can I approach this in a similar fashion to within-subjects design (multiple subjects in multiple experimental conditions), such that my design is multiple *groups* in multiple experimental conditions. Is it a case of first averaging over all trials belonging to each of the experimental conditions for each subject (as instructed in tutorial), and then averaging over all subjects in each group? Configuration code for setting up the design currently looks like this; grp = 2; subj = 11; design = zeros(2, subj*grp); for i = 1:grp design(1,i:2:end) = i; end idx = 1; for i = 1:subj design(2,idx:idx+1) = i; idx = idx+2; end Is there anything else I need to take into consideration when doing these statistics? Thank you, Dr Dylan DeLosAngeles Research Fellow Brain Signal Laboratory Flinders University -------------- next part -------------- An HTML attachment was scrubbed... URL: From eriksenj at ohsu.edu Wed Sep 24 05:57:57 2014 From: eriksenj at ohsu.edu (K Jeffrey Eriksen) Date: Wed, 24 Sep 2014 03:57:57 +0000 Subject: [FieldTrip] FDM and FEM forward models Message-ID: I just joined this list. I am interested in accurate FDM and FEM models for EEG forward solutions, and note that both seem to be available in some form with FieldTrip. MY question is, can these accommodate custom head models based on individual MRIs and/or CTs, or do they use a generic head of some sort? Thanks, -Jeff Eriksen -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Wed Sep 24 07:59:31 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 24 Sep 2014 07:59:31 +0200 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: Hello Dylan, You can analyse a between-subjects design exactly as you would a between-trials design (at least as far as the statistics step is concerned), in both cases the two conditions correspond to two groups of observations, and not to the same group of observations measured in two separate conditions (which would be a within-UO design). In FieldTrip, you would typically compute averages per subject, then use an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic (not depsamples). indepsamplesT only requires one row in the design matrix, indicating the condition. Note that if you have e.g. timelock structures in two (or more) cell arrays, corresponding to the conditions, you can input them into the statistics function as follows: stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); without having to call ft_timelockgrandaverage. In fact, the above is the preferred way to do statistics now. (The same holds for ft_freqstatistics.) Hope that helps, Best, Eelke On 24 September 2014 02:32, Dylan DeLosAngeles wrote: > Hello, > > So far, the tutorial on "Cluster-based permutation tests on time-frequency > data" has been very helpful. > > Out of the four combinations from the two UO-types (subjects and trials) and > the two experimental designs (between- and within-UO), the tutorial covers > statistics on data in two conditions in a between-trials, in a within-trials > and in a within-subjects design. However, I am wondering if there is any > information about the fourth type of experiment design: between-subjects. > > I have data for 2 groups with 12 subjects in each group. Both groups are > measured during 11 conditions. > Can I approach this in a similar fashion to within-subjects design (multiple > subjects in multiple experimental conditions), such that my design is > multiple groups in multiple experimental conditions. Is it a case of first > averaging over all trials belonging to each of the experimental conditions > for each subject (as instructed in tutorial), and then averaging over all > subjects in each group? > > Configuration code for setting up the design currently looks like this; > grp = 2; > subj = 11; > design = zeros(2, subj*grp); > > for i = 1:grp > design(1,i:2:end) = i; > end > > idx = 1; > for i = 1:subj > design(2,idx:idx+1) = i; > idx = idx+2; > end > > Is there anything else I need to take into consideration when doing these > statistics? > > Thank you, > Dr Dylan DeLosAngeles > Research Fellow > Brain Signal Laboratory > Flinders University > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Wed Sep 24 08:02:17 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Wed, 24 Sep 2014 08:02:17 +0200 Subject: [FieldTrip] FDM and FEM forward models In-Reply-To: References: Message-ID: Hi Jeff, All the forward modelling in FieldTrip is based on a user-specified MRI (preferably an individual one, but can be a template brain if an individual MRI is not available). You probably will want to have a look at this tutorial: http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg Best, Eelke On 24 September 2014 05:57, K Jeffrey Eriksen wrote: > I just joined this list. I am interested in accurate FDM and FEM models for > EEG forward solutions, and note that both seem to be available in some form > with FieldTrip. MY question is, can these accommodate custom head models > based on individual MRIs and/or CTs, or do they use a generic head of some > sort? > > > > Thanks, > > -Jeff Eriksen > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tzvetan.popov at uni-konstanz.de Wed Sep 24 10:58:45 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Wed, 24 Sep 2014 10:58:45 +0200 Subject: [FieldTrip] Questions about matriz lead field In-Reply-To: References: Message-ID: <83E25E9B-CF0F-41A5-B4FD-C4F45CDE7C5A@uni-konstanz.de> Allright then, > Sorry for my continuous questions, but i am new in this world, the final objective of this is try of generate my own sources to generate my own simulate eeg data, and next aplicate the source analysis to found the same position of the dipole here is what I would do using the standard head model and standard electrodes provided with fieldtrip. Just exchange the head model with your desired head model and make sure that the units match and the alignment of elec’s and vol is correct. good luck tzvetan load ('/Users/zez/Documents/matlabtools/fieldtrip-20140518/template/headmodel/standard_bem'); load ('/Users/zez/Documents/matlabtools/fieldtrip-20140518/template/headmodel/standard_mri'); elec = ft_read_sens('/Users/zez/Documents/matlabtools/fieldtrip-20140518/template/electrode/standard_1020.elc'); %% ft_plot_mesh(vol.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05); hold on; ft_plot_mesh(vol.bnd(2),'edgecolor','none','facealpha',0.4); hold on; ft_plot_mesh(vol.bnd(3),'edgecolor','none','facecolor',[0.4 0.6 0.4]); hold on; ft_plot_sens(elec,'style', 'sk'); %% cfg=[]; cfg.method = 'ortho'; figure; ft_sourceplot(cfg,mri); %% cfg=[]; cfg.dip.pos = [55 -7 5];%dipole located in the right heschl gyrus cfg.dip.mom = [0 0 -1]; cfg.dip.frequency = 10; cfg.dip.phase = 2; cfg.dip.amplitude = 1; cfg.ntrials = 20; cfg.triallength = 2; cfg.fsample = 100; cfg.vol = vol; cfg.elec = elec; cfg.relnoise = 0.1; data = ft_dipolesimulation(cfg); data.elec = elec; %% cfg = []; cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 2:2:30; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = 0:0.05:2; % time window "slides" from 0 to 2 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, data); TLK = ft_timelockanalysis([],data); %% plot the simulated signal in time and time-freq space cfg = []; cfg.channel = {'FC2', 'FC4', 'FC6', 'FT8', 'C2', 'C4', 'C6', 'T8', 'T4'}; cfg.renderer = 'zbuffer'; cfg.xlim = [0.5 1.5]; figure subplot(2,2,1);ft_singleplotTFR(cfg, TFRhann); subplot(2,2,2);ft_singleplotER(cfg,TLK); cfg.channel = {'EEG'}; subplot(2,2,3);ft_topoplotTFR(cfg, TFRhann); subplot(2,2,4);ft_topoplotER(cfg,TLK); %% cfg = []; cfg.latency = [0.5 1.5]; % specify latency window cfg.numdipoles = 1; cfg.vol = vol; cfg.grid.resolution = 10; cfg.grid.unit = 'mm'; dip = ft_dipolefitting(cfg, TLK); %% plot the location of the dipole cfg = []; cfg.location = dip.dip.pos; figure; ft_sourceplot(cfg, mri) > > > best > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 spa268 at nyu.edu Wed Sep 24 11:17:53 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Wed, 24 Sep 2014 13:17:53 +0400 Subject: [FieldTrip] Cluster-based permutation tests for between-subject design Message-ID: Hi Eelke, Thanks for this information. I just wanted to jump in and ask: what about for interactions in a mixed 2x2 design? For example, say I expect a difference between conditions A and B for group 1, but not group 2. Would the correct way to do this be to 1) make difference waves (A-B) for each participant, then 2) do a between-UO test on the difference waves using indepsamplesT? In the past I have always tested within-UO interactions using basically this method (based on http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html), but I was under the impression that this is not OK for mixed designs (from this post: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004244.html) Thanks, Steve > > ------------------------------ > > Message: 12 > Date: Wed, 24 Sep 2014 07:59:31 +0200 > From: Eelke Spaak > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > Message-ID: > < CABPNLUomYPTw6m__+Wx8jRJc8HvyU-Pqc4Q7+G7czOjD502dfA at mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > wrote: > > Hello, > > > > So far, the tutorial on "Cluster-based permutation tests on time-frequency > > data" has been very helpful. > > > > Out of the four combinations from the two UO-types (subjects and trials) and > > the two experimental designs (between- and within-UO), the tutorial covers > > statistics on data in two conditions in a between-trials, in a within-trials > > and in a within-subjects design. However, I am wondering if there is any > > information about the fourth type of experiment design: between-subjects. > > > > I have data for 2 groups with 12 subjects in each group. Both groups are > > measured during 11 conditions. > > Can I approach this in a similar fashion to within-subjects design (multiple > > subjects in multiple experimental conditions), such that my design is > > multiple groups in multiple experimental conditions. Is it a case of first > > averaging over all trials belonging to each of the experimental conditions > > for each subject (as instructed in tutorial), and then averaging over all > > subjects in each group? > > > > Configuration code for setting up the design currently looks like this; > > grp = 2; > > subj = 11; > > design = zeros(2, subj*grp); > > > > for i = 1:grp > > design(1,i:2:end) = i; > > end > > > > idx = 1; > > for i = 1:subj > > design(2,idx:idx+1) = i; > > idx = idx+2; > > end > > > > Is there anything else I need to take into consideration when doing these > > statistics? > > > > Thank you, > > Dr Dylan DeLosAngeles > > Research Fellow > > Brain Signal Laboratory > > Flinders University > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > All the forward modelling in FieldTrip is based on a user-specified > MRI (preferably an individual one, but can be a template brain if an > individual MRI is not available). You probably will want to have a > look at this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed Sep 24 17:26:28 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 24 Sep 2014 17:26:28 +0200 Subject: [FieldTrip] fieldtrip website updated Message-ID: <70EE18B4-801F-48EF-8CC3-9913B71E3FD5@donders.ru.nl> Dear all, This afternoon we have updated the software of the FieldTrip website. We encountered some compatibility issues with our own custom extensions. As a consequence, some things have changed slightly and some parts still need minor improvements. For example the search function is not yet 100% functional. If you notice something on the website that does not work as expected, please report it at http://bugzilla.fcdonders.nl/show_bug.cgi?id=2693 thanks Robert From katrinheimann at gmail.com Thu Sep 25 15:53:14 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Thu, 25 Sep 2014 15:53:14 +0200 Subject: [FieldTrip] numcomponent problem in ica Message-ID: Hey experts, I have a problem with an ICA. What I am basically doing is running an ICA on a big dataset and then removing the identified components from smaller datasets of the same subject. Due to interpolated channels I do reduce the components using numcomponent. But there seems to be a problem with this: My code is cfg = []; cfg.channel = {'all'}; cfg.numcomponent = 126 comp = ft_componentanalysis(cfg,obs_data_clean1); save (strcat(sb,'comp_all') , 'comp') and matlab writes: the input is component data with 126 components and 129 original channels detected 0 visual artifacts the input is component data with 126 components and 129 original channels processing trials just as expected! then I want to use this ica for cleaning a smaller dataset so I wrote: cfg = []; cfg.numcomponent = 126; cfg.unmixing = comp.unmixing; cfg.topolabel = comp.topolabel; comp_1 = ft_componentanalysis(cfg, obs90_data); the program again tells me: the input is raw data with 129 channels and 80 trials selecting 129 channels baseline correcting data scaling data with 1 over 126.842103 not concatenating data starting decomposition using predetermined unmixing matrix the call to "ft_componentanalysis" took 2 seconds and required the additional allocation of an estimated 574 MB then I remove the component I identified before as blinking cfg = []; cfg.component = [1]; obs90_data_ica_cleaned = ft_rejectcomponent(cfg, comp_1, obs90_data); save (strcat(sb,'obs90_ica_cleaned') , 'obs90_data_ica_cleaned') and suddenly matlab says: baseline correcting data removing 1 components keeping 128 components processing trials processing trial 80 from 80 Why does is speak of 129 (128+1) components??? My comp and comp_1 objects only have 126 components!!! Is it doing the right thing? Thanks again for your help! Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From gamaliel.ghu at gmail.com Thu Sep 25 18:23:00 2014 From: gamaliel.ghu at gmail.com (gamaliel huerta urrea) Date: Thu, 25 Sep 2014 13:23:00 -0300 Subject: [FieldTrip] Problem with standard_1020.elc file Message-ID: Hi all I have the next problem: When I read the standard_1020.elc file of my FieldTrip documents. reading shows the following: elec = ft_read_sens('standard_1020.elc') elec = chanpos: [97x3 double] elecpos: [97x3 double] label: {97x1 cell} type: 'eeg1010' unit: 'mm' I know that the 1020 system is different system 1010, but reading the standard_1020.elc file that comes by default in my Fieldtrip folder. Apparently not contain the informations system 1020 but 1010. have you a page where you can download the correct file standard_1020.elc? Another question is: Where I can get the files that come by default in fieldtrip: standard_bem and standard_mri? My template folder fieldtrip not have them by default. greetings -- *Gamaliel Huerta* *Ingeniería Civil Biomédica* *Universidad de Valparaíso* -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Thu Sep 25 18:48:26 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Thu, 25 Sep 2014 18:48:26 +0200 Subject: [FieldTrip] Problem with standard_1020.elc file In-Reply-To: References: Message-ID: <8E550D9B-3433-424F-94C1-27EE95C60DFD@uni-konstanz.de> Hi, please download a recent FieldTrip version and do this on the command line: restoredefaultpath addpath /yourpath/fieldtrip ft_defaults If you follow these instructions: http://fieldtrip.fcdonders.nl/faq/should_i_add_fieldtrip_with_all_subdirectories_to_my_matlab_path?s[]=genpath everything should work for you. best tzvetan > Hi all > > I have the next problem: > > When I read the standard_1020.elc file of my FieldTrip documents. reading shows the following: > > elec = ft_read_sens('standard_1020.elc') > > elec = > > chanpos: [97x3 double] > elecpos: [97x3 double] > label: {97x1 cell} > type: 'eeg1010' > unit: 'mm' > > > I know that the 1020 system is different system 1010, but reading the standard_1020.elc file that comes by default in my Fieldtrip folder. Apparently not contain the informations system 1020 but 1010. > > have you a page where you can download the correct file standard_1020.elc? > > Another question is: > > Where I can get the files that come by default in fieldtrip: > > standard_bem and standard_mri? > > My template folder fieldtrip not have them by default. > > > greetings > > -- > Gamaliel Huerta > Ingeniería Civil Biomédica > Universidad de Valparaíso > _______________________________________________ > 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 linkgoron at gmail.com Fri Sep 26 20:24:34 2014 From: linkgoron at gmail.com (Nitzan Uziely) Date: Fri, 26 Sep 2014 21:24:34 +0300 Subject: [FieldTrip] Fwd: Using Akaike Information Criterion for order selection with ft_mvaranalysis In-Reply-To: References: Message-ID: Hi, My name is Nitzan Uziely, and I'm a student (under-grad) at the Hebrew University of Jerusalem. I'm using fieldtrip to process EEG signals at our lab, and I'm trying to run a PDC analysis on my data. I took the data, calculated the inverse-solution and segmented it into virtual channels using the AAL atlas. I'm trying to to calculate the correct order for the ft_mvaranalysis function. I've seen a previous question that went unanswered a few years ago about order selection ( http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003947.html). Following the above question, I searched how to calculate the Akaike Information Criterion (AIC) to calculate the correct model order. According to http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ I need to calculate the determinant of the noise covariance matrix, however the determinant (I've checked orders 1 to 10) is so small that matlab just rounds it to zero. This makes me feel that either I have a problem, I've misunderstood how to calculate AIC to select the correct model, or that AIC is not the correct way to go. So, my question is - does it seem that is something wrong with my data (which can be seen by the small determinant), am I misunderstanding the requirement of the determinant or is there a better way to select the order of the mvar model. (oh, I'm using mdcfg.toolbox = 'bsmart'; if it matters) Thanks, Nitzan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Sat Sep 27 02:42:21 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Fri, 26 Sep 2014 14:42:21 -1000 Subject: [FieldTrip] Where to add a trialfun? Message-ID: Hello all! I'm having a simple problem. I want to add this trialfun: http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun I get this error: Reference to non-existent field 'trialdef'. Error in trialfun_bit2dec (line 52) if strcmp(event(i).type, cfg.trialdef.eventtype) I'm quite sure it's because I'm not writing it in the correct part of my script. This is my trial definition part. Where should I add it and how should I write the line? % TRIAL DEFINITION cfg=[]; cfg.filename = ['my/folders/', subject, '.RAW']; cfg.headerfile = ['my/folders/', subject, '.RAW']; cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = cgrmrk; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 1; cfg.trialdef.eventtype=?; cfg = definetrial(cfg); trl = cfg.trl; cfg=[]; cfg.dataset = ['my/folders/', subject, '.RAW']; cfg.trl = trl; cfg.reref = 'yes'; cfg.refchannel = ['all']; THANKS! -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Sat Sep 27 11:05:40 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Sat, 27 Sep 2014 11:05:40 +0200 (CEST) Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: Message-ID: <1456425059.1815959.1411808740191.JavaMail.root@indus.zimbra.ru.nl> Hi Ana Laura, In general, you need to determine which trial function (Trialfun) to use when using definetrial (see this tutorial: http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the trial definition for the fully incongruent (FIC) condition). Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to your code before calling definetrial (see below). % TRIAL DEFINITION cfg=[]; cfg.filename = ['my/folders/', subject, '.RAW']; cfg.headerfile = ['my/folders/', subject, '.RAW']; cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = cgrmrk; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 1; cfg.trialdef.eventtype=?; cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition cfg = definetrial(cfg); As an addition note: based on your error message, it seemed that the problem was in the function trialfun_bit2dec. However, from the code you showed us, you haven't referenced/called this function. I was wondering if the code you provide corresponded to the code that created your error message? I'm guessing you ran [trl] =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which case, it was looking for cfg.trialdef.eventtype. You can call trialfun_bit2dec as long as you have all the relevant information in the cfg (which is in the code you showed us). Hope this helps. Best, Nietzsche ----- Original Message ----- > From: "Ana Laura Diez Martini" > To: "FieldTrip discussion list" > Sent: Saturday, 27 September, 2014 2:42:21 AM > Subject: [FieldTrip] Where to add a trialfun? > Hello all! I'm having a simple problem. I want to add this trialfun: > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > I get this error: > > > > Reference to non-existent field 'trialdef'. > > > Error in trialfun_bit2dec (line 52) > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > I'm quite sure it's because I'm not writing it in the correct part of > my script. This is my trial definition part. Where should I add it and > how should I write the line? > > > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['my/folders/', subject, '.RAW']; > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > cfg.trialdef.eventtype=?; > > > cfg = definetrial(cfg); > > > trl = cfg.trl; > cfg=[]; > cfg.dataset = ['my/folders/', subject, '.RAW']; > cfg.trl = trl; > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > > > THANKS! > _______________________________________________ > 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 matt.gerhold at gmail.com Sat Sep 27 12:52:50 2014 From: matt.gerhold at gmail.com (Matt Gerhold) Date: Sat, 27 Sep 2014 12:52:50 +0200 Subject: [FieldTrip] Taper Function MVAR Model Fit Message-ID: Hi, I have a question(s) regarding the MVAR model fitting routine in FieldTrip. I haven't had enough time outside of my current commitments to scan through the MATLAB code when fitting the model. I hope to do so at some point. Given my time constraints, I wonder if it will be possible for you to answer one or two questions regarding the treatment of the data prior to model fitting? Is it necessary to apply a taper function such as a hamming window prior to fitting the model? I've gone through a few papers and no authors have explicitly mentioned it in the context of EEG and EMG/EEG MVAR modelling. How does the FieldTrip routine execute in default mode with regards to a taper function in the MVAR routine? What would you recommend as authors of the code and as experienced practitioners of the method(s)? Many Thanks, Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Sat Sep 27 19:18:25 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Sat, 27 Sep 2014 07:18:25 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: <1456425059.1815959.1411808740191.JavaMail.root@indus.zimbra.ru.nl> References: <1456425059.1815959.1411808740191.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Thank you Nietzsche! I added it where you suggested and now this is the error I get: Error using feval Invalid function name 'trialfun_bit2dec(cfg)'. Error in definetrial (line 105) trl = feval(cfg.trialfun, cfg); Error in process_ERP_1_fieldtrip (line 97) cfg = definetrial(cfg); Something I was worried about is that I use an old version of Fieldtrip for my scripts because I wrote them long ago and this trialfun uses the new format (with 'ft_s',etc.). Could this affect it in any way? Thanks again! On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche wrote: > Hi Ana Laura, > > In general, you need to determine which trial function (Trialfun) to use > when using definetrial (see this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the trial > definition for the fully incongruent (FIC) condition). > > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to your > code before calling definetrial (see below). > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['my/folders/', subject, '.RAW']; > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > cfg.trialdef.eventtype=?; > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun > definition > cfg = definetrial(cfg); > > > As an addition note: based on your error message, it seemed that the > problem was in the function trialfun_bit2dec. However, from the code you > showed us, you haven't referenced/called this function. I was wondering if > the code you provide corresponded to the code that created your error > message? I'm guessing you ran [trl] =trialfun_bit2dec(cfg) directly (i.e. > not via definetrial). In which case, it was looking for > cfg.trialdef.eventtype. You can call trialfun_bit2dec as long as you have > all the relevant information in the cfg (which is in the code you showed > us). Hope this helps. > > Best, > Nietzsche > > > > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" > > To: "FieldTrip discussion list" > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > Subject: [FieldTrip] Where to add a trialfun? > > Hello all! I'm having a simple problem. I want to add this trialfun: > > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > I get this error: > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > Error in trialfun_bit2dec (line 52) > > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > > > > I'm quite sure it's because I'm not writing it in the correct part of > > my script. This is my trial definition part. Where should I add it and > > how should I write the line? > > > > > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > > > > > cfg = definetrial(cfg); > > > > > > trl = cfg.trl; > > cfg=[]; > > cfg.dataset = ['my/folders/', subject, '.RAW']; > > cfg.trl = trl; > > cfg.reref = 'yes'; > > cfg.refchannel = ['all']; > > > > > > THANKS! > > _______________________________________________ > > 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 katrinheimann at gmail.com Sun Sep 28 11:54:54 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 28 Sep 2014 11:54:54 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point Message-ID: Dear all, I know I asked this already twice, but I did not get the right answer yet and just cannot figure it out myself. So, I did cut my data in quite large trials using ft_define trial and logging it to the beginning of a slide. cfg = []; cfg.dataset = name; cfg.trialfun = 'ft_trialfun_general'; % this is the default cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger cfg.trialdef.prestim = 0.216; % in seconds cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) cfg = ft_definetrial(cfg); % cancel out training trials cfg.trl([1:4],:) = []; %change timeline according to constant offset of 16 ms = 8 samples (because recorded with 500 hz)in %structure trial - plus delay reported by EGE = 18 ms = 9 samples cfg.trl(:,3)=cfg.trl(:,3)-17 Then I preprocessed these trials %% preprocess data cfg.channel = 'all'; cfg.preproc.detrend = 'yes'; cfg.preproc.demean = 'yes'; cfg.preproc.baselinewindow = [-0.1 0] % mov_data = ft_preprocessing(cfg); % save (strcat(sb,'mov_data') , 'mov_data') Now I wanna cut out smaller pieces that are centered around another trigger - the response of the subject. I did not use this trigger at the beginning as then defining a baselinewindow is impossible (as the response is always happening at a different time). I tried to just use ft_definetrial again, as I don't see a possibility to use ft_redefine trial: cfg = [] cfg.dataset= strcat(sb,'mov_data.mat') cfg.trialdef.eventtype = 'trigger'; cfg.trialdef.eventvalue = 'resp' cfg.trialdef.prestim = 0.75 cfg.trialdef.poststim = 0.75 mov_data_small = ft_definetrial(cfg) but I get the error message: Error using ft_read_header (line 1833) unsupported header format (matlab) Error in ft_trialfun_general (line 71) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); Error in ft_definetrial (line 169) [trl, event] = feval(cfg.trialfun, cfg); I wonder if that is as the file produced by fieldtrip during the preprocessing is not one that is specified for ft_read_header - but how do I deal with this? Thanks a lot for your help Katrin -------------- next part -------------- An HTML attachment was scrubbed... URL: From anne.urai at gmail.com Sun Sep 28 18:35:57 2014 From: anne.urai at gmail.com (Anne Urai) Date: Sun, 28 Sep 2014 18:35:57 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point In-Reply-To: References: Message-ID: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> Dear Katrin, if you use a custom trialfun (http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition) you can code the time between stimulus onset and response in an additional column. That way, you can shift the time axis of the data by this amount on each trial. For example: % redefine trials offset = (data.trialinfo(:,RTcol)); prestim = 1; poststim = 2; cfg = []; cfg.begsample = round(offset - prestim*data.fsample); cfg.endsample = round(offset + poststim*data.fsample); data = ft_redefinetrial(cfg, data); % then shift the time axis cfg = []; cfg.offset = -offset; data = ft_redefinetrial(cfg, data); % timelock cfg = []; cfg.keeptrials = 'yes'; data = ft_timelockanalysis(cfg, data); That way, your new data structure will now be response locked. Note that the timelockanalysis is optional, and only works when you have trials that are all the same length. If you do not want to use a custom trialfun, you could also rerun the same analysis as you have for the stimulus-locked data, but then taking the response code as your eventvalue. Good luck, --- Anne E. Urai, MSc PhD student | Institut für Neurophysiologie und Pathophysiologie | Universitätsklinikum Hamburg-Eppendorf Martinistrasse 52, 20246 Hamburg, Germany | http://anneurai.wordpress.com On 28 Sep 2014, at 11:54, KatrinH Heimann wrote: > Dear all, > I know I asked this already twice, but I did not get the right answer yet and just cannot figure it out myself. > So, I did cut my data in quite large trials using ft_define trial and logging it to the beginning of a slide. > > cfg = []; > cfg.dataset = name; > cfg.trialfun = 'ft_trialfun_general'; % this is the default > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger > cfg.trialdef.prestim = 0.216; % in seconds > cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) > cfg = ft_definetrial(cfg); > > % cancel out training trials > cfg.trl([1:4],:) = []; > > %change timeline according to constant offset of 16 ms = 8 samples (because recorded with 500 hz)in > %structure trial - plus delay reported by EGE = 18 ms = 9 samples > cfg.trl(:,3)=cfg.trl(:,3)-17 > > > > Then I preprocessed these trials > > %% preprocess data > cfg.channel = 'all'; > cfg.preproc.detrend = 'yes'; > cfg.preproc.demean = 'yes'; > cfg.preproc.baselinewindow = [-0.1 0] > % > mov_data = ft_preprocessing(cfg); > % > save (strcat(sb,'mov_data') , 'mov_data') > > > Now I wanna cut out smaller pieces that are centered around another trigger - the response of the subject. I did not use this trigger at the beginning as then defining a baselinewindow is impossible (as the response is always happening at a different time). > > I tried to just use ft_definetrial again, as I don't see a possibility to use ft_redefine trial: > > cfg = [] > cfg.dataset= strcat(sb,'mov_data.mat') > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'resp' > cfg.trialdef.prestim = 0.75 > cfg.trialdef.poststim = 0.75 > > mov_data_small = ft_definetrial(cfg) > > but I get the error message: > > Error using ft_read_header (line 1833) > unsupported header format (matlab) > > Error in ft_trialfun_general (line 71) > hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); > > Error in ft_definetrial (line 169) > [trl, event] = feval(cfg.trialfun, cfg); > > > I wonder if that is as the file produced by fieldtrip during the preprocessing is not one that is specified for ft_read_header - but how do I deal with this? > > Thanks a lot for your help > > Katrin > _______________________________________________ > 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 katrinheimann at gmail.com Sun Sep 28 19:02:40 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Sun, 28 Sep 2014 19:02:40 +0200 Subject: [FieldTrip] redefine trials using different trigger as zero point In-Reply-To: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> References: <792ACDCA-97E8-4771-AAC2-18A60D1F78D3@gmail.com> Message-ID: Thanks Anne! I will try that! :) Katrin 2014-09-28 18:35 GMT+02:00 Anne Urai : > Dear Katrin, > > if you use a custom trialfun ( > http://fieldtrip.fcdonders.nl/example/making_your_own_trialfun_for_conditional_trial_definition) > you can code the time between stimulus onset and response in an additional > column. That way, you can shift the time axis of the data by this amount on > each trial. For example: > > % redefine trials > offset = (data.trialinfo(:,RTcol)); > prestim = 1; > poststim = 2; > > > cfg = []; > cfg.begsample = round(offset - prestim*data.fsample); > cfg.endsample = round(offset + poststim*data.fsample); > data = ft_redefinetrial(cfg, data); > > > % then shift the time axis > cfg = []; > cfg.offset = -offset; > data = ft_redefinetrial(cfg, data); > > % timelock > cfg = []; > cfg.keeptrials = 'yes'; > data = ft_timelockanalysis(cfg, data); > > That way, your new data structure will now be response locked. Note that > the timelockanalysis is optional, and only works when you have trials that > are all the same length. > > If you do not want to use a custom trialfun, you could also rerun the same > analysis as you have for the stimulus-locked data, but then taking the > response code as your eventvalue. > > Good luck, > > --- > Anne E. Urai, MSc > PhD student | Institut für Neurophysiologie und Pathophysiologie > | Universitätsklinikum Hamburg-Eppendorf > Martinistrasse 52, 20246 Hamburg, Germany | http://anneurai.wordpress.com > > > > > > On 28 Sep 2014, at 11:54, KatrinH Heimann wrote: > > Dear all, > I know I asked this already twice, but I did not get the right answer yet > and just cannot figure it out myself. > So, I did cut my data in quite large trials using ft_define trial and > logging it to the beginning of a slide. > > cfg = []; > cfg.dataset = name; > cfg.trialfun = 'ft_trialfun_general'; % this is the default > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'ceck'; % the value of the stimulus trigger > cfg.trialdef.prestim = 0.216; % in seconds > cfg.trialdef.poststim = 7.284; % in seconds (max time of check slide) > cfg = ft_definetrial(cfg); > > > % cancel out training trials > cfg.trl([1:4],:) = []; > > > %change timeline according to constant offset of 16 ms = 8 samples > (because recorded with 500 hz)in > %structure trial - plus delay reported by EGE = 18 ms = 9 samples > cfg.trl(:,3)=cfg.trl(:,3)-17 > > > > > > Then I preprocessed these trials > > %% preprocess data > cfg.channel = 'all'; > cfg.preproc.detrend = 'yes'; > cfg.preproc.demean = 'yes'; > cfg.preproc.baselinewindow = [-0.1 0] > % > mov_data = ft_preprocessing(cfg); > % > save (strcat(sb,'mov_data') , 'mov_data') > > > > Now I wanna cut out smaller pieces that are centered around another > trigger - the response of the subject. I did not use this trigger at the > beginning as then defining a baselinewindow is impossible (as the response > is always happening at a different time). > > I tried to just use ft_definetrial again, as I don't see a possibility to > use ft_redefine trial: > > cfg = [] > cfg.dataset= strcat(sb,'mov_data.mat') > cfg.trialdef.eventtype = 'trigger'; > cfg.trialdef.eventvalue = 'resp' > cfg.trialdef.prestim = 0.75 > cfg.trialdef.poststim = 0.75 > > > mov_data_small = ft_definetrial(cfg) > > but I get the error message: > > Error using ft_read_header (line 1833) > unsupported header format (matlab) > > Error in ft_trialfun_general (line 71) > hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); > > Error in ft_definetrial (line 169) > [trl, event] = feval(cfg.trialfun, cfg); > > > > I wonder if that is as the file produced by fieldtrip during the > preprocessing is not one that is specified for ft_read_header - but how do > I deal with this? > > Thanks a lot for your help > > Katrin > _______________________________________________ > 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 n.lam at fcdonders.ru.nl Mon Sep 29 10:45:53 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Mon, 29 Sep 2014 10:45:53 +0200 (CEST) Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: Message-ID: <1618358664.1830927.1411980353708.JavaMail.root@indus.zimbra.ru.nl> Hi Ana Laura, I've now noticed that you use "definetrial(cfg)" instead of "ft_definetrial", it was probably about 5 years ago that we used "definetrial". We do maintain backward compatibility, but from what I can see "trialfun_bit2dec" was only written this year, so that is probably why "definetrial" doesn't recognize it, and you get the error message "Error using feval Invalid function name 'trialfun_bit2dec(cfg)". For a bit more background, we constantly change, and update these changes in FieldTrip, so it would be best to get the newest version of Fieldtrip, and adjust your script(s) accordingly. You also referred to "this trialfun" in your email. Both "trialfun_bit2dec" and "ft_trialfun_general" are trialfuns (trial functions). Ft_definetrial is not (strictly) a trial function. Ft_definetrial gets information from a trial function (like one of the two aforementioned, or you can custom write your own) and then segments the data accordingly. Best, Nietzsche ----- Original Message ----- > From: "Ana Laura Diez Martini" > To: "FieldTrip discussion list" > Sent: Saturday, 27 September, 2014 7:18:25 PM > Subject: Re: [FieldTrip] Where to add a trialfun? > Thank you Nietzsche! > > > I added it where you suggested and now this is the error I get: > > > > Error using feval > Invalid function name 'trialfun_bit2dec(cfg)'. > > > Error in definetrial (line 105) > trl = feval(cfg.trialfun, cfg); > > > Error in process_ERP_1_fieldtrip (line 97) > cfg = definetrial(cfg); > > > Something I was worried about is that I use an old version of > Fieldtrip for my scripts because I wrote them long ago and this > trialfun uses the new format (with 'ft_s',etc.). Could this affect it > in any way? > > > Thanks again! > > > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < > n.lam at fcdonders.ru.nl > wrote: > > > Hi Ana Laura, > > In general, you need to determine which trial function (Trialfun) to > use when using definetrial (see this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the > trial definition for the fully incongruent (FIC) condition). > > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to > your code before calling definetrial (see below). > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['my/folders/', subject, '.RAW']; > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > cfg.trialdef.eventtype=?; > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition > cfg = definetrial(cfg); > > > As an addition note: based on your error message, it seemed that the > problem was in the function trialfun_bit2dec. However, from the code > you showed us, you haven't referenced/called this function. I was > wondering if the code you provide corresponded to the code that > created your error message? I'm guessing you ran [trl] > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which > case, it was looking for cfg.trialdef.eventtype. You can call > trialfun_bit2dec as long as you have all the relevant information in > the cfg (which is in the code you showed us). Hope this helps. > > Best, > Nietzsche > > > > > > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > Subject: [FieldTrip] Where to add a trialfun? > > Hello all! I'm having a simple problem. I want to add this trialfun: > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > I get this error: > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > Error in trialfun_bit2dec (line 52) > > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > > > > I'm quite sure it's because I'm not writing it in the correct part > > of > > my script. This is my trial definition part. Where should I add it > > and > > how should I write the line? > > > > > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > > > > > cfg = definetrial(cfg); > > > > > > trl = cfg.trl; > > cfg=[]; > > cfg.dataset = ['my/folders/', subject, '.RAW']; > > cfg.trl = trl; > > cfg.reref = 'yes'; > > cfg.refchannel = ['all']; > > > > > > THANKS! > > _______________________________________________ > > 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 > > > _______________________________________________ > 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 n.lam at fcdonders.ru.nl Mon Sep 29 10:53:00 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Mon, 29 Sep 2014 10:53:00 +0200 (CEST) Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: Message-ID: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Hi again Ana Laura, One other thing that I thought of was to make sure that the function "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial can find this function. By updating your fieldtrip to the most recent version "trialfun_bit2dec" is *not* included. So you'll need to store that as a separate .m file in a location that can be accessed by the paths set in matlab. Nietzsche ----- Original Message ----- > From: "Ana Laura Diez Martini" > To: "FieldTrip discussion list" > Sent: Saturday, 27 September, 2014 7:18:25 PM > Subject: Re: [FieldTrip] Where to add a trialfun? > Thank you Nietzsche! > > > I added it where you suggested and now this is the error I get: > > > > Error using feval > Invalid function name 'trialfun_bit2dec(cfg)'. > > > Error in definetrial (line 105) > trl = feval(cfg.trialfun, cfg); > > > Error in process_ERP_1_fieldtrip (line 97) > cfg = definetrial(cfg); > > > Something I was worried about is that I use an old version of > Fieldtrip for my scripts because I wrote them long ago and this > trialfun uses the new format (with 'ft_s',etc.). Could this affect it > in any way? > > > Thanks again! > > > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < > n.lam at fcdonders.ru.nl > wrote: > > > Hi Ana Laura, > > In general, you need to determine which trial function (Trialfun) to > use when using definetrial (see this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the > trial definition for the fully incongruent (FIC) condition). > > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to > your code before calling definetrial (see below). > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['my/folders/', subject, '.RAW']; > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > cfg.trialdef.eventtype=?; > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition > cfg = definetrial(cfg); > > > As an addition note: based on your error message, it seemed that the > problem was in the function trialfun_bit2dec. However, from the code > you showed us, you haven't referenced/called this function. I was > wondering if the code you provide corresponded to the code that > created your error message? I'm guessing you ran [trl] > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which > case, it was looking for cfg.trialdef.eventtype. You can call > trialfun_bit2dec as long as you have all the relevant information in > the cfg (which is in the code you showed us). Hope this helps. > > Best, > Nietzsche > > > > > > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > Subject: [FieldTrip] Where to add a trialfun? > > Hello all! I'm having a simple problem. I want to add this trialfun: > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > I get this error: > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > Error in trialfun_bit2dec (line 52) > > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > > > > I'm quite sure it's because I'm not writing it in the correct part > > of > > my script. This is my trial definition part. Where should I add it > > and > > how should I write the line? > > > > > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > > > > > cfg = definetrial(cfg); > > > > > > trl = cfg.trl; > > cfg=[]; > > cfg.dataset = ['my/folders/', subject, '.RAW']; > > cfg.trl = trl; > > cfg.reref = 'yes'; > > cfg.refchannel = ['all']; > > > > > > THANKS! > > _______________________________________________ > > 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 > > > _______________________________________________ > 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 linkgoron at gmail.com Mon Sep 29 11:46:38 2014 From: linkgoron at gmail.com (Nitzan Uziely) Date: Mon, 29 Sep 2014 12:46:38 +0300 Subject: [FieldTrip] Using Akaike Information Criterion for order selection with ft_mvaranalysis In-Reply-To: References: Message-ID: Hi again, Just to clarify the above, here is the code that I use to calculate the AIC: "source" is my inverse-solution after being partitioned into virtual channels using the AAL atlas. % mvar analysis. cfg = []; cfg.order = order; cfg.toolbox = 'bsmart'; mdata = ft_mvaranalysis(cfg, source); % aic calculation: www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ k = size(source.label,1); p = cfg.order; logv = log(det(mdata.noisecov)); % this gives me inf, as det(mdata.noisecov) is 0. % look at source nTotal = size(source.time,2)*length(source.time{1}); aic = -logv + 2*p*(k^2)/nTotal; disp(strcat(['order:' num2str(order) ', aic:',num2str(aic)])); Any ideas would be greatly appreciated! Best, Nitzan On Fri, Sep 26, 2014 at 9:24 PM, Nitzan Uziely wrote: > Hi, > > My name is Nitzan Uziely, and I'm a student (under-grad) at the Hebrew > University of Jerusalem. > > I'm using fieldtrip to process EEG signals at our lab, and I'm trying to > run a PDC analysis on my data. > > I took the data, calculated the inverse-solution and segmented it into > virtual channels using the AAL atlas. > > I'm trying to to calculate the correct order for the ft_mvaranalysis > function. > I've seen a previous question that went unanswered a few years ago about > order selection ( > http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003947.html). > > Following the above question, I searched how to calculate the Akaike > Information Criterion (AIC) to calculate the correct model order. According > to http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ I need to > calculate the determinant of the noise covariance matrix, however the > determinant (I've checked orders 1 to 10) is so small that matlab just > rounds it to zero. This makes me feel that either I have a problem, I've > misunderstood how to calculate AIC to select the correct model, or that AIC > is not the correct way to go. > > So, my question is - does it seem that is something wrong with my data > (which can be seen by the small determinant), am I misunderstanding the > requirement of the determinant or is there a better way to select the order > of the mvar model. (oh, I'm using mdcfg.toolbox = 'bsmart'; if it matters) > > Thanks, > > Nitzan. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Mon Sep 29 12:18:20 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Mon, 29 Sep 2014 12:18:20 +0200 Subject: [FieldTrip] Using Akaike Information Criterion for order selection with ft_mvaranalysis In-Reply-To: References: Message-ID: A determinant of 0 to me suggests that your data is rank deficient, which suggests the number of virtual channels is larger than the number of original observations. Best, Jan-Mathijs On Sep 29, 2014, at 11:46 AM, Nitzan Uziely wrote: > Hi again, > > Just to clarify the above, here is the code that I use to calculate the AIC: > "source" is my inverse-solution after being partitioned into virtual channels using the AAL atlas. > > % mvar analysis. > cfg = []; > cfg.order = order; > cfg.toolbox = 'bsmart'; > mdata = ft_mvaranalysis(cfg, source); > > % aic calculation: www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ > k = size(source.label,1); > p = cfg.order; > logv = log(det(mdata.noisecov)); % this gives me inf, as det(mdata.noisecov) is 0. > > % look at source > nTotal = size(source.time,2)*length(source.time{1}); > aic = -logv + 2*p*(k^2)/nTotal; > disp(strcat(['order:' num2str(order) ', aic:',num2str(aic)])); > > Any ideas would be greatly appreciated! > Best, > > Nitzan > > On Fri, Sep 26, 2014 at 9:24 PM, Nitzan Uziely wrote: > Hi, > > My name is Nitzan Uziely, and I'm a student (under-grad) at the Hebrew University of Jerusalem. > > I'm using fieldtrip to process EEG signals at our lab, and I'm trying to run a PDC analysis on my data. > > I took the data, calculated the inverse-solution and segmented it into virtual channels using the AAL atlas. > > I'm trying to to calculate the correct order for the ft_mvaranalysis function. > I've seen a previous question that went unanswered a few years ago about order selection (http://mailman.science.ru.nl/pipermail/fieldtrip/2011-June/003947.html). > > Following the above question, I searched how to calculate the Akaike Information Criterion (AIC) to calculate the correct model order. According to http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2585694/ I need to calculate the determinant of the noise covariance matrix, however the determinant (I've checked orders 1 to 10) is so small that matlab just rounds it to zero. This makes me feel that either I have a problem, I've misunderstood how to calculate AIC to select the correct model, or that AIC is not the correct way to go. > > So, my question is - does it seem that is something wrong with my data (which can be seen by the small determinant), am I misunderstanding the requirement of the determinant or is there a better way to select the order of the mvar model. (oh, I'm using mdcfg.toolbox = 'bsmart'; if it matters) > > Thanks, > > Nitzan. > > _______________________________________________ > 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 dominic.nathan at gmail.com Mon Sep 29 17:04:12 2014 From: dominic.nathan at gmail.com (dominic nathan) Date: Mon, 29 Sep 2014 11:04:12 -0400 Subject: [FieldTrip] preprocessing Elekta Neuromag datasets Message-ID: Dear All, We are starting to use Fieldtrip to process our Elekta Neuromag data and were wondering if anyone has some scripts that we could follow for standard preprocessing. One of the main challenges that we face is how to combine both the gradiometers and magnetometers for the preprocessing. Thank you. dominic From diezmartini at gmail.com Mon Sep 29 19:00:26 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Mon, 29 Sep 2014 07:00:26 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Thank you again Nietzsche!! Yes, I was referring to trialfun_bit2dec. I followed your advice and I changed definetrial to ft_definetrial and I confirm the function was added to my paths. After doing this, the error I get is: Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. Error in trialfun_bit2dec (line 66) idx = any(diff(trl(:,1),1,1),2); Error in ft_definetrial (line 169) trl = feval(cfg.trialfun, cfg); Error in process_ERP_1_fieldtrip (line 95) cfg = ft_definetrial(cfg); This is again the trial definition part in which I think I added what I think are useless lines but I was just trying to make it run it. % TRIAL DEFINITION cfg=[]; cfg.filename = ['myfolders/subject.RAW']; cfg.headerfile = ['myfolders/subject.RAW']; cfg.dataset = ['myfolders/subject.RAW']; cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers cfg.trialdef.prestim = 0.2; % latency in seconds cfg.trialdef.poststim = 1; % latency in seconds cfg = ft_definetrial(cfg); trl = cfg.trl; cfg=[]; cfg.dataset = ['myfolders/subject.RAW']; cfg.trl = trl; cfg.reref = 'yes'; cfg.refchannel = ['all']; Unfortunately using this function is crucial to my analysis because I would like to use only Fieldtrip to analyse all my data. Thank you for taking all this time. On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche wrote: > Hi again Ana Laura, > > One other thing that I thought of was to make sure that the function > "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial > can find this function. > > By updating your fieldtrip to the most recent version "trialfun_bit2dec" > is *not* included. So you'll need to store that as a separate .m file in a > location that can be accessed by the paths set in matlab. > > Nietzsche > > ----- Original Message ----- > > From: "Ana Laura Diez Martini" > > To: "FieldTrip discussion list" > > Sent: Saturday, 27 September, 2014 7:18:25 PM > > Subject: Re: [FieldTrip] Where to add a trialfun? > > Thank you Nietzsche! > > > > > > I added it where you suggested and now this is the error I get: > > > > > > > > Error using feval > > Invalid function name 'trialfun_bit2dec(cfg)'. > > > > > > Error in definetrial (line 105) > > trl = feval(cfg.trialfun, cfg); > > > > > > Error in process_ERP_1_fieldtrip (line 97) > > cfg = definetrial(cfg); > > > > > > Something I was worried about is that I use an old version of > > Fieldtrip for my scripts because I wrote them long ago and this > > trialfun uses the new format (with 'ft_s',etc.). Could this affect it > > in any way? > > > > > > Thanks again! > > > > > > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < > > n.lam at fcdonders.ru.nl > wrote: > > > > > > Hi Ana Laura, > > > > In general, you need to determine which trial function (Trialfun) to > > use when using definetrial (see this tutorial: > > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the > > trial definition for the fully incongruent (FIC) condition). > > > > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to > > your code before calling definetrial (see below). > > > > % TRIAL DEFINITION > > cfg=[]; > > cfg.filename = ['my/folders/', subject, '.RAW']; > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.trialdef.eventvalue = cgrmrk; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 1; > > cfg.trialdef.eventtype=?; > > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition > > cfg = definetrial(cfg); > > > > > > As an addition note: based on your error message, it seemed that the > > problem was in the function trialfun_bit2dec. However, from the code > > you showed us, you haven't referenced/called this function. I was > > wondering if the code you provide corresponded to the code that > > created your error message? I'm guessing you ran [trl] > > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which > > case, it was looking for cfg.trialdef.eventtype. You can call > > trialfun_bit2dec as long as you have all the relevant information in > > the cfg (which is in the code you showed us). Hope this helps. > > > > Best, > > Nietzsche > > > > > > > > > > > > > > ----- Original Message ----- > > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > > Sent: Saturday, 27 September, 2014 2:42:21 AM > > > Subject: [FieldTrip] Where to add a trialfun? > > > Hello all! I'm having a simple problem. I want to add this trialfun: > > > > > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun > > > > > > > > > > > > I get this error: > > > > > > > > > > > > Reference to non-existent field 'trialdef'. > > > > > > > > > Error in trialfun_bit2dec (line 52) > > > if strcmp(event(i).type, cfg.trialdef.eventtype) > > > > > > > > > I'm quite sure it's because I'm not writing it in the correct part > > > of > > > my script. This is my trial definition part. Where should I add it > > > and > > > how should I write the line? > > > > > > > > > > > > % TRIAL DEFINITION > > > cfg=[]; > > > cfg.filename = ['my/folders/', subject, '.RAW']; > > > cfg.headerfile = ['my/folders/', subject, '.RAW']; > > > > > > > > > cfg.trialdef.eventtype = 'STATUS'; > > > cfg.trialdef.eventvalue = cgrmrk; > > > cfg.trialdef.prestim = 0.2; > > > cfg.trialdef.poststim = 1; > > > cfg.trialdef.eventtype=?; > > > > > > > > > cfg = definetrial(cfg); > > > > > > > > > trl = cfg.trl; > > > cfg=[]; > > > cfg.dataset = ['my/folders/', subject, '.RAW']; > > > cfg.trl = trl; > > > cfg.reref = 'yes'; > > > cfg.refchannel = ['all']; > > > > > > > > > THANKS! > > > _______________________________________________ > > > 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 > > > > > > _______________________________________________ > > 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 a.stolk8 at gmail.com Mon Sep 29 20:57:40 2014 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Mon, 29 Sep 2014 20:57:40 +0200 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Hey Ana Laura, Seems from the error message you're getting "Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]." that none of the triggers were found in your event data. You might wanna check why this is happening, by debugging 'trialfun_bit2dec' on your input. Best, Arjen 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini : > Thank you again Nietzsche!! > > Yes, I was referring to trialfun_bit2dec. I followed your advice and I > changed definetrial to ft_definetrial and I confirm the function was added > to my paths. After doing this, the error I get is: > > Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > Error in process_ERP_1_fieldtrip (line 95) > cfg = ft_definetrial(cfg); > > This is again the trial definition part in which I think I added what I > think are useless lines but I was just trying to make it run it. > > % TRIAL DEFINITION > cfg=[]; > cfg.filename = ['myfolders/subject.RAW']; > cfg.headerfile = ['myfolders/subject.RAW']; > cfg.dataset = ['myfolders/subject.RAW']; > cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers > cfg.trialdef.prestim = 0.2; % latency in seconds > cfg.trialdef.poststim = 1; % latency in seconds > cfg = ft_definetrial(cfg); > > trl = cfg.trl; > cfg=[]; > cfg.dataset = ['myfolders/subject.RAW']; > cfg.trl = trl; > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > > Unfortunately using this function is crucial to my analysis because I > would like to use only Fieldtrip to analyse all my data. Thank you for > taking all this time. > > On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche > wrote: > >> Hi again Ana Laura, >> >> One other thing that I thought of was to make sure that the function >> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >> can find this function. >> >> By updating your fieldtrip to the most recent version "trialfun_bit2dec" >> is *not* included. So you'll need to store that as a separate .m file in a >> location that can be accessed by the paths set in matlab. >> >> Nietzsche >> >> ----- Original Message ----- >> > From: "Ana Laura Diez Martini" >> > To: "FieldTrip discussion list" >> > Sent: Saturday, 27 September, 2014 7:18:25 PM >> > Subject: Re: [FieldTrip] Where to add a trialfun? >> > Thank you Nietzsche! >> > >> > >> > I added it where you suggested and now this is the error I get: >> > >> > >> > >> > Error using feval >> > Invalid function name 'trialfun_bit2dec(cfg)'. >> > >> > >> > Error in definetrial (line 105) >> > trl = feval(cfg.trialfun, cfg); >> > >> > >> > Error in process_ERP_1_fieldtrip (line 97) >> > cfg = definetrial(cfg); >> > >> > >> > Something I was worried about is that I use an old version of >> > Fieldtrip for my scripts because I wrote them long ago and this >> > trialfun uses the new format (with 'ft_s',etc.). Could this affect it >> > in any way? >> > >> > >> > Thanks again! >> > >> > >> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >> > n.lam at fcdonders.ru.nl > wrote: >> > >> > >> > Hi Ana Laura, >> > >> > In general, you need to determine which trial function (Trialfun) to >> > use when using definetrial (see this tutorial: >> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >> > trial definition for the fully incongruent (FIC) condition). >> > >> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >> > your code before calling definetrial (see below). >> > >> > % TRIAL DEFINITION >> > cfg=[]; >> > cfg.filename = ['my/folders/', subject, '.RAW']; >> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >> > >> > cfg.trialdef.eventtype = 'STATUS'; >> > cfg.trialdef.eventvalue = cgrmrk; >> > cfg.trialdef.prestim = 0.2; >> > cfg.trialdef.poststim = 1; >> > cfg.trialdef.eventtype=?; >> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >> > cfg = definetrial(cfg); >> > >> > >> > As an addition note: based on your error message, it seemed that the >> > problem was in the function trialfun_bit2dec. However, from the code >> > you showed us, you haven't referenced/called this function. I was >> > wondering if the code you provide corresponded to the code that >> > created your error message? I'm guessing you ran [trl] >> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >> > case, it was looking for cfg.trialdef.eventtype. You can call >> > trialfun_bit2dec as long as you have all the relevant information in >> > the cfg (which is in the code you showed us). Hope this helps. >> > >> > Best, >> > Nietzsche >> > >> > >> > >> > >> > >> > >> > ----- Original Message ----- >> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >> > > Subject: [FieldTrip] Where to add a trialfun? >> > > Hello all! I'm having a simple problem. I want to add this trialfun: >> > > >> > > >> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >> > > >> > > >> > > >> > > I get this error: >> > > >> > > >> > > >> > > Reference to non-existent field 'trialdef'. >> > > >> > > >> > > Error in trialfun_bit2dec (line 52) >> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >> > > >> > > >> > > I'm quite sure it's because I'm not writing it in the correct part >> > > of >> > > my script. This is my trial definition part. Where should I add it >> > > and >> > > how should I write the line? >> > > >> > > >> > > >> > > % TRIAL DEFINITION >> > > cfg=[]; >> > > cfg.filename = ['my/folders/', subject, '.RAW']; >> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >> > > >> > > >> > > cfg.trialdef.eventtype = 'STATUS'; >> > > cfg.trialdef.eventvalue = cgrmrk; >> > > cfg.trialdef.prestim = 0.2; >> > > cfg.trialdef.poststim = 1; >> > > cfg.trialdef.eventtype=?; >> > > >> > > >> > > cfg = definetrial(cfg); >> > > >> > > >> > > trl = cfg.trl; >> > > cfg=[]; >> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >> > > cfg.trl = trl; >> > > cfg.reref = 'yes'; >> > > cfg.refchannel = ['all']; >> > > >> > > >> > > THANKS! >> > > _______________________________________________ >> > > 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 >> > >> > >> > _______________________________________________ >> > 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 >> > > > _______________________________________________ > 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 e.maris at psych.ru.nl Mon Sep 29 21:12:33 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Mon, 29 Sep 2014 21:12:33 +0200 (CEST) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: References: Message-ID: <006b01cfdc19$4dfccce0$e9f666a0$@maris@psych.ru.nl> Hi Steve, Have a look here: http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests Best, Eric Maris From: Stephen Politzer-Ahles [mailto:spa268 at nyu.edu] Sent: woensdag 24 september 2014 11:18 To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Hi Eelke, Thanks for this information. I just wanted to jump in and ask: what about for interactions in a mixed 2x2 design? For example, say I expect a difference between conditions A and B for group 1, but not group 2. Would the correct way to do this be to 1) make difference waves (A-B) for each participant, then 2) do a between-UO test on the difference waves using indepsamplesT? In the past I have always tested within-UO interactions using basically this method (based on http://mailman.science.ru.nl/pipermail/fieldtrip/2011-January/003447.html), but I was under the impression that this is not OK for mixed designs (from this post: http://mailman.science.ru.nl/pipermail/fieldtrip/2011-September/004244.html) Thanks, Steve > > ------------------------------ > > Message: 12 > Date: Wed, 24 Sep 2014 07:59:31 +0200 > From: Eelke Spaak > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > Message-ID: > > > > > Content-Type: text/plain; charset=UTF-8 > > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > wrote: > > Hello, > > > > So far, the tutorial on "Cluster-based permutation tests on > > time-frequency > > data" has been very helpful. > > > > Out of the four combinations from the two UO-types (subjects and trials) > > and > > the two experimental designs (between- and within-UO), the tutorial > > covers > > statistics on data in two conditions in a between-trials, in a > > within-trials > > and in a within-subjects design. However, I am wondering if there is any > > information about the fourth type of experiment design: > > between-subjects. > > > > I have data for 2 groups with 12 subjects in each group. Both groups are > > measured during 11 conditions. > > Can I approach this in a similar fashion to within-subjects design > > (multiple > > subjects in multiple experimental conditions), such that my design is > > multiple groups in multiple experimental conditions. Is it a case of > > first > > averaging over all trials belonging to each of the experimental > > conditions > > for each subject (as instructed in tutorial), and then averaging over > > all > > subjects in each group? > > > > Configuration code for setting up the design currently looks like this; > > grp = 2; > > subj = 11; > > design = zeros(2, subj*grp); > > > > for i = 1:grp > > design(1,i:2:end) = i; > > end > > > > idx = 1; > > for i = 1:subj > > design(2,idx:idx+1) = i; > > idx = idx+2; > > end > > > > Is there anything else I need to take into consideration when doing > > these > > statistics? > > > > Thank you, > > Dr Dylan DeLosAngeles > > Research Fellow > > Brain Signal Laboratory > > Flinders University > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > All the forward modelling in FieldTrip is based on a user-specified > MRI (preferably an individual one, but can be a template brain if an > individual MRI is not available). You probably will want to have a > look at this tutorial: > http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.whitmarsh at gmail.com Mon Sep 29 22:38:58 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Mon, 29 Sep 2014 22:38:58 +0200 Subject: [FieldTrip] preprocessing Elekta Neuromag datasets In-Reply-To: References: Message-ID: Dear Dominic, We have just started a week-long FieldTrip/invited lectures workshop, that we have optimized for our Neuromag system, and specifically for combined EEG and MEG recordings. We are also recording the lectures and creating wiki tutorials. In short - in a couple of weeks you can expect a lot of material coming online. I'll make sure to announce it on the mailinglist. This week will be too busy, but I keep an eye out for your (and other Neuromag users) questions. Good luck! Stephen On 29 September 2014 17:04, dominic nathan wrote: > Dear All, > > We are starting to use Fieldtrip to process our Elekta Neuromag data > and were wondering if anyone has some scripts that we could follow for > standard preprocessing. One of the main challenges that we face is how > to combine both the gradiometers and magnetometers for the > preprocessing. > > Thank you. > > dominic > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From diezmartini at gmail.com Tue Sep 30 00:11:40 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Mon, 29 Sep 2014 12:11:40 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Dear Arjen and Nietzsche, I tried debugging with dbstop if error and cfg.debug = 'saveonerror' and matlab points to: % discard the repeated values idx = any(diff(trl(:,1),1,1),2); trl = trl(idx,:); It does seem it is not reading the events. When I read them with the raw data, they seem to be there, with the DIN prefix. Any idea? On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk wrote: > Hey Ana Laura, > > Seems from the error message you're getting > > "Attempted to access trl(:,1); index out of bounds because > size(trl)=[0,0]." > > that none of the triggers were found in your event data. You might wanna > check why this is happening, by debugging 'trialfun_bit2dec' on your input. > > Best, > Arjen > > > > 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini : > >> Thank you again Nietzsche!! >> >> Yes, I was referring to trialfun_bit2dec. I followed your advice and I >> changed definetrial to ft_definetrial and I confirm the function was added >> to my paths. After doing this, the error I get is: >> >> Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> Error in process_ERP_1_fieldtrip (line 95) >> cfg = ft_definetrial(cfg); >> >> This is again the trial definition part in which I think I added what I >> think are useless lines but I was just trying to make it run it. >> >> % TRIAL DEFINITION >> cfg=[]; >> cfg.filename = ['myfolders/subject.RAW']; >> cfg.headerfile = ['myfolders/subject.RAW']; >> cfg.dataset = ['myfolders/subject.RAW']; >> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition >> cfg.trialdef.eventtype = 'STATUS'; >> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >> cfg.trialdef.prestim = 0.2; % latency in seconds >> cfg.trialdef.poststim = 1; % latency in seconds >> cfg = ft_definetrial(cfg); >> >> trl = cfg.trl; >> cfg=[]; >> cfg.dataset = ['myfolders/subject.RAW']; >> cfg.trl = trl; >> cfg.reref = 'yes'; >> cfg.refchannel = ['all']; >> >> Unfortunately using this function is crucial to my analysis because I >> would like to use only Fieldtrip to analyse all my data. Thank you for >> taking all this time. >> >> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche >> wrote: >> >>> Hi again Ana Laura, >>> >>> One other thing that I thought of was to make sure that the function >>> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >>> can find this function. >>> >>> By updating your fieldtrip to the most recent version "trialfun_bit2dec" >>> is *not* included. So you'll need to store that as a separate .m file in a >>> location that can be accessed by the paths set in matlab. >>> >>> Nietzsche >>> >>> ----- Original Message ----- >>> > From: "Ana Laura Diez Martini" >>> > To: "FieldTrip discussion list" >>> > Sent: Saturday, 27 September, 2014 7:18:25 PM >>> > Subject: Re: [FieldTrip] Where to add a trialfun? >>> > Thank you Nietzsche! >>> > >>> > >>> > I added it where you suggested and now this is the error I get: >>> > >>> > >>> > >>> > Error using feval >>> > Invalid function name 'trialfun_bit2dec(cfg)'. >>> > >>> > >>> > Error in definetrial (line 105) >>> > trl = feval(cfg.trialfun, cfg); >>> > >>> > >>> > Error in process_ERP_1_fieldtrip (line 97) >>> > cfg = definetrial(cfg); >>> > >>> > >>> > Something I was worried about is that I use an old version of >>> > Fieldtrip for my scripts because I wrote them long ago and this >>> > trialfun uses the new format (with 'ft_s',etc.). Could this affect it >>> > in any way? >>> > >>> > >>> > Thanks again! >>> > >>> > >>> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >>> > n.lam at fcdonders.ru.nl > wrote: >>> > >>> > >>> > Hi Ana Laura, >>> > >>> > In general, you need to determine which trial function (Trialfun) to >>> > use when using definetrial (see this tutorial: >>> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >>> > trial definition for the fully incongruent (FIC) condition). >>> > >>> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >>> > your code before calling definetrial (see below). >>> > >>> > % TRIAL DEFINITION >>> > cfg=[]; >>> > cfg.filename = ['my/folders/', subject, '.RAW']; >>> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>> > >>> > cfg.trialdef.eventtype = 'STATUS'; >>> > cfg.trialdef.eventvalue = cgrmrk; >>> > cfg.trialdef.prestim = 0.2; >>> > cfg.trialdef.poststim = 1; >>> > cfg.trialdef.eventtype=?; >>> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >>> > cfg = definetrial(cfg); >>> > >>> > >>> > As an addition note: based on your error message, it seemed that the >>> > problem was in the function trialfun_bit2dec. However, from the code >>> > you showed us, you haven't referenced/called this function. I was >>> > wondering if the code you provide corresponded to the code that >>> > created your error message? I'm guessing you ran [trl] >>> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >>> > case, it was looking for cfg.trialdef.eventtype. You can call >>> > trialfun_bit2dec as long as you have all the relevant information in >>> > the cfg (which is in the code you showed us). Hope this helps. >>> > >>> > Best, >>> > Nietzsche >>> > >>> > >>> > >>> > >>> > >>> > >>> > ----- Original Message ----- >>> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >>> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >>> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >>> > > Subject: [FieldTrip] Where to add a trialfun? >>> > > Hello all! I'm having a simple problem. I want to add this trialfun: >>> > > >>> > > >>> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >>> > > >>> > > >>> > > >>> > > I get this error: >>> > > >>> > > >>> > > >>> > > Reference to non-existent field 'trialdef'. >>> > > >>> > > >>> > > Error in trialfun_bit2dec (line 52) >>> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >>> > > >>> > > >>> > > I'm quite sure it's because I'm not writing it in the correct part >>> > > of >>> > > my script. This is my trial definition part. Where should I add it >>> > > and >>> > > how should I write the line? >>> > > >>> > > >>> > > >>> > > % TRIAL DEFINITION >>> > > cfg=[]; >>> > > cfg.filename = ['my/folders/', subject, '.RAW']; >>> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>> > > >>> > > >>> > > cfg.trialdef.eventtype = 'STATUS'; >>> > > cfg.trialdef.eventvalue = cgrmrk; >>> > > cfg.trialdef.prestim = 0.2; >>> > > cfg.trialdef.poststim = 1; >>> > > cfg.trialdef.eventtype=?; >>> > > >>> > > >>> > > cfg = definetrial(cfg); >>> > > >>> > > >>> > > trl = cfg.trl; >>> > > cfg=[]; >>> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >>> > > cfg.trl = trl; >>> > > cfg.reref = 'yes'; >>> > > cfg.refchannel = ['all']; >>> > > >>> > > >>> > > THANKS! >>> > > _______________________________________________ >>> > > 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 >>> > >>> > >>> > _______________________________________________ >>> > 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 >>> >> >> >> _______________________________________________ >> 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 diezmartini at gmail.com Tue Sep 30 06:20:29 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Mon, 29 Sep 2014 18:20:29 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: This is my attempt of adapting the code for the new Fieldtrip % TRIAL DEFINITION cfg=[]; cfg.dataset = 'myfile'; hdr = ft_read_header( 'myfile'); dat = ft_read_data('myfile'); cfg.trialfun = 'trialfun_bit2dec'; cfg.trialdef.eventtype = 'STATUS'; cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 1; cfg.reref = 'yes'; cfg.refchannel = ['all']; cfg = ft_definetrial(cfg); again the error is: Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. Error in trialfun_bit2dec (line 66) idx = any(diff(trl(:,1),1,1),2); Error in ft_definetrial (line 169) trl = feval(cfg.trialfun, cfg); Error in process_ERP_1_fieldtrip (line 106) cfg = ft_definetrial(cfg); On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini < diezmartini at gmail.com> wrote: > Dear Arjen and Nietzsche, > > I tried debugging with dbstop if error and cfg.debug = 'saveonerror' and > matlab points to: > > % discard the repeated values > idx = any(diff(trl(:,1),1,1),2); > trl = trl(idx,:); > > It does seem it is not reading the events. When I read them with the raw > data, they seem to be there, with the DIN prefix. Any idea? > > On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk wrote: > >> Hey Ana Laura, >> >> Seems from the error message you're getting >> >> "Attempted to access trl(:,1); index out of bounds because >> size(trl)=[0,0]." >> >> that none of the triggers were found in your event data. You might wanna >> check why this is happening, by debugging 'trialfun_bit2dec' on your input. >> >> Best, >> Arjen >> >> >> >> 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini >> : >> >>> Thank you again Nietzsche!! >>> >>> Yes, I was referring to trialfun_bit2dec. I followed your advice and I >>> changed definetrial to ft_definetrial and I confirm the function was added >>> to my paths. After doing this, the error I get is: >>> >>> Attempted to access trl(:,1); index out of bounds because >>> size(trl)=[0,0]. >>> >>> Error in trialfun_bit2dec (line 66) >>> idx = any(diff(trl(:,1),1,1),2); >>> >>> Error in ft_definetrial (line 169) >>> trl = feval(cfg.trialfun, cfg); >>> >>> Error in process_ERP_1_fieldtrip (line 95) >>> cfg = ft_definetrial(cfg); >>> >>> This is again the trial definition part in which I think I added what I >>> think are useless lines but I was just trying to make it run it. >>> >>> % TRIAL DEFINITION >>> cfg=[]; >>> cfg.filename = ['myfolders/subject.RAW']; >>> cfg.headerfile = ['myfolders/subject.RAW']; >>> cfg.dataset = ['myfolders/subject.RAW']; >>> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition >>> cfg.trialdef.eventtype = 'STATUS'; >>> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >>> cfg.trialdef.prestim = 0.2; % latency in seconds >>> cfg.trialdef.poststim = 1; % latency in seconds >>> cfg = ft_definetrial(cfg); >>> >>> trl = cfg.trl; >>> cfg=[]; >>> cfg.dataset = ['myfolders/subject.RAW']; >>> cfg.trl = trl; >>> cfg.reref = 'yes'; >>> cfg.refchannel = ['all']; >>> >>> Unfortunately using this function is crucial to my analysis because I >>> would like to use only Fieldtrip to analyse all my data. Thank you for >>> taking all this time. >>> >>> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche >>> wrote: >>> >>>> Hi again Ana Laura, >>>> >>>> One other thing that I thought of was to make sure that the function >>>> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >>>> can find this function. >>>> >>>> By updating your fieldtrip to the most recent version >>>> "trialfun_bit2dec" is *not* included. So you'll need to store that as a >>>> separate .m file in a location that can be accessed by the paths set in >>>> matlab. >>>> >>>> Nietzsche >>>> >>>> ----- Original Message ----- >>>> > From: "Ana Laura Diez Martini" >>>> > To: "FieldTrip discussion list" >>>> > Sent: Saturday, 27 September, 2014 7:18:25 PM >>>> > Subject: Re: [FieldTrip] Where to add a trialfun? >>>> > Thank you Nietzsche! >>>> > >>>> > >>>> > I added it where you suggested and now this is the error I get: >>>> > >>>> > >>>> > >>>> > Error using feval >>>> > Invalid function name 'trialfun_bit2dec(cfg)'. >>>> > >>>> > >>>> > Error in definetrial (line 105) >>>> > trl = feval(cfg.trialfun, cfg); >>>> > >>>> > >>>> > Error in process_ERP_1_fieldtrip (line 97) >>>> > cfg = definetrial(cfg); >>>> > >>>> > >>>> > Something I was worried about is that I use an old version of >>>> > Fieldtrip for my scripts because I wrote them long ago and this >>>> > trialfun uses the new format (with 'ft_s',etc.). Could this affect it >>>> > in any way? >>>> > >>>> > >>>> > Thanks again! >>>> > >>>> > >>>> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >>>> > n.lam at fcdonders.ru.nl > wrote: >>>> > >>>> > >>>> > Hi Ana Laura, >>>> > >>>> > In general, you need to determine which trial function (Trialfun) to >>>> > use when using definetrial (see this tutorial: >>>> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >>>> > trial definition for the fully incongruent (FIC) condition). >>>> > >>>> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >>>> > your code before calling definetrial (see below). >>>> > >>>> > % TRIAL DEFINITION >>>> > cfg=[]; >>>> > cfg.filename = ['my/folders/', subject, '.RAW']; >>>> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>> > >>>> > cfg.trialdef.eventtype = 'STATUS'; >>>> > cfg.trialdef.eventvalue = cgrmrk; >>>> > cfg.trialdef.prestim = 0.2; >>>> > cfg.trialdef.poststim = 1; >>>> > cfg.trialdef.eventtype=?; >>>> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >>>> > cfg = definetrial(cfg); >>>> > >>>> > >>>> > As an addition note: based on your error message, it seemed that the >>>> > problem was in the function trialfun_bit2dec. However, from the code >>>> > you showed us, you haven't referenced/called this function. I was >>>> > wondering if the code you provide corresponded to the code that >>>> > created your error message? I'm guessing you ran [trl] >>>> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >>>> > case, it was looking for cfg.trialdef.eventtype. You can call >>>> > trialfun_bit2dec as long as you have all the relevant information in >>>> > the cfg (which is in the code you showed us). Hope this helps. >>>> > >>>> > Best, >>>> > Nietzsche >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > ----- Original Message ----- >>>> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >>>> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >>>> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >>>> > > Subject: [FieldTrip] Where to add a trialfun? >>>> > > Hello all! I'm having a simple problem. I want to add this trialfun: >>>> > > >>>> > > >>>> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >>>> > > >>>> > > >>>> > > >>>> > > I get this error: >>>> > > >>>> > > >>>> > > >>>> > > Reference to non-existent field 'trialdef'. >>>> > > >>>> > > >>>> > > Error in trialfun_bit2dec (line 52) >>>> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >>>> > > >>>> > > >>>> > > I'm quite sure it's because I'm not writing it in the correct part >>>> > > of >>>> > > my script. This is my trial definition part. Where should I add it >>>> > > and >>>> > > how should I write the line? >>>> > > >>>> > > >>>> > > >>>> > > % TRIAL DEFINITION >>>> > > cfg=[]; >>>> > > cfg.filename = ['my/folders/', subject, '.RAW']; >>>> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>> > > >>>> > > >>>> > > cfg.trialdef.eventtype = 'STATUS'; >>>> > > cfg.trialdef.eventvalue = cgrmrk; >>>> > > cfg.trialdef.prestim = 0.2; >>>> > > cfg.trialdef.poststim = 1; >>>> > > cfg.trialdef.eventtype=?; >>>> > > >>>> > > >>>> > > cfg = definetrial(cfg); >>>> > > >>>> > > >>>> > > trl = cfg.trl; >>>> > > cfg=[]; >>>> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >>>> > > cfg.trl = trl; >>>> > > cfg.reref = 'yes'; >>>> > > cfg.refchannel = ['all']; >>>> > > >>>> > > >>>> > > THANKS! >>>> > > _______________________________________________ >>>> > > 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 >>>> > >>>> > >>>> > _______________________________________________ >>>> > 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 >>>> >>> >>> >>> _______________________________________________ >>> 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 a.stolk8 at gmail.com Tue Sep 30 09:01:11 2014 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Tue, 30 Sep 2014 09:01:11 +0200 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Hi Ana Laura, Your 'trl' is empty, which it shouldn't be. So anytime you try to index an element in it, it will throw an error. Can you check what 'event.values' you find in your dataset? And compare those with any of the ones falling under the switch case statement? One way to do this, is to put a debug marker (red dot) at the 'end' of the first for-loop (judging from the wiki). Then check the value of event(i).value, and click the continue button to move on to the next. An alternative way is to put a debug marker after event = ft_read_event and to instantly check all values of event with "[event(:).value]". Goodluck, Arjen 2014-09-30 6:20 GMT+02:00 Ana Laura Diez Martini : > This is my attempt of adapting the code for the new Fieldtrip > > % TRIAL DEFINITION > > cfg=[]; > cfg.dataset = 'myfile'; > > hdr = ft_read_header( 'myfile'); > dat = ft_read_data('myfile'); > cfg.trialfun = 'trialfun_bit2dec'; > cfg.trialdef.eventtype = 'STATUS'; > cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 1; > > cfg.reref = 'yes'; > cfg.refchannel = ['all']; > cfg = ft_definetrial(cfg); > > again the error is: > > Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. > > Error in trialfun_bit2dec (line 66) > idx = any(diff(trl(:,1),1,1),2); > > Error in ft_definetrial (line 169) > trl = feval(cfg.trialfun, cfg); > > Error in process_ERP_1_fieldtrip (line 106) > cfg = ft_definetrial(cfg); > > > > On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini < > diezmartini at gmail.com> wrote: > >> Dear Arjen and Nietzsche, >> >> I tried debugging with dbstop if error and cfg.debug = 'saveonerror' and >> matlab points to: >> >> % discard the repeated values >> idx = any(diff(trl(:,1),1,1),2); >> trl = trl(idx,:); >> >> It does seem it is not reading the events. When I read them with the raw >> data, they seem to be there, with the DIN prefix. Any idea? >> >> On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk wrote: >> >>> Hey Ana Laura, >>> >>> Seems from the error message you're getting >>> >>> "Attempted to access trl(:,1); index out of bounds because >>> size(trl)=[0,0]." >>> >>> that none of the triggers were found in your event data. You might wanna >>> check why this is happening, by debugging 'trialfun_bit2dec' on your input. >>> >>> Best, >>> Arjen >>> >>> >>> >>> 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini >> >: >>> >>>> Thank you again Nietzsche!! >>>> >>>> Yes, I was referring to trialfun_bit2dec. I followed your advice and I >>>> changed definetrial to ft_definetrial and I confirm the function was added >>>> to my paths. After doing this, the error I get is: >>>> >>>> Attempted to access trl(:,1); index out of bounds because >>>> size(trl)=[0,0]. >>>> >>>> Error in trialfun_bit2dec (line 66) >>>> idx = any(diff(trl(:,1),1,1),2); >>>> >>>> Error in ft_definetrial (line 169) >>>> trl = feval(cfg.trialfun, cfg); >>>> >>>> Error in process_ERP_1_fieldtrip (line 95) >>>> cfg = ft_definetrial(cfg); >>>> >>>> This is again the trial definition part in which I think I added what I >>>> think are useless lines but I was just trying to make it run it. >>>> >>>> % TRIAL DEFINITION >>>> cfg=[]; >>>> cfg.filename = ['myfolders/subject.RAW']; >>>> cfg.headerfile = ['myfolders/subject.RAW']; >>>> cfg.dataset = ['myfolders/subject.RAW']; >>>> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition >>>> cfg.trialdef.eventtype = 'STATUS'; >>>> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >>>> cfg.trialdef.prestim = 0.2; % latency in seconds >>>> cfg.trialdef.poststim = 1; % latency in seconds >>>> cfg = ft_definetrial(cfg); >>>> >>>> trl = cfg.trl; >>>> cfg=[]; >>>> cfg.dataset = ['myfolders/subject.RAW']; >>>> cfg.trl = trl; >>>> cfg.reref = 'yes'; >>>> cfg.refchannel = ['all']; >>>> >>>> Unfortunately using this function is crucial to my analysis because I >>>> would like to use only Fieldtrip to analyse all my data. Thank you for >>>> taking all this time. >>>> >>>> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche >>> > wrote: >>>> >>>>> Hi again Ana Laura, >>>>> >>>>> One other thing that I thought of was to make sure that the function >>>>> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >>>>> can find this function. >>>>> >>>>> By updating your fieldtrip to the most recent version >>>>> "trialfun_bit2dec" is *not* included. So you'll need to store that as a >>>>> separate .m file in a location that can be accessed by the paths set in >>>>> matlab. >>>>> >>>>> Nietzsche >>>>> >>>>> ----- Original Message ----- >>>>> > From: "Ana Laura Diez Martini" >>>>> > To: "FieldTrip discussion list" >>>>> > Sent: Saturday, 27 September, 2014 7:18:25 PM >>>>> > Subject: Re: [FieldTrip] Where to add a trialfun? >>>>> > Thank you Nietzsche! >>>>> > >>>>> > >>>>> > I added it where you suggested and now this is the error I get: >>>>> > >>>>> > >>>>> > >>>>> > Error using feval >>>>> > Invalid function name 'trialfun_bit2dec(cfg)'. >>>>> > >>>>> > >>>>> > Error in definetrial (line 105) >>>>> > trl = feval(cfg.trialfun, cfg); >>>>> > >>>>> > >>>>> > Error in process_ERP_1_fieldtrip (line 97) >>>>> > cfg = definetrial(cfg); >>>>> > >>>>> > >>>>> > Something I was worried about is that I use an old version of >>>>> > Fieldtrip for my scripts because I wrote them long ago and this >>>>> > trialfun uses the new format (with 'ft_s',etc.). Could this affect it >>>>> > in any way? >>>>> > >>>>> > >>>>> > Thanks again! >>>>> > >>>>> > >>>>> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >>>>> > n.lam at fcdonders.ru.nl > wrote: >>>>> > >>>>> > >>>>> > Hi Ana Laura, >>>>> > >>>>> > In general, you need to determine which trial function (Trialfun) to >>>>> > use when using definetrial (see this tutorial: >>>>> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >>>>> > trial definition for the fully incongruent (FIC) condition). >>>>> > >>>>> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >>>>> > your code before calling definetrial (see below). >>>>> > >>>>> > % TRIAL DEFINITION >>>>> > cfg=[]; >>>>> > cfg.filename = ['my/folders/', subject, '.RAW']; >>>>> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>>> > >>>>> > cfg.trialdef.eventtype = 'STATUS'; >>>>> > cfg.trialdef.eventvalue = cgrmrk; >>>>> > cfg.trialdef.prestim = 0.2; >>>>> > cfg.trialdef.poststim = 1; >>>>> > cfg.trialdef.eventtype=?; >>>>> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >>>>> > cfg = definetrial(cfg); >>>>> > >>>>> > >>>>> > As an addition note: based on your error message, it seemed that the >>>>> > problem was in the function trialfun_bit2dec. However, from the code >>>>> > you showed us, you haven't referenced/called this function. I was >>>>> > wondering if the code you provide corresponded to the code that >>>>> > created your error message? I'm guessing you ran [trl] >>>>> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >>>>> > case, it was looking for cfg.trialdef.eventtype. You can call >>>>> > trialfun_bit2dec as long as you have all the relevant information in >>>>> > the cfg (which is in the code you showed us). Hope this helps. >>>>> > >>>>> > Best, >>>>> > Nietzsche >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > ----- Original Message ----- >>>>> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >>>>> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >>>>> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >>>>> > > Subject: [FieldTrip] Where to add a trialfun? >>>>> > > Hello all! I'm having a simple problem. I want to add this >>>>> trialfun: >>>>> > > >>>>> > > >>>>> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >>>>> > > >>>>> > > >>>>> > > >>>>> > > I get this error: >>>>> > > >>>>> > > >>>>> > > >>>>> > > Reference to non-existent field 'trialdef'. >>>>> > > >>>>> > > >>>>> > > Error in trialfun_bit2dec (line 52) >>>>> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >>>>> > > >>>>> > > >>>>> > > I'm quite sure it's because I'm not writing it in the correct part >>>>> > > of >>>>> > > my script. This is my trial definition part. Where should I add it >>>>> > > and >>>>> > > how should I write the line? >>>>> > > >>>>> > > >>>>> > > >>>>> > > % TRIAL DEFINITION >>>>> > > cfg=[]; >>>>> > > cfg.filename = ['my/folders/', subject, '.RAW']; >>>>> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>>> > > >>>>> > > >>>>> > > cfg.trialdef.eventtype = 'STATUS'; >>>>> > > cfg.trialdef.eventvalue = cgrmrk; >>>>> > > cfg.trialdef.prestim = 0.2; >>>>> > > cfg.trialdef.poststim = 1; >>>>> > > cfg.trialdef.eventtype=?; >>>>> > > >>>>> > > >>>>> > > cfg = definetrial(cfg); >>>>> > > >>>>> > > >>>>> > > trl = cfg.trl; >>>>> > > cfg=[]; >>>>> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >>>>> > > cfg.trl = trl; >>>>> > > cfg.reref = 'yes'; >>>>> > > cfg.refchannel = ['all']; >>>>> > > >>>>> > > >>>>> > > THANKS! >>>>> > > _______________________________________________ >>>>> > > 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 >>>>> > >>>>> > >>>>> > _______________________________________________ >>>>> > 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 >>>>> >>>> >>>> >>>> _______________________________________________ >>>> 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: From russgport at gmail.com Tue Sep 30 16:08:39 2014 From: russgport at gmail.com (Russell G Port) Date: Tue, 30 Sep 2014 10:08:39 -0400 Subject: [FieldTrip] applying ica rejection to differently epoched data Message-ID: Hi All, I have a question, which I hope someone can help with. Currently I read in my dataset (*.ds) via standard fieldtrip commands, epoching 1 second bins for the length of the data. After proper removal of all jump and muscle artifact, I apply ICA to the resample data (now 300Hz before it was 1200Hz). This is just like fieldtrip's website suggests. Then I verify which components I want to remove via topoplots and coherence in the time domain with the ECG channels. So I now have the list of components that I think are artifact and want removed. Can these components be applied for rejection onto the same dataset, but differently parsed into epochs, now trials being centered 1 second bins around a trigger? I am trying to see if this works, because I hope if I include more data in the ICA analysis (all data in the dataset) I will get a better components since there are more trials to train the data on, rather than if I based trials around the trigger. I guess what I want to know is if I can get better estimates of my artifacts via using a larger dataset, and then apply then to the same dataset just differently epoched? Best, Russ Port -------------- next part -------------- An HTML attachment was scrubbed... URL: From diezmartini at gmail.com Tue Sep 30 22:27:25 2014 From: diezmartini at gmail.com (Ana Laura Diez Martini) Date: Tue, 30 Sep 2014 10:27:25 -1000 Subject: [FieldTrip] Where to add a trialfun? In-Reply-To: References: <586982176.1831108.1411980780568.JavaMail.root@indus.zimbra.ru.nl> Message-ID: For a more simple check, when I try to read the events without the trialfun ( so it uses ft_trialfun_general by default) I get the original event values: >> cfg = []; >> cfg.dataset = '27CW1.RAW'; >> cfg.trialdef.eventtype = '?'; >> cfg=ft_definetrial(cfg); Warning: no trialfun was specified, using ft_trialfun_general > In ft_definetrial at 135 evaluating trialfunction 'ft_trialfun_general' reading the events from '27CW1.RAW' the following events were found in the datafile event type: 'trigger' with event values: 'DIN1' 'DIN2' 'DIN4' 'DIN8' no trials have been defined yet, see FT_DEFINETRIAL for further help found 750 events created 0 trials the call to "ft_definetrial" took 4 seconds Then I try to use the trialfun, I get the same error >> cfg = []; >> cfg.dataset = '27CW1.RAW'; >> cfg.trialfun = 'trialfun_bit2dec'; >> cfg.trialdef.eventtype = '?'; >> cfg=ft_definetrial(cfg); evaluating trialfunction 'trialfun_bit2dec' Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. Error in trialfun_bit2dec (line 66) idx = any(diff(trl(:,1),1,1),2); Error in ft_definetrial (line 169) trl = feval(cfg.trialfun, cfg); So there is something the trialfun_bit2dec does that events cannot be read anymore. On Mon, Sep 29, 2014 at 9:01 PM, Arjen Stolk wrote: > Hi Ana Laura, > > Your 'trl' is empty, which it shouldn't be. So anytime you try to index an > element in it, it will throw an error. > > Can you check what 'event.values' you find in your dataset? And compare > those with any of the ones falling under the switch case statement? One way > to do this, is to put a debug marker (red dot) at the 'end' of the first > for-loop (judging from the wiki). Then check the value of event(i).value, > and click the continue button to move on to the next. An alternative way is > to put a debug marker after event = ft_read_event and to instantly check > all values of event with "[event(:).value]". > > Goodluck, > Arjen > > 2014-09-30 6:20 GMT+02:00 Ana Laura Diez Martini : > >> This is my attempt of adapting the code for the new Fieldtrip >> >> % TRIAL DEFINITION >> >> cfg=[]; >> cfg.dataset = 'myfile'; >> >> hdr = ft_read_header( 'myfile'); >> dat = ft_read_data('myfile'); >> cfg.trialfun = 'trialfun_bit2dec'; >> cfg.trialdef.eventtype = 'STATUS'; >> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >> cfg.trialdef.prestim = 0.2; >> cfg.trialdef.poststim = 1; >> >> cfg.reref = 'yes'; >> cfg.refchannel = ['all']; >> cfg = ft_definetrial(cfg); >> >> again the error is: >> >> Attempted to access trl(:,1); index out of bounds because size(trl)=[0,0]. >> >> Error in trialfun_bit2dec (line 66) >> idx = any(diff(trl(:,1),1,1),2); >> >> Error in ft_definetrial (line 169) >> trl = feval(cfg.trialfun, cfg); >> >> Error in process_ERP_1_fieldtrip (line 106) >> cfg = ft_definetrial(cfg); >> >> >> >> On Mon, Sep 29, 2014 at 12:11 PM, Ana Laura Diez Martini < >> diezmartini at gmail.com> wrote: >> >>> Dear Arjen and Nietzsche, >>> >>> I tried debugging with dbstop if error and cfg.debug = 'saveonerror' >>> and matlab points to: >>> >>> % discard the repeated values >>> idx = any(diff(trl(:,1),1,1),2); >>> trl = trl(idx,:); >>> >>> It does seem it is not reading the events. When I read them with the raw >>> data, they seem to be there, with the DIN prefix. Any idea? >>> >>> On Mon, Sep 29, 2014 at 8:57 AM, Arjen Stolk wrote: >>> >>>> Hey Ana Laura, >>>> >>>> Seems from the error message you're getting >>>> >>>> "Attempted to access trl(:,1); index out of bounds because >>>> size(trl)=[0,0]." >>>> >>>> that none of the triggers were found in your event data. You might >>>> wanna check why this is happening, by debugging 'trialfun_bit2dec' on your >>>> input. >>>> >>>> Best, >>>> Arjen >>>> >>>> >>>> >>>> 2014-09-29 19:00 GMT+02:00 Ana Laura Diez Martini < >>>> diezmartini at gmail.com>: >>>> >>>>> Thank you again Nietzsche!! >>>>> >>>>> Yes, I was referring to trialfun_bit2dec. I followed your advice and I >>>>> changed definetrial to ft_definetrial and I confirm the function was added >>>>> to my paths. After doing this, the error I get is: >>>>> >>>>> Attempted to access trl(:,1); index out of bounds because >>>>> size(trl)=[0,0]. >>>>> >>>>> Error in trialfun_bit2dec (line 66) >>>>> idx = any(diff(trl(:,1),1,1),2); >>>>> >>>>> Error in ft_definetrial (line 169) >>>>> trl = feval(cfg.trialfun, cfg); >>>>> >>>>> Error in process_ERP_1_fieldtrip (line 95) >>>>> cfg = ft_definetrial(cfg); >>>>> >>>>> This is again the trial definition part in which I think I added what >>>>> I think are useless lines but I was just trying to make it run it. >>>>> >>>>> % TRIAL DEFINITION >>>>> cfg=[]; >>>>> cfg.filename = ['myfolders/subject.RAW']; >>>>> cfg.headerfile = ['myfolders/subject.RAW']; >>>>> cfg.dataset = ['myfolders/subject.RAW']; >>>>> cfg.trialfun = 'trialfun_bit2dec'; %% trialfun definition >>>>> cfg.trialdef.eventtype = 'STATUS'; >>>>> cfg.trialdef.eventvalue = cgrmrk; % stimulus triggers >>>>> cfg.trialdef.prestim = 0.2; % latency in seconds >>>>> cfg.trialdef.poststim = 1; % latency in seconds >>>>> cfg = ft_definetrial(cfg); >>>>> >>>>> trl = cfg.trl; >>>>> cfg=[]; >>>>> cfg.dataset = ['myfolders/subject.RAW']; >>>>> cfg.trl = trl; >>>>> cfg.reref = 'yes'; >>>>> cfg.refchannel = ['all']; >>>>> >>>>> Unfortunately using this function is crucial to my analysis because I >>>>> would like to use only Fieldtrip to analyse all my data. Thank you for >>>>> taking all this time. >>>>> >>>>> On Sun, Sep 28, 2014 at 10:53 PM, Lam, Nietzsche < >>>>> n.lam at fcdonders.ru.nl> wrote: >>>>> >>>>>> Hi again Ana Laura, >>>>>> >>>>>> One other thing that I thought of was to make sure that the function >>>>>> "trialfun_bit2dec" is added to your paths in matlab, so that ft_definetrial >>>>>> can find this function. >>>>>> >>>>>> By updating your fieldtrip to the most recent version >>>>>> "trialfun_bit2dec" is *not* included. So you'll need to store that as a >>>>>> separate .m file in a location that can be accessed by the paths set in >>>>>> matlab. >>>>>> >>>>>> Nietzsche >>>>>> >>>>>> ----- Original Message ----- >>>>>> > From: "Ana Laura Diez Martini" >>>>>> > To: "FieldTrip discussion list" >>>>>> > Sent: Saturday, 27 September, 2014 7:18:25 PM >>>>>> > Subject: Re: [FieldTrip] Where to add a trialfun? >>>>>> > Thank you Nietzsche! >>>>>> > >>>>>> > >>>>>> > I added it where you suggested and now this is the error I get: >>>>>> > >>>>>> > >>>>>> > >>>>>> > Error using feval >>>>>> > Invalid function name 'trialfun_bit2dec(cfg)'. >>>>>> > >>>>>> > >>>>>> > Error in definetrial (line 105) >>>>>> > trl = feval(cfg.trialfun, cfg); >>>>>> > >>>>>> > >>>>>> > Error in process_ERP_1_fieldtrip (line 97) >>>>>> > cfg = definetrial(cfg); >>>>>> > >>>>>> > >>>>>> > Something I was worried about is that I use an old version of >>>>>> > Fieldtrip for my scripts because I wrote them long ago and this >>>>>> > trialfun uses the new format (with 'ft_s',etc.). Could this affect >>>>>> it >>>>>> > in any way? >>>>>> > >>>>>> > >>>>>> > Thanks again! >>>>>> > >>>>>> > >>>>>> > On Fri, Sep 26, 2014 at 11:05 PM, Lam, Nietzsche < >>>>>> > n.lam at fcdonders.ru.nl > wrote: >>>>>> > >>>>>> > >>>>>> > Hi Ana Laura, >>>>>> > >>>>>> > In general, you need to determine which trial function (Trialfun) to >>>>>> > use when using definetrial (see this tutorial: >>>>>> > http://fieldtrip.fcdonders.nl/tutorial/preprocessing under "do the >>>>>> > trial definition for the fully incongruent (FIC) condition). >>>>>> > >>>>>> > Please try adding this: "cfg.trialfun = 'trialfun_bit2dec(cfg)". to >>>>>> > your code before calling definetrial (see below). >>>>>> > >>>>>> > % TRIAL DEFINITION >>>>>> > cfg=[]; >>>>>> > cfg.filename = ['my/folders/', subject, '.RAW']; >>>>>> > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>>>> > >>>>>> > cfg.trialdef.eventtype = 'STATUS'; >>>>>> > cfg.trialdef.eventvalue = cgrmrk; >>>>>> > cfg.trialdef.prestim = 0.2; >>>>>> > cfg.trialdef.poststim = 1; >>>>>> > cfg.trialdef.eventtype=?; >>>>>> > cfg.trialfun = 'trialfun_bit2dec(cfg) %% trialfun definition >>>>>> > cfg = definetrial(cfg); >>>>>> > >>>>>> > >>>>>> > As an addition note: based on your error message, it seemed that the >>>>>> > problem was in the function trialfun_bit2dec. However, from the code >>>>>> > you showed us, you haven't referenced/called this function. I was >>>>>> > wondering if the code you provide corresponded to the code that >>>>>> > created your error message? I'm guessing you ran [trl] >>>>>> > =trialfun_bit2dec(cfg) directly (i.e. not via definetrial). In which >>>>>> > case, it was looking for cfg.trialdef.eventtype. You can call >>>>>> > trialfun_bit2dec as long as you have all the relevant information in >>>>>> > the cfg (which is in the code you showed us). Hope this helps. >>>>>> > >>>>>> > Best, >>>>>> > Nietzsche >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > ----- Original Message ----- >>>>>> > > From: "Ana Laura Diez Martini" < diezmartini at gmail.com > >>>>>> > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > >>>>>> > > Sent: Saturday, 27 September, 2014 2:42:21 AM >>>>>> > > Subject: [FieldTrip] Where to add a trialfun? >>>>>> > > Hello all! I'm having a simple problem. I want to add this >>>>>> trialfun: >>>>>> > > >>>>>> > > >>>>>> http://fieldtrip.fcdonders.nl/faq/how_can_i_transform_trigger_values_from_bits_to_decimal_representation_with_a_trialfun >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > I get this error: >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > Reference to non-existent field 'trialdef'. >>>>>> > > >>>>>> > > >>>>>> > > Error in trialfun_bit2dec (line 52) >>>>>> > > if strcmp(event(i).type, cfg.trialdef.eventtype) >>>>>> > > >>>>>> > > >>>>>> > > I'm quite sure it's because I'm not writing it in the correct part >>>>>> > > of >>>>>> > > my script. This is my trial definition part. Where should I add it >>>>>> > > and >>>>>> > > how should I write the line? >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > % TRIAL DEFINITION >>>>>> > > cfg=[]; >>>>>> > > cfg.filename = ['my/folders/', subject, '.RAW']; >>>>>> > > cfg.headerfile = ['my/folders/', subject, '.RAW']; >>>>>> > > >>>>>> > > >>>>>> > > cfg.trialdef.eventtype = 'STATUS'; >>>>>> > > cfg.trialdef.eventvalue = cgrmrk; >>>>>> > > cfg.trialdef.prestim = 0.2; >>>>>> > > cfg.trialdef.poststim = 1; >>>>>> > > cfg.trialdef.eventtype=?; >>>>>> > > >>>>>> > > >>>>>> > > cfg = definetrial(cfg); >>>>>> > > >>>>>> > > >>>>>> > > trl = cfg.trl; >>>>>> > > cfg=[]; >>>>>> > > cfg.dataset = ['my/folders/', subject, '.RAW']; >>>>>> > > cfg.trl = trl; >>>>>> > > cfg.reref = 'yes'; >>>>>> > > cfg.refchannel = ['all']; >>>>>> > > >>>>>> > > >>>>>> > > THANKS! >>>>>> > > _______________________________________________ >>>>>> > > 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 >>>>>> > >>>>>> > >>>>>> > _______________________________________________ >>>>>> > 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 >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> 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 >> > > > _______________________________________________ > 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 kathrin.muesch at gmail.com Tue Sep 30 22:49:08 2014 From: kathrin.muesch at gmail.com (=?iso-8859-1?Q?Kathrin_M=FCsch?=) Date: Tue, 30 Sep 2014 16:49:08 -0400 Subject: [FieldTrip] loading neuroscan cnt files - noninteger samples Message-ID: Dear All, I would like to analyze CNT files acquired with a Neuroscan Synamps2 system. I manage to correctly load it in the 32 bit data format. However, the samples for my trigger events are not integers. This shouldn’t be happening because precision cannot be higher than the sampling rate. I noticed that this only happens when the the teeg parameter that is read out of the cnt file is set to 3 but not to 2. For some of my data files the teeg=3 and for some it is 2 and then I get integer samples. The files come from the same data session so I cannot understand why they are read out differently. Has anyone experienced this before and has suggestions how this can be solved? Any help is appreciated. Best, Kathrin -- Kathrin Müsch, Ph.D. Department of Psychology University of Toronto Toronto, Canada www.honeylab.org -------------- next part -------------- An HTML attachment was scrubbed... URL: