[FieldTrip] HELP: import simple data from txt file - non supported format, no header

Hoang Truong Hoang.Truong at colorado.edu
Fri Nov 30 18:47:10 CET 2018


Thanks for your prompt help, Eugenio and Stephen !!!
I can view the data with Eugenio's code w MATLAB2018a. I'll continue to
work from there.

@Stephen: I build a small hardware piece that can capture multimodal
biosignal and integrate this into some wearable prototypes.

Sincerely,
Tony


On Fri, Nov 30, 2018 at 10:25 AM Eugenio Abela <abela.eugenio at gmail.com>
wrote:

> Hi Tony
>
> Here’s a pretty quick and dirty fix - have a careful look to make sure it
> does what you want. You need FieldTrip installed and in the path; it works
> on my MATLAB2016a. Others on the list might have better ideas, or spot
> obvious errors.
>
> Good luck
> eugenio
>
> % Import you data
> D = importdata('Pressure_3_6.txt',' ');
>
>
> % Fill in FieldTrip data structure (check out ft_datatype_raw)
> % I assume columns 4, 5 are EEG, 6,7 EMG.
> % Channels go in rows, time in columns.
> data = struct();
> data.label = {'EEG-1';'EEG-2';'EMG-1';'EMG-2'};
> data.fsample = 250;
> data.time  = {1:length(D)};
> data.trial = {D(:,4:7)’};
>
>
> % Check out how it looks
> cfg = [];
> cfg.viemode = 'vertical';
> ft_databrowser(cfg,data);
>
>
>
> On 29 Nov 2018, at 17:22, Hoang Truong <Hoang.Truong at colorado.edu> wrote:
>
> Dear community,
>
> This is Tony, from CS Department, University of Colorado Boulder. I am new
> to eeg analysis and fieldtrip. Currently I work on recording eeg and emg
> data using our own hardware with 2 eeg and 2 emg channels respectively.
> Since we use our custom hardware, the data are saved in a simple format of
> txt file with 7 columns (example data on Dropbox: link
> <https://www.dropbox.com/s/30yzafa7ukg8xhl/Pressure_3_6.txt?dl=0>): 3
> first columns are data from environment sensors, the next 4 are eeg and emg
> data (250Hz sampling rate, 42s recording)
> I would like to ask what will be a proper way for me to import this data
> into fieldtrip. I checked the faq about importing custom data but I do not
> understand how to make custom readheader, readdata and readevent function.
> Any help would be appreciated (suggestions, code examples, etc).
> Thank you so much.
>
> Sincerely,
> Tony
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20181130/d47a3fba/attachment-0002.html>


More information about the fieldtrip mailing list