From wibral at MPIH-FRANKFURT.MPG.DE Mon Dec 5 20:11:32 2005 From: wibral at MPIH-FRANKFURT.MPG.DE (Michael Wibral) Date: Mon, 5 Dec 2005 20:11:32 +0100 Subject: maxsum vs. maxsumt In-Reply-To: Message-ID: Hi, I just noticed that my version of clusterrandanalysis (20051127) doesn't list the teststatistic 'maxsumt' in its header or in the actual code as it is used in the tutorial (toolkit 2005). Instead there's an option (the default) 'maxsum'. Are these two the same - or is maxsum just the summed raw effect within a cluster ( and thus maybe pretty sensitive to extreme outliers), whereas maxsumt refers to summed t-scores from the initial tests performed for cluster finding? I also notice that maxsum 'always' yields more significants clusters than orderedsums, is there an explanation for this behaviour (I thought it might rather be the other way round...)? Best Regards, Michael Wibral From maris at NICI.RU.NL Mon Dec 5 22:05:00 2005 From: maris at NICI.RU.NL (Eric Maris) Date: Mon, 5 Dec 2005 22:05:00 +0100 Subject: maxsum vs. maxsumt Message-ID: Hi Michael, > I just noticed that my version of clusterrandanalysis (20051127) doesn't > list the teststatistic 'maxsumt' in its header or in the actual code as it > is used in the tutorial (toolkit 2005). Instead there's an option (the > default) 'maxsum'. Are these two the same - or is maxsum just the summed > raw effect within a cluster ( and thus maybe pretty sensitive to extreme > outliers), whereas maxsumt refers to summed t-scores from the initial > tests performed for cluster finding? The change from 'maxsumt' to 'maxsum' occured when clusterrandanalysis also supported F-statistics at the level of (sensor,frequency,time)-triplets. Using 'cfg.clusterteststat=maxsum' in combination with 'cfg.statistic=indepsamplesT' gives the same results as the 'maxsumt'-option of the older version of clusterrandanalysis. > I also notice that maxsum 'always' yields more significants clusters than > orderedsums, is there an explanation for this behaviour (I thought it > might rather be the other way round...)? I am not surprised. The behavior of 'cfg.clusterteststat=orderedsums' depends on the value assigned to 'cfg.smallestcluster'. If you give 'cfg.smallestcluster' a small value, this will reduce the sensitivity for larger clusters (larger than this small value). The option 'cfg.clusterteststat=orderedsums' will result in more significant clusters than obtained with 'cfg.clusterteststat=maxsum' if the data contain one big cluster and a number of much smaller (but systematic) clusters. These smaller clusters may become significant with 'cfg.clusterteststat=orderedsums' if their size is larger than 'cfg.smallestcluster'. The value of 'cfg.smallestcluster' should be determined independently of the data. I guess there is no need to explain why this so. greetings, Eric Maris From wibral at MPIH-FRANKFURT.MPG.DE Wed Dec 7 11:15:53 2005 From: wibral at MPIH-FRANKFURT.MPG.DE (Michael Wibral) Date: Wed, 7 Dec 2005 11:15:53 +0100 Subject: maxsum vs. maxsumt In-Reply-To: <001a01c5f9df$8e3a3610$6401a8c0@fcdc195> Message-ID: Hi Eric, thank you for pointing out the importnace of smalllestcluster for the potential significance estimations of large cluster. Best Regards, Michael Wibral Eric Maris schrieb: > Hi Michael, > > >> I just noticed that my version of clusterrandanalysis (20051127) >> doesn't list the teststatistic 'maxsumt' in its header or in the >> actual code as it is used in the tutorial (toolkit 2005). Instead >> there's an option (the default) 'maxsum'. Are these two the same - or >> is maxsum just the summed raw effect within a cluster ( and thus >> maybe pretty sensitive to extreme outliers), whereas maxsumt refers >> to summed t-scores from the initial tests performed for cluster finding? > > > The change from 'maxsumt' to 'maxsum' occured when clusterrandanalysis > also supported F-statistics at the level of > (sensor,frequency,time)-triplets. Using 'cfg.clusterteststat=maxsum' > in combination with 'cfg.statistic=indepsamplesT' gives the same > results as the 'maxsumt'-option of the older version of > clusterrandanalysis. > > >> I also notice that maxsum 'always' yields more significants clusters >> than orderedsums, is there an explanation for this behaviour (I >> thought it might rather be the other way round...)? > > > I am not surprised. The behavior of 'cfg.clusterteststat=orderedsums' > depends on the value assigned to 'cfg.smallestcluster'. If you give > 'cfg.smallestcluster' a small value, this will reduce the sensitivity > for larger clusters (larger than this small value). The option > 'cfg.clusterteststat=orderedsums' will result in more significant > clusters than obtained with 'cfg.clusterteststat=maxsum' if the data > contain one big cluster and a number of much smaller (but systematic) > clusters. These smaller clusters may become significant with > 'cfg.clusterteststat=orderedsums' if their size is larger than > 'cfg.smallestcluster'. The value of 'cfg.smallestcluster' should be > determined independently of the data. I guess there is no need to > explain why this so. > > > greetings, > > Eric Maris > > . > From Sehatpour at NKI.RFMH.ORG Tue Dec 13 04:09:14 2005 From: Sehatpour at NKI.RFMH.ORG (Sehatpour, Pejman) Date: Mon, 12 Dec 2005 22:09:14 -0500 Subject: topoplotER shows error message Message-ID: Hi, I am going through the tutorial for "event related averaging" and everything worked well untill I got to plotting the topographic distribution using the topoplotER. At this point when I enter the command which is in the tutorial, I get an error message as follows: cfg = []; cfg.xlim = [0.3 0.5]; topoplotER(cfg,avgFIC) creating layout for ctf151 MEG system ??? Undefined command/function 'dist'. Error in ==> work\private\createlayout at 100 d = dist(prj'); Error in ==> topoplotER at 184 lay = createlayout(data.grad); Could someone please tell me what this error is? and how it should be corrected? The topoplotER version that I am using is from today 12/12/05 Thanks, Pejman. From r.oostenveld at FCDONDERS.RU.NL Tue Dec 13 11:24:40 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 13 Dec 2005 11:24:40 +0100 Subject: topoplotER shows error message In-Reply-To: <52E9E57B58FA71468E55CD3CDE7BE180046D1EE7@nki-exch.nki.rfmh.org> Message-ID: Dear Pejman Thanks for reporting the bug. The "dist" function seems to be missing in the ftp version of fieldtrip/private. Since there is also a "dist" function in the neural networks toolbox that works exactly the same, I (and probably other users as well) did not notice the function to be missing. Please find the function attached, put it in the fieldtrip/private subdirectory. I will also include it in the next ftp release. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: dist.m Type: application/octet-stream Size: 609 bytes Desc: not available URL: -------------- next part -------------- On 13-dec-2005, at 4:09, Sehatpour, Pejman wrote: > Hi, > I am going through the tutorial for "event related averaging" and > everything worked well untill I got to plotting the topographic > distribution using the topoplotER. > At this point when I enter the command which is in the tutorial, I > get an error message as follows: > > cfg = []; > cfg.xlim = [0.3 0.5]; > topoplotER(cfg,avgFIC) > creating layout for ctf151 MEG system > ??? Undefined command/function 'dist'. > Error in ==> work\private\createlayout at 100 > d = dist(prj'); > Error in ==> topoplotER at 184 > lay = createlayout(data.grad); > > > Could someone please tell me what this error is? and how it should > be corrected? > The topoplotER version that I am using is from today 12/12/05 > Thanks, > Pejman. > From werkle at MPIB-BERLIN.MPG.DE Thu Dec 15 18:28:10 2005 From: werkle at MPIB-BERLIN.MPG.DE (Markus Werkle-Bergner) Date: Thu, 15 Dec 2005 18:28:10 +0100 Subject: Problems reading BVA data (segmented) In-Reply-To: Message-ID: Dear all, I'm a beginner with fieldtrip, therefore I probably have an easy question. I try to read in EEG-data that I already preprocessed in Brainvision Analyser. The data is therefore already segmented. From the tutorials and the discussion list, I understood that I should nevertheless use the function preprocessing.m. Now my guess is that I have trouble with the definition of trials from my data-set. I used the following script to read the data: cfg = [] % General settings cfg.datafile = 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.dat'; cfg.headerfile = 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vhdr'; cfg.channel = 'all'; %Trialdefinition cfg.trialfun = 'trialfun_brainvision'; cfg.trialdef.trgfile = 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vmkr'; cfg.trialdef.stim = 'HFC'; cfg.trialdef.segment = 'no'; cfg.trialdef.timezero = 'no'; cfg.trialdef.eventtype = 'Stimulus'; cfg.trialdef.eventvalue = 'HFC'; cfg.trialdef.prestim = 0.500; cfg.trialdef.poststim = 0.600; [cfg]=definetrial(cfg) [raw] = preprocessing(cfg) When I run this script, I get the following error-message: ??? Error using ==> fieldtrip-20051214\private\read_brainvision_vmrk cannot open marker file Error in ==> fieldtrip-20051214\private\trialfun_brainvision at 16 [stim, resp, segment, timezero] = read_brainvision_vmrk(cfg.trialdef.trgfile); Error in ==> definetrial at 151 trl = feval(cfg.trialfun, cfg); Error in ==> FieldtripTest at 17 [cfg]=definetrial(cfg) I checked that the *.dat, *.vhdr, and *.vmrk files are all in the location specified in the script. I really would appreciate if one can give me some advice. Best regards, Markus P.S.: I added the *.vhdr, and *.vmrk files. Perhaps this information is needed. -- ************************************************************** Markus Werkle-Bergner, Dipl. Psych. Predoctoral Research Fellow Center for Lifespan Psychology Max Planck Institute for Human Development Lentzeallee 94, Room 211, D-14195 Berlin, Germany. Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 ************************************************************** -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: mdo13136_1_HFCrej.vmrk URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: mdo13136_1_HFCrej.vhdr URL: From arno at SALK.EDU Fri Dec 16 09:44:44 2005 From: arno at SALK.EDU (arno) Date: Fri, 16 Dec 2005 09:44:44 +0100 Subject: Problems reading BVA data (segmented) In-Reply-To: <43A1A7AA.3060601@mpib-berlin.mpg.de> Message-ID: Dear Markus, in case nothing else works, try also the BVA matlab plugin for EEGLAB. Functions can be called from the command line. Then you can convert the EEGLAB structure to fieldtrip using eeglab2fieldtrip. http://cvs.sourceforge.net/viewcvs.py/bva-io/bva-io/ Best, Arno Markus Werkle-Bergner wrote: > Dear all, > > I'm a beginner with fieldtrip, therefore I probably have an easy > question. > > I try to read in EEG-data that I already preprocessed in Brainvision > Analyser. The data is therefore already segmented. From the tutorials > and the discussion list, I understood that I should nevertheless use > the function preprocessing.m. Now my guess is that I have trouble with > the definition of trials from my data-set. I used the following script > to read the data: > > cfg = [] > % General settings > cfg.datafile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.dat'; > cfg.headerfile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vhdr'; > cfg.channel = 'all'; > %Trialdefinition > cfg.trialfun = 'trialfun_brainvision'; > cfg.trialdef.trgfile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vmkr'; > cfg.trialdef.stim = 'HFC'; > cfg.trialdef.segment = 'no'; > cfg.trialdef.timezero = 'no'; > cfg.trialdef.eventtype = 'Stimulus'; > cfg.trialdef.eventvalue = 'HFC'; > cfg.trialdef.prestim = 0.500; > cfg.trialdef.poststim = 0.600; > > [cfg]=definetrial(cfg) > [raw] = preprocessing(cfg) > > When I run this script, I get the following error-message: > > ??? Error using ==> fieldtrip-20051214\private\read_brainvision_vmrk > cannot open marker file > > Error in ==> fieldtrip-20051214\private\trialfun_brainvision at 16 > [stim, resp, segment, timezero] = > read_brainvision_vmrk(cfg.trialdef.trgfile); > > Error in ==> definetrial at 151 > trl = feval(cfg.trialfun, cfg); > > Error in ==> FieldtripTest at 17 > [cfg]=definetrial(cfg) > > I checked that the *.dat, *.vhdr, and *.vmrk files are all in the > location specified in the script. I really would appreciate if one can > give me some advice. > > Best regards, > Markus > > P.S.: I added the *.vhdr, and *.vmrk files. Perhaps this information > is needed. > >------------------------------------------------------------------------ > >Brain Vision Data Exchange Marker File, Version 1.0 >; Data created from history path: mdo13136_1/Raw Data/Markers Changed/AnneMarker/Segmentation/OddCSt/HFC/Artifact Rejection >; The channel numbers are related to the channels in the exported file. > >[Common Infos] >DataFile=mdo13136_1_HFCrej.dat > >[Marker Infos] >; Each entry: Mk=,,, >; , , >; >; Fields are delimited by commas, some fields might be omited (empty). >; Commas in type or description text are coded as "\1". >Mk1=New Segment,,1,1,0,20031211162420402948 >Mk2=Stimulus,HFC,251,1,0 >Mk3=Time 0,,251,1,0 >Mk4=New Segment,,551,1,0,20031211162424374948 >Mk5=Stimulus,HFC,801,1,0 >Mk6=Time 0,,801,1,0 >Mk7=New Segment,,1101,1,0,20031211162425732947 >Mk8=Stimulus,HFC,1351,1,0 >Mk9=Time 0,,1351,1,0 >Mk10=New Segment,,1651,1,0,20031211162428430948 >Mk11=Stimulus,HFC,1901,1,0 >Mk12=Time 0,,1901,1,0 >Mk13=New Segment,,2201,1,0,20031211162429732948 >Mk14=Stimulus,HFC,2451,1,0 >Mk15=Time 0,,2451,1,0 >Mk16=New Segment,,2751,1,0,20031211162431122948 >Mk17=Stimulus,HFC,3001,1,0 >Mk18=Time 0,,3001,1,0 >Mk19=New Segment,,3301,1,0,20031211162432516947 >Mk20=Stimulus,HFC,3551,1,0 >Mk21=Time 0,,3551,1,0 >Mk22=New Segment,,3851,1,0,20031211162435158947 >Mk23=Time 0,,4101,1,0 >Mk24=Stimulus,HFC,4101,1,0 >Mk25=New Segment,,4401,1,0,20031211162436430948 >Mk26=Time 0,,4651,1,0 >Mk27=Stimulus,HFC,4651,1,0 >Mk28=New Segment,,4951,1,0,20031211162437902948 >Mk29=Time 0,,5201,1,0 >Mk30=Stimulus,HFC,5201,1,0 >Mk31=New Segment,,5501,1,0,20031211162439208948 >Mk32=Stimulus,HFC,5751,1,0 >Mk33=Time 0,,5751,1,0 >Mk34=New Segment,,6051,1,0,20031211162442154948 >Mk35=Stimulus,HFC,6301,1,0 >Mk36=Time 0,,6301,1,0 >Mk37=New Segment,,6601,1,0,20031211162443594947 >Mk38=Stimulus,HFC,6851,1,0 >Mk39=Time 0,,6851,1,0 >Mk40=New Segment,,7151,1,0,20031211162444934947 >Mk41=Stimulus,HFC,7401,1,0 >Mk42=Time 0,,7401,1,0 >Mk43=New Segment,,7701,1,0,20031211162446334947 >Mk44=Stimulus,HFC,7951,1,0 >Mk45=Time 0,,7951,1,0 >Mk46=New Segment,,8251,1,0,20031211162447634948 >Mk47=Time 0,,8501,1,0 >Mk48=Stimulus,HFC,8501,1,0 >Mk49=New Segment,,8801,1,0,20031211162450298948 >Mk50=Stimulus,HFC,9051,1,0 >Mk51=Time 0,,9051,1,0 >Mk52=New Segment,,9351,1,0,20031211162453138948 >Mk53=Stimulus,HFC,9601,1,0 >Mk54=Time 0,,9601,1,0 >Mk55=New Segment,,9901,1,0,20031211162454462948 >Mk56=Time 0,,10151,1,0 >Mk57=Stimulus,HFC,10151,1,0 >Mk58=New Segment,,10451,1,0,20031211162455922948 >Mk59=Stimulus,HFC,10701,1,0 >Mk60=Time 0,,10701,1,0 >Mk61=New Segment,,11001,1,0,20031211162457290947 >Mk62=Time 0,,11251,1,0 >Mk63=Stimulus,HFC,11251,1,0 >Mk64=New Segment,,11551,1,0,20031211162458498947 >Mk65=Time 0,,11801,1,0 >Mk66=Stimulus,HFC,11801,1,0 >Mk67=New Segment,,12101,1,0,20031211162459800947 >Mk68=Time 0,,12351,1,0 >Mk69=Stimulus,HFC,12351,1,0 >Mk70=New Segment,,12651,1,0,20031211162501014948 >Mk71=Stimulus,HFC,12901,1,0 >Mk72=Time 0,,12901,1,0 >Mk73=New Segment,,13201,1,0,20031211162502270948 >Mk74=Time 0,,13451,1,0 >Mk75=Stimulus,HFC,13451,1,0 >Mk76=New Segment,,13751,1,0,20031211162503716948 >Mk77=Stimulus,HFC,14001,1,0 >Mk78=Time 0,,14001,1,0 >Mk79=New Segment,,14301,1,0,20031211162505206947 >Mk80=Time 0,,14551,1,0 >Mk81=Stimulus,HFC,14551,1,0 >Mk82=New Segment,,14851,1,0,20031211162506654948 >Mk83=Time 0,,15101,1,0 >Mk84=Stimulus,HFC,15101,1,0 >Mk85=New Segment,,15401,1,0,20031211162509204948 >Mk86=Time 0,,15651,1,0 >Mk87=Stimulus,HFC,15651,1,0 >Mk88=New Segment,,15951,1,0,20031211162510522947 >Mk89=Stimulus,HFC,16201,1,0 >Mk90=Time 0,,16201,1,0 >Mk91=New Segment,,16501,1,0,20031211162511826948 >Mk92=Stimulus,HFC,16751,1,0 >Mk93=Time 0,,16751,1,0 >Mk94=New Segment,,17051,1,0,20031211162513182948 >Mk95=Stimulus,HFC,17301,1,0 >Mk96=Time 0,,17301,1,0 >Mk97=New Segment,,17601,1,0,20031211162516068947 >Mk98=Stimulus,HFC,17851,1,0 >Mk99=Time 0,,17851,1,0 >Mk100=New Segment,,18151,1,0,20031211162517532948 >Mk101=Stimulus,HFC,18401,1,0 >Mk102=Time 0,,18401,1,0 >Mk103=New Segment,,18701,1,0,20031211162520134948 >Mk104=Stimulus,HFC,18951,1,0 >Mk105=Time 0,,18951,1,0 >Mk106=New Segment,,19251,1,0,20031211162521592947 >Mk107=Time 0,,19501,1,0 >Mk108=Stimulus,HFC,19501,1,0 >Mk109=New Segment,,19801,1,0,20031211162522982948 >Mk110=Time 0,,20051,1,0 >Mk111=Stimulus,HFC,20051,1,0 >Mk112=New Segment,,20351,1,0,20031211162524374947 >Mk113=Stimulus,HFC,20601,1,0 >Mk114=Time 0,,20601,1,0 >Mk115=New Segment,,20901,1,0,20031211162525870947 >Mk116=Time 0,,21151,1,0 >Mk117=Stimulus,HFC,21151,1,0 >Mk118=New Segment,,21451,1,0,20031211162527098947 >Mk119=Time 0,,21701,1,0 >Mk120=Stimulus,HFC,21701,1,0 >Mk121=New Segment,,22001,1,0,20031211162528502948 >Mk122=Time 0,,22251,1,0 >Mk123=Stimulus,HFC,22251,1,0 >Mk124=New Segment,,22551,1,0,20031211162529716948 >Mk125=Stimulus,HFC,22801,1,0 >Mk126=Time 0,,22801,1,0 >Mk127=New Segment,,23101,1,0,20031211162531162947 >Mk128=Time 0,,23351,1,0 >Mk129=Stimulus,HFC,23351,1,0 >Mk130=New Segment,,23651,1,0,20031211162532546947 >Mk131=Stimulus,HFC,23901,1,0 >Mk132=Time 0,,23901,1,0 >Mk133=New Segment,,24201,1,0,20031211162533924948 >Mk134=Stimulus,HFC,24451,1,0 >Mk135=Time 0,,24451,1,0 >Mk136=New Segment,,24751,1,0,20031211162535330947 >Mk137=Time 0,,25001,1,0 >Mk138=Stimulus,HFC,25001,1,0 >Mk139=New Segment,,25301,1,0,20031211162536630948 >Mk140=Time 0,,25551,1,0 >Mk141=Stimulus,HFC,25551,1,0 >Mk142=New Segment,,25851,1,0,20031211162537974948 >Mk143=Time 0,,26101,1,0 >Mk144=Stimulus,HFC,26101,1,0 >Mk145=New Segment,,26401,1,0,20031211162539290948 >Mk146=Time 0,,26651,1,0 >Mk147=Stimulus,HFC,26651,1,0 >Mk148=New Segment,,26951,1,0,20031211162543326947 >Mk149=Time 0,,27201,1,0 >Mk150=Stimulus,HFC,27201,1,0 >Mk151=New Segment,,27501,1,0,20031211162545958947 >Mk152=Time 0,,27751,1,0 >Mk153=Stimulus,HFC,27751,1,0 >Mk154=New Segment,,28051,1,0,20031211162547342948 >Mk155=Time 0,,28301,1,0 >Mk156=Stimulus,HFC,28301,1,0 >Mk157=New Segment,,28601,1,0,20031211162548594947 >Mk158=Time 0,,28851,1,0 >Mk159=Stimulus,HFC,28851,1,0 >Mk160=New Segment,,29151,1,0,20031211162549830948 >Mk161=Time 0,,29401,1,0 >Mk162=Stimulus,HFC,29401,1,0 >Mk163=New Segment,,29701,1,0,20031211162551038948 >Mk164=Time 0,,29951,1,0 >Mk165=Stimulus,HFC,29951,1,0 >Mk166=New Segment,,30251,1,0,20031211162553710947 >Mk167=Time 0,,30501,1,0 >Mk168=Stimulus,HFC,30501,1,0 >Mk169=New Segment,,30801,1,0,20031211162555198948 >Mk170=Time 0,,31051,1,0 >Mk171=Stimulus,HFC,31051,1,0 >Mk172=New Segment,,31351,1,0,20031211162556648947 >Mk173=Stimulus,HFC,31601,1,0 >Mk174=Time 0,,31601,1,0 >Mk175=New Segment,,31901,1,0,20031211162557940948 >Mk176=Stimulus,HFC,32151,1,0 >Mk177=Time 0,,32151,1,0 >Mk178=New Segment,,32451,1,0,20031211162559320947 >Mk179=Stimulus,HFC,32701,1,0 >Mk180=Time 0,,32701,1,0 >Mk181=New Segment,,33001,1,0,20031211162600694948 >Mk182=Time 0,,33251,1,0 >Mk183=Stimulus,HFC,33251,1,0 >Mk184=New Segment,,33551,1,0,20031211162603296948 >Mk185=Time 0,,33801,1,0 >Mk186=Stimulus,HFC,33801,1,0 >Mk187=New Segment,,34101,1,0,20031211162607310947 >Mk188=Stimulus,HFC,34351,1,0 >Mk189=Time 0,,34351,1,0 >Mk190=New Segment,,34651,1,0,20031211162608558948 >Mk191=Stimulus,HFC,34901,1,0 >Mk192=Time 0,,34901,1,0 >Mk193=New Segment,,35201,1,0,20031211162609864948 >Mk194=Stimulus,HFC,35451,1,0 >Mk195=Time 0,,35451,1,0 >Mk196=New Segment,,35751,1,0,20031211162612548947 >Mk197=Stimulus,HFC,36001,1,0 >Mk198=Time 0,,36001,1,0 >Mk199=New Segment,,36301,1,0,20031211162613862948 >Mk200=Time 0,,36551,1,0 >Mk201=Stimulus,HFC,36551,1,0 >Mk202=New Segment,,36851,1,0,20031211162615336947 >Mk203=Stimulus,HFC,37101,1,0 >Mk204=Time 0,,37101,1,0 >Mk205=New Segment,,37401,1,0,20031211162616834948 >Mk206=Time 0,,37651,1,0 >Mk207=Stimulus,HFC,37651,1,0 >Mk208=New Segment,,37951,1,0,20031211162618178948 >Mk209=Stimulus,HFC,38201,1,0 >Mk210=Time 0,,38201,1,0 >Mk211=New Segment,,38501,1,0,20031211162619552948 >Mk212=Stimulus,HFC,38751,1,0 >Mk213=Time 0,,38751,1,0 >Mk214=New Segment,,39051,1,0,20031211162622136947 >Mk215=Stimulus,HFC,39301,1,0 >Mk216=Time 0,,39301,1,0 >Mk217=New Segment,,39601,1,0,20031211162624838948 >Mk218=Stimulus,HFC,39851,1,0 >Mk219=Time 0,,39851,1,0 >Mk220=New Segment,,40151,1,0,20031211162626222948 >Mk221=Time 0,,40401,1,0 >Mk222=Stimulus,HFC,40401,1,0 >Mk223=New Segment,,40701,1,0,20031211162627450947 >Mk224=Stimulus,HFC,40951,1,0 >Mk225=Time 0,,40951,1,0 >Mk226=New Segment,,41251,1,0,20031211162628698948 >Mk227=Stimulus,HFC,41501,1,0 >Mk228=Time 0,,41501,1,0 >Mk229=New Segment,,41801,1,0,20031211162630104948 >Mk230=Stimulus,HFC,42051,1,0 >Mk231=Time 0,,42051,1,0 >Mk232=New Segment,,42351,1,0,20031211162631464947 >Mk233=Stimulus,HFC,42601,1,0 >Mk234=Time 0,,42601,1,0 >Mk235=New Segment,,42901,1,0,20031211162632692948 >Mk236=Stimulus,HFC,43151,1,0 >Mk237=Time 0,,43151,1,0 >Mk238=New Segment,,43451,1,0,20031211162633962947 >Mk239=Stimulus,HFC,43701,1,0 >Mk240=Time 0,,43701,1,0 >Mk241=New Segment,,44001,1,0,20031211162635376948 >Mk242=Time 0,,44251,1,0 >Mk243=Stimulus,HFC,44251,1,0 >Mk244=New Segment,,44551,1,0,20031211162636716948 >Mk245=Time 0,,44801,1,0 >Mk246=Stimulus,HFC,44801,1,0 >Mk247=New Segment,,45101,1,0,20031211162638194948 >Mk248=Time 0,,45351,1,0 >Mk249=Stimulus,HFC,45351,1,0 >Mk250=New Segment,,45651,1,0,20031211162639456947 >Mk251=Time 0,,45901,1,0 >Mk252=Stimulus,HFC,45901,1,0 >Mk253=New Segment,,46201,1,0,20031211162640836948 >Mk254=Stimulus,HFC,46451,1,0 >Mk255=Time 0,,46451,1,0 >Mk256=New Segment,,46751,1,0,20031211162642122947 >Mk257=Stimulus,HFC,47001,1,0 >Mk258=Time 0,,47001,1,0 >Mk259=New Segment,,47301,1,0,20031211162643426948 >Mk260=Stimulus,HFC,47551,1,0 >Mk261=Time 0,,47551,1,0 >Mk262=New Segment,,47851,1,0,20031211162644918947 >Mk263=Stimulus,HFC,48101,1,0 >Mk264=Time 0,,48101,1,0 >Mk265=New Segment,,48401,1,0,20031211162647476947 >Mk266=Time 0,,48651,1,0 >Mk267=Stimulus,HFC,48651,1,0 >Mk268=New Segment,,48951,1,0,20031211162648800948 >Mk269=Stimulus,HFC,49201,1,0 >Mk270=Time 0,,49201,1,0 >Mk271=New Segment,,49501,1,0,20031211162650032947 >Mk272=Stimulus,HFC,49751,1,0 >Mk273=Time 0,,49751,1,0 >Mk274=New Segment,,50051,1,0,20031211162651516948 >Mk275=Stimulus,HFC,50301,1,0 >Mk276=Time 0,,50301,1,0 >Mk277=New Segment,,50601,1,0,20031211162654074947 >Mk278=Stimulus,HFC,50851,1,0 >Mk279=Time 0,,50851,1,0 >Mk280=New Segment,,51151,1,0,20031211162655472947 >Mk281=Stimulus,HFC,51401,1,0 >Mk282=Time 0,,51401,1,0 >Mk283=New Segment,,51701,1,0,20031211162656774948 >Mk284=Stimulus,HFC,51951,1,0 >Mk285=Time 0,,51951,1,0 >Mk286=New Segment,,52251,1,0,20031211162658156948 >Mk287=Stimulus,HFC,52501,1,0 >Mk288=Time 0,,52501,1,0 >Mk289=New Segment,,52801,1,0,20031211162702070948 >Mk290=Time 0,,53051,1,0 >Mk291=Stimulus,HFC,53051,1,0 >Mk292=New Segment,,53351,1,0,20031211162703302947 >Mk293=Time 0,,53601,1,0 >Mk294=Stimulus,HFC,53601,1,0 >Mk295=New Segment,,53901,1,0,20031211162704738948 >Mk296=Stimulus,HFC,54151,1,0 >Mk297=Time 0,,54151,1,0 >Mk298=New Segment,,54451,1,0,20031211162707646948 >Mk299=Stimulus,HFC,54701,1,0 >Mk300=Time 0,,54701,1,0 >Mk301=New Segment,,55001,1,0,20031211162710232948 >Mk302=Time 0,,55251,1,0 >Mk303=Stimulus,HFC,55251,1,0 >Mk304=New Segment,,55551,1,0,20031211162711586947 >Mk305=Stimulus,HFC,55801,1,0 >Mk306=Time 0,,55801,1,0 >Mk307=New Segment,,56101,1,0,20031211162712942948 >Mk308=Time 0,,56351,1,0 >Mk309=Stimulus,HFC,56351,1,0 >Mk310=New Segment,,56651,1,0,20031211162714412947 >Mk311=Time 0,,56901,1,0 >Mk312=Stimulus,HFC,56901,1,0 >Mk313=New Segment,,57201,1,0,20031211162715810948 >Mk314=Time 0,,57451,1,0 >Mk315=Stimulus,HFC,57451,1,0 >Mk316=New Segment,,57751,1,0,20031211162717290947 >Mk317=Stimulus,HFC,58001,1,0 >Mk318=Time 0,,58001,1,0 >Mk319=New Segment,,58301,1,0,20031211162718598948 >Mk320=Time 0,,58551,1,0 >Mk321=Stimulus,HFC,58551,1,0 >Mk322=New Segment,,58851,1,0,20031211162721318948 >Mk323=Time 0,,59101,1,0 >Mk324=Stimulus,HFC,59101,1,0 >Mk325=New Segment,,59401,1,0,20031211162722572948 >Mk326=Time 0,,59651,1,0 >Mk327=Stimulus,HFC,59651,1,0 >Mk328=New Segment,,59951,1,0,20031211162723952948 >Mk329=Time 0,,60201,1,0 >Mk330=Stimulus,HFC,60201,1,0 >Mk331=New Segment,,60501,1,0,20031211162725270948 >Mk332=Time 0,,60751,1,0 >Mk333=Stimulus,HFC,60751,1,0 >Mk334=New Segment,,61051,1,0,20031211162726724948 >Mk335=Stimulus,HFC,61301,1,0 >Mk336=Time 0,,61301,1,0 >Mk337=New Segment,,61601,1,0,20031211162728050947 >Mk338=Stimulus,HFC,61851,1,0 >Mk339=Time 0,,61851,1,0 >Mk340=New Segment,,62151,1,0,20031211162729476947 >Mk341=Stimulus,HFC,62401,1,0 >Mk342=Time 0,,62401,1,0 >Mk343=New Segment,,62701,1,0,20031211162730904948 >Mk344=Stimulus,HFC,62951,1,0 >Mk345=Time 0,,62951,1,0 >Mk346=New Segment,,63251,1,0,20031211162733452947 >Mk347=Time 0,,63501,1,0 >Mk348=Stimulus,HFC,63501,1,0 >Mk349=New Segment,,63801,1,0,20031211162734692948 >Mk350=Stimulus,HFC,64051,1,0 >Mk351=Time 0,,64051,1,0 >Mk352=New Segment,,64351,1,0,20031211162736090947 >Mk353=Time 0,,64601,1,0 >Mk354=Stimulus,HFC,64601,1,0 >Mk355=New Segment,,64901,1,0,20031211162738694948 >Mk356=Time 0,,65151,1,0 >Mk357=Stimulus,HFC,65151,1,0 >Mk358=New Segment,,65451,1,0,20031211162740170947 >Mk359=Stimulus,HFC,65701,1,0 >Mk360=Time 0,,65701,1,0 >Mk361=New Segment,,66001,1,0,20031211162741634947 >Mk362=Stimulus,HFC,66251,1,0 >Mk363=Time 0,,66251,1,0 >Mk364=New Segment,,66551,1,0,20031211162742894948 >Mk365=Stimulus,HFC,66801,1,0 >Mk366=Time 0,,66801,1,0 >Mk367=New Segment,,67101,1,0,20031211162744208947 >Mk368=Stimulus,HFC,67351,1,0 >Mk369=Time 0,,67351,1,0 >Mk370=New Segment,,67651,1,0,20031211162746802948 >Mk371=Stimulus,HFC,67901,1,0 >Mk372=Time 0,,67901,1,0 >Mk373=New Segment,,68201,1,0,20031211162748036948 >Mk374=Stimulus,HFC,68451,1,0 >Mk375=Time 0,,68451,1,0 >Mk376=New Segment,,68751,1,0,20031211162749354947 >Mk377=Stimulus,HFC,69001,1,0 >Mk378=Time 0,,69001,1,0 >Mk379=New Segment,,69301,1,0,20031211162752086948 >Mk380=Stimulus,HFC,69551,1,0 >Mk381=Time 0,,69551,1,0 >Mk382=New Segment,,69851,1,0,20031211162753302948 >Mk383=Stimulus,HFC,70101,1,0 >Mk384=Time 0,,70101,1,0 >Mk385=New Segment,,70401,1,0,20031211162754670947 >Mk386=Time 0,,70651,1,0 >Mk387=Stimulus,HFC,70651,1,0 >Mk388=New Segment,,70951,1,0,20031211162755914948 >Mk389=Time 0,,71201,1,0 >Mk390=Stimulus,HFC,71201,1,0 >Mk391=New Segment,,71501,1,0,20031211162757224947 >Mk392=Stimulus,HFC,71751,1,0 >Mk393=Time 0,,71751,1,0 >Mk394=New Segment,,72051,1,0,20031211162801366948 >Mk395=Stimulus,HFC,72301,1,0 >Mk396=Time 0,,72301,1,0 >Mk397=New Segment,,72601,1,0,20031211162802708947 >Mk398=Stimulus,HFC,72851,1,0 >Mk399=Time 0,,72851,1,0 >Mk400=New Segment,,73151,1,0,20031211162804012948 >Mk401=Stimulus,HFC,73401,1,0 >Mk402=Time 0,,73401,1,0 >Mk403=New Segment,,73701,1,0,20031211162805414948 >Mk404=Time 0,,73951,1,0 >Mk405=Stimulus,HFC,73951,1,0 >Mk406=New Segment,,74251,1,0,20031211162806788948 >Mk407=Time 0,,74501,1,0 >Mk408=Stimulus,HFC,74501,1,0 >Mk409=New Segment,,74801,1,0,20031211162808256947 >Mk410=Time 0,,75051,1,0 >Mk411=Stimulus,HFC,75051,1,0 >Mk412=New Segment,,75351,1,0,20031211162812310947 >Mk413=Time 0,,75601,1,0 >Mk414=Stimulus,HFC,75601,1,0 >Mk415=New Segment,,75901,1,0,20031211162813668948 >Mk416=Time 0,,76151,1,0 >Mk417=Stimulus,HFC,76151,1,0 >Mk418=New Segment,,76451,1,0,20031211162815164948 >Mk419=Stimulus,HFC,76701,1,0 >Mk420=Time 0,,76701,1,0 >Mk421=New Segment,,77001,1,0,20031211162816408947 >Mk422=Stimulus,HFC,77251,1,0 >Mk423=Time 0,,77251,1,0 >Mk424=New Segment,,77551,1,0,20031211162817690948 >Mk425=Time 0,,77801,1,0 >Mk426=Stimulus,HFC,77801,1,0 >Mk427=New Segment,,78101,1,0,20031211162819138947 >Mk428=Stimulus,HFC,78351,1,0 >Mk429=Time 0,,78351,1,0 >Mk430=New Segment,,78651,1,0,20031211162820620948 >Mk431=Time 0,,78901,1,0 >Mk432=Stimulus,HFC,78901,1,0 >Mk433=New Segment,,79201,1,0,20031211162824476947 >Mk434=Stimulus,HFC,79451,1,0 >Mk435=Time 0,,79451,1,0 >Mk436=New Segment,,79751,1,0,20031211162825752948 >Mk437=Stimulus,HFC,80001,1,0 >Mk438=Time 0,,80001,1,0 >Mk439=New Segment,,80301,1,0,20031211162828456948 >Mk440=Stimulus,HFC,80551,1,0 >Mk441=Time 0,,80551,1,0 >Mk442=New Segment,,80851,1,0,20031211162829822947 >Mk443=Stimulus,HFC,81101,1,0 >Mk444=Time 0,,81101,1,0 >Mk445=New Segment,,81401,1,0,20031211162832608947 >Mk446=Stimulus,HFC,81651,1,0 >Mk447=Time 0,,81651,1,0 > > >------------------------------------------------------------------------ > >Brain Vision Data Exchange Header File Version 1.0 >; Data created from history path: mdo13136_1/Raw Data/Markers Changed/AnneMarker/Segmentation/OddCSt/HFC/Artifact Rejection > >[Common Infos] >DataFile=mdo13136_1_HFCrej.dat >MarkerFile=mdo13136_1_HFCrej.vmrk >DataFormat=ASCII >; Data orientation: VECTORIZED=ch1,pt1, ch1,pt2..., MULTIPLEXED=ch1,pt1, ch2,pt1 ... >DataOrientation=MULTIPLEXED >DataType=TIMEDOMAIN >NumberOfChannels=63 >DataPoints=81950 >; Sampling interval in microseconds if time domain (convert to Hertz: >; 1000000 / SamplingInterval) or in Hertz if frequency domain: >SamplingInterval=2000 >SegmentationType=MARKERBASED > >[ASCII Infos] >; Decimal symbol for floating point numbers: the header file always uses a dot (.), >; however the data file might use a different one >DecimalSymbol=. >; SkipLines, SkipColumns: leading lines and columns with additional informations. >SkipLines=1 >SkipColumns=0 > >[Channel Infos] >; Each entry: Ch=,, >; ,; Fields are delimited by commas, some fields might be omited (empty). >; Commas in channel names are coded as "\1". >Ch1=Fp1,, >Ch2=Fpz,, >Ch3=Fp2,, >Ch4=AF3,, >Ch5=AF4,, >Ch6=F7,, >Ch7=F5,, >Ch8=F3,, >Ch9=F1,, >Ch10=Fz,, >Ch11=F2,, >Ch12=F4,, >Ch13=F6,, >Ch14=F8,, >Ch15=FC5,, >Ch16=FC3,, >Ch17=FC1,, >Ch18=FCz,, >Ch19=FC2,, >Ch20=FC4,, >Ch21=FC6,, >Ch22=T7,, >Ch23=C5,, >Ch24=C3,, >Ch25=C1,, >Ch26=Cz,, >Ch27=C2,, >Ch28=C4,, >Ch29=C6,, >Ch30=T8,, >Ch31=A2,, >Ch32=TP7,, >Ch33=CP5,, >Ch34=CP3,, >Ch35=CP1,, >Ch36=CPz,, >Ch37=CP2,, >Ch38=CP4,, >Ch39=CP6,, >Ch40=TP8,, >Ch41=P7,, >Ch42=P5,, >Ch43=P3,, >Ch44=P1,, >Ch45=Pz,, >Ch46=P2,, >Ch47=P4,, >Ch48=P6,, >Ch49=P8,, >Ch50=PO7,, >Ch51=PO3,, >Ch52=PO1,, >Ch53=POz,, >Ch54=PO2,, >Ch55=PO4,, >Ch56=PO8,, >Ch57=O1,, >Ch58=Oz,, >Ch59=O2,, >Ch60=VEOGM,, >Ch61=VEOGP,, >Ch62=HEOGM,, >Ch63=HEOGP,, > >[Coordinates] >; Each entry: Ch=,, >Ch1=1,-92,-72 >Ch2=1,92,90 >Ch3=1,92,72 >Ch4=1,-74,-65 >Ch5=1,74,65 >Ch6=1,-92,-36 >Ch7=1,-75,-41 >Ch8=1,-60,-51 >Ch9=1,-50,-68 >Ch10=1,46,90 >Ch11=1,50,68 >Ch12=1,60,51 >Ch13=1,75,41 >Ch14=1,92,36 >Ch15=1,-72,-21 >Ch16=1,-50,-28 >Ch17=1,-32,-45 >Ch18=1,23,90 >Ch19=1,32,45 >Ch20=1,50,28 >Ch21=1,72,21 >Ch22=1,-92,0 >Ch23=1,-69,0 >Ch24=1,-46,0 >Ch25=1,-23,0 >Ch26=1,0,0 >Ch27=1,23,0 >Ch28=1,46,0 >Ch29=1,69,0 >Ch30=1,92,0 >Ch31=1,129,0 >Ch32=1,-92,18 >Ch33=1,-72,21 >Ch34=1,-50,28 >Ch35=1,-32,45 >Ch36=1,23,-90 >Ch37=1,32,-45 >Ch38=1,50,-28 >Ch39=1,72,-21 >Ch40=1,92,-18 >Ch41=1,-92,36 >Ch42=1,-75,41 >Ch43=1,-60,51 >Ch44=1,-50,68 >Ch45=1,46,-90 >Ch46=1,50,-68 >Ch47=1,60,-51 >Ch48=1,75,-41 >Ch49=1,92,-36 >Ch50=1,-92,54 >Ch51=1,-74,65 >Ch52=1,-69,79 >Ch53=1,69,-90 >Ch54=1,69,-79 >Ch55=1,74,-65 >Ch56=1,92,-54 >Ch57=1,-92,72 >Ch58=1,92,-90 >Ch59=1,92,-72 >Ch60=0,0,0 >Ch61=0,0,0 >Ch62=0,0,0 >Ch63=0,0,0 > > From h.f.kwok at BHAM.AC.UK Fri Dec 16 10:28:30 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Fri, 16 Dec 2005 09:28:30 -0000 Subject: Problems reading BVA data (segmented) In-Reply-To: <43A1A7AA.3060601@mpib-berlin.mpg.de> Message-ID: Hi, I have read BVA data into FieldTrip. I think you should try not to define the cfg.trialfun. This will cause the definetrial function to call the trialfun_general which will obtain the name of the marker file from the header file and in turn read the events from the marker file in the read_fcdc_event function. One thing though is that in the read_fcdc_event, the event.offset is not defined when the filetype is brainvision. This may cause problem when you try to do further analysis. I have therefore attached an amended read_fcdc_event.m. Another thing is that the read_fcdc_event function will get (from the header file) the file name of the marker file but not the file path. Therefore, to be safe, you should make sure the files are in the MATLAB search path. Hope that this will help. Regards, Hoi Fei ******************************************** Dr. Hoi Fei Kwok Research Fellow SyMon Sensory Motor Neuroscience School of Psychology BBS Centre (Hills) The University of Birmingham Edgbaston BIRMINGHAM B15 2TT, UK Tel: +44-(0)121-4147949 Email: h.f.kwok at bham.ac.uk ********************************************* > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Markus Werkle-Bergner > Sent: 15 December 2005 17:28 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] Problems reading BVA data (segmented) > > Dear all, > > I'm a beginner with fieldtrip, therefore I probably have an easy question. > > I try to read in EEG-data that I already preprocessed in Brainvision > Analyser. The data is therefore already segmented. From the tutorials > and the discussion list, I understood that I should nevertheless use the > function preprocessing.m. Now my guess is that I have trouble with the > definition of trials from my data-set. I used the following script to > read the data: > > cfg = [] > % General settings > cfg.datafile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.dat'; > cfg.headerfile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vhdr'; > cfg.channel = 'all'; > %Trialdefinition > cfg.trialfun = 'trialfun_brainvision'; > cfg.trialdef.trgfile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vmkr'; > cfg.trialdef.stim = 'HFC'; > cfg.trialdef.segment = 'no'; > cfg.trialdef.timezero = 'no'; > cfg.trialdef.eventtype = 'Stimulus'; > cfg.trialdef.eventvalue = 'HFC'; > cfg.trialdef.prestim = 0.500; > cfg.trialdef.poststim = 0.600; > > [cfg]Þfinetrial(cfg) > [raw] = preprocessing(cfg) > > When I run this script, I get the following error-message: > > ??? Error using ==> fieldtrip-20051214\private\read_brainvision_vmrk > cannot open marker file > > Error in ==> fieldtrip-20051214\private\trialfun_brainvision at 16 > [stim, resp, segment, timezero] = > read_brainvision_vmrk(cfg.trialdef.trgfile); > > Error in ==> definetrial at 151 > trl = feval(cfg.trialfun, cfg); > > Error in ==> FieldtripTest at 17 > [cfg]Þfinetrial(cfg) > > I checked that the *.dat, *.vhdr, and *.vmrk files are all in the > location specified in the script. I really would appreciate if one can > give me some advice. > > Best regards, > Markus > > P.S.: I added the *.vhdr, and *.vmrk files. Perhaps this information is > needed. > > -- > ************************************************************** > Markus Werkle-Bergner, Dipl. Psych. > Predoctoral Research Fellow > > Center for Lifespan Psychology > Max Planck Institute for Human Development > Lentzeallee 94, Room 211, D-14195 Berlin, Germany. > Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 > ************************************************************** > > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: read_fcdc_event.m URL: From werkle at MPIB-BERLIN.MPG.DE Fri Dec 16 11:35:51 2005 From: werkle at MPIB-BERLIN.MPG.DE (Markus Werkle-Bergner) Date: Fri, 16 Dec 2005 11:35:51 +0100 Subject: Problems reading BVA data (segmented) In-Reply-To: <000001c60223$13febb90$e516bc93@universi8ef8be> Message-ID: Hi, thank you all for your valuable comments. Now it worked fine. I simply used the read_fcdc_event.m file provided by Hoi Fei. The the trialfun_general did the job. Thank you! Best regards, Markus Hoi Fei Kwok wrote: >Hi, > >I have read BVA data into FieldTrip. I think you should try not to define >the cfg.trialfun. This will cause the definetrial function to call the >trialfun_general which will obtain the name of the marker file from the >header file and in turn read the events from the marker file in the >read_fcdc_event function. One thing though is that in the read_fcdc_event, >the event.offset is not defined when the filetype is brainvision. This may >cause problem when you try to do further analysis. I have therefore attached >an amended read_fcdc_event.m. Another thing is that the read_fcdc_event >function will get (from the header file) the file name of the marker file >but not the file path. Therefore, to be safe, you should make sure the files >are in the MATLAB search path. > >Hope that this will help. > >Regards, >Hoi Fei > >******************************************** > >Dr. Hoi Fei Kwok >Research Fellow >SyMon Sensory Motor Neuroscience >School of Psychology >BBS Centre (Hills) >The University of Birmingham >Edgbaston >BIRMINGHAM B15 2TT, UK > >Tel: +44-(0)121-4147949 >Email: h.f.kwok at bham.ac.uk > >********************************************* > > > >>-----Original Message----- >>From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On >>Behalf Of Markus Werkle-Bergner >>Sent: 15 December 2005 17:28 >>To: FIELDTRIP at NIC.SURFNET.NL >>Subject: [FIELDTRIP] Problems reading BVA data (segmented) >> >>Dear all, >> >>I'm a beginner with fieldtrip, therefore I probably have an easy question. >> >>I try to read in EEG-data that I already preprocessed in Brainvision >>Analyser. The data is therefore already segmented. From the tutorials >>and the discussion list, I understood that I should nevertheless use the >>function preprocessing.m. Now my guess is that I have trouble with the >>definition of trials from my data-set. I used the following script to >>read the data: >> >>cfg = [] >>% General settings >>cfg.datafile = >>'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.dat'; >>cfg.headerfile = >>'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vhdr'; >>cfg.channel = 'all'; >>%Trialdefinition >>cfg.trialfun = 'trialfun_brainvision'; >>cfg.trialdef.trgfile = >>'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vmkr'; >>cfg.trialdef.stim = 'HFC'; >>cfg.trialdef.segment = 'no'; >>cfg.trialdef.timezero = 'no'; >>cfg.trialdef.eventtype = 'Stimulus'; >>cfg.trialdef.eventvalue = 'HFC'; >>cfg.trialdef.prestim = 0.500; >>cfg.trialdef.poststim = 0.600; >> >>[cfg]Þfinetrial(cfg) >>[raw] = preprocessing(cfg) >> >>When I run this script, I get the following error-message: >> >>??? Error using ==> fieldtrip-20051214\private\read_brainvision_vmrk >>cannot open marker file >> >>Error in ==> fieldtrip-20051214\private\trialfun_brainvision at 16 >>[stim, resp, segment, timezero] = >>read_brainvision_vmrk(cfg.trialdef.trgfile); >> >>Error in ==> definetrial at 151 >> trl = feval(cfg.trialfun, cfg); >> >>Error in ==> FieldtripTest at 17 >>[cfg]Þfinetrial(cfg) >> >>I checked that the *.dat, *.vhdr, and *.vmrk files are all in the >>location specified in the script. I really would appreciate if one can >>give me some advice. >> >>Best regards, >>Markus >> >>P.S.: I added the *.vhdr, and *.vmrk files. Perhaps this information is >>needed. >> >>-- >>************************************************************** >>Markus Werkle-Bergner, Dipl. Psych. >>Predoctoral Research Fellow >> >>Center for Lifespan Psychology >>Max Planck Institute for Human Development >>Lentzeallee 94, Room 211, D-14195 Berlin, Germany. >>Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 >>************************************************************** >> >> >> >> > > > >------------------------------------------------------------------------ > >function [event] = read_fcdc_event(filename) > >% READ_FCDC_EVENT reads all events from an EEG/MEG dataset and returns them >% in a well defined structure. It is a wrapper around different EEG/MEG file >% importers, directly supported formats are CTF, Neuromag, EEP, BrainVision, >% Neuroscan and Neuralynx. >% >% Use as >% [event] = read_fcdc_event(filename) >% >% This function returns a structure with the following fields >% event.type = string >% event.sample = expressed in samples, first sample of file is 1 >% event.value = number or string >% event.offset = expressed in samples >% event.duration = expressed in samples >% >% Some of these fields can be empty, depending on the type of event file. >% After reading the event structure, you can use following tricks to >% extract information about those events in which you are interested. >% >% Determine the different event types >% unique({event.type}) >% >% Get the index of all trial events >% find(strcmp('trial', {event.type})) >% >% Make a vector with all triggers that occurred on the backpanel >% [event(find(strcmp('backpanel trigger', {event.type}))).value] >% >% Find the events that ocurred in trial t=26 >% t = 26; find([event.sample]>trl(t,1) & [event.sample]% >% See also READ_FCDC_DATA, READ_FCDC_HEADER > >% Copyright (C) 2004, Robert Oostenveld >% >% $Log: read_fcdc_event.m,v $ >% Revision 1.29 2005/10/05 06:30:25 roboos >% added support for MPI datasets and DAP files >% >% Revision 1.28 2005/09/15 07:38:38 roboos >% added support for ctf_res4 and ctf_meg4 by renaming filename into dataset >% >% Revision 1.27 2005/09/08 09:25:53 roboos >% added support for the Yokogawa MEG data format >% >% Revision 1.26 2005/09/06 12:45:00 roboos >% renamed plextor into plexon (incorrect company name) >% >% Revision 1.25 2005/08/17 19:34:58 roboos >% added a check for the presence of the file >% added a TTLValue event for each trigger in Neuralynx dataset >% >% Revision 1.24 2005/06/17 10:56:59 roboos >% fixed event.type for CTF stimulus channels (should be string instead of cell) >% >% Revision 1.23 2005/05/24 07:37:04 roboos >% implemented reading of other trigger channels (like UPPT001, UTRG001) for CTF event detection >% >% Revision 1.22 2005/05/19 07:11:32 roboos >% added support for neuralynx_nev >% >% Revision 1.21 2005/05/18 15:50:31 roboos >% repeated last bugfix, now hopefully correct (thanks to Juliet) >% >% Revision 1.20 2005/05/18 10:26:43 roboos >% fixed "Operands to the || and && operators must be convertible to logical scalar values" problem by first checking whether variable is a string or numeric >% >% Revision 1.19 2005/05/17 17:50:38 roboos >% changed all "if" occurences of & and | into && and || >% this makes the code more compatible with Octave and also seems to be in closer correspondence with Matlab documentation on shortcircuited evaluation of sequential boolean constructs >% >% Revision 1.18 2005/05/11 08:27:50 roboos >% implemeted the correct offset (in samples) for CTF markerfiles, sofar the offset was always set to zero >% >% Revision 1.17 2005/03/31 07:05:58 roboos >% implemented support for besa_avr using my own read_besa_avr >% >% Revision 1.16 2005/02/16 07:48:59 roboos >% added support for Plexon nex files, using read_nex_event >% >% Revision 1.15 2005/02/02 14:33:16 roboos >% renamed event.type of eep_avg to 'average', implemented triggers for eep_cnt (using *.trg file) >% >% Revision 1.14 2004/12/07 18:13:04 roboos >% added initial support for Neuroscan cnt files >% >% Revision 1.13 2004/11/17 09:01:50 roboos >% added check for the presence of CTF MarkerFile, to avoid unneccesary warning in readmarkerfile >% >% Revision 1.12 2004/11/15 09:14:09 roboos >% implemented support for Neuroscan *.eeg (epoched) files >% applied auto-indentation, which changed some whitespace in other parts of the file >% >% Revision 1.11 2004/10/01 09:53:25 roboos >% added Neuromag to the help as one of the supported formats >% >% Revision 1.10 2004/09/27 15:37:11 roboos >% renamed the function readClassFile to read_ctf_cls (part of file_io) >% >% Revision 1.9 2004/09/27 13:55:24 roboos >% fixed bugs for CTF marker >% >% Revision 1.8 2004/09/24 07:13:57 roboos >% added support for CTF Markerfiles, using the readmarkerfile function I got from Tom Holroyd >% >% Revision 1.7 2004/09/21 13:09:46 roboos >% added 2 digital trigger channels for fif, analog triggers in fif file are only scanned if no digital triggers are present >% >% Revision 1.6 2004/09/20 11:48:31 roboos >% improved support for Neuromag, threshold all STI-channels at =>5 and treat STI014 as digital channel >% >% Revision 1.5 2004/09/03 09:02:29 roboos >% added raw>5 for flank detection for neuromag trigger channels >% >% Revision 1.4 2004/08/20 09:18:14 roboos >% changed event(i).sample for CTF trials >% implemented Neuromag format: trials and "STI xxx" channels >% >% Revision 1.3 2004/06/30 16:05:24 roboos >% added support for BrainVision marker file on a more general way than implemented in the read_brainvision_vmrk function >% added subfunction tokenize >% renamed dataset into filename >% >% Revision 1.2 2004/06/21 19:21:10 roberto >% renamed eventfile into dataset, added check for empty CTF classfile >% >% Revision 1.1 2004/06/03 09:15:22 roberto >% initial version, supported are CTF and eep_avr >% > >% detect the external toolboxes that optionally can be used >hasbiosig = (exist('sopen') & exist('sread')); % see http://biosig.sourceforge.net/ >hasmegpd = (exist('rawdata') & exist('channames')); % see http://www.kolumbus.fi/kuutela/programs/meg-pd/ >haseegsf = (exist('ctf_read_meg4') & exist('ctf_read_res4')); % see http://eeg.sourceforge.net/ > >% test whether the file exists >if ~exist(filename) > error(sprintf('file ''%s'' does not exist', filename)); >end > >% start with an empty event structure >event = []; > >%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >if filetype(filename, 'ctf_ds') || filetype(filename, 'ctf_meg4') || filetype(filename, 'ctf_res4') > > % obtain the dataset name > if filetype(filename, 'ctf_meg4') || filetype(filename, 'ctf_res4') > filename = fileparts(filename); > end > > [path, name, ext] = fileparts(filename); > headerfile = fullfile(path, [name ext], [name '.res4']); > datafile = fullfile(path, [name ext], [name '.meg4']); > classfile = fullfile(path, [name ext], 'ClassFile.cls'); > > hdr = read_ctf_res4(headerfile); > > % read the trigger codes from the STIM channel, usefull for (pseudo) continuous data > % this splits the trigger channel into the lowers and highest 16 bits, > % corresponding with the front and back panel of the electronics cabinet at the Donders Centre > [backpanel, frontpanel] = read_ctf_trigger(filename); > for i=find(backpanel(:)') > event(end+1).type = 'backpanel trigger'; > event(end ).sample = i; > event(end ).value = backpanel(i); > end > for i=find(frontpanel(:)') > event(end+1).type = 'frontpanel trigger'; > event(end ).sample = i; > event(end ).value = frontpanel(i); > end > > % determine the trigger channels from the header > if isfield(hdr, 'sensType') > for i=find(hdr.sensType(:)'==11) > % read the trigger channel as raw data > trig = read_ctf_meg4(datafile, hdr, 1, hdr.nTrials*hdr.nSamples, i); > % correct for reading it as signed integer, whereas it should be an unsigned int > trig(find(trig<0)) = trig(find(trig<0)) + 2^32; > % convert the trigger into an event with a value at a specific sample > for j=find(diff([0 trig(:)'])>1) > event(end+1).type = hdr.label{i}; > event(end ).sample = j; > event(end ).value = trig(j); > end > end > end > > % make an event for each trial as defined in the header > for i=1:hdr.nTrials > event(end+1).type = 'trial'; > event(end ).sample = (i-1)*hdr.nSamples + 1; > event(end ).offset = -hdr.nSamplesPre; > event(end ).duration = hdr.nSamples; > end > > % read the classification file and make an event for each classified trial > [condNumbers,condLabels] = read_ctf_cls(classfile); > if ~isempty(condNumbers) > Ncond = length(condLabels); > for i=1:Ncond > for j=1:length(condNumbers{i}) > event(end+1).type = 'classification'; > event(end ).value = condLabels{i}; > event(end ).sample = (condNumbers{i}{j}-1)*hdr.nSamples + 1; > event(end ).offset = -hdr.nSamplesPre; > event(end ).duration = hdr.nSamples; > end > end > end > > if exist(fullfile(filename,'MarkerFile.mrk')) > % read the marker file and make an event for each marker > % this depends on the readmarkerfile function that I got from Tom Holroyd > % I have not tested this myself extensively, since at the FCDC we > % don't use the marker files > mrk = readmarkerfile(filename); > for i=1:mrk.number_markers > for j=1:mrk.number_samples(i) > % determine the location of the marker, expressed in samples > trialnum = mrk.trial_times{i}(j,1); > synctime = mrk.trial_times{i}(j,2); > begsample = (trialnum-1)*hdr.nSamples + 1; % of the trial, relative to the start of the datafile > endsample = (trialnum )*hdr.nSamples; % of the trial, relative to the start of the datafile > offset = round(synctime*hdr.Fs); % this is the offset (in samples) relative to time t=0 for this trial > offset = offset + hdr.nSamplesPre; % and time t=0 corrsponds with the nSamplesPre'th sample > % store this marker as an event > event(end+1).type = mrk.marker_names{i}; > event(end ).value = []; > event(end ).sample = begsample + offset; > event(end ).duration = 0; > event(end ).offset = offset; > end > end > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'eep_avr') > % the headerfile and datafile are the same > hdr = read_fcdc_header(filename); > event(end+1).type = 'average'; > event(end ).sample = 1; > event(end ).duration = hdr.nSamples; > event(end ).offset = -hdr.nSamplesPre; > event(end ).value = []; > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'eep_cnt') > % try to read external trigger file in EEP format > trgfile = [filename(1:(end-3)), 'trg']; > if exist(trgfile, 'file') > hdr = read_fcdc_header(filename); > tmp = read_eep_trg(trgfile); > % translate the EEProbe trigger codes to events > for i=1:length(tmp) > event(i).type = 'trigger'; > event(i).sample = round((tmp(i).time/1000) * hdr.Fs) + 1; % convert from ms to samples > event(i).value = tmp(i).code; > event(i).offset = 0; > event(i).duration = 0; > end > else > warning('no triggerfile was found'); > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'brainvision_vhdr') || filetype(filename, 'brainvision_vmrk') > > if filetype(filename, 'brainvision_vhdr') > % read the headerfile belonging to the dataset and try to determine the corresponding markerfile > hdr = read_brainvision_vhdr(filename); > > % replace the filename with the filename of the markerfile > if ~isfield(hdr, 'MarkerFile') || isempty(hdr.MarkerFile) > filename = []; > else > [p, f, e] = fileparts(filename); > filename = fullfile(p, hdr.MarkerFile); > end > end > > fid=fopen(filename,'rt'); > if fid==-1, > error('cannot open BrainVision marker file') > end > > line = []; > while ischar(line) || isempty(line) > line = fgetl(fid); > if ~isempty(line) && ~(isnumeric(line) && line==-1) > if strncmpi(line, 'Mk', 2) > % this line contains a marker > tok = tokenize(line, '='); > if length(tok)~=2 > warning('skipping unexpected formatted line in BrainVision marker file'); > else > % the line looks like "MkXXX=YYY", which is ok > % the interesting part now is in the YYY, i.e. the second token > tok = tokenize(tok{2}, ','); > if isempty(tok{1}) > tok{1} = []; > end > if isempty(tok{2}) > tok{2} = []; > end > event(end+1).type = tok{1}; > event(end ).value = tok{2}; > event(end ).sample = str2num(tok{3}); > event(end ).duration = str2num(tok{4}); > event(end ).offset=[]; % added by H. F. Kwok, University of Birmingham Dec 2005 for compatibility with definetrial.m > end > end > end > end > fclose(fid); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'yokogawa_sqd') || filetype(filename, 'yokogawa_con') || filetype(filename, 'yokogawa_raw') > event = read_yokogawa_event(filename); > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'mpi_ds') || filetype(filename, 'mpi_dap') > hdr = read_fcdc_header(filename); > % determine the DAP files that compromise this dataset > if isdir(filename) > ls = dir(filename); > dapfile = {}; > for i=1:length(ls) > if ~isempty(regexp(ls(i).name, '.dap$')) > dapfile{end+1} = fullfile(filename, ls(i).name); > end > end > dapfile = sort(dapfile); > elseif iscell(filename) > dapfile = filename; > else > dapfile = {filename}; > end > % assume that each DAP file is accompanied by a dat file > % read the trigger values from the separate dat files > trg = []; > for i=1:length(dapfile) > datfile = [dapfile{i}(1:(end-4)) '.dat']; > trg = cat(1, trg, textread(datfile, '', 'headerlines', 1)); > end > % construct a event structure, one 'trialcode' event per trial > for i=1:length(trg) > event(i).type = 'trialcode'; % string > event(i).sample = (i-1)*hdr.nSamples + 1; % expressed in samples, first sample of file is 1 > event(i).value = trg(i); % number or string > event(i).offset = 0; % expressed in samples > event(i).duration = hdr.nSamples; % expressed in samples > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'ns_eeg') > hdr = read_fcdc_header(filename); > for i=1:hdr.nTrials > event(end+1).type = 'trial'; > event(end ).sample = (i-1)*hdr.nSamples + 1; > event(end ).value = []; > event(end ).offset = -hdr.nSamplesPre; > event(end ).duration = hdr.nSamples; > % read the data to determine manually accepted/rejected trials > tmp = read_ns_eeg(filename, i); > if tmp.sweep.accept > event(end).value = 'accept'; > else > event(end).value = 'reject'; > end > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'ns_cnt') > warning('handling of event structure has not been fully tested for Neuroscan *.cnt files'); > % this is a very inefficient implementation > % since it reads not only the event table, but also all data from the file > tmp = read_ns_cnt(filename); > % translate the cnt event table into known FieldTrip event types > for i=1:tmp.nevent > event(i).type = 'trigger'; > event(i).sample = tmp.event.frame(i); > event(i).value = tmp.event.stimtype(i); > event(i).offset = 0; > event(i).duration = 0; > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'besa_avr') > hdr = read_fcdc_header(filename); > event(end+1).type = 'average'; > event(end ).sample = 1; > event(end ).duration = hdr.nSamples; > event(end ).offset = -hdr.nSamplesPre; > event(end ).value = []; > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'neuromag_fif') > hdr = read_fcdc_header(filename); > % add the trials to the event structure > for i=1:hdr.nTrials > event(end+1).type = 'trial'; > event(end ).sample = (i-1)*hdr.nSamples + 1; > event(end ).value = []; > event(end ).offset = -hdr.nSamplesPre; > event(end ).duration = hdr.nSamples; > end > > % add triggers based on the binary trigger channel, this is based the following email > % > % On 14 Sep 2004, at 16:33, Lauri Parkkonen wrote: > % > Anke's file is probably quite recent one. It should have normal binary > % > coding on STI014 and its "analog" counterparts on STI1 ... STI6, > % > swinging between 0 ... +5 volts. These latter channels are virtual, > % > i.e., they are generated from STI014 for backwards compatibility. STI1 > % > is the LSB of STI014 etc. For all the new stuff, I would recommend > % > using STI014 as that's the way the triggers will be stored in the future > % > (maybe the channel name is going to change to something more reasonable > % > like TRIG). Unfortunately, some older files from the 306-channel system > % > have the STI014 coded in a different way - the two 8-bit halves code > % > the input and output triggers separately. > > triglab = {'STI 014', 'STI 015', 'STI 016'}; > trigindx = match_str(hdr.label, triglab); > if length(trigindx)>0 > % pad with the last sample of the previous block, start with zeros > pad = zeros(length(trigindx),1); > for i=1:hdr.nTrials > begsample = (i-1)*hdr.nSamples + 1; > endsample = (i )*hdr.nSamples; > raw = read_fcdc_data(filename, hdr, begsample, endsample, trigindx); > % detect the flank of the trigger > flank = ((diff([raw pad], [], 2) .* raw)~=0); > % for each flank in the TRIG channels, add an event > for j=1:length(trigindx) > for k=find(flank(j,:)) > event(end+1).type = 'trigger'; > event(end ).sample = begsample + k; > event(end ).value = raw(j,k); > event(end ).offset = []; > event(end ).duration = []; > end > end > % remember the last sample to ensure continuity with the next block > pad = raw(:,end); > end > end % if length(trigindx) > > % look for the analog triggers only if no binary trigger channel is present > if isempty(trigindx) > % add the triggers to the event structure based on trigger channels with the name "STI xxx" > % this is not a very efficient implementation, since it has to read all data > % furthermore, there are some issues with noise on these analog trigger channels > stimindx = []; > stimlab = {}; > for i=1:length(hdr.label) > if all(hdr.label{i}(1:3) == 'STI') > stimindx(end+1) = i; > stimlab{end+1} = hdr.label{i}; > end > end > if length(stimindx)>0 > % pad with the last sample of the previous block, start with zeros > pad = zeros(length(stimindx),1); > for i=1:hdr.nTrials > begsample = (i-1)*hdr.nSamples + 1; > endsample = (i )*hdr.nSamples; > raw = read_fcdc_data(filename, hdr, begsample, endsample, stimindx); > % detect the flank of the trigger > flank = ((diff([raw pad], [], 2) .* raw)~=0) & (raw>=5); > % Note: the original code read > % flank = (diff([raw pad], [], 2) .* raw)~=0; > % but according to Joachim, real events always have triggers > 5 > % for each flank in the STIM channels, add an event > for j=1:length(stimindx) > for k=find(flank(j,:)) > event(end+1).type = stimlab{j}; > event(end ).sample = begsample + k; > event(end ).value = raw(j,k); > event(end ).offset = []; > event(end ).duration = []; > end > end > % remember the last sample to ensure continuity with the next block > pad = raw(:,end); > end > end % if length(stimindx) > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'plexon_nex') > event = read_nex_event(filename); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'neuralynx_nev') || filetype(filename, 'neuralynx_ds') > if ~isdir(filename); > filename = fileparts(filename); % only the directory should be used here > end > % read the header and the events > hdr = read_neuralynx_header(filename); > nev = read_neuralynx_event(filename); > AcqStartTimeStamp = max(hdr.FirstTimeStamp); % the first sample that is present in all files is called "1" > for i=1:length(nev) > % add an event containing the string as value > event(end+1).type = 'EventString'; > event(end ).sample = round(hdr.SamplingFrequency * (nev(i).TimeStamp - AcqStartTimeStamp)/1e6) + 1; > event(end ).value = nev(i).EventString; > event(end ).offset = []; > event(end ).duration = []; > % add an event containing the TTL as value > event(end+1).type = 'TTLValue'; > event(end ).sample = round(hdr.SamplingFrequency * (nev(i).TimeStamp - AcqStartTimeStamp)/1e6) + 1; > event(end ).value = nev(i).TTLValue; > event(end ).offset = []; > event(end ).duration = []; > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % added by H. F. Kwok for University of Birmingham data > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename,'bham_bdf') > event=read_biosemi_event(filename); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >else > error('unknown filetype for events'); >end % different filetypes > >if ~isempty(event) > % sort the events on the sample on which they occur > [dum, indx] = sort([event.sample]); > event = event(indx); >else > warning(sprintf('no events found in %s', filename)); >end > >%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >% SUBFUNCTION that cuts a string into pieces on a user-defined separator character >%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >function [tok] = tokenize(str, sep) >tok = {}; >f = find(str==sep); >f = [0, f, length(str)+1]; >for i=1:(length(f)-1) > tok{i} = str((f(i)+1):(f(i+1)-1)); >end > > -- ************************************************************** Markus Werkle-Bergner, Dipl. Psych. Predoctoral Research Fellow Center for Lifespan Psychology Max Planck Institute for Human Development Lentzeallee 94, Room 211, D-14195 Berlin, Germany. Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 ************************************************************** From wibral at MPIH-FRANKFURT.MPG.DE Thu Dec 22 14:09:46 2005 From: wibral at MPIH-FRANKFURT.MPG.DE (Michael Wibral) Date: Thu, 22 Dec 2005 14:09:46 +0100 Subject: Manually Importing data In-Reply-To: Message-ID: Dear Colleagues, we have a dataset that is in some sense 'preprocessed' i.e. there is a little matrix (or concatenated ones) for each trial of each condition, we also have information on filters, electrode locations etc. but not in any of the usual file formats. As we would like to use the Multitaper analysis and coherence/phase locking we'll have to 'fake' a Fieldtrip dataset at some point by assembling the corresponding structutre by hand. What's the better entry point for this: before preproc (but then we'll have to make a trialfun etc.) or after preproc (where the structure is already quite involved, at least it looks like that). If we try to mimic a preprocessed dataset, which of the fields are mandatory? Thanks for any comment on this. Merry Christmas and a Happy New Year to everyone. Michael Wibral M. Wibral MSc. Max Planck Institute for Brain Research Dept. Neurophysiology Deutschordenstrasse 46 60528 Frankfurt am Main Germany Phone: +49(0)69/6301-83849 +49(0)173/4966728 Fax: +49(0)69/96769-327 From r.oostenveld at FCDONDERS.RU.NL Fri Dec 23 11:27:01 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 23 Dec 2005 11:27:01 +0100 Subject: Manually Importing data In-Reply-To: <43AAA59A.7050908@mpih-frankfurt.mpg.de> Message-ID: Dear Michael On 22-dec-2005, at 14:09, Michael Wibral wrote: > /phase locking we'll have to 'fake' a Fieldtrip dataset at some > point by assembling the corresponding structutre by hand. What's > the better entry point for this: before preproc (but then we'll > have to make a trialfun etc.) or after preproc (where the > structure is already quite involved, at least it looks like that). > If we try to mimic a preprocessed dataset, which of the fields are > mandatory? In your case it is much easier to do it after preprocessing. The output of the preprocessing function, which you have to mimic, is data.trial = 1xNtrials cell-array, each containing Nchans X Nsamples data.time = 1xNtrials cell-array, each containing 1 X Nsamples data.fsample = number in Hz data.cfg = []; this will do data.label = Nchans X 1 cell-array with strings, e.g. {'Fp1', 'Fpz', ...} I guess that most of this is straightforward. Since we support trials of variable length, each trial has its own time axis. In most cases with fixed-length trial data, data.time{i} is the same for all i. About electrode locations: you can add a data.elec field, but that is optional. The elec structure contains elec.pnt = Nelec X 3 matrix with carthesian xyz locations elec.label = Nelec x 1 cell array, see above. Since not all datachannels have to be associated with an electrode location (e.g. bipolar EMG channels or a force channel) and since not all electrodes in an electrode cap have to be connected to the amplifier, the electrode structure can contain a longer (or shorter) list of positions and labels. Whenever needed (e.g. for topoplotting or clusterrandanalysis), Fieldtrip will select and use the electrode positions and physiological values that correspond in the data itself and in the elec structure. best wishes, Robert From wibral at MPIH-FRANKFURT.MPG.DE Mon Dec 5 20:11:32 2005 From: wibral at MPIH-FRANKFURT.MPG.DE (Michael Wibral) Date: Mon, 5 Dec 2005 20:11:32 +0100 Subject: maxsum vs. maxsumt In-Reply-To: Message-ID: Hi, I just noticed that my version of clusterrandanalysis (20051127) doesn't list the teststatistic 'maxsumt' in its header or in the actual code as it is used in the tutorial (toolkit 2005). Instead there's an option (the default) 'maxsum'. Are these two the same - or is maxsum just the summed raw effect within a cluster ( and thus maybe pretty sensitive to extreme outliers), whereas maxsumt refers to summed t-scores from the initial tests performed for cluster finding? I also notice that maxsum 'always' yields more significants clusters than orderedsums, is there an explanation for this behaviour (I thought it might rather be the other way round...)? Best Regards, Michael Wibral From maris at NICI.RU.NL Mon Dec 5 22:05:00 2005 From: maris at NICI.RU.NL (Eric Maris) Date: Mon, 5 Dec 2005 22:05:00 +0100 Subject: maxsum vs. maxsumt Message-ID: Hi Michael, > I just noticed that my version of clusterrandanalysis (20051127) doesn't > list the teststatistic 'maxsumt' in its header or in the actual code as it > is used in the tutorial (toolkit 2005). Instead there's an option (the > default) 'maxsum'. Are these two the same - or is maxsum just the summed > raw effect within a cluster ( and thus maybe pretty sensitive to extreme > outliers), whereas maxsumt refers to summed t-scores from the initial > tests performed for cluster finding? The change from 'maxsumt' to 'maxsum' occured when clusterrandanalysis also supported F-statistics at the level of (sensor,frequency,time)-triplets. Using 'cfg.clusterteststat=maxsum' in combination with 'cfg.statistic=indepsamplesT' gives the same results as the 'maxsumt'-option of the older version of clusterrandanalysis. > I also notice that maxsum 'always' yields more significants clusters than > orderedsums, is there an explanation for this behaviour (I thought it > might rather be the other way round...)? I am not surprised. The behavior of 'cfg.clusterteststat=orderedsums' depends on the value assigned to 'cfg.smallestcluster'. If you give 'cfg.smallestcluster' a small value, this will reduce the sensitivity for larger clusters (larger than this small value). The option 'cfg.clusterteststat=orderedsums' will result in more significant clusters than obtained with 'cfg.clusterteststat=maxsum' if the data contain one big cluster and a number of much smaller (but systematic) clusters. These smaller clusters may become significant with 'cfg.clusterteststat=orderedsums' if their size is larger than 'cfg.smallestcluster'. The value of 'cfg.smallestcluster' should be determined independently of the data. I guess there is no need to explain why this so. greetings, Eric Maris From wibral at MPIH-FRANKFURT.MPG.DE Wed Dec 7 11:15:53 2005 From: wibral at MPIH-FRANKFURT.MPG.DE (Michael Wibral) Date: Wed, 7 Dec 2005 11:15:53 +0100 Subject: maxsum vs. maxsumt In-Reply-To: <001a01c5f9df$8e3a3610$6401a8c0@fcdc195> Message-ID: Hi Eric, thank you for pointing out the importnace of smalllestcluster for the potential significance estimations of large cluster. Best Regards, Michael Wibral Eric Maris schrieb: > Hi Michael, > > >> I just noticed that my version of clusterrandanalysis (20051127) >> doesn't list the teststatistic 'maxsumt' in its header or in the >> actual code as it is used in the tutorial (toolkit 2005). Instead >> there's an option (the default) 'maxsum'. Are these two the same - or >> is maxsum just the summed raw effect within a cluster ( and thus >> maybe pretty sensitive to extreme outliers), whereas maxsumt refers >> to summed t-scores from the initial tests performed for cluster finding? > > > The change from 'maxsumt' to 'maxsum' occured when clusterrandanalysis > also supported F-statistics at the level of > (sensor,frequency,time)-triplets. Using 'cfg.clusterteststat=maxsum' > in combination with 'cfg.statistic=indepsamplesT' gives the same > results as the 'maxsumt'-option of the older version of > clusterrandanalysis. > > >> I also notice that maxsum 'always' yields more significants clusters >> than orderedsums, is there an explanation for this behaviour (I >> thought it might rather be the other way round...)? > > > I am not surprised. The behavior of 'cfg.clusterteststat=orderedsums' > depends on the value assigned to 'cfg.smallestcluster'. If you give > 'cfg.smallestcluster' a small value, this will reduce the sensitivity > for larger clusters (larger than this small value). The option > 'cfg.clusterteststat=orderedsums' will result in more significant > clusters than obtained with 'cfg.clusterteststat=maxsum' if the data > contain one big cluster and a number of much smaller (but systematic) > clusters. These smaller clusters may become significant with > 'cfg.clusterteststat=orderedsums' if their size is larger than > 'cfg.smallestcluster'. The value of 'cfg.smallestcluster' should be > determined independently of the data. I guess there is no need to > explain why this so. > > > greetings, > > Eric Maris > > . > From Sehatpour at NKI.RFMH.ORG Tue Dec 13 04:09:14 2005 From: Sehatpour at NKI.RFMH.ORG (Sehatpour, Pejman) Date: Mon, 12 Dec 2005 22:09:14 -0500 Subject: topoplotER shows error message Message-ID: Hi, I am going through the tutorial for "event related averaging" and everything worked well untill I got to plotting the topographic distribution using the topoplotER. At this point when I enter the command which is in the tutorial, I get an error message as follows: cfg = []; cfg.xlim = [0.3 0.5]; topoplotER(cfg,avgFIC) creating layout for ctf151 MEG system ??? Undefined command/function 'dist'. Error in ==> work\private\createlayout at 100 d = dist(prj'); Error in ==> topoplotER at 184 lay = createlayout(data.grad); Could someone please tell me what this error is? and how it should be corrected? The topoplotER version that I am using is from today 12/12/05 Thanks, Pejman. From r.oostenveld at FCDONDERS.RU.NL Tue Dec 13 11:24:40 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 13 Dec 2005 11:24:40 +0100 Subject: topoplotER shows error message In-Reply-To: <52E9E57B58FA71468E55CD3CDE7BE180046D1EE7@nki-exch.nki.rfmh.org> Message-ID: Dear Pejman Thanks for reporting the bug. The "dist" function seems to be missing in the ftp version of fieldtrip/private. Since there is also a "dist" function in the neural networks toolbox that works exactly the same, I (and probably other users as well) did not notice the function to be missing. Please find the function attached, put it in the fieldtrip/private subdirectory. I will also include it in the next ftp release. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: dist.m Type: application/octet-stream Size: 609 bytes Desc: not available URL: -------------- next part -------------- On 13-dec-2005, at 4:09, Sehatpour, Pejman wrote: > Hi, > I am going through the tutorial for "event related averaging" and > everything worked well untill I got to plotting the topographic > distribution using the topoplotER. > At this point when I enter the command which is in the tutorial, I > get an error message as follows: > > cfg = []; > cfg.xlim = [0.3 0.5]; > topoplotER(cfg,avgFIC) > creating layout for ctf151 MEG system > ??? Undefined command/function 'dist'. > Error in ==> work\private\createlayout at 100 > d = dist(prj'); > Error in ==> topoplotER at 184 > lay = createlayout(data.grad); > > > Could someone please tell me what this error is? and how it should > be corrected? > The topoplotER version that I am using is from today 12/12/05 > Thanks, > Pejman. > From werkle at MPIB-BERLIN.MPG.DE Thu Dec 15 18:28:10 2005 From: werkle at MPIB-BERLIN.MPG.DE (Markus Werkle-Bergner) Date: Thu, 15 Dec 2005 18:28:10 +0100 Subject: Problems reading BVA data (segmented) In-Reply-To: Message-ID: Dear all, I'm a beginner with fieldtrip, therefore I probably have an easy question. I try to read in EEG-data that I already preprocessed in Brainvision Analyser. The data is therefore already segmented. From the tutorials and the discussion list, I understood that I should nevertheless use the function preprocessing.m. Now my guess is that I have trouble with the definition of trials from my data-set. I used the following script to read the data: cfg = [] % General settings cfg.datafile = 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.dat'; cfg.headerfile = 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vhdr'; cfg.channel = 'all'; %Trialdefinition cfg.trialfun = 'trialfun_brainvision'; cfg.trialdef.trgfile = 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vmkr'; cfg.trialdef.stim = 'HFC'; cfg.trialdef.segment = 'no'; cfg.trialdef.timezero = 'no'; cfg.trialdef.eventtype = 'Stimulus'; cfg.trialdef.eventvalue = 'HFC'; cfg.trialdef.prestim = 0.500; cfg.trialdef.poststim = 0.600; [cfg]=definetrial(cfg) [raw] = preprocessing(cfg) When I run this script, I get the following error-message: ??? Error using ==> fieldtrip-20051214\private\read_brainvision_vmrk cannot open marker file Error in ==> fieldtrip-20051214\private\trialfun_brainvision at 16 [stim, resp, segment, timezero] = read_brainvision_vmrk(cfg.trialdef.trgfile); Error in ==> definetrial at 151 trl = feval(cfg.trialfun, cfg); Error in ==> FieldtripTest at 17 [cfg]=definetrial(cfg) I checked that the *.dat, *.vhdr, and *.vmrk files are all in the location specified in the script. I really would appreciate if one can give me some advice. Best regards, Markus P.S.: I added the *.vhdr, and *.vmrk files. Perhaps this information is needed. -- ************************************************************** Markus Werkle-Bergner, Dipl. Psych. Predoctoral Research Fellow Center for Lifespan Psychology Max Planck Institute for Human Development Lentzeallee 94, Room 211, D-14195 Berlin, Germany. Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 ************************************************************** -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: mdo13136_1_HFCrej.vmrk URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: mdo13136_1_HFCrej.vhdr URL: From arno at SALK.EDU Fri Dec 16 09:44:44 2005 From: arno at SALK.EDU (arno) Date: Fri, 16 Dec 2005 09:44:44 +0100 Subject: Problems reading BVA data (segmented) In-Reply-To: <43A1A7AA.3060601@mpib-berlin.mpg.de> Message-ID: Dear Markus, in case nothing else works, try also the BVA matlab plugin for EEGLAB. Functions can be called from the command line. Then you can convert the EEGLAB structure to fieldtrip using eeglab2fieldtrip. http://cvs.sourceforge.net/viewcvs.py/bva-io/bva-io/ Best, Arno Markus Werkle-Bergner wrote: > Dear all, > > I'm a beginner with fieldtrip, therefore I probably have an easy > question. > > I try to read in EEG-data that I already preprocessed in Brainvision > Analyser. The data is therefore already segmented. From the tutorials > and the discussion list, I understood that I should nevertheless use > the function preprocessing.m. Now my guess is that I have trouble with > the definition of trials from my data-set. I used the following script > to read the data: > > cfg = [] > % General settings > cfg.datafile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.dat'; > cfg.headerfile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vhdr'; > cfg.channel = 'all'; > %Trialdefinition > cfg.trialfun = 'trialfun_brainvision'; > cfg.trialdef.trgfile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vmkr'; > cfg.trialdef.stim = 'HFC'; > cfg.trialdef.segment = 'no'; > cfg.trialdef.timezero = 'no'; > cfg.trialdef.eventtype = 'Stimulus'; > cfg.trialdef.eventvalue = 'HFC'; > cfg.trialdef.prestim = 0.500; > cfg.trialdef.poststim = 0.600; > > [cfg]=definetrial(cfg) > [raw] = preprocessing(cfg) > > When I run this script, I get the following error-message: > > ??? Error using ==> fieldtrip-20051214\private\read_brainvision_vmrk > cannot open marker file > > Error in ==> fieldtrip-20051214\private\trialfun_brainvision at 16 > [stim, resp, segment, timezero] = > read_brainvision_vmrk(cfg.trialdef.trgfile); > > Error in ==> definetrial at 151 > trl = feval(cfg.trialfun, cfg); > > Error in ==> FieldtripTest at 17 > [cfg]=definetrial(cfg) > > I checked that the *.dat, *.vhdr, and *.vmrk files are all in the > location specified in the script. I really would appreciate if one can > give me some advice. > > Best regards, > Markus > > P.S.: I added the *.vhdr, and *.vmrk files. Perhaps this information > is needed. > >------------------------------------------------------------------------ > >Brain Vision Data Exchange Marker File, Version 1.0 >; Data created from history path: mdo13136_1/Raw Data/Markers Changed/AnneMarker/Segmentation/OddCSt/HFC/Artifact Rejection >; The channel numbers are related to the channels in the exported file. > >[Common Infos] >DataFile=mdo13136_1_HFCrej.dat > >[Marker Infos] >; Each entry: Mk=,,, >; , , >; >; Fields are delimited by commas, some fields might be omited (empty). >; Commas in type or description text are coded as "\1". >Mk1=New Segment,,1,1,0,20031211162420402948 >Mk2=Stimulus,HFC,251,1,0 >Mk3=Time 0,,251,1,0 >Mk4=New Segment,,551,1,0,20031211162424374948 >Mk5=Stimulus,HFC,801,1,0 >Mk6=Time 0,,801,1,0 >Mk7=New Segment,,1101,1,0,20031211162425732947 >Mk8=Stimulus,HFC,1351,1,0 >Mk9=Time 0,,1351,1,0 >Mk10=New Segment,,1651,1,0,20031211162428430948 >Mk11=Stimulus,HFC,1901,1,0 >Mk12=Time 0,,1901,1,0 >Mk13=New Segment,,2201,1,0,20031211162429732948 >Mk14=Stimulus,HFC,2451,1,0 >Mk15=Time 0,,2451,1,0 >Mk16=New Segment,,2751,1,0,20031211162431122948 >Mk17=Stimulus,HFC,3001,1,0 >Mk18=Time 0,,3001,1,0 >Mk19=New Segment,,3301,1,0,20031211162432516947 >Mk20=Stimulus,HFC,3551,1,0 >Mk21=Time 0,,3551,1,0 >Mk22=New Segment,,3851,1,0,20031211162435158947 >Mk23=Time 0,,4101,1,0 >Mk24=Stimulus,HFC,4101,1,0 >Mk25=New Segment,,4401,1,0,20031211162436430948 >Mk26=Time 0,,4651,1,0 >Mk27=Stimulus,HFC,4651,1,0 >Mk28=New Segment,,4951,1,0,20031211162437902948 >Mk29=Time 0,,5201,1,0 >Mk30=Stimulus,HFC,5201,1,0 >Mk31=New Segment,,5501,1,0,20031211162439208948 >Mk32=Stimulus,HFC,5751,1,0 >Mk33=Time 0,,5751,1,0 >Mk34=New Segment,,6051,1,0,20031211162442154948 >Mk35=Stimulus,HFC,6301,1,0 >Mk36=Time 0,,6301,1,0 >Mk37=New Segment,,6601,1,0,20031211162443594947 >Mk38=Stimulus,HFC,6851,1,0 >Mk39=Time 0,,6851,1,0 >Mk40=New Segment,,7151,1,0,20031211162444934947 >Mk41=Stimulus,HFC,7401,1,0 >Mk42=Time 0,,7401,1,0 >Mk43=New Segment,,7701,1,0,20031211162446334947 >Mk44=Stimulus,HFC,7951,1,0 >Mk45=Time 0,,7951,1,0 >Mk46=New Segment,,8251,1,0,20031211162447634948 >Mk47=Time 0,,8501,1,0 >Mk48=Stimulus,HFC,8501,1,0 >Mk49=New Segment,,8801,1,0,20031211162450298948 >Mk50=Stimulus,HFC,9051,1,0 >Mk51=Time 0,,9051,1,0 >Mk52=New Segment,,9351,1,0,20031211162453138948 >Mk53=Stimulus,HFC,9601,1,0 >Mk54=Time 0,,9601,1,0 >Mk55=New Segment,,9901,1,0,20031211162454462948 >Mk56=Time 0,,10151,1,0 >Mk57=Stimulus,HFC,10151,1,0 >Mk58=New Segment,,10451,1,0,20031211162455922948 >Mk59=Stimulus,HFC,10701,1,0 >Mk60=Time 0,,10701,1,0 >Mk61=New Segment,,11001,1,0,20031211162457290947 >Mk62=Time 0,,11251,1,0 >Mk63=Stimulus,HFC,11251,1,0 >Mk64=New Segment,,11551,1,0,20031211162458498947 >Mk65=Time 0,,11801,1,0 >Mk66=Stimulus,HFC,11801,1,0 >Mk67=New Segment,,12101,1,0,20031211162459800947 >Mk68=Time 0,,12351,1,0 >Mk69=Stimulus,HFC,12351,1,0 >Mk70=New Segment,,12651,1,0,20031211162501014948 >Mk71=Stimulus,HFC,12901,1,0 >Mk72=Time 0,,12901,1,0 >Mk73=New Segment,,13201,1,0,20031211162502270948 >Mk74=Time 0,,13451,1,0 >Mk75=Stimulus,HFC,13451,1,0 >Mk76=New Segment,,13751,1,0,20031211162503716948 >Mk77=Stimulus,HFC,14001,1,0 >Mk78=Time 0,,14001,1,0 >Mk79=New Segment,,14301,1,0,20031211162505206947 >Mk80=Time 0,,14551,1,0 >Mk81=Stimulus,HFC,14551,1,0 >Mk82=New Segment,,14851,1,0,20031211162506654948 >Mk83=Time 0,,15101,1,0 >Mk84=Stimulus,HFC,15101,1,0 >Mk85=New Segment,,15401,1,0,20031211162509204948 >Mk86=Time 0,,15651,1,0 >Mk87=Stimulus,HFC,15651,1,0 >Mk88=New Segment,,15951,1,0,20031211162510522947 >Mk89=Stimulus,HFC,16201,1,0 >Mk90=Time 0,,16201,1,0 >Mk91=New Segment,,16501,1,0,20031211162511826948 >Mk92=Stimulus,HFC,16751,1,0 >Mk93=Time 0,,16751,1,0 >Mk94=New Segment,,17051,1,0,20031211162513182948 >Mk95=Stimulus,HFC,17301,1,0 >Mk96=Time 0,,17301,1,0 >Mk97=New Segment,,17601,1,0,20031211162516068947 >Mk98=Stimulus,HFC,17851,1,0 >Mk99=Time 0,,17851,1,0 >Mk100=New Segment,,18151,1,0,20031211162517532948 >Mk101=Stimulus,HFC,18401,1,0 >Mk102=Time 0,,18401,1,0 >Mk103=New Segment,,18701,1,0,20031211162520134948 >Mk104=Stimulus,HFC,18951,1,0 >Mk105=Time 0,,18951,1,0 >Mk106=New Segment,,19251,1,0,20031211162521592947 >Mk107=Time 0,,19501,1,0 >Mk108=Stimulus,HFC,19501,1,0 >Mk109=New Segment,,19801,1,0,20031211162522982948 >Mk110=Time 0,,20051,1,0 >Mk111=Stimulus,HFC,20051,1,0 >Mk112=New Segment,,20351,1,0,20031211162524374947 >Mk113=Stimulus,HFC,20601,1,0 >Mk114=Time 0,,20601,1,0 >Mk115=New Segment,,20901,1,0,20031211162525870947 >Mk116=Time 0,,21151,1,0 >Mk117=Stimulus,HFC,21151,1,0 >Mk118=New Segment,,21451,1,0,20031211162527098947 >Mk119=Time 0,,21701,1,0 >Mk120=Stimulus,HFC,21701,1,0 >Mk121=New Segment,,22001,1,0,20031211162528502948 >Mk122=Time 0,,22251,1,0 >Mk123=Stimulus,HFC,22251,1,0 >Mk124=New Segment,,22551,1,0,20031211162529716948 >Mk125=Stimulus,HFC,22801,1,0 >Mk126=Time 0,,22801,1,0 >Mk127=New Segment,,23101,1,0,20031211162531162947 >Mk128=Time 0,,23351,1,0 >Mk129=Stimulus,HFC,23351,1,0 >Mk130=New Segment,,23651,1,0,20031211162532546947 >Mk131=Stimulus,HFC,23901,1,0 >Mk132=Time 0,,23901,1,0 >Mk133=New Segment,,24201,1,0,20031211162533924948 >Mk134=Stimulus,HFC,24451,1,0 >Mk135=Time 0,,24451,1,0 >Mk136=New Segment,,24751,1,0,20031211162535330947 >Mk137=Time 0,,25001,1,0 >Mk138=Stimulus,HFC,25001,1,0 >Mk139=New Segment,,25301,1,0,20031211162536630948 >Mk140=Time 0,,25551,1,0 >Mk141=Stimulus,HFC,25551,1,0 >Mk142=New Segment,,25851,1,0,20031211162537974948 >Mk143=Time 0,,26101,1,0 >Mk144=Stimulus,HFC,26101,1,0 >Mk145=New Segment,,26401,1,0,20031211162539290948 >Mk146=Time 0,,26651,1,0 >Mk147=Stimulus,HFC,26651,1,0 >Mk148=New Segment,,26951,1,0,20031211162543326947 >Mk149=Time 0,,27201,1,0 >Mk150=Stimulus,HFC,27201,1,0 >Mk151=New Segment,,27501,1,0,20031211162545958947 >Mk152=Time 0,,27751,1,0 >Mk153=Stimulus,HFC,27751,1,0 >Mk154=New Segment,,28051,1,0,20031211162547342948 >Mk155=Time 0,,28301,1,0 >Mk156=Stimulus,HFC,28301,1,0 >Mk157=New Segment,,28601,1,0,20031211162548594947 >Mk158=Time 0,,28851,1,0 >Mk159=Stimulus,HFC,28851,1,0 >Mk160=New Segment,,29151,1,0,20031211162549830948 >Mk161=Time 0,,29401,1,0 >Mk162=Stimulus,HFC,29401,1,0 >Mk163=New Segment,,29701,1,0,20031211162551038948 >Mk164=Time 0,,29951,1,0 >Mk165=Stimulus,HFC,29951,1,0 >Mk166=New Segment,,30251,1,0,20031211162553710947 >Mk167=Time 0,,30501,1,0 >Mk168=Stimulus,HFC,30501,1,0 >Mk169=New Segment,,30801,1,0,20031211162555198948 >Mk170=Time 0,,31051,1,0 >Mk171=Stimulus,HFC,31051,1,0 >Mk172=New Segment,,31351,1,0,20031211162556648947 >Mk173=Stimulus,HFC,31601,1,0 >Mk174=Time 0,,31601,1,0 >Mk175=New Segment,,31901,1,0,20031211162557940948 >Mk176=Stimulus,HFC,32151,1,0 >Mk177=Time 0,,32151,1,0 >Mk178=New Segment,,32451,1,0,20031211162559320947 >Mk179=Stimulus,HFC,32701,1,0 >Mk180=Time 0,,32701,1,0 >Mk181=New Segment,,33001,1,0,20031211162600694948 >Mk182=Time 0,,33251,1,0 >Mk183=Stimulus,HFC,33251,1,0 >Mk184=New Segment,,33551,1,0,20031211162603296948 >Mk185=Time 0,,33801,1,0 >Mk186=Stimulus,HFC,33801,1,0 >Mk187=New Segment,,34101,1,0,20031211162607310947 >Mk188=Stimulus,HFC,34351,1,0 >Mk189=Time 0,,34351,1,0 >Mk190=New Segment,,34651,1,0,20031211162608558948 >Mk191=Stimulus,HFC,34901,1,0 >Mk192=Time 0,,34901,1,0 >Mk193=New Segment,,35201,1,0,20031211162609864948 >Mk194=Stimulus,HFC,35451,1,0 >Mk195=Time 0,,35451,1,0 >Mk196=New Segment,,35751,1,0,20031211162612548947 >Mk197=Stimulus,HFC,36001,1,0 >Mk198=Time 0,,36001,1,0 >Mk199=New Segment,,36301,1,0,20031211162613862948 >Mk200=Time 0,,36551,1,0 >Mk201=Stimulus,HFC,36551,1,0 >Mk202=New Segment,,36851,1,0,20031211162615336947 >Mk203=Stimulus,HFC,37101,1,0 >Mk204=Time 0,,37101,1,0 >Mk205=New Segment,,37401,1,0,20031211162616834948 >Mk206=Time 0,,37651,1,0 >Mk207=Stimulus,HFC,37651,1,0 >Mk208=New Segment,,37951,1,0,20031211162618178948 >Mk209=Stimulus,HFC,38201,1,0 >Mk210=Time 0,,38201,1,0 >Mk211=New Segment,,38501,1,0,20031211162619552948 >Mk212=Stimulus,HFC,38751,1,0 >Mk213=Time 0,,38751,1,0 >Mk214=New Segment,,39051,1,0,20031211162622136947 >Mk215=Stimulus,HFC,39301,1,0 >Mk216=Time 0,,39301,1,0 >Mk217=New Segment,,39601,1,0,20031211162624838948 >Mk218=Stimulus,HFC,39851,1,0 >Mk219=Time 0,,39851,1,0 >Mk220=New Segment,,40151,1,0,20031211162626222948 >Mk221=Time 0,,40401,1,0 >Mk222=Stimulus,HFC,40401,1,0 >Mk223=New Segment,,40701,1,0,20031211162627450947 >Mk224=Stimulus,HFC,40951,1,0 >Mk225=Time 0,,40951,1,0 >Mk226=New Segment,,41251,1,0,20031211162628698948 >Mk227=Stimulus,HFC,41501,1,0 >Mk228=Time 0,,41501,1,0 >Mk229=New Segment,,41801,1,0,20031211162630104948 >Mk230=Stimulus,HFC,42051,1,0 >Mk231=Time 0,,42051,1,0 >Mk232=New Segment,,42351,1,0,20031211162631464947 >Mk233=Stimulus,HFC,42601,1,0 >Mk234=Time 0,,42601,1,0 >Mk235=New Segment,,42901,1,0,20031211162632692948 >Mk236=Stimulus,HFC,43151,1,0 >Mk237=Time 0,,43151,1,0 >Mk238=New Segment,,43451,1,0,20031211162633962947 >Mk239=Stimulus,HFC,43701,1,0 >Mk240=Time 0,,43701,1,0 >Mk241=New Segment,,44001,1,0,20031211162635376948 >Mk242=Time 0,,44251,1,0 >Mk243=Stimulus,HFC,44251,1,0 >Mk244=New Segment,,44551,1,0,20031211162636716948 >Mk245=Time 0,,44801,1,0 >Mk246=Stimulus,HFC,44801,1,0 >Mk247=New Segment,,45101,1,0,20031211162638194948 >Mk248=Time 0,,45351,1,0 >Mk249=Stimulus,HFC,45351,1,0 >Mk250=New Segment,,45651,1,0,20031211162639456947 >Mk251=Time 0,,45901,1,0 >Mk252=Stimulus,HFC,45901,1,0 >Mk253=New Segment,,46201,1,0,20031211162640836948 >Mk254=Stimulus,HFC,46451,1,0 >Mk255=Time 0,,46451,1,0 >Mk256=New Segment,,46751,1,0,20031211162642122947 >Mk257=Stimulus,HFC,47001,1,0 >Mk258=Time 0,,47001,1,0 >Mk259=New Segment,,47301,1,0,20031211162643426948 >Mk260=Stimulus,HFC,47551,1,0 >Mk261=Time 0,,47551,1,0 >Mk262=New Segment,,47851,1,0,20031211162644918947 >Mk263=Stimulus,HFC,48101,1,0 >Mk264=Time 0,,48101,1,0 >Mk265=New Segment,,48401,1,0,20031211162647476947 >Mk266=Time 0,,48651,1,0 >Mk267=Stimulus,HFC,48651,1,0 >Mk268=New Segment,,48951,1,0,20031211162648800948 >Mk269=Stimulus,HFC,49201,1,0 >Mk270=Time 0,,49201,1,0 >Mk271=New Segment,,49501,1,0,20031211162650032947 >Mk272=Stimulus,HFC,49751,1,0 >Mk273=Time 0,,49751,1,0 >Mk274=New Segment,,50051,1,0,20031211162651516948 >Mk275=Stimulus,HFC,50301,1,0 >Mk276=Time 0,,50301,1,0 >Mk277=New Segment,,50601,1,0,20031211162654074947 >Mk278=Stimulus,HFC,50851,1,0 >Mk279=Time 0,,50851,1,0 >Mk280=New Segment,,51151,1,0,20031211162655472947 >Mk281=Stimulus,HFC,51401,1,0 >Mk282=Time 0,,51401,1,0 >Mk283=New Segment,,51701,1,0,20031211162656774948 >Mk284=Stimulus,HFC,51951,1,0 >Mk285=Time 0,,51951,1,0 >Mk286=New Segment,,52251,1,0,20031211162658156948 >Mk287=Stimulus,HFC,52501,1,0 >Mk288=Time 0,,52501,1,0 >Mk289=New Segment,,52801,1,0,20031211162702070948 >Mk290=Time 0,,53051,1,0 >Mk291=Stimulus,HFC,53051,1,0 >Mk292=New Segment,,53351,1,0,20031211162703302947 >Mk293=Time 0,,53601,1,0 >Mk294=Stimulus,HFC,53601,1,0 >Mk295=New Segment,,53901,1,0,20031211162704738948 >Mk296=Stimulus,HFC,54151,1,0 >Mk297=Time 0,,54151,1,0 >Mk298=New Segment,,54451,1,0,20031211162707646948 >Mk299=Stimulus,HFC,54701,1,0 >Mk300=Time 0,,54701,1,0 >Mk301=New Segment,,55001,1,0,20031211162710232948 >Mk302=Time 0,,55251,1,0 >Mk303=Stimulus,HFC,55251,1,0 >Mk304=New Segment,,55551,1,0,20031211162711586947 >Mk305=Stimulus,HFC,55801,1,0 >Mk306=Time 0,,55801,1,0 >Mk307=New Segment,,56101,1,0,20031211162712942948 >Mk308=Time 0,,56351,1,0 >Mk309=Stimulus,HFC,56351,1,0 >Mk310=New Segment,,56651,1,0,20031211162714412947 >Mk311=Time 0,,56901,1,0 >Mk312=Stimulus,HFC,56901,1,0 >Mk313=New Segment,,57201,1,0,20031211162715810948 >Mk314=Time 0,,57451,1,0 >Mk315=Stimulus,HFC,57451,1,0 >Mk316=New Segment,,57751,1,0,20031211162717290947 >Mk317=Stimulus,HFC,58001,1,0 >Mk318=Time 0,,58001,1,0 >Mk319=New Segment,,58301,1,0,20031211162718598948 >Mk320=Time 0,,58551,1,0 >Mk321=Stimulus,HFC,58551,1,0 >Mk322=New Segment,,58851,1,0,20031211162721318948 >Mk323=Time 0,,59101,1,0 >Mk324=Stimulus,HFC,59101,1,0 >Mk325=New Segment,,59401,1,0,20031211162722572948 >Mk326=Time 0,,59651,1,0 >Mk327=Stimulus,HFC,59651,1,0 >Mk328=New Segment,,59951,1,0,20031211162723952948 >Mk329=Time 0,,60201,1,0 >Mk330=Stimulus,HFC,60201,1,0 >Mk331=New Segment,,60501,1,0,20031211162725270948 >Mk332=Time 0,,60751,1,0 >Mk333=Stimulus,HFC,60751,1,0 >Mk334=New Segment,,61051,1,0,20031211162726724948 >Mk335=Stimulus,HFC,61301,1,0 >Mk336=Time 0,,61301,1,0 >Mk337=New Segment,,61601,1,0,20031211162728050947 >Mk338=Stimulus,HFC,61851,1,0 >Mk339=Time 0,,61851,1,0 >Mk340=New Segment,,62151,1,0,20031211162729476947 >Mk341=Stimulus,HFC,62401,1,0 >Mk342=Time 0,,62401,1,0 >Mk343=New Segment,,62701,1,0,20031211162730904948 >Mk344=Stimulus,HFC,62951,1,0 >Mk345=Time 0,,62951,1,0 >Mk346=New Segment,,63251,1,0,20031211162733452947 >Mk347=Time 0,,63501,1,0 >Mk348=Stimulus,HFC,63501,1,0 >Mk349=New Segment,,63801,1,0,20031211162734692948 >Mk350=Stimulus,HFC,64051,1,0 >Mk351=Time 0,,64051,1,0 >Mk352=New Segment,,64351,1,0,20031211162736090947 >Mk353=Time 0,,64601,1,0 >Mk354=Stimulus,HFC,64601,1,0 >Mk355=New Segment,,64901,1,0,20031211162738694948 >Mk356=Time 0,,65151,1,0 >Mk357=Stimulus,HFC,65151,1,0 >Mk358=New Segment,,65451,1,0,20031211162740170947 >Mk359=Stimulus,HFC,65701,1,0 >Mk360=Time 0,,65701,1,0 >Mk361=New Segment,,66001,1,0,20031211162741634947 >Mk362=Stimulus,HFC,66251,1,0 >Mk363=Time 0,,66251,1,0 >Mk364=New Segment,,66551,1,0,20031211162742894948 >Mk365=Stimulus,HFC,66801,1,0 >Mk366=Time 0,,66801,1,0 >Mk367=New Segment,,67101,1,0,20031211162744208947 >Mk368=Stimulus,HFC,67351,1,0 >Mk369=Time 0,,67351,1,0 >Mk370=New Segment,,67651,1,0,20031211162746802948 >Mk371=Stimulus,HFC,67901,1,0 >Mk372=Time 0,,67901,1,0 >Mk373=New Segment,,68201,1,0,20031211162748036948 >Mk374=Stimulus,HFC,68451,1,0 >Mk375=Time 0,,68451,1,0 >Mk376=New Segment,,68751,1,0,20031211162749354947 >Mk377=Stimulus,HFC,69001,1,0 >Mk378=Time 0,,69001,1,0 >Mk379=New Segment,,69301,1,0,20031211162752086948 >Mk380=Stimulus,HFC,69551,1,0 >Mk381=Time 0,,69551,1,0 >Mk382=New Segment,,69851,1,0,20031211162753302948 >Mk383=Stimulus,HFC,70101,1,0 >Mk384=Time 0,,70101,1,0 >Mk385=New Segment,,70401,1,0,20031211162754670947 >Mk386=Time 0,,70651,1,0 >Mk387=Stimulus,HFC,70651,1,0 >Mk388=New Segment,,70951,1,0,20031211162755914948 >Mk389=Time 0,,71201,1,0 >Mk390=Stimulus,HFC,71201,1,0 >Mk391=New Segment,,71501,1,0,20031211162757224947 >Mk392=Stimulus,HFC,71751,1,0 >Mk393=Time 0,,71751,1,0 >Mk394=New Segment,,72051,1,0,20031211162801366948 >Mk395=Stimulus,HFC,72301,1,0 >Mk396=Time 0,,72301,1,0 >Mk397=New Segment,,72601,1,0,20031211162802708947 >Mk398=Stimulus,HFC,72851,1,0 >Mk399=Time 0,,72851,1,0 >Mk400=New Segment,,73151,1,0,20031211162804012948 >Mk401=Stimulus,HFC,73401,1,0 >Mk402=Time 0,,73401,1,0 >Mk403=New Segment,,73701,1,0,20031211162805414948 >Mk404=Time 0,,73951,1,0 >Mk405=Stimulus,HFC,73951,1,0 >Mk406=New Segment,,74251,1,0,20031211162806788948 >Mk407=Time 0,,74501,1,0 >Mk408=Stimulus,HFC,74501,1,0 >Mk409=New Segment,,74801,1,0,20031211162808256947 >Mk410=Time 0,,75051,1,0 >Mk411=Stimulus,HFC,75051,1,0 >Mk412=New Segment,,75351,1,0,20031211162812310947 >Mk413=Time 0,,75601,1,0 >Mk414=Stimulus,HFC,75601,1,0 >Mk415=New Segment,,75901,1,0,20031211162813668948 >Mk416=Time 0,,76151,1,0 >Mk417=Stimulus,HFC,76151,1,0 >Mk418=New Segment,,76451,1,0,20031211162815164948 >Mk419=Stimulus,HFC,76701,1,0 >Mk420=Time 0,,76701,1,0 >Mk421=New Segment,,77001,1,0,20031211162816408947 >Mk422=Stimulus,HFC,77251,1,0 >Mk423=Time 0,,77251,1,0 >Mk424=New Segment,,77551,1,0,20031211162817690948 >Mk425=Time 0,,77801,1,0 >Mk426=Stimulus,HFC,77801,1,0 >Mk427=New Segment,,78101,1,0,20031211162819138947 >Mk428=Stimulus,HFC,78351,1,0 >Mk429=Time 0,,78351,1,0 >Mk430=New Segment,,78651,1,0,20031211162820620948 >Mk431=Time 0,,78901,1,0 >Mk432=Stimulus,HFC,78901,1,0 >Mk433=New Segment,,79201,1,0,20031211162824476947 >Mk434=Stimulus,HFC,79451,1,0 >Mk435=Time 0,,79451,1,0 >Mk436=New Segment,,79751,1,0,20031211162825752948 >Mk437=Stimulus,HFC,80001,1,0 >Mk438=Time 0,,80001,1,0 >Mk439=New Segment,,80301,1,0,20031211162828456948 >Mk440=Stimulus,HFC,80551,1,0 >Mk441=Time 0,,80551,1,0 >Mk442=New Segment,,80851,1,0,20031211162829822947 >Mk443=Stimulus,HFC,81101,1,0 >Mk444=Time 0,,81101,1,0 >Mk445=New Segment,,81401,1,0,20031211162832608947 >Mk446=Stimulus,HFC,81651,1,0 >Mk447=Time 0,,81651,1,0 > > >------------------------------------------------------------------------ > >Brain Vision Data Exchange Header File Version 1.0 >; Data created from history path: mdo13136_1/Raw Data/Markers Changed/AnneMarker/Segmentation/OddCSt/HFC/Artifact Rejection > >[Common Infos] >DataFile=mdo13136_1_HFCrej.dat >MarkerFile=mdo13136_1_HFCrej.vmrk >DataFormat=ASCII >; Data orientation: VECTORIZED=ch1,pt1, ch1,pt2..., MULTIPLEXED=ch1,pt1, ch2,pt1 ... >DataOrientation=MULTIPLEXED >DataType=TIMEDOMAIN >NumberOfChannels=63 >DataPoints=81950 >; Sampling interval in microseconds if time domain (convert to Hertz: >; 1000000 / SamplingInterval) or in Hertz if frequency domain: >SamplingInterval=2000 >SegmentationType=MARKERBASED > >[ASCII Infos] >; Decimal symbol for floating point numbers: the header file always uses a dot (.), >; however the data file might use a different one >DecimalSymbol=. >; SkipLines, SkipColumns: leading lines and columns with additional informations. >SkipLines=1 >SkipColumns=0 > >[Channel Infos] >; Each entry: Ch=,, >; ,; Fields are delimited by commas, some fields might be omited (empty). >; Commas in channel names are coded as "\1". >Ch1=Fp1,, >Ch2=Fpz,, >Ch3=Fp2,, >Ch4=AF3,, >Ch5=AF4,, >Ch6=F7,, >Ch7=F5,, >Ch8=F3,, >Ch9=F1,, >Ch10=Fz,, >Ch11=F2,, >Ch12=F4,, >Ch13=F6,, >Ch14=F8,, >Ch15=FC5,, >Ch16=FC3,, >Ch17=FC1,, >Ch18=FCz,, >Ch19=FC2,, >Ch20=FC4,, >Ch21=FC6,, >Ch22=T7,, >Ch23=C5,, >Ch24=C3,, >Ch25=C1,, >Ch26=Cz,, >Ch27=C2,, >Ch28=C4,, >Ch29=C6,, >Ch30=T8,, >Ch31=A2,, >Ch32=TP7,, >Ch33=CP5,, >Ch34=CP3,, >Ch35=CP1,, >Ch36=CPz,, >Ch37=CP2,, >Ch38=CP4,, >Ch39=CP6,, >Ch40=TP8,, >Ch41=P7,, >Ch42=P5,, >Ch43=P3,, >Ch44=P1,, >Ch45=Pz,, >Ch46=P2,, >Ch47=P4,, >Ch48=P6,, >Ch49=P8,, >Ch50=PO7,, >Ch51=PO3,, >Ch52=PO1,, >Ch53=POz,, >Ch54=PO2,, >Ch55=PO4,, >Ch56=PO8,, >Ch57=O1,, >Ch58=Oz,, >Ch59=O2,, >Ch60=VEOGM,, >Ch61=VEOGP,, >Ch62=HEOGM,, >Ch63=HEOGP,, > >[Coordinates] >; Each entry: Ch=,, >Ch1=1,-92,-72 >Ch2=1,92,90 >Ch3=1,92,72 >Ch4=1,-74,-65 >Ch5=1,74,65 >Ch6=1,-92,-36 >Ch7=1,-75,-41 >Ch8=1,-60,-51 >Ch9=1,-50,-68 >Ch10=1,46,90 >Ch11=1,50,68 >Ch12=1,60,51 >Ch13=1,75,41 >Ch14=1,92,36 >Ch15=1,-72,-21 >Ch16=1,-50,-28 >Ch17=1,-32,-45 >Ch18=1,23,90 >Ch19=1,32,45 >Ch20=1,50,28 >Ch21=1,72,21 >Ch22=1,-92,0 >Ch23=1,-69,0 >Ch24=1,-46,0 >Ch25=1,-23,0 >Ch26=1,0,0 >Ch27=1,23,0 >Ch28=1,46,0 >Ch29=1,69,0 >Ch30=1,92,0 >Ch31=1,129,0 >Ch32=1,-92,18 >Ch33=1,-72,21 >Ch34=1,-50,28 >Ch35=1,-32,45 >Ch36=1,23,-90 >Ch37=1,32,-45 >Ch38=1,50,-28 >Ch39=1,72,-21 >Ch40=1,92,-18 >Ch41=1,-92,36 >Ch42=1,-75,41 >Ch43=1,-60,51 >Ch44=1,-50,68 >Ch45=1,46,-90 >Ch46=1,50,-68 >Ch47=1,60,-51 >Ch48=1,75,-41 >Ch49=1,92,-36 >Ch50=1,-92,54 >Ch51=1,-74,65 >Ch52=1,-69,79 >Ch53=1,69,-90 >Ch54=1,69,-79 >Ch55=1,74,-65 >Ch56=1,92,-54 >Ch57=1,-92,72 >Ch58=1,92,-90 >Ch59=1,92,-72 >Ch60=0,0,0 >Ch61=0,0,0 >Ch62=0,0,0 >Ch63=0,0,0 > > From h.f.kwok at BHAM.AC.UK Fri Dec 16 10:28:30 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Fri, 16 Dec 2005 09:28:30 -0000 Subject: Problems reading BVA data (segmented) In-Reply-To: <43A1A7AA.3060601@mpib-berlin.mpg.de> Message-ID: Hi, I have read BVA data into FieldTrip. I think you should try not to define the cfg.trialfun. This will cause the definetrial function to call the trialfun_general which will obtain the name of the marker file from the header file and in turn read the events from the marker file in the read_fcdc_event function. One thing though is that in the read_fcdc_event, the event.offset is not defined when the filetype is brainvision. This may cause problem when you try to do further analysis. I have therefore attached an amended read_fcdc_event.m. Another thing is that the read_fcdc_event function will get (from the header file) the file name of the marker file but not the file path. Therefore, to be safe, you should make sure the files are in the MATLAB search path. Hope that this will help. Regards, Hoi Fei ******************************************** Dr. Hoi Fei Kwok Research Fellow SyMon Sensory Motor Neuroscience School of Psychology BBS Centre (Hills) The University of Birmingham Edgbaston BIRMINGHAM B15 2TT, UK Tel: +44-(0)121-4147949 Email: h.f.kwok at bham.ac.uk ********************************************* > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Markus Werkle-Bergner > Sent: 15 December 2005 17:28 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] Problems reading BVA data (segmented) > > Dear all, > > I'm a beginner with fieldtrip, therefore I probably have an easy question. > > I try to read in EEG-data that I already preprocessed in Brainvision > Analyser. The data is therefore already segmented. From the tutorials > and the discussion list, I understood that I should nevertheless use the > function preprocessing.m. Now my guess is that I have trouble with the > definition of trials from my data-set. I used the following script to > read the data: > > cfg = [] > % General settings > cfg.datafile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.dat'; > cfg.headerfile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vhdr'; > cfg.channel = 'all'; > %Trialdefinition > cfg.trialfun = 'trialfun_brainvision'; > cfg.trialdef.trgfile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vmkr'; > cfg.trialdef.stim = 'HFC'; > cfg.trialdef.segment = 'no'; > cfg.trialdef.timezero = 'no'; > cfg.trialdef.eventtype = 'Stimulus'; > cfg.trialdef.eventvalue = 'HFC'; > cfg.trialdef.prestim = 0.500; > cfg.trialdef.poststim = 0.600; > > [cfg]Þfinetrial(cfg) > [raw] = preprocessing(cfg) > > When I run this script, I get the following error-message: > > ??? Error using ==> fieldtrip-20051214\private\read_brainvision_vmrk > cannot open marker file > > Error in ==> fieldtrip-20051214\private\trialfun_brainvision at 16 > [stim, resp, segment, timezero] = > read_brainvision_vmrk(cfg.trialdef.trgfile); > > Error in ==> definetrial at 151 > trl = feval(cfg.trialfun, cfg); > > Error in ==> FieldtripTest at 17 > [cfg]Þfinetrial(cfg) > > I checked that the *.dat, *.vhdr, and *.vmrk files are all in the > location specified in the script. I really would appreciate if one can > give me some advice. > > Best regards, > Markus > > P.S.: I added the *.vhdr, and *.vmrk files. Perhaps this information is > needed. > > -- > ************************************************************** > Markus Werkle-Bergner, Dipl. Psych. > Predoctoral Research Fellow > > Center for Lifespan Psychology > Max Planck Institute for Human Development > Lentzeallee 94, Room 211, D-14195 Berlin, Germany. > Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 > ************************************************************** > > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: read_fcdc_event.m URL: From werkle at MPIB-BERLIN.MPG.DE Fri Dec 16 11:35:51 2005 From: werkle at MPIB-BERLIN.MPG.DE (Markus Werkle-Bergner) Date: Fri, 16 Dec 2005 11:35:51 +0100 Subject: Problems reading BVA data (segmented) In-Reply-To: <000001c60223$13febb90$e516bc93@universi8ef8be> Message-ID: Hi, thank you all for your valuable comments. Now it worked fine. I simply used the read_fcdc_event.m file provided by Hoi Fei. The the trialfun_general did the job. Thank you! Best regards, Markus Hoi Fei Kwok wrote: >Hi, > >I have read BVA data into FieldTrip. I think you should try not to define >the cfg.trialfun. This will cause the definetrial function to call the >trialfun_general which will obtain the name of the marker file from the >header file and in turn read the events from the marker file in the >read_fcdc_event function. One thing though is that in the read_fcdc_event, >the event.offset is not defined when the filetype is brainvision. This may >cause problem when you try to do further analysis. I have therefore attached >an amended read_fcdc_event.m. Another thing is that the read_fcdc_event >function will get (from the header file) the file name of the marker file >but not the file path. Therefore, to be safe, you should make sure the files >are in the MATLAB search path. > >Hope that this will help. > >Regards, >Hoi Fei > >******************************************** > >Dr. Hoi Fei Kwok >Research Fellow >SyMon Sensory Motor Neuroscience >School of Psychology >BBS Centre (Hills) >The University of Birmingham >Edgbaston >BIRMINGHAM B15 2TT, UK > >Tel: +44-(0)121-4147949 >Email: h.f.kwok at bham.ac.uk > >********************************************* > > > >>-----Original Message----- >>From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On >>Behalf Of Markus Werkle-Bergner >>Sent: 15 December 2005 17:28 >>To: FIELDTRIP at NIC.SURFNET.NL >>Subject: [FIELDTRIP] Problems reading BVA data (segmented) >> >>Dear all, >> >>I'm a beginner with fieldtrip, therefore I probably have an easy question. >> >>I try to read in EEG-data that I already preprocessed in Brainvision >>Analyser. The data is therefore already segmented. From the tutorials >>and the discussion list, I understood that I should nevertheless use the >>function preprocessing.m. Now my guess is that I have trouble with the >>definition of trials from my data-set. I used the following script to >>read the data: >> >>cfg = [] >>% General settings >>cfg.datafile = >>'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.dat'; >>cfg.headerfile = >>'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vhdr'; >>cfg.channel = 'all'; >>%Trialdefinition >>cfg.trialfun = 'trialfun_brainvision'; >>cfg.trialdef.trgfile = >>'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vmkr'; >>cfg.trialdef.stim = 'HFC'; >>cfg.trialdef.segment = 'no'; >>cfg.trialdef.timezero = 'no'; >>cfg.trialdef.eventtype = 'Stimulus'; >>cfg.trialdef.eventvalue = 'HFC'; >>cfg.trialdef.prestim = 0.500; >>cfg.trialdef.poststim = 0.600; >> >>[cfg]Þfinetrial(cfg) >>[raw] = preprocessing(cfg) >> >>When I run this script, I get the following error-message: >> >>??? Error using ==> fieldtrip-20051214\private\read_brainvision_vmrk >>cannot open marker file >> >>Error in ==> fieldtrip-20051214\private\trialfun_brainvision at 16 >>[stim, resp, segment, timezero] = >>read_brainvision_vmrk(cfg.trialdef.trgfile); >> >>Error in ==> definetrial at 151 >> trl = feval(cfg.trialfun, cfg); >> >>Error in ==> FieldtripTest at 17 >>[cfg]Þfinetrial(cfg) >> >>I checked that the *.dat, *.vhdr, and *.vmrk files are all in the >>location specified in the script. I really would appreciate if one can >>give me some advice. >> >>Best regards, >>Markus >> >>P.S.: I added the *.vhdr, and *.vmrk files. Perhaps this information is >>needed. >> >>-- >>************************************************************** >>Markus Werkle-Bergner, Dipl. Psych. >>Predoctoral Research Fellow >> >>Center for Lifespan Psychology >>Max Planck Institute for Human Development >>Lentzeallee 94, Room 211, D-14195 Berlin, Germany. >>Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 >>************************************************************** >> >> >> >> > > > >------------------------------------------------------------------------ > >function [event] = read_fcdc_event(filename) > >% READ_FCDC_EVENT reads all events from an EEG/MEG dataset and returns them >% in a well defined structure. It is a wrapper around different EEG/MEG file >% importers, directly supported formats are CTF, Neuromag, EEP, BrainVision, >% Neuroscan and Neuralynx. >% >% Use as >% [event] = read_fcdc_event(filename) >% >% This function returns a structure with the following fields >% event.type = string >% event.sample = expressed in samples, first sample of file is 1 >% event.value = number or string >% event.offset = expressed in samples >% event.duration = expressed in samples >% >% Some of these fields can be empty, depending on the type of event file. >% After reading the event structure, you can use following tricks to >% extract information about those events in which you are interested. >% >% Determine the different event types >% unique({event.type}) >% >% Get the index of all trial events >% find(strcmp('trial', {event.type})) >% >% Make a vector with all triggers that occurred on the backpanel >% [event(find(strcmp('backpanel trigger', {event.type}))).value] >% >% Find the events that ocurred in trial t=26 >% t = 26; find([event.sample]>trl(t,1) & [event.sample]% >% See also READ_FCDC_DATA, READ_FCDC_HEADER > >% Copyright (C) 2004, Robert Oostenveld >% >% $Log: read_fcdc_event.m,v $ >% Revision 1.29 2005/10/05 06:30:25 roboos >% added support for MPI datasets and DAP files >% >% Revision 1.28 2005/09/15 07:38:38 roboos >% added support for ctf_res4 and ctf_meg4 by renaming filename into dataset >% >% Revision 1.27 2005/09/08 09:25:53 roboos >% added support for the Yokogawa MEG data format >% >% Revision 1.26 2005/09/06 12:45:00 roboos >% renamed plextor into plexon (incorrect company name) >% >% Revision 1.25 2005/08/17 19:34:58 roboos >% added a check for the presence of the file >% added a TTLValue event for each trigger in Neuralynx dataset >% >% Revision 1.24 2005/06/17 10:56:59 roboos >% fixed event.type for CTF stimulus channels (should be string instead of cell) >% >% Revision 1.23 2005/05/24 07:37:04 roboos >% implemented reading of other trigger channels (like UPPT001, UTRG001) for CTF event detection >% >% Revision 1.22 2005/05/19 07:11:32 roboos >% added support for neuralynx_nev >% >% Revision 1.21 2005/05/18 15:50:31 roboos >% repeated last bugfix, now hopefully correct (thanks to Juliet) >% >% Revision 1.20 2005/05/18 10:26:43 roboos >% fixed "Operands to the || and && operators must be convertible to logical scalar values" problem by first checking whether variable is a string or numeric >% >% Revision 1.19 2005/05/17 17:50:38 roboos >% changed all "if" occurences of & and | into && and || >% this makes the code more compatible with Octave and also seems to be in closer correspondence with Matlab documentation on shortcircuited evaluation of sequential boolean constructs >% >% Revision 1.18 2005/05/11 08:27:50 roboos >% implemeted the correct offset (in samples) for CTF markerfiles, sofar the offset was always set to zero >% >% Revision 1.17 2005/03/31 07:05:58 roboos >% implemented support for besa_avr using my own read_besa_avr >% >% Revision 1.16 2005/02/16 07:48:59 roboos >% added support for Plexon nex files, using read_nex_event >% >% Revision 1.15 2005/02/02 14:33:16 roboos >% renamed event.type of eep_avg to 'average', implemented triggers for eep_cnt (using *.trg file) >% >% Revision 1.14 2004/12/07 18:13:04 roboos >% added initial support for Neuroscan cnt files >% >% Revision 1.13 2004/11/17 09:01:50 roboos >% added check for the presence of CTF MarkerFile, to avoid unneccesary warning in readmarkerfile >% >% Revision 1.12 2004/11/15 09:14:09 roboos >% implemented support for Neuroscan *.eeg (epoched) files >% applied auto-indentation, which changed some whitespace in other parts of the file >% >% Revision 1.11 2004/10/01 09:53:25 roboos >% added Neuromag to the help as one of the supported formats >% >% Revision 1.10 2004/09/27 15:37:11 roboos >% renamed the function readClassFile to read_ctf_cls (part of file_io) >% >% Revision 1.9 2004/09/27 13:55:24 roboos >% fixed bugs for CTF marker >% >% Revision 1.8 2004/09/24 07:13:57 roboos >% added support for CTF Markerfiles, using the readmarkerfile function I got from Tom Holroyd >% >% Revision 1.7 2004/09/21 13:09:46 roboos >% added 2 digital trigger channels for fif, analog triggers in fif file are only scanned if no digital triggers are present >% >% Revision 1.6 2004/09/20 11:48:31 roboos >% improved support for Neuromag, threshold all STI-channels at =>5 and treat STI014 as digital channel >% >% Revision 1.5 2004/09/03 09:02:29 roboos >% added raw>5 for flank detection for neuromag trigger channels >% >% Revision 1.4 2004/08/20 09:18:14 roboos >% changed event(i).sample for CTF trials >% implemented Neuromag format: trials and "STI xxx" channels >% >% Revision 1.3 2004/06/30 16:05:24 roboos >% added support for BrainVision marker file on a more general way than implemented in the read_brainvision_vmrk function >% added subfunction tokenize >% renamed dataset into filename >% >% Revision 1.2 2004/06/21 19:21:10 roberto >% renamed eventfile into dataset, added check for empty CTF classfile >% >% Revision 1.1 2004/06/03 09:15:22 roberto >% initial version, supported are CTF and eep_avr >% > >% detect the external toolboxes that optionally can be used >hasbiosig = (exist('sopen') & exist('sread')); % see http://biosig.sourceforge.net/ >hasmegpd = (exist('rawdata') & exist('channames')); % see http://www.kolumbus.fi/kuutela/programs/meg-pd/ >haseegsf = (exist('ctf_read_meg4') & exist('ctf_read_res4')); % see http://eeg.sourceforge.net/ > >% test whether the file exists >if ~exist(filename) > error(sprintf('file ''%s'' does not exist', filename)); >end > >% start with an empty event structure >event = []; > >%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >if filetype(filename, 'ctf_ds') || filetype(filename, 'ctf_meg4') || filetype(filename, 'ctf_res4') > > % obtain the dataset name > if filetype(filename, 'ctf_meg4') || filetype(filename, 'ctf_res4') > filename = fileparts(filename); > end > > [path, name, ext] = fileparts(filename); > headerfile = fullfile(path, [name ext], [name '.res4']); > datafile = fullfile(path, [name ext], [name '.meg4']); > classfile = fullfile(path, [name ext], 'ClassFile.cls'); > > hdr = read_ctf_res4(headerfile); > > % read the trigger codes from the STIM channel, usefull for (pseudo) continuous data > % this splits the trigger channel into the lowers and highest 16 bits, > % corresponding with the front and back panel of the electronics cabinet at the Donders Centre > [backpanel, frontpanel] = read_ctf_trigger(filename); > for i=find(backpanel(:)') > event(end+1).type = 'backpanel trigger'; > event(end ).sample = i; > event(end ).value = backpanel(i); > end > for i=find(frontpanel(:)') > event(end+1).type = 'frontpanel trigger'; > event(end ).sample = i; > event(end ).value = frontpanel(i); > end > > % determine the trigger channels from the header > if isfield(hdr, 'sensType') > for i=find(hdr.sensType(:)'==11) > % read the trigger channel as raw data > trig = read_ctf_meg4(datafile, hdr, 1, hdr.nTrials*hdr.nSamples, i); > % correct for reading it as signed integer, whereas it should be an unsigned int > trig(find(trig<0)) = trig(find(trig<0)) + 2^32; > % convert the trigger into an event with a value at a specific sample > for j=find(diff([0 trig(:)'])>1) > event(end+1).type = hdr.label{i}; > event(end ).sample = j; > event(end ).value = trig(j); > end > end > end > > % make an event for each trial as defined in the header > for i=1:hdr.nTrials > event(end+1).type = 'trial'; > event(end ).sample = (i-1)*hdr.nSamples + 1; > event(end ).offset = -hdr.nSamplesPre; > event(end ).duration = hdr.nSamples; > end > > % read the classification file and make an event for each classified trial > [condNumbers,condLabels] = read_ctf_cls(classfile); > if ~isempty(condNumbers) > Ncond = length(condLabels); > for i=1:Ncond > for j=1:length(condNumbers{i}) > event(end+1).type = 'classification'; > event(end ).value = condLabels{i}; > event(end ).sample = (condNumbers{i}{j}-1)*hdr.nSamples + 1; > event(end ).offset = -hdr.nSamplesPre; > event(end ).duration = hdr.nSamples; > end > end > end > > if exist(fullfile(filename,'MarkerFile.mrk')) > % read the marker file and make an event for each marker > % this depends on the readmarkerfile function that I got from Tom Holroyd > % I have not tested this myself extensively, since at the FCDC we > % don't use the marker files > mrk = readmarkerfile(filename); > for i=1:mrk.number_markers > for j=1:mrk.number_samples(i) > % determine the location of the marker, expressed in samples > trialnum = mrk.trial_times{i}(j,1); > synctime = mrk.trial_times{i}(j,2); > begsample = (trialnum-1)*hdr.nSamples + 1; % of the trial, relative to the start of the datafile > endsample = (trialnum )*hdr.nSamples; % of the trial, relative to the start of the datafile > offset = round(synctime*hdr.Fs); % this is the offset (in samples) relative to time t=0 for this trial > offset = offset + hdr.nSamplesPre; % and time t=0 corrsponds with the nSamplesPre'th sample > % store this marker as an event > event(end+1).type = mrk.marker_names{i}; > event(end ).value = []; > event(end ).sample = begsample + offset; > event(end ).duration = 0; > event(end ).offset = offset; > end > end > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'eep_avr') > % the headerfile and datafile are the same > hdr = read_fcdc_header(filename); > event(end+1).type = 'average'; > event(end ).sample = 1; > event(end ).duration = hdr.nSamples; > event(end ).offset = -hdr.nSamplesPre; > event(end ).value = []; > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'eep_cnt') > % try to read external trigger file in EEP format > trgfile = [filename(1:(end-3)), 'trg']; > if exist(trgfile, 'file') > hdr = read_fcdc_header(filename); > tmp = read_eep_trg(trgfile); > % translate the EEProbe trigger codes to events > for i=1:length(tmp) > event(i).type = 'trigger'; > event(i).sample = round((tmp(i).time/1000) * hdr.Fs) + 1; % convert from ms to samples > event(i).value = tmp(i).code; > event(i).offset = 0; > event(i).duration = 0; > end > else > warning('no triggerfile was found'); > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'brainvision_vhdr') || filetype(filename, 'brainvision_vmrk') > > if filetype(filename, 'brainvision_vhdr') > % read the headerfile belonging to the dataset and try to determine the corresponding markerfile > hdr = read_brainvision_vhdr(filename); > > % replace the filename with the filename of the markerfile > if ~isfield(hdr, 'MarkerFile') || isempty(hdr.MarkerFile) > filename = []; > else > [p, f, e] = fileparts(filename); > filename = fullfile(p, hdr.MarkerFile); > end > end > > fid=fopen(filename,'rt'); > if fid==-1, > error('cannot open BrainVision marker file') > end > > line = []; > while ischar(line) || isempty(line) > line = fgetl(fid); > if ~isempty(line) && ~(isnumeric(line) && line==-1) > if strncmpi(line, 'Mk', 2) > % this line contains a marker > tok = tokenize(line, '='); > if length(tok)~=2 > warning('skipping unexpected formatted line in BrainVision marker file'); > else > % the line looks like "MkXXX=YYY", which is ok > % the interesting part now is in the YYY, i.e. the second token > tok = tokenize(tok{2}, ','); > if isempty(tok{1}) > tok{1} = []; > end > if isempty(tok{2}) > tok{2} = []; > end > event(end+1).type = tok{1}; > event(end ).value = tok{2}; > event(end ).sample = str2num(tok{3}); > event(end ).duration = str2num(tok{4}); > event(end ).offset=[]; % added by H. F. Kwok, University of Birmingham Dec 2005 for compatibility with definetrial.m > end > end > end > end > fclose(fid); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'yokogawa_sqd') || filetype(filename, 'yokogawa_con') || filetype(filename, 'yokogawa_raw') > event = read_yokogawa_event(filename); > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'mpi_ds') || filetype(filename, 'mpi_dap') > hdr = read_fcdc_header(filename); > % determine the DAP files that compromise this dataset > if isdir(filename) > ls = dir(filename); > dapfile = {}; > for i=1:length(ls) > if ~isempty(regexp(ls(i).name, '.dap$')) > dapfile{end+1} = fullfile(filename, ls(i).name); > end > end > dapfile = sort(dapfile); > elseif iscell(filename) > dapfile = filename; > else > dapfile = {filename}; > end > % assume that each DAP file is accompanied by a dat file > % read the trigger values from the separate dat files > trg = []; > for i=1:length(dapfile) > datfile = [dapfile{i}(1:(end-4)) '.dat']; > trg = cat(1, trg, textread(datfile, '', 'headerlines', 1)); > end > % construct a event structure, one 'trialcode' event per trial > for i=1:length(trg) > event(i).type = 'trialcode'; % string > event(i).sample = (i-1)*hdr.nSamples + 1; % expressed in samples, first sample of file is 1 > event(i).value = trg(i); % number or string > event(i).offset = 0; % expressed in samples > event(i).duration = hdr.nSamples; % expressed in samples > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'ns_eeg') > hdr = read_fcdc_header(filename); > for i=1:hdr.nTrials > event(end+1).type = 'trial'; > event(end ).sample = (i-1)*hdr.nSamples + 1; > event(end ).value = []; > event(end ).offset = -hdr.nSamplesPre; > event(end ).duration = hdr.nSamples; > % read the data to determine manually accepted/rejected trials > tmp = read_ns_eeg(filename, i); > if tmp.sweep.accept > event(end).value = 'accept'; > else > event(end).value = 'reject'; > end > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'ns_cnt') > warning('handling of event structure has not been fully tested for Neuroscan *.cnt files'); > % this is a very inefficient implementation > % since it reads not only the event table, but also all data from the file > tmp = read_ns_cnt(filename); > % translate the cnt event table into known FieldTrip event types > for i=1:tmp.nevent > event(i).type = 'trigger'; > event(i).sample = tmp.event.frame(i); > event(i).value = tmp.event.stimtype(i); > event(i).offset = 0; > event(i).duration = 0; > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'besa_avr') > hdr = read_fcdc_header(filename); > event(end+1).type = 'average'; > event(end ).sample = 1; > event(end ).duration = hdr.nSamples; > event(end ).offset = -hdr.nSamplesPre; > event(end ).value = []; > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'neuromag_fif') > hdr = read_fcdc_header(filename); > % add the trials to the event structure > for i=1:hdr.nTrials > event(end+1).type = 'trial'; > event(end ).sample = (i-1)*hdr.nSamples + 1; > event(end ).value = []; > event(end ).offset = -hdr.nSamplesPre; > event(end ).duration = hdr.nSamples; > end > > % add triggers based on the binary trigger channel, this is based the following email > % > % On 14 Sep 2004, at 16:33, Lauri Parkkonen wrote: > % > Anke's file is probably quite recent one. It should have normal binary > % > coding on STI014 and its "analog" counterparts on STI1 ... STI6, > % > swinging between 0 ... +5 volts. These latter channels are virtual, > % > i.e., they are generated from STI014 for backwards compatibility. STI1 > % > is the LSB of STI014 etc. For all the new stuff, I would recommend > % > using STI014 as that's the way the triggers will be stored in the future > % > (maybe the channel name is going to change to something more reasonable > % > like TRIG). Unfortunately, some older files from the 306-channel system > % > have the STI014 coded in a different way - the two 8-bit halves code > % > the input and output triggers separately. > > triglab = {'STI 014', 'STI 015', 'STI 016'}; > trigindx = match_str(hdr.label, triglab); > if length(trigindx)>0 > % pad with the last sample of the previous block, start with zeros > pad = zeros(length(trigindx),1); > for i=1:hdr.nTrials > begsample = (i-1)*hdr.nSamples + 1; > endsample = (i )*hdr.nSamples; > raw = read_fcdc_data(filename, hdr, begsample, endsample, trigindx); > % detect the flank of the trigger > flank = ((diff([raw pad], [], 2) .* raw)~=0); > % for each flank in the TRIG channels, add an event > for j=1:length(trigindx) > for k=find(flank(j,:)) > event(end+1).type = 'trigger'; > event(end ).sample = begsample + k; > event(end ).value = raw(j,k); > event(end ).offset = []; > event(end ).duration = []; > end > end > % remember the last sample to ensure continuity with the next block > pad = raw(:,end); > end > end % if length(trigindx) > > % look for the analog triggers only if no binary trigger channel is present > if isempty(trigindx) > % add the triggers to the event structure based on trigger channels with the name "STI xxx" > % this is not a very efficient implementation, since it has to read all data > % furthermore, there are some issues with noise on these analog trigger channels > stimindx = []; > stimlab = {}; > for i=1:length(hdr.label) > if all(hdr.label{i}(1:3) == 'STI') > stimindx(end+1) = i; > stimlab{end+1} = hdr.label{i}; > end > end > if length(stimindx)>0 > % pad with the last sample of the previous block, start with zeros > pad = zeros(length(stimindx),1); > for i=1:hdr.nTrials > begsample = (i-1)*hdr.nSamples + 1; > endsample = (i )*hdr.nSamples; > raw = read_fcdc_data(filename, hdr, begsample, endsample, stimindx); > % detect the flank of the trigger > flank = ((diff([raw pad], [], 2) .* raw)~=0) & (raw>=5); > % Note: the original code read > % flank = (diff([raw pad], [], 2) .* raw)~=0; > % but according to Joachim, real events always have triggers > 5 > % for each flank in the STIM channels, add an event > for j=1:length(stimindx) > for k=find(flank(j,:)) > event(end+1).type = stimlab{j}; > event(end ).sample = begsample + k; > event(end ).value = raw(j,k); > event(end ).offset = []; > event(end ).duration = []; > end > end > % remember the last sample to ensure continuity with the next block > pad = raw(:,end); > end > end % if length(stimindx) > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'plexon_nex') > event = read_nex_event(filename); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'neuralynx_nev') || filetype(filename, 'neuralynx_ds') > if ~isdir(filename); > filename = fileparts(filename); % only the directory should be used here > end > % read the header and the events > hdr = read_neuralynx_header(filename); > nev = read_neuralynx_event(filename); > AcqStartTimeStamp = max(hdr.FirstTimeStamp); % the first sample that is present in all files is called "1" > for i=1:length(nev) > % add an event containing the string as value > event(end+1).type = 'EventString'; > event(end ).sample = round(hdr.SamplingFrequency * (nev(i).TimeStamp - AcqStartTimeStamp)/1e6) + 1; > event(end ).value = nev(i).EventString; > event(end ).offset = []; > event(end ).duration = []; > % add an event containing the TTL as value > event(end+1).type = 'TTLValue'; > event(end ).sample = round(hdr.SamplingFrequency * (nev(i).TimeStamp - AcqStartTimeStamp)/1e6) + 1; > event(end ).value = nev(i).TTLValue; > event(end ).offset = []; > event(end ).duration = []; > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % added by H. F. Kwok for University of Birmingham data > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename,'bham_bdf') > event=read_biosemi_event(filename); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >else > error('unknown filetype for events'); >end % different filetypes > >if ~isempty(event) > % sort the events on the sample on which they occur > [dum, indx] = sort([event.sample]); > event = event(indx); >else > warning(sprintf('no events found in %s', filename)); >end > >%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >% SUBFUNCTION that cuts a string into pieces on a user-defined separator character >%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >function [tok] = tokenize(str, sep) >tok = {}; >f = find(str==sep); >f = [0, f, length(str)+1]; >for i=1:(length(f)-1) > tok{i} = str((f(i)+1):(f(i+1)-1)); >end > > -- ************************************************************** Markus Werkle-Bergner, Dipl. Psych. Predoctoral Research Fellow Center for Lifespan Psychology Max Planck Institute for Human Development Lentzeallee 94, Room 211, D-14195 Berlin, Germany. Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 ************************************************************** From wibral at MPIH-FRANKFURT.MPG.DE Thu Dec 22 14:09:46 2005 From: wibral at MPIH-FRANKFURT.MPG.DE (Michael Wibral) Date: Thu, 22 Dec 2005 14:09:46 +0100 Subject: Manually Importing data In-Reply-To: Message-ID: Dear Colleagues, we have a dataset that is in some sense 'preprocessed' i.e. there is a little matrix (or concatenated ones) for each trial of each condition, we also have information on filters, electrode locations etc. but not in any of the usual file formats. As we would like to use the Multitaper analysis and coherence/phase locking we'll have to 'fake' a Fieldtrip dataset at some point by assembling the corresponding structutre by hand. What's the better entry point for this: before preproc (but then we'll have to make a trialfun etc.) or after preproc (where the structure is already quite involved, at least it looks like that). If we try to mimic a preprocessed dataset, which of the fields are mandatory? Thanks for any comment on this. Merry Christmas and a Happy New Year to everyone. Michael Wibral M. Wibral MSc. Max Planck Institute for Brain Research Dept. Neurophysiology Deutschordenstrasse 46 60528 Frankfurt am Main Germany Phone: +49(0)69/6301-83849 +49(0)173/4966728 Fax: +49(0)69/96769-327 From r.oostenveld at FCDONDERS.RU.NL Fri Dec 23 11:27:01 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 23 Dec 2005 11:27:01 +0100 Subject: Manually Importing data In-Reply-To: <43AAA59A.7050908@mpih-frankfurt.mpg.de> Message-ID: Dear Michael On 22-dec-2005, at 14:09, Michael Wibral wrote: > /phase locking we'll have to 'fake' a Fieldtrip dataset at some > point by assembling the corresponding structutre by hand. What's > the better entry point for this: before preproc (but then we'll > have to make a trialfun etc.) or after preproc (where the > structure is already quite involved, at least it looks like that). > If we try to mimic a preprocessed dataset, which of the fields are > mandatory? In your case it is much easier to do it after preprocessing. The output of the preprocessing function, which you have to mimic, is data.trial = 1xNtrials cell-array, each containing Nchans X Nsamples data.time = 1xNtrials cell-array, each containing 1 X Nsamples data.fsample = number in Hz data.cfg = []; this will do data.label = Nchans X 1 cell-array with strings, e.g. {'Fp1', 'Fpz', ...} I guess that most of this is straightforward. Since we support trials of variable length, each trial has its own time axis. In most cases with fixed-length trial data, data.time{i} is the same for all i. About electrode locations: you can add a data.elec field, but that is optional. The elec structure contains elec.pnt = Nelec X 3 matrix with carthesian xyz locations elec.label = Nelec x 1 cell array, see above. Since not all datachannels have to be associated with an electrode location (e.g. bipolar EMG channels or a force channel) and since not all electrodes in an electrode cap have to be connected to the amplifier, the electrode structure can contain a longer (or shorter) list of positions and labels. Whenever needed (e.g. for topoplotting or clusterrandanalysis), Fieldtrip will select and use the electrode positions and physiological values that correspond in the data itself and in the elec structure. best wishes, Robert From wibral at MPIH-FRANKFURT.MPG.DE Mon Dec 5 20:11:32 2005 From: wibral at MPIH-FRANKFURT.MPG.DE (Michael Wibral) Date: Mon, 5 Dec 2005 20:11:32 +0100 Subject: maxsum vs. maxsumt In-Reply-To: Message-ID: Hi, I just noticed that my version of clusterrandanalysis (20051127) doesn't list the teststatistic 'maxsumt' in its header or in the actual code as it is used in the tutorial (toolkit 2005). Instead there's an option (the default) 'maxsum'. Are these two the same - or is maxsum just the summed raw effect within a cluster ( and thus maybe pretty sensitive to extreme outliers), whereas maxsumt refers to summed t-scores from the initial tests performed for cluster finding? I also notice that maxsum 'always' yields more significants clusters than orderedsums, is there an explanation for this behaviour (I thought it might rather be the other way round...)? Best Regards, Michael Wibral From maris at NICI.RU.NL Mon Dec 5 22:05:00 2005 From: maris at NICI.RU.NL (Eric Maris) Date: Mon, 5 Dec 2005 22:05:00 +0100 Subject: maxsum vs. maxsumt Message-ID: Hi Michael, > I just noticed that my version of clusterrandanalysis (20051127) doesn't > list the teststatistic 'maxsumt' in its header or in the actual code as it > is used in the tutorial (toolkit 2005). Instead there's an option (the > default) 'maxsum'. Are these two the same - or is maxsum just the summed > raw effect within a cluster ( and thus maybe pretty sensitive to extreme > outliers), whereas maxsumt refers to summed t-scores from the initial > tests performed for cluster finding? The change from 'maxsumt' to 'maxsum' occured when clusterrandanalysis also supported F-statistics at the level of (sensor,frequency,time)-triplets. Using 'cfg.clusterteststat=maxsum' in combination with 'cfg.statistic=indepsamplesT' gives the same results as the 'maxsumt'-option of the older version of clusterrandanalysis. > I also notice that maxsum 'always' yields more significants clusters than > orderedsums, is there an explanation for this behaviour (I thought it > might rather be the other way round...)? I am not surprised. The behavior of 'cfg.clusterteststat=orderedsums' depends on the value assigned to 'cfg.smallestcluster'. If you give 'cfg.smallestcluster' a small value, this will reduce the sensitivity for larger clusters (larger than this small value). The option 'cfg.clusterteststat=orderedsums' will result in more significant clusters than obtained with 'cfg.clusterteststat=maxsum' if the data contain one big cluster and a number of much smaller (but systematic) clusters. These smaller clusters may become significant with 'cfg.clusterteststat=orderedsums' if their size is larger than 'cfg.smallestcluster'. The value of 'cfg.smallestcluster' should be determined independently of the data. I guess there is no need to explain why this so. greetings, Eric Maris From wibral at MPIH-FRANKFURT.MPG.DE Wed Dec 7 11:15:53 2005 From: wibral at MPIH-FRANKFURT.MPG.DE (Michael Wibral) Date: Wed, 7 Dec 2005 11:15:53 +0100 Subject: maxsum vs. maxsumt In-Reply-To: <001a01c5f9df$8e3a3610$6401a8c0@fcdc195> Message-ID: Hi Eric, thank you for pointing out the importnace of smalllestcluster for the potential significance estimations of large cluster. Best Regards, Michael Wibral Eric Maris schrieb: > Hi Michael, > > >> I just noticed that my version of clusterrandanalysis (20051127) >> doesn't list the teststatistic 'maxsumt' in its header or in the >> actual code as it is used in the tutorial (toolkit 2005). Instead >> there's an option (the default) 'maxsum'. Are these two the same - or >> is maxsum just the summed raw effect within a cluster ( and thus >> maybe pretty sensitive to extreme outliers), whereas maxsumt refers >> to summed t-scores from the initial tests performed for cluster finding? > > > The change from 'maxsumt' to 'maxsum' occured when clusterrandanalysis > also supported F-statistics at the level of > (sensor,frequency,time)-triplets. Using 'cfg.clusterteststat=maxsum' > in combination with 'cfg.statistic=indepsamplesT' gives the same > results as the 'maxsumt'-option of the older version of > clusterrandanalysis. > > >> I also notice that maxsum 'always' yields more significants clusters >> than orderedsums, is there an explanation for this behaviour (I >> thought it might rather be the other way round...)? > > > I am not surprised. The behavior of 'cfg.clusterteststat=orderedsums' > depends on the value assigned to 'cfg.smallestcluster'. If you give > 'cfg.smallestcluster' a small value, this will reduce the sensitivity > for larger clusters (larger than this small value). The option > 'cfg.clusterteststat=orderedsums' will result in more significant > clusters than obtained with 'cfg.clusterteststat=maxsum' if the data > contain one big cluster and a number of much smaller (but systematic) > clusters. These smaller clusters may become significant with > 'cfg.clusterteststat=orderedsums' if their size is larger than > 'cfg.smallestcluster'. The value of 'cfg.smallestcluster' should be > determined independently of the data. I guess there is no need to > explain why this so. > > > greetings, > > Eric Maris > > . > From Sehatpour at NKI.RFMH.ORG Tue Dec 13 04:09:14 2005 From: Sehatpour at NKI.RFMH.ORG (Sehatpour, Pejman) Date: Mon, 12 Dec 2005 22:09:14 -0500 Subject: topoplotER shows error message Message-ID: Hi, I am going through the tutorial for "event related averaging" and everything worked well untill I got to plotting the topographic distribution using the topoplotER. At this point when I enter the command which is in the tutorial, I get an error message as follows: cfg = []; cfg.xlim = [0.3 0.5]; topoplotER(cfg,avgFIC) creating layout for ctf151 MEG system ??? Undefined command/function 'dist'. Error in ==> work\private\createlayout at 100 d = dist(prj'); Error in ==> topoplotER at 184 lay = createlayout(data.grad); Could someone please tell me what this error is? and how it should be corrected? The topoplotER version that I am using is from today 12/12/05 Thanks, Pejman. From r.oostenveld at FCDONDERS.RU.NL Tue Dec 13 11:24:40 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 13 Dec 2005 11:24:40 +0100 Subject: topoplotER shows error message In-Reply-To: <52E9E57B58FA71468E55CD3CDE7BE180046D1EE7@nki-exch.nki.rfmh.org> Message-ID: Dear Pejman Thanks for reporting the bug. The "dist" function seems to be missing in the ftp version of fieldtrip/private. Since there is also a "dist" function in the neural networks toolbox that works exactly the same, I (and probably other users as well) did not notice the function to be missing. Please find the function attached, put it in the fieldtrip/private subdirectory. I will also include it in the next ftp release. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: dist.m Type: application/octet-stream Size: 609 bytes Desc: not available URL: -------------- next part -------------- On 13-dec-2005, at 4:09, Sehatpour, Pejman wrote: > Hi, > I am going through the tutorial for "event related averaging" and > everything worked well untill I got to plotting the topographic > distribution using the topoplotER. > At this point when I enter the command which is in the tutorial, I > get an error message as follows: > > cfg = []; > cfg.xlim = [0.3 0.5]; > topoplotER(cfg,avgFIC) > creating layout for ctf151 MEG system > ??? Undefined command/function 'dist'. > Error in ==> work\private\createlayout at 100 > d = dist(prj'); > Error in ==> topoplotER at 184 > lay = createlayout(data.grad); > > > Could someone please tell me what this error is? and how it should > be corrected? > The topoplotER version that I am using is from today 12/12/05 > Thanks, > Pejman. > From werkle at MPIB-BERLIN.MPG.DE Thu Dec 15 18:28:10 2005 From: werkle at MPIB-BERLIN.MPG.DE (Markus Werkle-Bergner) Date: Thu, 15 Dec 2005 18:28:10 +0100 Subject: Problems reading BVA data (segmented) In-Reply-To: Message-ID: Dear all, I'm a beginner with fieldtrip, therefore I probably have an easy question. I try to read in EEG-data that I already preprocessed in Brainvision Analyser. The data is therefore already segmented. From the tutorials and the discussion list, I understood that I should nevertheless use the function preprocessing.m. Now my guess is that I have trouble with the definition of trials from my data-set. I used the following script to read the data: cfg = [] % General settings cfg.datafile = 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.dat'; cfg.headerfile = 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vhdr'; cfg.channel = 'all'; %Trialdefinition cfg.trialfun = 'trialfun_brainvision'; cfg.trialdef.trgfile = 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vmkr'; cfg.trialdef.stim = 'HFC'; cfg.trialdef.segment = 'no'; cfg.trialdef.timezero = 'no'; cfg.trialdef.eventtype = 'Stimulus'; cfg.trialdef.eventvalue = 'HFC'; cfg.trialdef.prestim = 0.500; cfg.trialdef.poststim = 0.600; [cfg]=definetrial(cfg) [raw] = preprocessing(cfg) When I run this script, I get the following error-message: ??? Error using ==> fieldtrip-20051214\private\read_brainvision_vmrk cannot open marker file Error in ==> fieldtrip-20051214\private\trialfun_brainvision at 16 [stim, resp, segment, timezero] = read_brainvision_vmrk(cfg.trialdef.trgfile); Error in ==> definetrial at 151 trl = feval(cfg.trialfun, cfg); Error in ==> FieldtripTest at 17 [cfg]=definetrial(cfg) I checked that the *.dat, *.vhdr, and *.vmrk files are all in the location specified in the script. I really would appreciate if one can give me some advice. Best regards, Markus P.S.: I added the *.vhdr, and *.vmrk files. Perhaps this information is needed. -- ************************************************************** Markus Werkle-Bergner, Dipl. Psych. Predoctoral Research Fellow Center for Lifespan Psychology Max Planck Institute for Human Development Lentzeallee 94, Room 211, D-14195 Berlin, Germany. Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 ************************************************************** -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: mdo13136_1_HFCrej.vmrk URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: mdo13136_1_HFCrej.vhdr URL: From arno at SALK.EDU Fri Dec 16 09:44:44 2005 From: arno at SALK.EDU (arno) Date: Fri, 16 Dec 2005 09:44:44 +0100 Subject: Problems reading BVA data (segmented) In-Reply-To: <43A1A7AA.3060601@mpib-berlin.mpg.de> Message-ID: Dear Markus, in case nothing else works, try also the BVA matlab plugin for EEGLAB. Functions can be called from the command line. Then you can convert the EEGLAB structure to fieldtrip using eeglab2fieldtrip. http://cvs.sourceforge.net/viewcvs.py/bva-io/bva-io/ Best, Arno Markus Werkle-Bergner wrote: > Dear all, > > I'm a beginner with fieldtrip, therefore I probably have an easy > question. > > I try to read in EEG-data that I already preprocessed in Brainvision > Analyser. The data is therefore already segmented. From the tutorials > and the discussion list, I understood that I should nevertheless use > the function preprocessing.m. Now my guess is that I have trouble with > the definition of trials from my data-set. I used the following script > to read the data: > > cfg = [] > % General settings > cfg.datafile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.dat'; > cfg.headerfile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vhdr'; > cfg.channel = 'all'; > %Trialdefinition > cfg.trialfun = 'trialfun_brainvision'; > cfg.trialdef.trgfile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vmkr'; > cfg.trialdef.stim = 'HFC'; > cfg.trialdef.segment = 'no'; > cfg.trialdef.timezero = 'no'; > cfg.trialdef.eventtype = 'Stimulus'; > cfg.trialdef.eventvalue = 'HFC'; > cfg.trialdef.prestim = 0.500; > cfg.trialdef.poststim = 0.600; > > [cfg]=definetrial(cfg) > [raw] = preprocessing(cfg) > > When I run this script, I get the following error-message: > > ??? Error using ==> fieldtrip-20051214\private\read_brainvision_vmrk > cannot open marker file > > Error in ==> fieldtrip-20051214\private\trialfun_brainvision at 16 > [stim, resp, segment, timezero] = > read_brainvision_vmrk(cfg.trialdef.trgfile); > > Error in ==> definetrial at 151 > trl = feval(cfg.trialfun, cfg); > > Error in ==> FieldtripTest at 17 > [cfg]=definetrial(cfg) > > I checked that the *.dat, *.vhdr, and *.vmrk files are all in the > location specified in the script. I really would appreciate if one can > give me some advice. > > Best regards, > Markus > > P.S.: I added the *.vhdr, and *.vmrk files. Perhaps this information > is needed. > >------------------------------------------------------------------------ > >Brain Vision Data Exchange Marker File, Version 1.0 >; Data created from history path: mdo13136_1/Raw Data/Markers Changed/AnneMarker/Segmentation/OddCSt/HFC/Artifact Rejection >; The channel numbers are related to the channels in the exported file. > >[Common Infos] >DataFile=mdo13136_1_HFCrej.dat > >[Marker Infos] >; Each entry: Mk=,,, >; , , >; >; Fields are delimited by commas, some fields might be omited (empty). >; Commas in type or description text are coded as "\1". >Mk1=New Segment,,1,1,0,20031211162420402948 >Mk2=Stimulus,HFC,251,1,0 >Mk3=Time 0,,251,1,0 >Mk4=New Segment,,551,1,0,20031211162424374948 >Mk5=Stimulus,HFC,801,1,0 >Mk6=Time 0,,801,1,0 >Mk7=New Segment,,1101,1,0,20031211162425732947 >Mk8=Stimulus,HFC,1351,1,0 >Mk9=Time 0,,1351,1,0 >Mk10=New Segment,,1651,1,0,20031211162428430948 >Mk11=Stimulus,HFC,1901,1,0 >Mk12=Time 0,,1901,1,0 >Mk13=New Segment,,2201,1,0,20031211162429732948 >Mk14=Stimulus,HFC,2451,1,0 >Mk15=Time 0,,2451,1,0 >Mk16=New Segment,,2751,1,0,20031211162431122948 >Mk17=Stimulus,HFC,3001,1,0 >Mk18=Time 0,,3001,1,0 >Mk19=New Segment,,3301,1,0,20031211162432516947 >Mk20=Stimulus,HFC,3551,1,0 >Mk21=Time 0,,3551,1,0 >Mk22=New Segment,,3851,1,0,20031211162435158947 >Mk23=Time 0,,4101,1,0 >Mk24=Stimulus,HFC,4101,1,0 >Mk25=New Segment,,4401,1,0,20031211162436430948 >Mk26=Time 0,,4651,1,0 >Mk27=Stimulus,HFC,4651,1,0 >Mk28=New Segment,,4951,1,0,20031211162437902948 >Mk29=Time 0,,5201,1,0 >Mk30=Stimulus,HFC,5201,1,0 >Mk31=New Segment,,5501,1,0,20031211162439208948 >Mk32=Stimulus,HFC,5751,1,0 >Mk33=Time 0,,5751,1,0 >Mk34=New Segment,,6051,1,0,20031211162442154948 >Mk35=Stimulus,HFC,6301,1,0 >Mk36=Time 0,,6301,1,0 >Mk37=New Segment,,6601,1,0,20031211162443594947 >Mk38=Stimulus,HFC,6851,1,0 >Mk39=Time 0,,6851,1,0 >Mk40=New Segment,,7151,1,0,20031211162444934947 >Mk41=Stimulus,HFC,7401,1,0 >Mk42=Time 0,,7401,1,0 >Mk43=New Segment,,7701,1,0,20031211162446334947 >Mk44=Stimulus,HFC,7951,1,0 >Mk45=Time 0,,7951,1,0 >Mk46=New Segment,,8251,1,0,20031211162447634948 >Mk47=Time 0,,8501,1,0 >Mk48=Stimulus,HFC,8501,1,0 >Mk49=New Segment,,8801,1,0,20031211162450298948 >Mk50=Stimulus,HFC,9051,1,0 >Mk51=Time 0,,9051,1,0 >Mk52=New Segment,,9351,1,0,20031211162453138948 >Mk53=Stimulus,HFC,9601,1,0 >Mk54=Time 0,,9601,1,0 >Mk55=New Segment,,9901,1,0,20031211162454462948 >Mk56=Time 0,,10151,1,0 >Mk57=Stimulus,HFC,10151,1,0 >Mk58=New Segment,,10451,1,0,20031211162455922948 >Mk59=Stimulus,HFC,10701,1,0 >Mk60=Time 0,,10701,1,0 >Mk61=New Segment,,11001,1,0,20031211162457290947 >Mk62=Time 0,,11251,1,0 >Mk63=Stimulus,HFC,11251,1,0 >Mk64=New Segment,,11551,1,0,20031211162458498947 >Mk65=Time 0,,11801,1,0 >Mk66=Stimulus,HFC,11801,1,0 >Mk67=New Segment,,12101,1,0,20031211162459800947 >Mk68=Time 0,,12351,1,0 >Mk69=Stimulus,HFC,12351,1,0 >Mk70=New Segment,,12651,1,0,20031211162501014948 >Mk71=Stimulus,HFC,12901,1,0 >Mk72=Time 0,,12901,1,0 >Mk73=New Segment,,13201,1,0,20031211162502270948 >Mk74=Time 0,,13451,1,0 >Mk75=Stimulus,HFC,13451,1,0 >Mk76=New Segment,,13751,1,0,20031211162503716948 >Mk77=Stimulus,HFC,14001,1,0 >Mk78=Time 0,,14001,1,0 >Mk79=New Segment,,14301,1,0,20031211162505206947 >Mk80=Time 0,,14551,1,0 >Mk81=Stimulus,HFC,14551,1,0 >Mk82=New Segment,,14851,1,0,20031211162506654948 >Mk83=Time 0,,15101,1,0 >Mk84=Stimulus,HFC,15101,1,0 >Mk85=New Segment,,15401,1,0,20031211162509204948 >Mk86=Time 0,,15651,1,0 >Mk87=Stimulus,HFC,15651,1,0 >Mk88=New Segment,,15951,1,0,20031211162510522947 >Mk89=Stimulus,HFC,16201,1,0 >Mk90=Time 0,,16201,1,0 >Mk91=New Segment,,16501,1,0,20031211162511826948 >Mk92=Stimulus,HFC,16751,1,0 >Mk93=Time 0,,16751,1,0 >Mk94=New Segment,,17051,1,0,20031211162513182948 >Mk95=Stimulus,HFC,17301,1,0 >Mk96=Time 0,,17301,1,0 >Mk97=New Segment,,17601,1,0,20031211162516068947 >Mk98=Stimulus,HFC,17851,1,0 >Mk99=Time 0,,17851,1,0 >Mk100=New Segment,,18151,1,0,20031211162517532948 >Mk101=Stimulus,HFC,18401,1,0 >Mk102=Time 0,,18401,1,0 >Mk103=New Segment,,18701,1,0,20031211162520134948 >Mk104=Stimulus,HFC,18951,1,0 >Mk105=Time 0,,18951,1,0 >Mk106=New Segment,,19251,1,0,20031211162521592947 >Mk107=Time 0,,19501,1,0 >Mk108=Stimulus,HFC,19501,1,0 >Mk109=New Segment,,19801,1,0,20031211162522982948 >Mk110=Time 0,,20051,1,0 >Mk111=Stimulus,HFC,20051,1,0 >Mk112=New Segment,,20351,1,0,20031211162524374947 >Mk113=Stimulus,HFC,20601,1,0 >Mk114=Time 0,,20601,1,0 >Mk115=New Segment,,20901,1,0,20031211162525870947 >Mk116=Time 0,,21151,1,0 >Mk117=Stimulus,HFC,21151,1,0 >Mk118=New Segment,,21451,1,0,20031211162527098947 >Mk119=Time 0,,21701,1,0 >Mk120=Stimulus,HFC,21701,1,0 >Mk121=New Segment,,22001,1,0,20031211162528502948 >Mk122=Time 0,,22251,1,0 >Mk123=Stimulus,HFC,22251,1,0 >Mk124=New Segment,,22551,1,0,20031211162529716948 >Mk125=Stimulus,HFC,22801,1,0 >Mk126=Time 0,,22801,1,0 >Mk127=New Segment,,23101,1,0,20031211162531162947 >Mk128=Time 0,,23351,1,0 >Mk129=Stimulus,HFC,23351,1,0 >Mk130=New Segment,,23651,1,0,20031211162532546947 >Mk131=Stimulus,HFC,23901,1,0 >Mk132=Time 0,,23901,1,0 >Mk133=New Segment,,24201,1,0,20031211162533924948 >Mk134=Stimulus,HFC,24451,1,0 >Mk135=Time 0,,24451,1,0 >Mk136=New Segment,,24751,1,0,20031211162535330947 >Mk137=Time 0,,25001,1,0 >Mk138=Stimulus,HFC,25001,1,0 >Mk139=New Segment,,25301,1,0,20031211162536630948 >Mk140=Time 0,,25551,1,0 >Mk141=Stimulus,HFC,25551,1,0 >Mk142=New Segment,,25851,1,0,20031211162537974948 >Mk143=Time 0,,26101,1,0 >Mk144=Stimulus,HFC,26101,1,0 >Mk145=New Segment,,26401,1,0,20031211162539290948 >Mk146=Time 0,,26651,1,0 >Mk147=Stimulus,HFC,26651,1,0 >Mk148=New Segment,,26951,1,0,20031211162543326947 >Mk149=Time 0,,27201,1,0 >Mk150=Stimulus,HFC,27201,1,0 >Mk151=New Segment,,27501,1,0,20031211162545958947 >Mk152=Time 0,,27751,1,0 >Mk153=Stimulus,HFC,27751,1,0 >Mk154=New Segment,,28051,1,0,20031211162547342948 >Mk155=Time 0,,28301,1,0 >Mk156=Stimulus,HFC,28301,1,0 >Mk157=New Segment,,28601,1,0,20031211162548594947 >Mk158=Time 0,,28851,1,0 >Mk159=Stimulus,HFC,28851,1,0 >Mk160=New Segment,,29151,1,0,20031211162549830948 >Mk161=Time 0,,29401,1,0 >Mk162=Stimulus,HFC,29401,1,0 >Mk163=New Segment,,29701,1,0,20031211162551038948 >Mk164=Time 0,,29951,1,0 >Mk165=Stimulus,HFC,29951,1,0 >Mk166=New Segment,,30251,1,0,20031211162553710947 >Mk167=Time 0,,30501,1,0 >Mk168=Stimulus,HFC,30501,1,0 >Mk169=New Segment,,30801,1,0,20031211162555198948 >Mk170=Time 0,,31051,1,0 >Mk171=Stimulus,HFC,31051,1,0 >Mk172=New Segment,,31351,1,0,20031211162556648947 >Mk173=Stimulus,HFC,31601,1,0 >Mk174=Time 0,,31601,1,0 >Mk175=New Segment,,31901,1,0,20031211162557940948 >Mk176=Stimulus,HFC,32151,1,0 >Mk177=Time 0,,32151,1,0 >Mk178=New Segment,,32451,1,0,20031211162559320947 >Mk179=Stimulus,HFC,32701,1,0 >Mk180=Time 0,,32701,1,0 >Mk181=New Segment,,33001,1,0,20031211162600694948 >Mk182=Time 0,,33251,1,0 >Mk183=Stimulus,HFC,33251,1,0 >Mk184=New Segment,,33551,1,0,20031211162603296948 >Mk185=Time 0,,33801,1,0 >Mk186=Stimulus,HFC,33801,1,0 >Mk187=New Segment,,34101,1,0,20031211162607310947 >Mk188=Stimulus,HFC,34351,1,0 >Mk189=Time 0,,34351,1,0 >Mk190=New Segment,,34651,1,0,20031211162608558948 >Mk191=Stimulus,HFC,34901,1,0 >Mk192=Time 0,,34901,1,0 >Mk193=New Segment,,35201,1,0,20031211162609864948 >Mk194=Stimulus,HFC,35451,1,0 >Mk195=Time 0,,35451,1,0 >Mk196=New Segment,,35751,1,0,20031211162612548947 >Mk197=Stimulus,HFC,36001,1,0 >Mk198=Time 0,,36001,1,0 >Mk199=New Segment,,36301,1,0,20031211162613862948 >Mk200=Time 0,,36551,1,0 >Mk201=Stimulus,HFC,36551,1,0 >Mk202=New Segment,,36851,1,0,20031211162615336947 >Mk203=Stimulus,HFC,37101,1,0 >Mk204=Time 0,,37101,1,0 >Mk205=New Segment,,37401,1,0,20031211162616834948 >Mk206=Time 0,,37651,1,0 >Mk207=Stimulus,HFC,37651,1,0 >Mk208=New Segment,,37951,1,0,20031211162618178948 >Mk209=Stimulus,HFC,38201,1,0 >Mk210=Time 0,,38201,1,0 >Mk211=New Segment,,38501,1,0,20031211162619552948 >Mk212=Stimulus,HFC,38751,1,0 >Mk213=Time 0,,38751,1,0 >Mk214=New Segment,,39051,1,0,20031211162622136947 >Mk215=Stimulus,HFC,39301,1,0 >Mk216=Time 0,,39301,1,0 >Mk217=New Segment,,39601,1,0,20031211162624838948 >Mk218=Stimulus,HFC,39851,1,0 >Mk219=Time 0,,39851,1,0 >Mk220=New Segment,,40151,1,0,20031211162626222948 >Mk221=Time 0,,40401,1,0 >Mk222=Stimulus,HFC,40401,1,0 >Mk223=New Segment,,40701,1,0,20031211162627450947 >Mk224=Stimulus,HFC,40951,1,0 >Mk225=Time 0,,40951,1,0 >Mk226=New Segment,,41251,1,0,20031211162628698948 >Mk227=Stimulus,HFC,41501,1,0 >Mk228=Time 0,,41501,1,0 >Mk229=New Segment,,41801,1,0,20031211162630104948 >Mk230=Stimulus,HFC,42051,1,0 >Mk231=Time 0,,42051,1,0 >Mk232=New Segment,,42351,1,0,20031211162631464947 >Mk233=Stimulus,HFC,42601,1,0 >Mk234=Time 0,,42601,1,0 >Mk235=New Segment,,42901,1,0,20031211162632692948 >Mk236=Stimulus,HFC,43151,1,0 >Mk237=Time 0,,43151,1,0 >Mk238=New Segment,,43451,1,0,20031211162633962947 >Mk239=Stimulus,HFC,43701,1,0 >Mk240=Time 0,,43701,1,0 >Mk241=New Segment,,44001,1,0,20031211162635376948 >Mk242=Time 0,,44251,1,0 >Mk243=Stimulus,HFC,44251,1,0 >Mk244=New Segment,,44551,1,0,20031211162636716948 >Mk245=Time 0,,44801,1,0 >Mk246=Stimulus,HFC,44801,1,0 >Mk247=New Segment,,45101,1,0,20031211162638194948 >Mk248=Time 0,,45351,1,0 >Mk249=Stimulus,HFC,45351,1,0 >Mk250=New Segment,,45651,1,0,20031211162639456947 >Mk251=Time 0,,45901,1,0 >Mk252=Stimulus,HFC,45901,1,0 >Mk253=New Segment,,46201,1,0,20031211162640836948 >Mk254=Stimulus,HFC,46451,1,0 >Mk255=Time 0,,46451,1,0 >Mk256=New Segment,,46751,1,0,20031211162642122947 >Mk257=Stimulus,HFC,47001,1,0 >Mk258=Time 0,,47001,1,0 >Mk259=New Segment,,47301,1,0,20031211162643426948 >Mk260=Stimulus,HFC,47551,1,0 >Mk261=Time 0,,47551,1,0 >Mk262=New Segment,,47851,1,0,20031211162644918947 >Mk263=Stimulus,HFC,48101,1,0 >Mk264=Time 0,,48101,1,0 >Mk265=New Segment,,48401,1,0,20031211162647476947 >Mk266=Time 0,,48651,1,0 >Mk267=Stimulus,HFC,48651,1,0 >Mk268=New Segment,,48951,1,0,20031211162648800948 >Mk269=Stimulus,HFC,49201,1,0 >Mk270=Time 0,,49201,1,0 >Mk271=New Segment,,49501,1,0,20031211162650032947 >Mk272=Stimulus,HFC,49751,1,0 >Mk273=Time 0,,49751,1,0 >Mk274=New Segment,,50051,1,0,20031211162651516948 >Mk275=Stimulus,HFC,50301,1,0 >Mk276=Time 0,,50301,1,0 >Mk277=New Segment,,50601,1,0,20031211162654074947 >Mk278=Stimulus,HFC,50851,1,0 >Mk279=Time 0,,50851,1,0 >Mk280=New Segment,,51151,1,0,20031211162655472947 >Mk281=Stimulus,HFC,51401,1,0 >Mk282=Time 0,,51401,1,0 >Mk283=New Segment,,51701,1,0,20031211162656774948 >Mk284=Stimulus,HFC,51951,1,0 >Mk285=Time 0,,51951,1,0 >Mk286=New Segment,,52251,1,0,20031211162658156948 >Mk287=Stimulus,HFC,52501,1,0 >Mk288=Time 0,,52501,1,0 >Mk289=New Segment,,52801,1,0,20031211162702070948 >Mk290=Time 0,,53051,1,0 >Mk291=Stimulus,HFC,53051,1,0 >Mk292=New Segment,,53351,1,0,20031211162703302947 >Mk293=Time 0,,53601,1,0 >Mk294=Stimulus,HFC,53601,1,0 >Mk295=New Segment,,53901,1,0,20031211162704738948 >Mk296=Stimulus,HFC,54151,1,0 >Mk297=Time 0,,54151,1,0 >Mk298=New Segment,,54451,1,0,20031211162707646948 >Mk299=Stimulus,HFC,54701,1,0 >Mk300=Time 0,,54701,1,0 >Mk301=New Segment,,55001,1,0,20031211162710232948 >Mk302=Time 0,,55251,1,0 >Mk303=Stimulus,HFC,55251,1,0 >Mk304=New Segment,,55551,1,0,20031211162711586947 >Mk305=Stimulus,HFC,55801,1,0 >Mk306=Time 0,,55801,1,0 >Mk307=New Segment,,56101,1,0,20031211162712942948 >Mk308=Time 0,,56351,1,0 >Mk309=Stimulus,HFC,56351,1,0 >Mk310=New Segment,,56651,1,0,20031211162714412947 >Mk311=Time 0,,56901,1,0 >Mk312=Stimulus,HFC,56901,1,0 >Mk313=New Segment,,57201,1,0,20031211162715810948 >Mk314=Time 0,,57451,1,0 >Mk315=Stimulus,HFC,57451,1,0 >Mk316=New Segment,,57751,1,0,20031211162717290947 >Mk317=Stimulus,HFC,58001,1,0 >Mk318=Time 0,,58001,1,0 >Mk319=New Segment,,58301,1,0,20031211162718598948 >Mk320=Time 0,,58551,1,0 >Mk321=Stimulus,HFC,58551,1,0 >Mk322=New Segment,,58851,1,0,20031211162721318948 >Mk323=Time 0,,59101,1,0 >Mk324=Stimulus,HFC,59101,1,0 >Mk325=New Segment,,59401,1,0,20031211162722572948 >Mk326=Time 0,,59651,1,0 >Mk327=Stimulus,HFC,59651,1,0 >Mk328=New Segment,,59951,1,0,20031211162723952948 >Mk329=Time 0,,60201,1,0 >Mk330=Stimulus,HFC,60201,1,0 >Mk331=New Segment,,60501,1,0,20031211162725270948 >Mk332=Time 0,,60751,1,0 >Mk333=Stimulus,HFC,60751,1,0 >Mk334=New Segment,,61051,1,0,20031211162726724948 >Mk335=Stimulus,HFC,61301,1,0 >Mk336=Time 0,,61301,1,0 >Mk337=New Segment,,61601,1,0,20031211162728050947 >Mk338=Stimulus,HFC,61851,1,0 >Mk339=Time 0,,61851,1,0 >Mk340=New Segment,,62151,1,0,20031211162729476947 >Mk341=Stimulus,HFC,62401,1,0 >Mk342=Time 0,,62401,1,0 >Mk343=New Segment,,62701,1,0,20031211162730904948 >Mk344=Stimulus,HFC,62951,1,0 >Mk345=Time 0,,62951,1,0 >Mk346=New Segment,,63251,1,0,20031211162733452947 >Mk347=Time 0,,63501,1,0 >Mk348=Stimulus,HFC,63501,1,0 >Mk349=New Segment,,63801,1,0,20031211162734692948 >Mk350=Stimulus,HFC,64051,1,0 >Mk351=Time 0,,64051,1,0 >Mk352=New Segment,,64351,1,0,20031211162736090947 >Mk353=Time 0,,64601,1,0 >Mk354=Stimulus,HFC,64601,1,0 >Mk355=New Segment,,64901,1,0,20031211162738694948 >Mk356=Time 0,,65151,1,0 >Mk357=Stimulus,HFC,65151,1,0 >Mk358=New Segment,,65451,1,0,20031211162740170947 >Mk359=Stimulus,HFC,65701,1,0 >Mk360=Time 0,,65701,1,0 >Mk361=New Segment,,66001,1,0,20031211162741634947 >Mk362=Stimulus,HFC,66251,1,0 >Mk363=Time 0,,66251,1,0 >Mk364=New Segment,,66551,1,0,20031211162742894948 >Mk365=Stimulus,HFC,66801,1,0 >Mk366=Time 0,,66801,1,0 >Mk367=New Segment,,67101,1,0,20031211162744208947 >Mk368=Stimulus,HFC,67351,1,0 >Mk369=Time 0,,67351,1,0 >Mk370=New Segment,,67651,1,0,20031211162746802948 >Mk371=Stimulus,HFC,67901,1,0 >Mk372=Time 0,,67901,1,0 >Mk373=New Segment,,68201,1,0,20031211162748036948 >Mk374=Stimulus,HFC,68451,1,0 >Mk375=Time 0,,68451,1,0 >Mk376=New Segment,,68751,1,0,20031211162749354947 >Mk377=Stimulus,HFC,69001,1,0 >Mk378=Time 0,,69001,1,0 >Mk379=New Segment,,69301,1,0,20031211162752086948 >Mk380=Stimulus,HFC,69551,1,0 >Mk381=Time 0,,69551,1,0 >Mk382=New Segment,,69851,1,0,20031211162753302948 >Mk383=Stimulus,HFC,70101,1,0 >Mk384=Time 0,,70101,1,0 >Mk385=New Segment,,70401,1,0,20031211162754670947 >Mk386=Time 0,,70651,1,0 >Mk387=Stimulus,HFC,70651,1,0 >Mk388=New Segment,,70951,1,0,20031211162755914948 >Mk389=Time 0,,71201,1,0 >Mk390=Stimulus,HFC,71201,1,0 >Mk391=New Segment,,71501,1,0,20031211162757224947 >Mk392=Stimulus,HFC,71751,1,0 >Mk393=Time 0,,71751,1,0 >Mk394=New Segment,,72051,1,0,20031211162801366948 >Mk395=Stimulus,HFC,72301,1,0 >Mk396=Time 0,,72301,1,0 >Mk397=New Segment,,72601,1,0,20031211162802708947 >Mk398=Stimulus,HFC,72851,1,0 >Mk399=Time 0,,72851,1,0 >Mk400=New Segment,,73151,1,0,20031211162804012948 >Mk401=Stimulus,HFC,73401,1,0 >Mk402=Time 0,,73401,1,0 >Mk403=New Segment,,73701,1,0,20031211162805414948 >Mk404=Time 0,,73951,1,0 >Mk405=Stimulus,HFC,73951,1,0 >Mk406=New Segment,,74251,1,0,20031211162806788948 >Mk407=Time 0,,74501,1,0 >Mk408=Stimulus,HFC,74501,1,0 >Mk409=New Segment,,74801,1,0,20031211162808256947 >Mk410=Time 0,,75051,1,0 >Mk411=Stimulus,HFC,75051,1,0 >Mk412=New Segment,,75351,1,0,20031211162812310947 >Mk413=Time 0,,75601,1,0 >Mk414=Stimulus,HFC,75601,1,0 >Mk415=New Segment,,75901,1,0,20031211162813668948 >Mk416=Time 0,,76151,1,0 >Mk417=Stimulus,HFC,76151,1,0 >Mk418=New Segment,,76451,1,0,20031211162815164948 >Mk419=Stimulus,HFC,76701,1,0 >Mk420=Time 0,,76701,1,0 >Mk421=New Segment,,77001,1,0,20031211162816408947 >Mk422=Stimulus,HFC,77251,1,0 >Mk423=Time 0,,77251,1,0 >Mk424=New Segment,,77551,1,0,20031211162817690948 >Mk425=Time 0,,77801,1,0 >Mk426=Stimulus,HFC,77801,1,0 >Mk427=New Segment,,78101,1,0,20031211162819138947 >Mk428=Stimulus,HFC,78351,1,0 >Mk429=Time 0,,78351,1,0 >Mk430=New Segment,,78651,1,0,20031211162820620948 >Mk431=Time 0,,78901,1,0 >Mk432=Stimulus,HFC,78901,1,0 >Mk433=New Segment,,79201,1,0,20031211162824476947 >Mk434=Stimulus,HFC,79451,1,0 >Mk435=Time 0,,79451,1,0 >Mk436=New Segment,,79751,1,0,20031211162825752948 >Mk437=Stimulus,HFC,80001,1,0 >Mk438=Time 0,,80001,1,0 >Mk439=New Segment,,80301,1,0,20031211162828456948 >Mk440=Stimulus,HFC,80551,1,0 >Mk441=Time 0,,80551,1,0 >Mk442=New Segment,,80851,1,0,20031211162829822947 >Mk443=Stimulus,HFC,81101,1,0 >Mk444=Time 0,,81101,1,0 >Mk445=New Segment,,81401,1,0,20031211162832608947 >Mk446=Stimulus,HFC,81651,1,0 >Mk447=Time 0,,81651,1,0 > > >------------------------------------------------------------------------ > >Brain Vision Data Exchange Header File Version 1.0 >; Data created from history path: mdo13136_1/Raw Data/Markers Changed/AnneMarker/Segmentation/OddCSt/HFC/Artifact Rejection > >[Common Infos] >DataFile=mdo13136_1_HFCrej.dat >MarkerFile=mdo13136_1_HFCrej.vmrk >DataFormat=ASCII >; Data orientation: VECTORIZED=ch1,pt1, ch1,pt2..., MULTIPLEXED=ch1,pt1, ch2,pt1 ... >DataOrientation=MULTIPLEXED >DataType=TIMEDOMAIN >NumberOfChannels=63 >DataPoints=81950 >; Sampling interval in microseconds if time domain (convert to Hertz: >; 1000000 / SamplingInterval) or in Hertz if frequency domain: >SamplingInterval=2000 >SegmentationType=MARKERBASED > >[ASCII Infos] >; Decimal symbol for floating point numbers: the header file always uses a dot (.), >; however the data file might use a different one >DecimalSymbol=. >; SkipLines, SkipColumns: leading lines and columns with additional informations. >SkipLines=1 >SkipColumns=0 > >[Channel Infos] >; Each entry: Ch=,, >; ,; Fields are delimited by commas, some fields might be omited (empty). >; Commas in channel names are coded as "\1". >Ch1=Fp1,, >Ch2=Fpz,, >Ch3=Fp2,, >Ch4=AF3,, >Ch5=AF4,, >Ch6=F7,, >Ch7=F5,, >Ch8=F3,, >Ch9=F1,, >Ch10=Fz,, >Ch11=F2,, >Ch12=F4,, >Ch13=F6,, >Ch14=F8,, >Ch15=FC5,, >Ch16=FC3,, >Ch17=FC1,, >Ch18=FCz,, >Ch19=FC2,, >Ch20=FC4,, >Ch21=FC6,, >Ch22=T7,, >Ch23=C5,, >Ch24=C3,, >Ch25=C1,, >Ch26=Cz,, >Ch27=C2,, >Ch28=C4,, >Ch29=C6,, >Ch30=T8,, >Ch31=A2,, >Ch32=TP7,, >Ch33=CP5,, >Ch34=CP3,, >Ch35=CP1,, >Ch36=CPz,, >Ch37=CP2,, >Ch38=CP4,, >Ch39=CP6,, >Ch40=TP8,, >Ch41=P7,, >Ch42=P5,, >Ch43=P3,, >Ch44=P1,, >Ch45=Pz,, >Ch46=P2,, >Ch47=P4,, >Ch48=P6,, >Ch49=P8,, >Ch50=PO7,, >Ch51=PO3,, >Ch52=PO1,, >Ch53=POz,, >Ch54=PO2,, >Ch55=PO4,, >Ch56=PO8,, >Ch57=O1,, >Ch58=Oz,, >Ch59=O2,, >Ch60=VEOGM,, >Ch61=VEOGP,, >Ch62=HEOGM,, >Ch63=HEOGP,, > >[Coordinates] >; Each entry: Ch=,, >Ch1=1,-92,-72 >Ch2=1,92,90 >Ch3=1,92,72 >Ch4=1,-74,-65 >Ch5=1,74,65 >Ch6=1,-92,-36 >Ch7=1,-75,-41 >Ch8=1,-60,-51 >Ch9=1,-50,-68 >Ch10=1,46,90 >Ch11=1,50,68 >Ch12=1,60,51 >Ch13=1,75,41 >Ch14=1,92,36 >Ch15=1,-72,-21 >Ch16=1,-50,-28 >Ch17=1,-32,-45 >Ch18=1,23,90 >Ch19=1,32,45 >Ch20=1,50,28 >Ch21=1,72,21 >Ch22=1,-92,0 >Ch23=1,-69,0 >Ch24=1,-46,0 >Ch25=1,-23,0 >Ch26=1,0,0 >Ch27=1,23,0 >Ch28=1,46,0 >Ch29=1,69,0 >Ch30=1,92,0 >Ch31=1,129,0 >Ch32=1,-92,18 >Ch33=1,-72,21 >Ch34=1,-50,28 >Ch35=1,-32,45 >Ch36=1,23,-90 >Ch37=1,32,-45 >Ch38=1,50,-28 >Ch39=1,72,-21 >Ch40=1,92,-18 >Ch41=1,-92,36 >Ch42=1,-75,41 >Ch43=1,-60,51 >Ch44=1,-50,68 >Ch45=1,46,-90 >Ch46=1,50,-68 >Ch47=1,60,-51 >Ch48=1,75,-41 >Ch49=1,92,-36 >Ch50=1,-92,54 >Ch51=1,-74,65 >Ch52=1,-69,79 >Ch53=1,69,-90 >Ch54=1,69,-79 >Ch55=1,74,-65 >Ch56=1,92,-54 >Ch57=1,-92,72 >Ch58=1,92,-90 >Ch59=1,92,-72 >Ch60=0,0,0 >Ch61=0,0,0 >Ch62=0,0,0 >Ch63=0,0,0 > > From h.f.kwok at BHAM.AC.UK Fri Dec 16 10:28:30 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Fri, 16 Dec 2005 09:28:30 -0000 Subject: Problems reading BVA data (segmented) In-Reply-To: <43A1A7AA.3060601@mpib-berlin.mpg.de> Message-ID: Hi, I have read BVA data into FieldTrip. I think you should try not to define the cfg.trialfun. This will cause the definetrial function to call the trialfun_general which will obtain the name of the marker file from the header file and in turn read the events from the marker file in the read_fcdc_event function. One thing though is that in the read_fcdc_event, the event.offset is not defined when the filetype is brainvision. This may cause problem when you try to do further analysis. I have therefore attached an amended read_fcdc_event.m. Another thing is that the read_fcdc_event function will get (from the header file) the file name of the marker file but not the file path. Therefore, to be safe, you should make sure the files are in the MATLAB search path. Hope that this will help. Regards, Hoi Fei ******************************************** Dr. Hoi Fei Kwok Research Fellow SyMon Sensory Motor Neuroscience School of Psychology BBS Centre (Hills) The University of Birmingham Edgbaston BIRMINGHAM B15 2TT, UK Tel: +44-(0)121-4147949 Email: h.f.kwok at bham.ac.uk ********************************************* > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Markus Werkle-Bergner > Sent: 15 December 2005 17:28 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] Problems reading BVA data (segmented) > > Dear all, > > I'm a beginner with fieldtrip, therefore I probably have an easy question. > > I try to read in EEG-data that I already preprocessed in Brainvision > Analyser. The data is therefore already segmented. From the tutorials > and the discussion list, I understood that I should nevertheless use the > function preprocessing.m. Now my guess is that I have trouble with the > definition of trials from my data-set. I used the following script to > read the data: > > cfg = [] > % General settings > cfg.datafile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.dat'; > cfg.headerfile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vhdr'; > cfg.channel = 'all'; > %Trialdefinition > cfg.trialfun = 'trialfun_brainvision'; > cfg.trialdef.trgfile = > 'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vmkr'; > cfg.trialdef.stim = 'HFC'; > cfg.trialdef.segment = 'no'; > cfg.trialdef.timezero = 'no'; > cfg.trialdef.eventtype = 'Stimulus'; > cfg.trialdef.eventvalue = 'HFC'; > cfg.trialdef.prestim = 0.500; > cfg.trialdef.poststim = 0.600; > > [cfg]Þfinetrial(cfg) > [raw] = preprocessing(cfg) > > When I run this script, I get the following error-message: > > ??? Error using ==> fieldtrip-20051214\private\read_brainvision_vmrk > cannot open marker file > > Error in ==> fieldtrip-20051214\private\trialfun_brainvision at 16 > [stim, resp, segment, timezero] = > read_brainvision_vmrk(cfg.trialdef.trgfile); > > Error in ==> definetrial at 151 > trl = feval(cfg.trialfun, cfg); > > Error in ==> FieldtripTest at 17 > [cfg]Þfinetrial(cfg) > > I checked that the *.dat, *.vhdr, and *.vmrk files are all in the > location specified in the script. I really would appreciate if one can > give me some advice. > > Best regards, > Markus > > P.S.: I added the *.vhdr, and *.vmrk files. Perhaps this information is > needed. > > -- > ************************************************************** > Markus Werkle-Bergner, Dipl. Psych. > Predoctoral Research Fellow > > Center for Lifespan Psychology > Max Planck Institute for Human Development > Lentzeallee 94, Room 211, D-14195 Berlin, Germany. > Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 > ************************************************************** > > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: read_fcdc_event.m URL: From werkle at MPIB-BERLIN.MPG.DE Fri Dec 16 11:35:51 2005 From: werkle at MPIB-BERLIN.MPG.DE (Markus Werkle-Bergner) Date: Fri, 16 Dec 2005 11:35:51 +0100 Subject: Problems reading BVA data (segmented) In-Reply-To: <000001c60223$13febb90$e516bc93@universi8ef8be> Message-ID: Hi, thank you all for your valuable comments. Now it worked fine. I simply used the read_fcdc_event.m file provided by Hoi Fei. The the trialfun_general did the job. Thank you! Best regards, Markus Hoi Fei Kwok wrote: >Hi, > >I have read BVA data into FieldTrip. I think you should try not to define >the cfg.trialfun. This will cause the definetrial function to call the >trialfun_general which will obtain the name of the marker file from the >header file and in turn read the events from the marker file in the >read_fcdc_event function. One thing though is that in the read_fcdc_event, >the event.offset is not defined when the filetype is brainvision. This may >cause problem when you try to do further analysis. I have therefore attached >an amended read_fcdc_event.m. Another thing is that the read_fcdc_event >function will get (from the header file) the file name of the marker file >but not the file path. Therefore, to be safe, you should make sure the files >are in the MATLAB search path. > >Hope that this will help. > >Regards, >Hoi Fei > >******************************************** > >Dr. Hoi Fei Kwok >Research Fellow >SyMon Sensory Motor Neuroscience >School of Psychology >BBS Centre (Hills) >The University of Birmingham >Edgbaston >BIRMINGHAM B15 2TT, UK > >Tel: +44-(0)121-4147949 >Email: h.f.kwok at bham.ac.uk > >********************************************* > > > >>-----Original Message----- >>From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On >>Behalf Of Markus Werkle-Bergner >>Sent: 15 December 2005 17:28 >>To: FIELDTRIP at NIC.SURFNET.NL >>Subject: [FIELDTRIP] Problems reading BVA data (segmented) >> >>Dear all, >> >>I'm a beginner with fieldtrip, therefore I probably have an easy question. >> >>I try to read in EEG-data that I already preprocessed in Brainvision >>Analyser. The data is therefore already segmented. From the tutorials >>and the discussion list, I understood that I should nevertheless use the >>function preprocessing.m. Now my guess is that I have trouble with the >>definition of trials from my data-set. I used the following script to >>read the data: >> >>cfg = [] >>% General settings >>cfg.datafile = >>'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.dat'; >>cfg.headerfile = >>'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vhdr'; >>cfg.channel = 'all'; >>%Trialdefinition >>cfg.trialfun = 'trialfun_brainvision'; >>cfg.trialdef.trgfile = >>'E:\MATLAB\DATA\Oddball_TestFieldtrip\Export\mdo13136_1_HFCrej.vmkr'; >>cfg.trialdef.stim = 'HFC'; >>cfg.trialdef.segment = 'no'; >>cfg.trialdef.timezero = 'no'; >>cfg.trialdef.eventtype = 'Stimulus'; >>cfg.trialdef.eventvalue = 'HFC'; >>cfg.trialdef.prestim = 0.500; >>cfg.trialdef.poststim = 0.600; >> >>[cfg]Þfinetrial(cfg) >>[raw] = preprocessing(cfg) >> >>When I run this script, I get the following error-message: >> >>??? Error using ==> fieldtrip-20051214\private\read_brainvision_vmrk >>cannot open marker file >> >>Error in ==> fieldtrip-20051214\private\trialfun_brainvision at 16 >>[stim, resp, segment, timezero] = >>read_brainvision_vmrk(cfg.trialdef.trgfile); >> >>Error in ==> definetrial at 151 >> trl = feval(cfg.trialfun, cfg); >> >>Error in ==> FieldtripTest at 17 >>[cfg]Þfinetrial(cfg) >> >>I checked that the *.dat, *.vhdr, and *.vmrk files are all in the >>location specified in the script. I really would appreciate if one can >>give me some advice. >> >>Best regards, >>Markus >> >>P.S.: I added the *.vhdr, and *.vmrk files. Perhaps this information is >>needed. >> >>-- >>************************************************************** >>Markus Werkle-Bergner, Dipl. Psych. >>Predoctoral Research Fellow >> >>Center for Lifespan Psychology >>Max Planck Institute for Human Development >>Lentzeallee 94, Room 211, D-14195 Berlin, Germany. >>Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 >>************************************************************** >> >> >> >> > > > >------------------------------------------------------------------------ > >function [event] = read_fcdc_event(filename) > >% READ_FCDC_EVENT reads all events from an EEG/MEG dataset and returns them >% in a well defined structure. It is a wrapper around different EEG/MEG file >% importers, directly supported formats are CTF, Neuromag, EEP, BrainVision, >% Neuroscan and Neuralynx. >% >% Use as >% [event] = read_fcdc_event(filename) >% >% This function returns a structure with the following fields >% event.type = string >% event.sample = expressed in samples, first sample of file is 1 >% event.value = number or string >% event.offset = expressed in samples >% event.duration = expressed in samples >% >% Some of these fields can be empty, depending on the type of event file. >% After reading the event structure, you can use following tricks to >% extract information about those events in which you are interested. >% >% Determine the different event types >% unique({event.type}) >% >% Get the index of all trial events >% find(strcmp('trial', {event.type})) >% >% Make a vector with all triggers that occurred on the backpanel >% [event(find(strcmp('backpanel trigger', {event.type}))).value] >% >% Find the events that ocurred in trial t=26 >% t = 26; find([event.sample]>trl(t,1) & [event.sample]% >% See also READ_FCDC_DATA, READ_FCDC_HEADER > >% Copyright (C) 2004, Robert Oostenveld >% >% $Log: read_fcdc_event.m,v $ >% Revision 1.29 2005/10/05 06:30:25 roboos >% added support for MPI datasets and DAP files >% >% Revision 1.28 2005/09/15 07:38:38 roboos >% added support for ctf_res4 and ctf_meg4 by renaming filename into dataset >% >% Revision 1.27 2005/09/08 09:25:53 roboos >% added support for the Yokogawa MEG data format >% >% Revision 1.26 2005/09/06 12:45:00 roboos >% renamed plextor into plexon (incorrect company name) >% >% Revision 1.25 2005/08/17 19:34:58 roboos >% added a check for the presence of the file >% added a TTLValue event for each trigger in Neuralynx dataset >% >% Revision 1.24 2005/06/17 10:56:59 roboos >% fixed event.type for CTF stimulus channels (should be string instead of cell) >% >% Revision 1.23 2005/05/24 07:37:04 roboos >% implemented reading of other trigger channels (like UPPT001, UTRG001) for CTF event detection >% >% Revision 1.22 2005/05/19 07:11:32 roboos >% added support for neuralynx_nev >% >% Revision 1.21 2005/05/18 15:50:31 roboos >% repeated last bugfix, now hopefully correct (thanks to Juliet) >% >% Revision 1.20 2005/05/18 10:26:43 roboos >% fixed "Operands to the || and && operators must be convertible to logical scalar values" problem by first checking whether variable is a string or numeric >% >% Revision 1.19 2005/05/17 17:50:38 roboos >% changed all "if" occurences of & and | into && and || >% this makes the code more compatible with Octave and also seems to be in closer correspondence with Matlab documentation on shortcircuited evaluation of sequential boolean constructs >% >% Revision 1.18 2005/05/11 08:27:50 roboos >% implemeted the correct offset (in samples) for CTF markerfiles, sofar the offset was always set to zero >% >% Revision 1.17 2005/03/31 07:05:58 roboos >% implemented support for besa_avr using my own read_besa_avr >% >% Revision 1.16 2005/02/16 07:48:59 roboos >% added support for Plexon nex files, using read_nex_event >% >% Revision 1.15 2005/02/02 14:33:16 roboos >% renamed event.type of eep_avg to 'average', implemented triggers for eep_cnt (using *.trg file) >% >% Revision 1.14 2004/12/07 18:13:04 roboos >% added initial support for Neuroscan cnt files >% >% Revision 1.13 2004/11/17 09:01:50 roboos >% added check for the presence of CTF MarkerFile, to avoid unneccesary warning in readmarkerfile >% >% Revision 1.12 2004/11/15 09:14:09 roboos >% implemented support for Neuroscan *.eeg (epoched) files >% applied auto-indentation, which changed some whitespace in other parts of the file >% >% Revision 1.11 2004/10/01 09:53:25 roboos >% added Neuromag to the help as one of the supported formats >% >% Revision 1.10 2004/09/27 15:37:11 roboos >% renamed the function readClassFile to read_ctf_cls (part of file_io) >% >% Revision 1.9 2004/09/27 13:55:24 roboos >% fixed bugs for CTF marker >% >% Revision 1.8 2004/09/24 07:13:57 roboos >% added support for CTF Markerfiles, using the readmarkerfile function I got from Tom Holroyd >% >% Revision 1.7 2004/09/21 13:09:46 roboos >% added 2 digital trigger channels for fif, analog triggers in fif file are only scanned if no digital triggers are present >% >% Revision 1.6 2004/09/20 11:48:31 roboos >% improved support for Neuromag, threshold all STI-channels at =>5 and treat STI014 as digital channel >% >% Revision 1.5 2004/09/03 09:02:29 roboos >% added raw>5 for flank detection for neuromag trigger channels >% >% Revision 1.4 2004/08/20 09:18:14 roboos >% changed event(i).sample for CTF trials >% implemented Neuromag format: trials and "STI xxx" channels >% >% Revision 1.3 2004/06/30 16:05:24 roboos >% added support for BrainVision marker file on a more general way than implemented in the read_brainvision_vmrk function >% added subfunction tokenize >% renamed dataset into filename >% >% Revision 1.2 2004/06/21 19:21:10 roberto >% renamed eventfile into dataset, added check for empty CTF classfile >% >% Revision 1.1 2004/06/03 09:15:22 roberto >% initial version, supported are CTF and eep_avr >% > >% detect the external toolboxes that optionally can be used >hasbiosig = (exist('sopen') & exist('sread')); % see http://biosig.sourceforge.net/ >hasmegpd = (exist('rawdata') & exist('channames')); % see http://www.kolumbus.fi/kuutela/programs/meg-pd/ >haseegsf = (exist('ctf_read_meg4') & exist('ctf_read_res4')); % see http://eeg.sourceforge.net/ > >% test whether the file exists >if ~exist(filename) > error(sprintf('file ''%s'' does not exist', filename)); >end > >% start with an empty event structure >event = []; > >%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >if filetype(filename, 'ctf_ds') || filetype(filename, 'ctf_meg4') || filetype(filename, 'ctf_res4') > > % obtain the dataset name > if filetype(filename, 'ctf_meg4') || filetype(filename, 'ctf_res4') > filename = fileparts(filename); > end > > [path, name, ext] = fileparts(filename); > headerfile = fullfile(path, [name ext], [name '.res4']); > datafile = fullfile(path, [name ext], [name '.meg4']); > classfile = fullfile(path, [name ext], 'ClassFile.cls'); > > hdr = read_ctf_res4(headerfile); > > % read the trigger codes from the STIM channel, usefull for (pseudo) continuous data > % this splits the trigger channel into the lowers and highest 16 bits, > % corresponding with the front and back panel of the electronics cabinet at the Donders Centre > [backpanel, frontpanel] = read_ctf_trigger(filename); > for i=find(backpanel(:)') > event(end+1).type = 'backpanel trigger'; > event(end ).sample = i; > event(end ).value = backpanel(i); > end > for i=find(frontpanel(:)') > event(end+1).type = 'frontpanel trigger'; > event(end ).sample = i; > event(end ).value = frontpanel(i); > end > > % determine the trigger channels from the header > if isfield(hdr, 'sensType') > for i=find(hdr.sensType(:)'==11) > % read the trigger channel as raw data > trig = read_ctf_meg4(datafile, hdr, 1, hdr.nTrials*hdr.nSamples, i); > % correct for reading it as signed integer, whereas it should be an unsigned int > trig(find(trig<0)) = trig(find(trig<0)) + 2^32; > % convert the trigger into an event with a value at a specific sample > for j=find(diff([0 trig(:)'])>1) > event(end+1).type = hdr.label{i}; > event(end ).sample = j; > event(end ).value = trig(j); > end > end > end > > % make an event for each trial as defined in the header > for i=1:hdr.nTrials > event(end+1).type = 'trial'; > event(end ).sample = (i-1)*hdr.nSamples + 1; > event(end ).offset = -hdr.nSamplesPre; > event(end ).duration = hdr.nSamples; > end > > % read the classification file and make an event for each classified trial > [condNumbers,condLabels] = read_ctf_cls(classfile); > if ~isempty(condNumbers) > Ncond = length(condLabels); > for i=1:Ncond > for j=1:length(condNumbers{i}) > event(end+1).type = 'classification'; > event(end ).value = condLabels{i}; > event(end ).sample = (condNumbers{i}{j}-1)*hdr.nSamples + 1; > event(end ).offset = -hdr.nSamplesPre; > event(end ).duration = hdr.nSamples; > end > end > end > > if exist(fullfile(filename,'MarkerFile.mrk')) > % read the marker file and make an event for each marker > % this depends on the readmarkerfile function that I got from Tom Holroyd > % I have not tested this myself extensively, since at the FCDC we > % don't use the marker files > mrk = readmarkerfile(filename); > for i=1:mrk.number_markers > for j=1:mrk.number_samples(i) > % determine the location of the marker, expressed in samples > trialnum = mrk.trial_times{i}(j,1); > synctime = mrk.trial_times{i}(j,2); > begsample = (trialnum-1)*hdr.nSamples + 1; % of the trial, relative to the start of the datafile > endsample = (trialnum )*hdr.nSamples; % of the trial, relative to the start of the datafile > offset = round(synctime*hdr.Fs); % this is the offset (in samples) relative to time t=0 for this trial > offset = offset + hdr.nSamplesPre; % and time t=0 corrsponds with the nSamplesPre'th sample > % store this marker as an event > event(end+1).type = mrk.marker_names{i}; > event(end ).value = []; > event(end ).sample = begsample + offset; > event(end ).duration = 0; > event(end ).offset = offset; > end > end > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'eep_avr') > % the headerfile and datafile are the same > hdr = read_fcdc_header(filename); > event(end+1).type = 'average'; > event(end ).sample = 1; > event(end ).duration = hdr.nSamples; > event(end ).offset = -hdr.nSamplesPre; > event(end ).value = []; > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'eep_cnt') > % try to read external trigger file in EEP format > trgfile = [filename(1:(end-3)), 'trg']; > if exist(trgfile, 'file') > hdr = read_fcdc_header(filename); > tmp = read_eep_trg(trgfile); > % translate the EEProbe trigger codes to events > for i=1:length(tmp) > event(i).type = 'trigger'; > event(i).sample = round((tmp(i).time/1000) * hdr.Fs) + 1; % convert from ms to samples > event(i).value = tmp(i).code; > event(i).offset = 0; > event(i).duration = 0; > end > else > warning('no triggerfile was found'); > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'brainvision_vhdr') || filetype(filename, 'brainvision_vmrk') > > if filetype(filename, 'brainvision_vhdr') > % read the headerfile belonging to the dataset and try to determine the corresponding markerfile > hdr = read_brainvision_vhdr(filename); > > % replace the filename with the filename of the markerfile > if ~isfield(hdr, 'MarkerFile') || isempty(hdr.MarkerFile) > filename = []; > else > [p, f, e] = fileparts(filename); > filename = fullfile(p, hdr.MarkerFile); > end > end > > fid=fopen(filename,'rt'); > if fid==-1, > error('cannot open BrainVision marker file') > end > > line = []; > while ischar(line) || isempty(line) > line = fgetl(fid); > if ~isempty(line) && ~(isnumeric(line) && line==-1) > if strncmpi(line, 'Mk', 2) > % this line contains a marker > tok = tokenize(line, '='); > if length(tok)~=2 > warning('skipping unexpected formatted line in BrainVision marker file'); > else > % the line looks like "MkXXX=YYY", which is ok > % the interesting part now is in the YYY, i.e. the second token > tok = tokenize(tok{2}, ','); > if isempty(tok{1}) > tok{1} = []; > end > if isempty(tok{2}) > tok{2} = []; > end > event(end+1).type = tok{1}; > event(end ).value = tok{2}; > event(end ).sample = str2num(tok{3}); > event(end ).duration = str2num(tok{4}); > event(end ).offset=[]; % added by H. F. Kwok, University of Birmingham Dec 2005 for compatibility with definetrial.m > end > end > end > end > fclose(fid); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'yokogawa_sqd') || filetype(filename, 'yokogawa_con') || filetype(filename, 'yokogawa_raw') > event = read_yokogawa_event(filename); > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'mpi_ds') || filetype(filename, 'mpi_dap') > hdr = read_fcdc_header(filename); > % determine the DAP files that compromise this dataset > if isdir(filename) > ls = dir(filename); > dapfile = {}; > for i=1:length(ls) > if ~isempty(regexp(ls(i).name, '.dap$')) > dapfile{end+1} = fullfile(filename, ls(i).name); > end > end > dapfile = sort(dapfile); > elseif iscell(filename) > dapfile = filename; > else > dapfile = {filename}; > end > % assume that each DAP file is accompanied by a dat file > % read the trigger values from the separate dat files > trg = []; > for i=1:length(dapfile) > datfile = [dapfile{i}(1:(end-4)) '.dat']; > trg = cat(1, trg, textread(datfile, '', 'headerlines', 1)); > end > % construct a event structure, one 'trialcode' event per trial > for i=1:length(trg) > event(i).type = 'trialcode'; % string > event(i).sample = (i-1)*hdr.nSamples + 1; % expressed in samples, first sample of file is 1 > event(i).value = trg(i); % number or string > event(i).offset = 0; % expressed in samples > event(i).duration = hdr.nSamples; % expressed in samples > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'ns_eeg') > hdr = read_fcdc_header(filename); > for i=1:hdr.nTrials > event(end+1).type = 'trial'; > event(end ).sample = (i-1)*hdr.nSamples + 1; > event(end ).value = []; > event(end ).offset = -hdr.nSamplesPre; > event(end ).duration = hdr.nSamples; > % read the data to determine manually accepted/rejected trials > tmp = read_ns_eeg(filename, i); > if tmp.sweep.accept > event(end).value = 'accept'; > else > event(end).value = 'reject'; > end > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'ns_cnt') > warning('handling of event structure has not been fully tested for Neuroscan *.cnt files'); > % this is a very inefficient implementation > % since it reads not only the event table, but also all data from the file > tmp = read_ns_cnt(filename); > % translate the cnt event table into known FieldTrip event types > for i=1:tmp.nevent > event(i).type = 'trigger'; > event(i).sample = tmp.event.frame(i); > event(i).value = tmp.event.stimtype(i); > event(i).offset = 0; > event(i).duration = 0; > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'besa_avr') > hdr = read_fcdc_header(filename); > event(end+1).type = 'average'; > event(end ).sample = 1; > event(end ).duration = hdr.nSamples; > event(end ).offset = -hdr.nSamplesPre; > event(end ).value = []; > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'neuromag_fif') > hdr = read_fcdc_header(filename); > % add the trials to the event structure > for i=1:hdr.nTrials > event(end+1).type = 'trial'; > event(end ).sample = (i-1)*hdr.nSamples + 1; > event(end ).value = []; > event(end ).offset = -hdr.nSamplesPre; > event(end ).duration = hdr.nSamples; > end > > % add triggers based on the binary trigger channel, this is based the following email > % > % On 14 Sep 2004, at 16:33, Lauri Parkkonen wrote: > % > Anke's file is probably quite recent one. It should have normal binary > % > coding on STI014 and its "analog" counterparts on STI1 ... STI6, > % > swinging between 0 ... +5 volts. These latter channels are virtual, > % > i.e., they are generated from STI014 for backwards compatibility. STI1 > % > is the LSB of STI014 etc. For all the new stuff, I would recommend > % > using STI014 as that's the way the triggers will be stored in the future > % > (maybe the channel name is going to change to something more reasonable > % > like TRIG). Unfortunately, some older files from the 306-channel system > % > have the STI014 coded in a different way - the two 8-bit halves code > % > the input and output triggers separately. > > triglab = {'STI 014', 'STI 015', 'STI 016'}; > trigindx = match_str(hdr.label, triglab); > if length(trigindx)>0 > % pad with the last sample of the previous block, start with zeros > pad = zeros(length(trigindx),1); > for i=1:hdr.nTrials > begsample = (i-1)*hdr.nSamples + 1; > endsample = (i )*hdr.nSamples; > raw = read_fcdc_data(filename, hdr, begsample, endsample, trigindx); > % detect the flank of the trigger > flank = ((diff([raw pad], [], 2) .* raw)~=0); > % for each flank in the TRIG channels, add an event > for j=1:length(trigindx) > for k=find(flank(j,:)) > event(end+1).type = 'trigger'; > event(end ).sample = begsample + k; > event(end ).value = raw(j,k); > event(end ).offset = []; > event(end ).duration = []; > end > end > % remember the last sample to ensure continuity with the next block > pad = raw(:,end); > end > end % if length(trigindx) > > % look for the analog triggers only if no binary trigger channel is present > if isempty(trigindx) > % add the triggers to the event structure based on trigger channels with the name "STI xxx" > % this is not a very efficient implementation, since it has to read all data > % furthermore, there are some issues with noise on these analog trigger channels > stimindx = []; > stimlab = {}; > for i=1:length(hdr.label) > if all(hdr.label{i}(1:3) == 'STI') > stimindx(end+1) = i; > stimlab{end+1} = hdr.label{i}; > end > end > if length(stimindx)>0 > % pad with the last sample of the previous block, start with zeros > pad = zeros(length(stimindx),1); > for i=1:hdr.nTrials > begsample = (i-1)*hdr.nSamples + 1; > endsample = (i )*hdr.nSamples; > raw = read_fcdc_data(filename, hdr, begsample, endsample, stimindx); > % detect the flank of the trigger > flank = ((diff([raw pad], [], 2) .* raw)~=0) & (raw>=5); > % Note: the original code read > % flank = (diff([raw pad], [], 2) .* raw)~=0; > % but according to Joachim, real events always have triggers > 5 > % for each flank in the STIM channels, add an event > for j=1:length(stimindx) > for k=find(flank(j,:)) > event(end+1).type = stimlab{j}; > event(end ).sample = begsample + k; > event(end ).value = raw(j,k); > event(end ).offset = []; > event(end ).duration = []; > end > end > % remember the last sample to ensure continuity with the next block > pad = raw(:,end); > end > end % if length(stimindx) > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'plexon_nex') > event = read_nex_event(filename); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename, 'neuralynx_nev') || filetype(filename, 'neuralynx_ds') > if ~isdir(filename); > filename = fileparts(filename); % only the directory should be used here > end > % read the header and the events > hdr = read_neuralynx_header(filename); > nev = read_neuralynx_event(filename); > AcqStartTimeStamp = max(hdr.FirstTimeStamp); % the first sample that is present in all files is called "1" > for i=1:length(nev) > % add an event containing the string as value > event(end+1).type = 'EventString'; > event(end ).sample = round(hdr.SamplingFrequency * (nev(i).TimeStamp - AcqStartTimeStamp)/1e6) + 1; > event(end ).value = nev(i).EventString; > event(end ).offset = []; > event(end ).duration = []; > % add an event containing the TTL as value > event(end+1).type = 'TTLValue'; > event(end ).sample = round(hdr.SamplingFrequency * (nev(i).TimeStamp - AcqStartTimeStamp)/1e6) + 1; > event(end ).value = nev(i).TTLValue; > event(end ).offset = []; > event(end ).duration = []; > end > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > % added by H. F. Kwok for University of Birmingham data > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >elseif filetype(filename,'bham_bdf') > event=read_biosemi_event(filename); > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >else > error('unknown filetype for events'); >end % different filetypes > >if ~isempty(event) > % sort the events on the sample on which they occur > [dum, indx] = sort([event.sample]); > event = event(indx); >else > warning(sprintf('no events found in %s', filename)); >end > >%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >% SUBFUNCTION that cuts a string into pieces on a user-defined separator character >%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >function [tok] = tokenize(str, sep) >tok = {}; >f = find(str==sep); >f = [0, f, length(str)+1]; >for i=1:(length(f)-1) > tok{i} = str((f(i)+1):(f(i+1)-1)); >end > > -- ************************************************************** Markus Werkle-Bergner, Dipl. Psych. Predoctoral Research Fellow Center for Lifespan Psychology Max Planck Institute for Human Development Lentzeallee 94, Room 211, D-14195 Berlin, Germany. Phone: +49(0)30-82406-447 Fax: +49(0)30-8249939 ************************************************************** From wibral at MPIH-FRANKFURT.MPG.DE Thu Dec 22 14:09:46 2005 From: wibral at MPIH-FRANKFURT.MPG.DE (Michael Wibral) Date: Thu, 22 Dec 2005 14:09:46 +0100 Subject: Manually Importing data In-Reply-To: Message-ID: Dear Colleagues, we have a dataset that is in some sense 'preprocessed' i.e. there is a little matrix (or concatenated ones) for each trial of each condition, we also have information on filters, electrode locations etc. but not in any of the usual file formats. As we would like to use the Multitaper analysis and coherence/phase locking we'll have to 'fake' a Fieldtrip dataset at some point by assembling the corresponding structutre by hand. What's the better entry point for this: before preproc (but then we'll have to make a trialfun etc.) or after preproc (where the structure is already quite involved, at least it looks like that). If we try to mimic a preprocessed dataset, which of the fields are mandatory? Thanks for any comment on this. Merry Christmas and a Happy New Year to everyone. Michael Wibral M. Wibral MSc. Max Planck Institute for Brain Research Dept. Neurophysiology Deutschordenstrasse 46 60528 Frankfurt am Main Germany Phone: +49(0)69/6301-83849 +49(0)173/4966728 Fax: +49(0)69/96769-327 From r.oostenveld at FCDONDERS.RU.NL Fri Dec 23 11:27:01 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 23 Dec 2005 11:27:01 +0100 Subject: Manually Importing data In-Reply-To: <43AAA59A.7050908@mpih-frankfurt.mpg.de> Message-ID: Dear Michael On 22-dec-2005, at 14:09, Michael Wibral wrote: > /phase locking we'll have to 'fake' a Fieldtrip dataset at some > point by assembling the corresponding structutre by hand. What's > the better entry point for this: before preproc (but then we'll > have to make a trialfun etc.) or after preproc (where the > structure is already quite involved, at least it looks like that). > If we try to mimic a preprocessed dataset, which of the fields are > mandatory? In your case it is much easier to do it after preprocessing. The output of the preprocessing function, which you have to mimic, is data.trial = 1xNtrials cell-array, each containing Nchans X Nsamples data.time = 1xNtrials cell-array, each containing 1 X Nsamples data.fsample = number in Hz data.cfg = []; this will do data.label = Nchans X 1 cell-array with strings, e.g. {'Fp1', 'Fpz', ...} I guess that most of this is straightforward. Since we support trials of variable length, each trial has its own time axis. In most cases with fixed-length trial data, data.time{i} is the same for all i. About electrode locations: you can add a data.elec field, but that is optional. The elec structure contains elec.pnt = Nelec X 3 matrix with carthesian xyz locations elec.label = Nelec x 1 cell array, see above. Since not all datachannels have to be associated with an electrode location (e.g. bipolar EMG channels or a force channel) and since not all electrodes in an electrode cap have to be connected to the amplifier, the electrode structure can contain a longer (or shorter) list of positions and labels. Whenever needed (e.g. for topoplotting or clusterrandanalysis), Fieldtrip will select and use the electrode positions and physiological values that correspond in the data itself and in the elec structure. best wishes, Robert