<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 Sina,
<div class=""><br class="">
</div>
<div class="">the ‘.mat’ file format is used by matlab to store arbitrary variables that can be loaded into matlab with the ‘load’ function, indeed as you mentioned. However, this does not mean that any variable that you load into matlab can be processed by
 fieldtrip functions, or that by arbitrarily storing those variables into a fieldtrip cfg-structure will work. FieldTrip ‘expects’ data to be organized in constrained, and well-defined structures (i.e. variables with fields that contain (meta)data), it does
 not work out of the box on arbitrary data.</div>
<div class=""><br class="">
</div>
<div class="">I strongly suggest you to start at the beginning, and study the fieldtrip documentation in detail about how to get started, how data structures are defined, etc. (specifically I would throw in a google search for ‘how are fieldtrip data structures
 defined’), and extensively explore the ‘getting started’ section on the fieldtrip website, whichis located at
<a href="https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Ffieldtriptoolbox.org%2F&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Ca33e3070ce6a43c52a7908dc73dd2f15%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638512641007391884%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=b6kWbl9Z3jCKF%2BDVrU7zPxCL19DEcxJmiGXjvu7%2FPXY%3D&reserved=0" originalsrc="http://fieldtriptoolbox.org/" shash="FcmOcZHjrTL+lY970YWffa902EnnXduYfvXmtqd2IX/on9Jp/yXmdAO87AbJuyGurbQ0vgIgzXLNBFXnNTTLXwUKXLpGJ3NE6/tczgvmAX4USwtTgHcLyhOFeTOiny9IcuktllRMtbvO2VCMLcAWq7t4LR94qYbRPloSSVpEs5k=" class="">
fieldtriptoolbox.org</a></div>
<div class=""><br class="">
</div>
<div class="">Good luck with your endeavours,</div>
<div class=""><br class="">
</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On 8 May 2024, at 23:53, Sina Makhdoomi Kaviri 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 dir="ltr" class=""><font face="arial, sans-serif" class="">To whom it may concern,<br class="">
<br class="">
I want to preprocess .mat file which can be found in ( <a href="https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbnci-horizon-2020.eu%2Fdatabase%2Fdata-sets&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Ca33e3070ce6a43c52a7908dc73dd2f15%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638512641007548156%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=frNqh15yYtxTezH3EWvSETr1v3lMb2GsWG7DMryRso0%3D&reserved=0" originalsrc="http://bnci-horizon-2020.eu/database/data-sets" shash="A0kLX3r1NpP8VnhixzISKx4lZcyOuiYCTD1DdBhy0F9l9q3tcbYrnkCwVWFTNqZXBqobw1Gj8z639gP065V/IBohe8/SJ3Ee22XWJSGtCUvMUyy8suXmenjipPfRcVQsxbQ2xxEN7N1Hv8LL28FnZYoIJyNDX9Pls+ACCcXaezw=" originalsrc="http://bnci-horizon-2020.eu/database/data-sets" shash="e22aneK5iM5z1jNi/Yc7z5w19Y4hRVODe5FnDpb2RnoF5oTJweQ1IlM2HesXMBNSGB62hA1zqfLmcPD5Gq8U8xzbpEiZAiyx/k/rNg6MnQgg/ZIVqMXfXH3IxjdfXp2JgVmgYKWnuRxpCppcwLXZ/r/O9aM9UBPjc7s1yZqs+nE=" class="">
http://bnci-horizon-2020.eu/database/data-sets</a> (Accession Number 001-2020)). I can access to the files by regular load function in Matlab, but it has an error as follows in ft_preprocessing:</font>
<div class=""><font face="arial, sans-serif" class=""><br class="">
>> %% Data preprocessing<br class="">
dataset = 'D:/fieldtrip/dataset/RGdataset/G01.mat';<br class="">
dataset1 = load(dataset);<br class="">
data = dataset1.signal;<br class="">
header  = dataset1.header<br class="">
channel = header.channels_labels;<br class="">
cfg = [];<br class="">
cfg.dataset              = dataset;<br class="">
cfg.continuous           = 'yes';<br class="">
cfg.datafile             = data;<br class="">
cfg.headerfile           = header;<br class="">
cfg.channel              = channel;<br class="">
data_segmented           = ft_preprocessing(cfg);<br class="">
<br class="">
header =<br class="">
  struct with fields:<br class="">
               runs: []<br class="">
        device_type: 'gtec'<br class="">
       channels_eeg: [1×58 double]<br class="">
       channels_eog: [59 60 61 62 63 64]<br class="">
    channels_labels: {1×64 cell}<br class="">
        sample_rate: 256<br class="">
        event_codes: [503587 501794 534562 503588 501795 534563 768 769 10 11 12 13 14 15]<br class="">
        event_names: {1×14 cell}<br class="">
<br class="">
Dot indexing is not supported for variables of this type.<br class="">
<br class="">
Error in ft_read_header (line 2795)<br class="">
if numel(hdr.label) < hdr.nChans<br class="">
<br class="">
Error in ft_preprocessing (line 391)<br class="">
  hdr = ft_read_header(cfg.headerfile, headeropt{:});<br class="">
<br class="">
Please let me know how I can preprocess this dataset to source localization or reconstruction methods.<br class="">
<br class="">
Best regards,<br class="">
Sina</font><br class="">
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<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%7Ca33e3070ce6a43c52a7908dc73dd2f15%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638512641007548156%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=UZFy4hCGkxlE1FvyVBhkLeSuroItaMzAtbp4q9UpCck%3D&reserved=0" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="UTQ2F9JXediaiUGgydDo7IOmL3mCxCZwuLRWpSbDhfGwwAvN2mvDIOPi96FcNYGWXUUGJVG/Or4rMEEGCh9qUd/XPtH37i7if0sP2PGW0voAbCud80eHgQB3X20+AvTouHilFH+yk64MDDV+NVEuR9cMTRHfz0CRcL8TDj/NWL0=" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>