[FieldTrip] problem in importing my data in fieldtrip
Zlatomira Ilchovska
ZXI820 at student.bham.ac.uk
Mon Jun 20 13:35:29 CEST 2022
Dear Moumita,
Maybe try saying:
cd ('F:\data_fldtrp');
data = '1_MD_1_edtd.set';
I use the adding to path for making sure my toolboxes' folders are added, so maybe the 'change directory' command is better in your case? I usually add my file, assigning it to a variable, then I add my cfg "options" separately as subfields of this configuration structure, like so "cfg.time, cfg.trials, etc.". And when I want to do something to the file, I just do, for example:
ft_redefinetrial (data, cfg)
Best,
Zlati
PhD Researcher
School of Psychology
University of Birmingham
Please note that I am currently working more flexibly, which may result in sending and responding to emails out of hours, but there is no expectation on you to do the same.
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of fieldtrip at science.ru.nl <fieldtrip at science.ru.nl>
Sent: Monday, June 20, 2022 11:54:12 AM
To: Eva Masson
Cc: Moumita bhowmick; FieldTrip discussion list
Subject: Re: [FieldTrip] problem in importing my data in fieldtrip
Hello Eva,
Thanks for your reply. I mistakenly typed differently for the email. Let me write it again.
I am trying to import continuous data into the fieldtrip for ft_preprocessing. Since I need to do ft_definetrial first for which I need to know the eventtype and eventvalues first, I tried calling ft_definetrial with cfg.dataset.
1) I gave the following command:
cfg = [];
cfg.dataset = '1_MD_1_edtd.set';
cfg.trialdef.eventtype = '?';
ft_definetrial(cfg);
But I am getting the following error:
Error using ft_trialfun_show (line 56)
file or directory '1_MD_1_edtd.set' does not exist
Error in ft_definetrial (line 199)
[trl, event] = feval(cfg.trialfun, cfg);
2) I then tried specifying the filepath with the following command:
cfg = [];
cfg.dataset = 'F:\data_fldtrp\1_MD_1_edtd.set';
cfg.trialdef.eventtype = '?';
ft_definetrial(cfg);
But I am still getting the same error.
3) I then tried the following (without specifying the extension .set):
cfg = [];
cfg.dataset = '1_MD_1_edtd';
cfg.trialdef.eventtype = '?';
ft_definetrial(cfg);
In return I am getting the following:
Warning: file or directory "1_MD_1_edtd" does not exist, could not determine file format
Warning: unsupported event format "unknown"
no events were found in the data
no trials have been defined yet, see FT_DEFINETRIAL for further help
found 0 events
the call to "ft_definetrial" took 0 seconds
4) I tried following your suggestion. Did you mean the following?
cfg = [];
addpath('F:\data_fldtrp');
cfg.dataset = '1_MD_1_edtd.set';
cfg.trialdef.eventtype = '?';
ft_definetrial(cfg);
For which I got the following error:
Error using ft_trialfun_show (line 56)
file or directory '1_MD_1_edtd.set' does not exist
Error in ft_definetrial (line 199)
[trl, event] = feval(cfg.trialfun, cfg);
5) I then tried the following:
addpath('F:\data_fldtrp');
cfg = [];
cfg.dataset = '1_MD_1_edtd.set';
cfg.trialdef.eventtype = '?';
ft_definetrial(cfg);
I am getting the same error.
How to write cfg.dataset = 'F:\data_fldtrp\1_MD_1_epochs.set'; so that fieldtrip can find the file? Why does it keep on saying 'the file does not exist'?
On Mon, Jun 20, 2022 at 4:05 PM Eva Masson <eva.masson at hotmail.fr<mailto:eva.masson at hotmail.fr>> wrote:
Hi Moumita,
Maybe try to add the path before, adding a line like :
addpath(‘F:\data_fldtrp’)
Then you should be able to call your dataset with the first set of commands your wrote.
I hope this helps.
Alternatively, the second option you mentionned should also work, but the file you are calling is not the same in the two examples.
Best,
Éva
De : Moumita bhowmick via fieldtrip<mailto:fieldtrip at science.ru.nl>
Envoyé le :lundi 20 juin 2022 12:20
À : fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>
Cc : Moumita bhowmick<mailto:bhowmickmoumita1 at gmail.com>
Objet :[FieldTrip] problem in importing my data in fieldtrip
Hello,
I am a novice in fieldtrip. Trying to learn it for my EEG analysis, on my own. I don't have any local group with whom I can discuss the problems I am facing here. I am trying to import continuous data into the fieldtrip for ft_preprocessing. Since I need to do ft_definetrial first for which I need to know the eventtype and eventvalues first, I tried calling ft_definetrial with cfg.dataset.
I gave the following command:
cfg = [];
cfg.dataset = '1_MD_1_edtd.set';
cfg.trialdef.eventtype = '?';
ft_definetrial(cfg);
But I am getting the following error:
Error using ft_trialfun_show (line 56)
file or directory '1_MD_1_edtd.set' does not exist
Error in ft_definetrial (line 199)
[trl, event] = feval(cfg.trialfun, cfg);
I then tried specifying the filepath with the following command:
cfg = [];
cfg.dataset = 'F:\data_fldtrp\1_MD_1_epochs.set';
cfg.trialdef.eventtype = '?';
ft_definetrial(cfg);
But I am still getting the same error. How to write cfg.dataset = 'F:\data_fldtrp\1_MD_1_epochs.set'; so that fieldtrip can find the file?
Will be highly obliged if you can help me understand how to import data into fieldtrip.
Thanking you,
Moumita
--
Moumita Bhowmick
PhD student
School of Cognitive Science,
Jadavpur University
--
Moumita Bhowmick
PhD student
School of Cognitive Science,
Jadavpur University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220620/c50a67d3/attachment.htm>
More information about the fieldtrip
mailing list