<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
Hi Ruvindu,
<div><br>
</div>
<div>Your pasted code in principle looks fine. Since you don’t mention what is not working for you, I cannot provide any pointers apart from that you need to check whether the dimensions of the trial matrices are as expected (i.e. the number of rows equal to
 the number of elements in the label-field, and the number of columns the same as the number of elements in the corresponding time-vector.</div>
<div><br>
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>
<blockquote type="cite">
<div>On 27 May 2024, at 12:30, Ruvindu Kaluarachchi via fieldtrip <fieldtrip@science.ru.nl> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; text-align: left; margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
Dear FieldTrip Community,</div>
<div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; text-align: left; margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
My name is Ruvindu, and I am working on converting a simultaneous EEG and NIRS dataset into FieldTrip format. It is currently in the BBCI format as I wish to use a TRENTOOL for analysis as well as I wish to analyse NIRS data in the future I am exploring this
 option and convert it to FT format.</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; text-align: left; margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
The dataset is of the following structure,</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; text-align: left; margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
<b>EEG Data:</b></div>
<ul style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; text-align: left;">
<li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;"><b>cnt:</b> 1x6 cells, continuous EEG data</span></li><ul>
<li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">cnt{1,1}, cnt{1,3}, cnt{1,5}: Motor imagery data</span></li><li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">cnt{1,2}, cnt{1,4}, cnt{1,6}: Mental arithmetic data</span></li></ul>
<li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;"><b>mrk:</b> 1x6 cells, task onset markers</span></li><ul>
<li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">mrk{1,1}, mrk{1,3}, mrk{1,5}: Motor imagery markers (16 = left hand imagery, 32 = right hand imagery)</span></li><li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">mrk{1,2}, mrk{1,4}, mrk{1,6}: Mental arithmetic markers (16 = mental arithmetic, 32 = baseline)</span></li></ul>
<li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;"><b>mnt:</b> Montage for cnt</span></li></ul>
<div style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; text-align: left; margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
Standard BBCI data structure format can be found<span class="Apple-converted-space"> </span><a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbbci%2Fbbci_public%2Fblob%2Fmaster%2Fdoc%2FToolboxData.markdown&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C7411883f79da44ac239b08dc8af95373%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638538050650024498%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=%2BkesqF0RG%2BtJnMk7%2BiWYIqJY7%2F0Kv%2F11bS78M0oldm8%3D&reserved=0" originalsrc="https://github.com/bbci/bbci_public/blob/master/doc/ToolboxData.markdown" shash="phdC/IcY5WF/BTBMMSPGBEgekK7aiVnUtlVL2/FWxYfN5MwAtsXmJHAKgqhVIaT1/5j155C67ubmVX37IUEkuBAfAunIBtn4LE745I4ctCnxlYOcUFLKyq69l5SshakjO8FKtrQ+6BAxiPQ2ALkUZDF7EMJw0Me7EaFE0dlLU5k=" originalsrc="https://github.com/bbci/bbci_public/blob/master/doc/ToolboxData.markdown" shash="fy/BLfGUim6cwHeSIsjQdpTe5VgwNfcXUoXHRVsloSg/YqC0z1EHPWicQ7WX5tMnkxu7wZ52EwKGQaB8Pht2rS6PkNUtDqAyPWmkdDZrmH3nNdih0KYPn+Bmf1yCER5WOsL/3rkQ3tgq2sKnDiM8xtrsA5u58zJHdebp9dgmXZE=" target="_blank" id="OWAeb150089-3945-55b1-1628-9a896ca92628" class="OWAAutoLink" title="https://github.com/bbci/bbci_public/blob/master/doc/ToolboxData.markdown" rel="noopener noreferrer" data-auth="NotApplicable" data-linkindex="0" data-loopstyle="linkonly" style="margin: 0px;">here</a>.
 My attempt can be found<span class="Apple-converted-space"> </span><a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpastebin.com%2FXd5Q3rMy&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C7411883f79da44ac239b08dc8af95373%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638538050650024498%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=NRKJ6oyPDOQgGyVdk8SAmhHlCFwmg%2BqzmxGIiGsHXUs%3D&reserved=0" originalsrc="https://pastebin.com/Xd5Q3rMy" shash="v5UpXNTzoJTgKc7lSLm1lUuIYsGJuCUJvxM0QXl7QvmIerZYo8oMzza11p5jBdQcjcoa9pQqBkgsIH1frfWW6CSEISQIgra/kjenShG2H3JR4HGDoQ1b+6XFKcSaB2+uGyIpI8hFG7/b2O9iJhc8o7sTQShvkyniPKhv6hsvtUU=" originalsrc="https://pastebin.com/Xd5Q3rMy" shash="okiRrpFwD4O7mCrT8tKSkQu97+1BH5gppS7EAWXCT3zjmhe0kEWttLdPLt714PWQoSPSB7NcCoryouNaqJ7eR+BQUNb9t086R24lQfN3L1j4/agg3gTUofARB/ofDdI+fmmjkd4wtG2w07mEeRdRA/rpZG3N4Lza2a/BtoCg71A=" target="_blank" id="OWAb40943d4-657a-a7bd-44e8-67f0a48f3bb5" class="OWAAutoLink" title="https://pastebin.com/Xd5Q3rMy" rel="noopener noreferrer" data-auth="NotApplicable" data-linkindex="1" data-loopstyle="linkonly" style="margin: 0px;">here</a>,
 which does not work.</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; text-align: left; margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
I would greatly appreciate any guidance, examples, or scripts that could assist with this conversion.</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; text-align: left; margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
Thank you for your support!</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; text-align: left; margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
Best regards,</div>
<div class="elementToProof" style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; text-align: left; margin: 1em 0px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
Ruvindu</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; 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;">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; 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;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; 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;">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: 400; 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;">
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C7411883f79da44ac239b08dc8af95373%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638538050650180783%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=p%2Bjj7d6HM7Smskk9i7W19TlGMq58uqH4KRvhFpj2CME%3D&reserved=0" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="wJLhlEXLPt7Ewf9BqaxA2PTeAzgF4SWZroV8AZeCWZvL0BJojV6hY7jaUF/FxNk4/oA6OkPLGREn+Xk1WBrG2HiRmVB4aN6Sc6Dembzix4NjlJLYraYSLRRbEl5eUvQtiiigAMNdy1pcVd+fOF2kjLViDysEqEiKAm7quVxX8n8=" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">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: 400; 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;">
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C7411883f79da44ac239b08dc8af95373%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638538050650180783%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=FZwza8RLED10WIrHhThMus6fVKum3Yuec72qd01SU3o%3D&reserved=0" originalsrc="https://doi.org/10.1371/journal.pcbi.1002202" shash="LhxYZOxJcmP2z9NQXY1lpH2LHATl7qjOwjpS4kJMSdM/dH3ruOmTZMjCsX7BumdJEF8ui/mAHlQ6/3nqiVPY5wUsbbXmxhayfbMZf0mcgcCPOIVxC79ITUDdCBqAQJ7WcsRJpi2q9k1dlhpUStJ7IiK70cqPYtdi6m0JLqhcjIc=" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">https://doi.org/10.1371/journal.pcbi.1002202</a></div>
</blockquote>
</div>
<br>
</div>
</body>
</html>