[FieldTrip] Help with definetrial for EGI .mff file

Varghese Mathew 1881002 varghese.mathew at res.christuniversity.in
Sat Apr 22 06:42:06 CEST 2023


Thank you so much for the suggestion and code. I will try this out. I am
just getting used to understanding the codes and this will help.

Sincerely

On Wed, Apr 19, 2023 at 11:48 PM Julian Keil via fieldtrip <
fieldtrip at science.ru.nl> wrote:

> Hi Varghese,
>
> have you tried reading the .mff with EEGLab?
> A while ago I worked with some older EGI data and reading directly to
> FieldTrip didn’t work. Using EEGLab with the MFFMatlabIO extension did the
> trick, and then you can use eeglab2fieldtrip to move over to FieldTrip.
> Here’s a link to the code I used, although I did a lot of preprocessing in
> EEGLab: https://urldefense.com/v3/__https://osf.io/uh5rk__;!!HJOPV4FYYWzcc1jazlU!8CaXs2tEtqE9qa9v7Breg2ImNICRtmWJ0pKPov53Kn1-EX3FIbh28qCX9XuMChOKWA3NfLoC_qkM1xOvAo-wSqPTEfosDDhH9I44KBa_J9YQ$ 
> <https://urldefense.com/v3/__https://osf.io/uh5rk__;!!HJOPV4FYYWzcc1jazlU!9Yh_5cOpyEfLD2Lxtli-X9YZbZN7V7Wq4TC5vPr_4jkhBDUWiH-8EJaz356EB1tVQt72kuDBEiW8TpP1zIi7R5RY6w$>
>
> Good Luck,
>
> Julian
>
> Am 19.04.2023 um 16:27 schrieb Varghese Mathew 1881002 via fieldtrip <
> fieldtrip at science.ru.nl>:
>
> Hi
> I am doing analysis on Netstation EGI .mff file using Fieldtrip, I have
> tried using .mff file directly and after converting to EDF. However, I am
> getting error in defining trials. Mostly I get an error message  Unrecognized
> field name "headerfile"  .
> I would like to know how to go about this in EDF or .mff format.
> It will also be helpful if someone can help with how to modify
> ft_trialfun_general for .mff file as well.
> I am pasting the code I used, below.
> cfg=[]
> cfg.dataset = 'E:\FT\OP17.mff';
> cfg.dataformat = 'egi_mff_v3'
> cfg.headerformat = 'egi_mff_v3'
> cfg.trialdef.eventtype = 'stim';
> cfg.trialdef.prestim = 1;
> cfg.trialdef.poststim =1;
> cfg.trialdef.eventvalue = {'01''02''03''04'};
> cfg.trialfun = 'ft_trialfun_general_stimmod';
> cfg = ft_definetrial(cfg)
>
>
> For modifying trialfun_general
>
> function [trl, event] = ft_trialfun_general_stimmod(cfg)
> event = ft_read_event(cfg.dataset, 'headerformat', 'egi_mff_v3');
> % Find trigger values
> trigger = [event(strcmp('stim', {event.type})).value]';
> % Note: Replace 'STI101' with the label of the trigger channel that
> % contains the trigger values for your data
> % Define trial segments
> trl = [];
> for j = 1:length(trigger)
> if any(trigger(j) == [01 02 03 04])
> trlbegin = event(j).sample;
> trlend = trlbegin + 1000; % define trial length as 1 second
> offset = 0; % no offset
> newtrl = [trlbegin trlend offset trigger(j)];
> trl = [trl; newtrl];
> end
> end
> Please help with the issue, as I am trying to pick up analysis using
> Fieldtrip and I do not have a coding background.
> Looking forward for a response,
>
> Sincerely
> --
> Varghese Mathew
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8CaXs2tEtqE9qa9v7Breg2ImNICRtmWJ0pKPov53Kn1-EX3FIbh28qCX9XuMChOKWA3NfLoC_qkM1xOvAo-wSqPTEfosDDhH9I44KNN_tQeI$ 
> <https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!9Yh_5cOpyEfLD2Lxtli-X9YZbZN7V7Wq4TC5vPr_4jkhBDUWiH-8EJaz356EB1tVQt72kuDBEiW8TpP1zIjXO0okaA$>
>
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8CaXs2tEtqE9qa9v7Breg2ImNICRtmWJ0pKPov53Kn1-EX3FIbh28qCX9XuMChOKWA3NfLoC_qkM1xOvAo-wSqPTEfosDDhH9I44KNN_tQeI$ 
>


-- 
Varghese Mathew
Mobile No. 9535395896
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20230422/67c9a8b8/attachment.htm>


More information about the fieldtrip mailing list