<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="">
Hi Éva,
<div class=""><br class="">
</div>
<div class="">I don’t completely follow your exposition, but I don’t understand well why you think that you should use cfg.keepsampleinfo = ‘yes’ for the reason that you mentioned:<i class="">  (QUOTE): '<span style="font-family: Calibri, sans-serif; font-size: 11pt;" class="">Even
 though the files are separated, they should contain the same events, so I kept the option</span><span style="font-family: Calibri, sans-serif; font-size: 11pt;" class=""> </span><span class="" style="font-family: Calibri, sans-serif; font-size: 11pt;">cfg.keepsampleinfo
 = 'yes’</span><span style="font-family: Calibri, sans-serif; font-size: 11pt;" class="">.</span><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class="">’</span></font></i></div>
<div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class=""><br class="">
</span></font></div>
<div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class="">If you retain the sampleinfo in the data structures that come from different files, the mapping from recorded samples to samples present in the data
 structure - which is what the sampleinfo reflects - results in conflicting information. Let’s say that you have two recordings (with a length of 100 samples) that are read in into a fieldtrip structure. If you retain the sampleinfo, both datastructures will
  have a sampleinfo [1 100]. The later check (in ft_fetch_data, called by a subfunction of ft_databrowser) investigates (in case of a sampleinfo being present, and in that case based on the sampleinfo), whether the data segments are overlapping - under the
 assumption that the segments are derived from the same recording. In your case it fails. </span></font></div>
<div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class=""><br class="">
</span></font></div>
<div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class="">Now, you also mention ft_appenddata in passing. I don’t know what this has to do with it, but I guess that you tried this function to append the
 two data structures. I don’t know how by heart how clever this function is, so it could be that it did not work in your case. I suspect that if you get rid of the sampleinfo, things will work out fine.</span></font></div>
<div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class=""><br class="">
</span></font></div>
<div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class="">Best wishes,</span></font></div>
<div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class="">Jan-Mathijs</span></font></div>
<div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class=""><br class="">
</span></font></div>
<div class=""><font face="Calibri, sans-serif" class=""><span style="font-size: 14.666666984558105px;" class=""><br class="">
</span></font>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 26 Jan 2023, at 22:49, Eva Masson via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="page: WordSection1; 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: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Dear FieldTrip community,</div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
I am trying to merge two blocks of (so far) continuous data. The recordings are the same in the sense that they have the same number of channels. The files contain events, but I have not defined trials yet. (as a side note, I tried merging with defined trials
 in both blocks, but the issue is the same)</div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
To do so, after I transformed my .set files into a fieldtrip structure, I tried using ft_appenddata.</div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Even though the files are separated, they should contain the same events, so I kept the option<span class="Apple-converted-space"> </span><i class="">cfg.keepsampleinfo = 'yes'</i>.</div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
In appearances, the obtained structure is what I expected (twice as much data as a single file). But when I try to visualize the raw data with ft_databrowser, I get the following error:</div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class="">Error using ft_fetch_data<o:p class=""></o:p></i></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class="">some of the requested samples occur twice in the data and have conflicting values<o:p class=""></o:p></i></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><o:p class=""> </o:p></i></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class="">Error in ft_databrowser>redraw_cb (line 1807)<o:p class=""></o:p></i></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class="">  dat = ft_fetch_data(opt.orgdata, 'header', opt.hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', chanindx, 'allowoverlap', cfg.allowoverlap, 'skipcheckdata', true);<o:p class=""></o:p></i></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><o:p class=""> </o:p></i></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class="">Error in ft_databrowser (line 810)<o:p class=""></o:p></i></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class="">redraw_cb(h);<o:p class=""></o:p></i></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><o:p class=""> </o:p></i></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
From my understanding (<i class="">'the trials will be concatenated'</i>, from documentation), I expect ft_appenddata to merge the data as data1 followed by data2 as a big continuous data file. Is there a misunderstanding of how ft_appenddata actually works?
 Or is it a sign for a design issue of my experiment?</div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Thank you very much for your help.</div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Best regards,</div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Éva<o:p class=""></o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></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="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://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!6lL40jy3LPXM6ebwJoPRKwNXe8x0-9B5MXorSFIBF23I7oazUFZ1XuiaRSP5lI2xV7y8DFyXjr8iVytp-ARtO48Wgmu5EoPogJd-0Q$" style="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://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!6lL40jy3LPXM6ebwJoPRKwNXe8x0-9B5MXorSFIBF23I7oazUFZ1XuiaRSP5lI2xV7y8DFyXjr8iVytp-ARtO48Wgmu5EoPogJd-0Q$</a><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></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>