<div dir="ltr"><div dir="ltr"><div>Hi Jan Mathijs,</div><div>Thank you for the reply and suggestions. It worked out :). Integration has been smooth so far but there are still two problems that I am facing.</div><div>1. I want to align (linear registration) EEG positions in the ds.eeg structure (taken from the CNT file) and MEG positions in the ds.res4.senres.pos structure. Is there a routine to do so?</div><div>2. Original.ds data (MEG only): when read into BESA, it ‘knows’ the CTF MEG channels are magnetometers. But, after combining with EEG using the FieldTrip's CTF toolbox, when read into BESA, BESA is showing there are magnetometer and also gradiometer-type channels. Also, the MEG sensor location information is lost. I suspect that the gradiometer type is coming in through writeCTFds or readCTFds functions. Potentially, due to differences in how FieldTrip and BESA interpret the CTF .ds data coming from the CTF.</div><div><div>Could anyone please guide me? Potentially, some of you have experienced this as well.<br>Thank you in advance for the help<br><div>Best regards,</div><div><span>Eshwar</span></div></div></div><div><span><br></span></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 13, 2023 at 7:15 PM Schoffelen, J.M. (Jan Mathijs) via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Eshwar,<br>
<br>
I don’t know. I’ve never had the need (luckily I guess) to try this myself.<br>
<br>
Are you sure that the issue is specific to adding ‘EEG’ channels to the *.ds, or might it (i.e. the new data all being 0) be independent of what you try to write into the file.<br>
<br>
I would check getCTFdata starting from line 321, which is a complicated section that combines with all types of ‘gain’ from the res4 header information, into a single number that is used as the ‘final gain’. Working your way backwards I guess that you’d need to at least adjust the same fields in the senres struct-array, in order to get anywhere close to success.<br>
<br>
Best wishes and good luck,<br>
<br>
Jan-Mathijs<br>
<br>
<br>
<br>
> On 13 Sep 2023, at 12:27, Eshwar Ghumare via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a>> wrote:<br>
> <br>
> Hi,<br>
> I am trying to combine simultaneously acquired MEG data in CTF .ds format and EEG data in ANT eeprobe 64-bit extended (.cnt) format in single .ds file.  I am using the CTF toolbox under Field Trip to read and write the CTF file. The triggers sent help me align the data, including resampling. <br>
> <br>
> I modified ds.res4.chanNames, ds.res4.senres and data to add the required EEG channels from the CNT file. But I think I am unsure about qgain, gain. By setting the qgain, gain, equal to 1 for the EEG channels and using unit 'T' ( that is, EEG data copied to CNT was converted to volts) for reading and writing the file, I can write the file successfully, but when I read the saved file again, my EEG data copied from CNT is changed to 0 for all channels.<br>
> <br>
> Could anyone please guide me on the correct way to do so?<br>
> Thank you in advance for the help<br>
> Best regards,<br>
> Eshwar<br>
> _______________________________________________<br>
> fieldtrip mailing list<br>
> <a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
> <a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!4UNSJm9fNVIOhn3XcpQuwD1jaRea_VDj4ZplBcZfG1VI4CFgGRrGcUgeO70DFfcVyhrggZG78PeyInbIbMJNoVVLjwvqDOP_kce6oA$" rel="noreferrer" target="_blank">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!4UNSJm9fNVIOhn3XcpQuwD1jaRea_VDj4ZplBcZfG1VI4CFgGRrGcUgeO70DFfcVyhrggZG78PeyInbIbMJNoVVLjwvqDOP_kce6oA$</a> <br>
<br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div></div>