<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Gulim;
        panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Malgun Gothic";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:"\@Malgun Gothic";}
@font-face
        {font-family:"\@Gulim";
        panose-1:2 11 6 0 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:50857048;
        mso-list-type:hybrid;
        mso-list-template-ids:1228823400 67502097 67502105 67502107 67502095 67502105 67502107 67502095 67502105 67502107;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DA" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">Dear Jaewon<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">I will address your first question/issue:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p style="margin:0cm"><span lang="EN-US" style="mso-fareast-language:EN-US">When you call
</span><span lang="EN-US" style="font-size:10.0pt">timelockHH    = ft_timelockanalysis(cfg, 'ERP_HH.mat'); the argument after cfg, should not be the filename, but the data structure that you imported and is in your MATLAB workspace.<o:p></o:p></span></p>
<p style="margin:0cm"><span lang="EN-US" style="font-size:10.0pt"><o:p> </o:p></span></p>
<p style="margin:0cm"><span lang="EN-US" style="font-size:10.0pt">The order in which you call the function in your example in your mail is out of order, in that it seems that you define the cfg for the statistical test already for the averaging procedure. ft_timelockanalysis
 is not, despite it’s name, for statistical analysis of timelocked responses, but a function to average/aggregate over single trials, i.e. calculate ERPs in this case. The function for the cluster-based permutation statistics is ft_timelock<u>statistics</u>.
 The order should be:<o:p></o:p></span></p>
<ol style="margin-top:0cm" start="1" type="1">
<li style="margin-top:0cm;margin-bottom:0cm;mso-list:l0 level1 lfo1"><span lang="EN-US" style="font-size:10.0pt">Import from Analyzer.
</span><span lang="EN-US"><o:p></o:p></span></li><li style="margin-top:0cm;margin-bottom:0cm;mso-list:l0 level1 lfo1"><span lang="EN-US" style="font-size:10.0pt">Calculate average with ft_timelockanalysis for each subject</span><span lang="EN-US"><o:p></o:p></span></li><li style="margin-top:0cm;margin-bottom:0cm;mso-list:l0 level1 lfo1"><span lang="EN-US" style="font-size:10.0pt">Do statistics with ft_timelockstatistics across all subjects.</span><span lang="EN-US"><o:p></o:p></span></li></ol>
<p style="margin:0cm;cursor:text"><span lang="EN-US" style="font-size:10.0pt"><o:p> </o:p></span></p>
<p style="margin:0cm"><span lang="EN-US" style="font-size:10.0pt">Best regards<o:p></o:p></span></p>
<p style="margin:0cm"><span lang="EN-US" style="font-size:10.0pt">Mikkel</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="cursor:text"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">Fra:
</span></b><span style="font-size:12.0pt;color:black">fieldtrip <fieldtrip-bounces@science.ru.nl> på vegne af "</span><span style="font-size:12.0pt;font-family:"Malgun Gothic",sans-serif;color:black">오재원</span><span style="font-size:12.0pt;color:black">" via
 fieldtrip <fieldtrip@science.ru.nl><br>
<b>Dato: </b>fredag, 25. februar 2022 kl. 11.14<br>
<b>Til: </b>fieldtrip@science.ru.nl <fieldtrip@science.ru.nl><br>
<b>Cc: </b>"</span><span style="font-size:12.0pt;font-family:"Malgun Gothic",sans-serif;color:black">오재원</span><span style="font-size:12.0pt;color:black">" <ann0207@snu.ac.kr><br>
<b>Emne: </b>[FieldTrip] A question on fieldtrip cluster-based permutation test<o:p></o:p></span></p>
</div>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt;font-family:"Gulim",sans-serif"><o:p> </o:p></span></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt;font-family:"Gulim",sans-serif"><o:p> </o:p></span></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">Hello. I'm Jaewon Oh.</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">I am struggling with cluster-based permutation test using my EEG data (ERP).</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">First, I have already preprocessed my data (including filtering, segmentation, base-line correction, artifact rejection, CSD, etc.) in BrainVision analyzer and then exported the data using 'generic
 export', and then imported them into matlab. I followed thsi way to import the data into Matlab : https://www.youtube.com/watch?v=wyLg40dLwJo</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">According to an explanation on the function 'BVA2Matlab' used in the video, the function transfroms data into the form of the output of 'ft_preprocessing'.</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">So I thought I could apply my data which had been analyzed in BrainVision analyzer to 'ft_tiemlockanalysis' and then to 'ft_timelockstatistics'.</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">Below are the codes:</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">>> cfg         = [];</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.channel = {'EEG'};</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.latency = [0 0.6];</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.method           = 'montecarlo';</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.statistic        = 'ft_statfun_depsamplesFmultivariate';</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.correctm         = 'cluster';</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.clusteralpha     = 0.05;</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.clusterstatistic = 'maxsum';</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.minnbchan        = 2;</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.tail             = 0;</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.clustertail      = 0;</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.alpha            = 0.025;</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.numrandomization = 500;</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">Nsubj  = 26;</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">design = zeros(2, Nsubj*2);</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">design(1,:) = [1:Nsubj 1:Nsubj];</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">design(2,:) = [ones(1,Nsubj) ones(1,Nsubj)*2];</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.design = design;</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.uvar   = 1;</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.ivar   = 2;</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">>> cfg = [];</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.keeptrials = 'yes';</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">timelockHH    = ft_timelockanalysis(cfg, 'ERP_HH.mat');</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">timelockHN     = ft_timelockanalysis(cfg, 'ERP_HN.mat');</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">timelockLH    = ft_timelockanalysis(cfg, 'ERP_LH.mat');</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">timelockLN     = ft_timelockanalysis(cfg, 'ERP_LN.mat');</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">% and the error I encountered :</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">다음</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">사용</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">중</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">오류가</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">발생함</span><span style="font-size:10.0pt">: ft_checkdata (538</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">번</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">라인</span><span style="font-size:10.0pt">)</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">This function requires 'raw+comp' or 'raw' data as input, see ft_datatype_raw.</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">오류</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">발생</span><span style="font-size:10.0pt">: ft_timelockanalysis (98</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">번</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">라인</span><span style="font-size:10.0pt">)</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes');</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">ft_datatype_raw says that it is typically obtained after calling after ft_definetrial and ft_preprocessing.</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">However, as I said, I used 'BVA2Matlab' function which modifies data into the form of the output of ft_preprocessing. But why did that kind of error come up?</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">Can't I apply the data which has already been analyzed in BrainVision analyzer to fieldtrip cluster-based permutation test?</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">I also tried to apply the original raw data (.eeg, .vmrk, .vhdr) to the very first step of preprocessing in fieldtrip using 'ft_definetrial'.</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">However, somehow, it was not possible. Below are the codes.</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">>> cfg                         = [];</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.dataset                 = 'p01.eeg';</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.trialfun                = 'ft_trialfun_general'</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.trialdef.eventtype      = '?';</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.trialdef.eventvalue     = [1 2 3 4];</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.trialdef.prestim        = 0.2; </span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.trialdef.poststim       = 1; </span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg = ft_definetrial(cfg);</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">As a result, I got the following :</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg = </span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">  </span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">다음</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">필드를</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">포함한</span><span style="font-size:10.0pt"> struct:</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">     dataset: 'p01.eeg'</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">    trialfun: 'ft_trialfun_general'</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">경고</span><span style="font-size:10.0pt">: Your path is set up incorrectly. You probably used addpath(genpath('path_to_fieldtrip')), this can lead to</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">unexpected behavior. See</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">http://www.fieldtriptoolbox.org/faq/should_i_add_fieldtrip_with_all_subdirectories_to_my_matlab_path </span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">경고</span><span style="font-size:10.0pt">: cfg.trialdef.eventtype='?' is deprecated, please specify cfg.trialfun='ft_trialfun_show' </span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">evaluating trial function 'ft_trialfun_show'</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">reading the events from 'p01.vhdr'</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">the following events were found in the data</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">event type: 'New Segment' </span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">with event values: 1</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">event type: 'Stimulus' </span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">with event values: 'S  1' 'S  2' 'S  3' 'S  4' 'S  5' 'S  6' 'S 10' 'S 11' 'S111' </span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">no trials have been defined yet, see FT_DEFINETRIAL for further help</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">found 525 events</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">the call to "ft_definetrial" took 3 seconds</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">The event values are all correct and retried with the event type of 'Stimulus' : </span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">>> cfg                         = [];</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.dataset                 = 'p01.eeg';</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.trialfun                = 'ft_trialfun_general'</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.trialdef.eventtype      = 'Stimulus';</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.trialdef.eventvalue     = [1 2 3 4];</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.trialdef.prestim        = 0.2; </span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg.trialdef.poststim       = 1; </span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg = ft_definetrial(cfg);</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">And what I got from this was like :</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">cfg = </span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">  </span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">다음</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">필드를</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">포함한</span><span style="font-size:10.0pt"> struct:</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">     dataset: 'p01.eeg'</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">    trialfun: 'ft_trialfun_general'</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">경고</span><span style="font-size:10.0pt">: Your path is set up incorrectly. You probably used addpath(genpath('path_to_fieldtrip')), this can lead to</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">unexpected behavior. See</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">http://www.fieldtriptoolbox.org/faq/should_i_add_fieldtrip_with_all_subdirectories_to_my_matlab_path </span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">evaluating trial function 'ft_trialfun_general'</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">reading the header from 'p01.vhdr'</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">reading the events from 'p01.vhdr'</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">다음</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">사용</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">중</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">오류가</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">발생함</span><span style="font-size:10.0pt">: ft_definetrial (210</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">번</span><span style="font-size:10.0pt">
</span><span style="font-size:10.0pt;font-family:"Malgun Gothic",sans-serif">라인</span><span style="font-size:10.0pt">)</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">no trials were defined, see FT_DEFINETRIAL for help</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">Why can't I use even 'ft_definetrial'? Do you see any problem in my codes?</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">In short, I have two questions.</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">The first one is troubleshooting in applying the data imported from BrainVision analyzer to fieldtrip cluster-based permutation test,</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">and the second one is troubleshooting with ft_definetrial.</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">Thank you for reading this long mail.</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">I will be waiting for your response.</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">Thank you and have a nice day :)</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">All your best,</span><o:p></o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><o:p> </o:p></p>
<p style="margin:0cm;cursor:text"><span style="font-size:10.0pt">Jaewon</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><img id="_x0000_i1025" src="https://mail.snu.ac.kr:443/checkread/MTU2ODgyMTIyOA==/ZmllbGR0cmlwQHNjaWVuY2UucnUubmw=/"><o:p></o:p></span></p>
</div>
</body>
</html>