<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="DA" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">You can use
</span><span style="font-family:"Courier New"">ft_appenddata</span><span style="font-size:11.0pt"> to merge dataset with different channels; for example MEG data, EEG data, and extra channels:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">%% Append all data<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">cfg = [];<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">preprocessed_data = ft_appenddata(cfg, preprocessed_data_MEG, preprocessed_data_EEG, preprocessed_data_ExG);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US">If they all have the same sample info FieldTrip will know to append them as different channels on the same trial.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US">Best regards<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US">Mikkel<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">Fra:
</span></b><span style="font-size:12.0pt;color:black">fieldtrip <fieldtrip-bounces@science.ru.nl> på vegne af bagen hasi via fieldtrip <fieldtrip@science.ru.nl><br>
<b>Dato: </b>onsdag, 27. april 2022 kl. 11.08<br>
<b>Til: </b>fieldtrip@science.ru.nl <fieldtrip@science.ru.nl><br>
<b>Cc: </b>bagen hasi <hasibagenedu@gmail.com><br>
<b>Emne: </b>[FieldTrip] how to combining gradiometer/magnetometer sensors - neuromag(elekta) data<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:18.0pt">Does anyone know how to use fieldtrip to merge two separate files (mag, grad) back into one?<br>
I did grad and mag separately and saved them separately when I was doing ICA.<br>
But now I want to do source positioning, and I want to use all channels together for source positioning, how do I merge grad and mag back into one folder?<br>
<br>
Can I just merge the Matlab structure of grad and mag files? Will some information be lost this way?<br>
<br>
This is my previous code<br>
<br>
%% magnetometers ICA<br>
cfg=[]; cfg.channel={'MEG*1'};<br>
data_orig=ft_selectdata(cfg,data);<br>
save(['sub2019' subjectID{x} '_origmag.mat'],'data_orig', '-v7.3');<br>
<br>
%% planar gradiometers ICA<br>
cfg=[]; cfg.channel={'MEG*2','MEG*3'};<br>
data_orig=ft_selectdata(cfg,data);<br>
save(['sub2019' subjectID{x} '_origgrad.mat'],'data_orig', '-v7.3');<br>
<br>
I searched a previous question, but I didn't find in it exactly how to do this, and I also searched the fieldtrip GitHub site, but I didn't find the relevant statements either.<br>
<br>
</span><span style="font-size:11.0pt"><a href="https://mailman.science.ru.nl/pipermail/fieldtrip/2017-May/037417.html" target="_blank"><span style="font-size:18.0pt">https://mailman.science.ru.nl/pipermail/fieldtrip/2017-May/037417.html</span></a></span><span style="font-size:18.0pt"><br>
<br>
I was wondering if you could help me with this?<br>
<br>
Thank you for your time and I look forward to hearing from you soon!<br>
<br>
Best regards,<br>
Hasi Bagen</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
</div>
</body>
</html>