<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
The error you get suggests that the FieldTrip on your matlab path is not able to deal with old-syntax ft_selectdata. This is a function in fieldtrip/utilities, which at some time in the past supported two different sets of input arguments.
<div class="">This has changed in later versions of the code, to ensure overall code consistency.</div>
<div class="">Now, the megconnectome scripts use the old syntax call to ft_selectdata, so it is crucial that the correct version of the code is used. As far as I can see, the fieldtrip-r10442 should support both the old and new syntax. If you look in fieldtrip/utilities,
 there should be a triplet of functions : ft_selectdata/ft_selectdata_old/ft_selectdata_new, where the code in ft_selectdata has some intelligency built in to choose the right old/new file, conditional on the input.</div>
<div class=""><br class="">
</div>
<div class="">My current guess is that you have an overloaded version of fieldtrip higher on your matlab path, so that you end up in the wrong version of fieldtrip. This guess is further supported by the fact that the line 42 in ft_preamble_init (as per the
 error report that you pasted in your message) of fieldtrip-r10442 does not look as if you ended up there.</div>
<div class=""><br class="">
</div>
<div class="">You can find out which file is used by matlab, if you type: which ft_selectdata. If it does not point to a file in the fieldtrip-r10442 then you need to update your matlab path settings. There’s documentation on
<a href="http://fieldtriptoolbox.org" class="">fieldtriptoolbox.org</a> which explains how to do this.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 23 Sep 2020, at 17:48, Winter, Matthew <<a href="mailto:mattwint@iu.edu" class="">mattwint@iu.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Thanks Jan-Mathijs,</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
 </p>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Sorry about that, I am using the  megconnectome x3.0 and fieldtrip-r10442, But perhaps I should try cycling through the different fieldtrip versions to see if that makes a difference.</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
 </p>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Best,</div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Matt<span class="Apple-converted-space"> </span></div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
 </p>
<div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class="">
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; border: none; padding: 0in;" class="">
<b class="">From:<span class="Apple-converted-space"> </span></b><a href="mailto:jan.schoffelen@donders.ru.nl" style="color: blue; text-decoration: underline;" class="">Schoffelen, J.M. (Jan Mathijs)</a><br class="">
<b class="">Sent:<span class="Apple-converted-space"> </span></b>Wednesday, September 23, 2020 2:57 AM<br class="">
<b class="">To:<span class="Apple-converted-space"> </span></b><a href="mailto:fieldtrip@science.ru.nl" style="color: blue; text-decoration: underline;" class="">FieldTrip discussion list</a><br class="">
<b class="">Subject:<span class="Apple-converted-space"> </span></b>[External] Re: [FieldTrip] ft_preamble error for HCP Pipeline</div>
</div>
<p class="MsoNormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
 </p>
</div>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: rgb(255, 236, 229); color: rgb(130, 39, 13); border-left-width: 0.25rem; border-left-style: solid; border-left-color: rgb(223, 54, 3); padding: 0.5rem; text-align: left; line-height: 1.25;" class="">
This message was sent from a non-IU address. Please exercise caution when clicking links or opening attachments from external sources.</div>
<br class="">
Hi Matt,
<div class=""><br class="">
</div>
<div class="">Hard to tell without any additional information. The megconnectome code was written ~7 years ago, using a certain version of the fieldtrip code base. It is not unlikely that there are compatibility issues.</div>
<div class="">You did not provide information with respect to the FieldTrip version you are using, but my first guess would be a mismatch. </div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 23 Sep 2020, at 03:46, Winter, Matthew <<a href="mailto:mattwint@iu.edu" class="" style="color: blue; text-decoration: underline;">mattwint@iu.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;">
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
Hi Everyone,</div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
 </div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
I am trying to run the megconnectome pipeline hcp_tmegconnebacic.m. However I get a list of errors:</div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
 </div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
Error using ft_preamble_init (line 42)</div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
It seems as if the first input argument is a FieldTrip data structure, while a cfg is expected</div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
 </div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
Error in ft_preamble (line 83)</div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
evalin('caller', full_cmd);</div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
 </div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
Error in ft_selectdata (line 80)</div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
ft_preamble init</div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
 </div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
Error in hcp_tmegconnebasic_contrasts (line 283)</div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
    datacntr1A=ft_selectdata(alldata1A,'rpt',sel);</div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
 </div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
Error in hcp_tmegconnebasic (line 534)</div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
    [outStatus] = hcp_tmegconnebasic_contrasts(cfg);</div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
 </div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
It traces back to the ft_preamble_init functions when it calls another function, FjmoT6aA_stack = dbstack(‘-completenames'), and I find myself at a deadend there, I am not sure how or where the cfg is supposed to be input. Does anyone have any insights that
 could help me figure this out?<span class="Apple-converted-space"> </span></div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
 </div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
Best,</div>
<div class="" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
Matt</div>
</div>
<span class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">_______________________________________________</span><br class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;">
<span class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; float: none; display: inline !important;">fieldtrip
 mailing list</span><br class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="" style="color: blue; text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" class="" style="color: blue; text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">https://doi.org/10.1371/journal.pcbi.1002202</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">fieldtrip
 mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="color: blue; text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" style="color: blue; text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://doi.org/10.1371/journal.pcbi.1002202</a></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>