<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Martina,<div><br></div><div>I agree that the sorting of the channels is somewhat annoying, and an unexpected feature in the coding. Presently we are looking into how to address this.</div><div><br></div><div>Yet, the sorting that is applied to the list of channels is consistently applied to all fields that contain numeric data. In your case I don’t understand your statement that the mask stays unsorted. Is there any way you are able to verify that? If I run the following simple simulation everything is reordered, also the ‘mask’-field.</div><div><br></div><div>stat.label={‘B’;’A’;’C’};</div><div>stat.stat=repmat([1:3]’,[1 2]);</div><div>stat.mask=stat.stat;</div><div>stat.prob=stat.stat;</div><div>stat.time=[1 2];</div><div>stat.dimord=‘chan_time’;</div><div><br></div><div>stat2=ft_selectdata([],stat);</div><div><br></div><div>If I now do:</div><div><br></div><div>stat2.label</div><div><br></div><div>I get </div><div><br></div><div>ans = </div><div><br></div><div>  ‘A’</div><div>  ‘B’</div><div>  ‘C’</div><div><br></div><div>and when I do:</div><div><br></div><div>stat2.stat</div><div><br></div><div>I get</div><div><br></div><div>ans = </div><div><br></div><div>  2 2</div><div>  1 1</div><div>  3 3</div><div><br></div><div>and when I do:</div><div><br></div><div>stat2.mask</div><div><br></div><div>I get</div><div><br></div><div>ans = </div><div><br></div><div>  2 2 </div><div>  1 1</div><div>  3 3</div><div><br></div><div>Conslusion: the mask is also re-ordered. In other words, the rows in the numeric data fields are still consistent with respect to one another.</div><div><br></div><div>If you want to stay informed about this issue, I suggest you to create an account on <a href="http://bugzilla.fcdonders.nl">bugzilla.fcdonders.nl</a>, and add yourself to the cc-list of bug #2597.</div><div><br></div><div><br></div><div>Best wishes,</div><div>Jan-Mathijs</div><div><br></div><div><br><div><div>On Jun 23, 2014, at 4:14 PM, Martina Postorino <<a href="mailto:martina.postorino@gmail.com">martina.postorino@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>Dear all,</div><div><br></div><div>I recently encountered a problem using the function ft_selectdata to select a subset of channels from my EEG dataset.</div><div> </div><div>I found out that in the output of the function ft_selectdata, channels are sorted alphabetically. For me, that represents a problem since I would like to plot the results from a cluster based permutation test using the information stored in stat.mask (in which the order of channels is in line with the original order of channels, i.e. not alphabetically) on the ERP grandaverage of specific electrodes selected with ft_selectdata, to see which time points are significantly different between my experimental conditions. Due to the different orders of the channels, the mask is plotted over the wrong channels.</div>

<div> </div><div>Is there a way to avoid that the function automatically sorts the labels of the channels alphabetically?</div><div> </div><div>I have already tried the different versions of ft_selectdata (ft_selectdata, ft_selectdata_old, ft_selectdata_new) and updated my Fieldtrip version to the last one available. Nothing changed.</div>

<div><br></div><div>This is the code I use:<br></div><div><br></div><div>[stat] = ft_timelockstatistics(cfg, ERP_pain_bp_GA, ERP_buttonpress_GA);</div><div><br></div><div> %plotting</div><div><br></div><div>cfgp = [];</div>

<div>cfgp.channel = {'Cz'; 'CPz', 'Pz', 'CP1'. 'CP3', 'CP2', 'CP4'};</div><div>cfgp.avgoverchan = 'no';</div><div>cfgp.latency = [-1 1];</div><div>ERP_pain_bp_GA_red = ft_selectdata_new(cfgp, ERP_pain_bp_GA);</div>

<div>ERP_buttonpress_GA_red = ft_selectdata_new(cfgp, ERP_buttonpress_GA);</div><div> </div><div>% average data across subjects</div><div><br></div><div>cfgp = [];</div><div>cfgp.keepindividual = 'no';</div><div>
ERP_pain_bp_GA_avg = ft_timelockanalysis (cfgp, ERP_pain_bp_GA_red);<br>
</div><div>ERP_buttonpress_GA_avg = ft_timelockanalysis (cfgp, ERP_buttonpress_GA_red);</div><div>% ERP_pain_GA_avg = ft_timelockanalysis (cfg, ERP_pain_GA_red);</div><div><br></div><div>ERP_pain_bp_GA_avg.mask = stat.mask;<br>

</div><div>ERP_buttonpress_GA_avg.mask = stat.mask;</div><div>% ERP_pain_GA_avg.mask = stat.mask;</div><div><br></div><div>% do the plotting</div><div><br></div><div>cfgp = [];</div><div>cfgp.maskparameter = 'mask';</div>

<div>cfgp.maskstyle = 'box';</div><div>cfgp.layout = layout_easycap_painlabmunich;<br></div><div><br></div><div>ft_multiplotER(cfgp,ERP_pain_bp_GA_avg, ERP_buttonpress_GA_avg); <br></div><div><br></div><div>Thanks in advance!</div>

<div><div dir="ltr"><div><br></div><div><font color="#999999">___________________________________________</font></div><div><br></div><font color="#999999">Martina Postorino, M.Sc</font><div><font color="#999999">Phd program in Medical Life Science and Technology</font></div>

<div><font color="#999999"><br></font></div><div><div><font color="#999999">Neuroimaging Center (TUM-NIC)<br></font></div><div><font color="#999999">Technische Universität München, Klinikum Rechts der Isar</font></div><div>

<br></div></div></div></div>
</div>
_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Jan-Mathijs Schoffelen, MD PhD </div><div><br></div><div>Donders Institute for Brain, Cognition and Behaviour, <br>Centre for Cognitive Neuroimaging,<br>Radboud University Nijmegen, The Netherlands</div><div><br></div><div>Max Planck Institute for Psycholinguistics,</div><div>Nijmegen, The Netherlands</div><div><br></div><div><a href="mailto:J.Schoffelen@donders.ru.nl">J.Schoffelen@donders.ru.nl</a></div><div>Telephone: +31-24-3614793</div><div><br></div><div><a href="http://www.hettaligebrein.nl">http://www.hettaligebrein.nl</a></div></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></span>
</div>
<br></div></body></html>