You can use this tool to see each of your epoch being summed as they occured and to monitor what your data was like when you were collecting it. First, you have to get your data ready
for Moment.
To get started you only need a computer and a dataset you have already collected (ERN, FN, N2PC, N400 etc) using pycorder. First, you need to prepare your data.
Use these instructions to prepare your data before you bring it into Moment.
Note:This needs to be done only once for each raw data.
You are basically converting the raw eeg and marker files into a CSV format so that moment can read and stream them.
So the best thing to do is to check to see if CSVs exist in the directory of the raw data, if the answer is yes then skip to
streaming.
You will need:
%------------------------------------------------------------%
%-- GetRawData_8_6_2018_na.m version 1.1 %
%------------------------------------------------------------%
% This matlab program will open a participant's data (Brainvision format)%
% 1) Down sample the data to 500 Hz, %
% 2) Save the data in a XXX_eeg.csv so that it can streamed in moment %
% 3) Save the markers in time stamped array into another XXX_mrk.CVS %
% This can be used to mimic "online" data collection in moment. %
%------------------------------------------------------------------------%
%
%
% !! THE VERSION OF THIS SCRIPT IS FOR SINGLE SUBJECTS
% !! YOU WILL LOAD IN THE FILES MANUALLY
%
% Input: EEG dataset in the form of .vhdr, .vmrk, .eeg files
%
% Output: EEG dataset in the form of .csv
% Event dataset in the form of .csv
%
% Last Modified by: Nader and Ollie [13 June 2018]
clearvars;
close all;
SDIR = uigetdir('C:\'); % Set the location for saving the data
EEG = pop_loadbv(); % Load data
EEG = pop_resample(EEG, 500); % reample the data
% Ask which task and which time so you can name the file properly
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%get the task
%% Usingthe dialog box in preogress
study_list = {'doors','flanker','N2pc','iaps','interp_ocd','interp_ptsd'};
[indx,tf] = listdlg('ListString',study_list);
task = '';
switch indx
case 1
task = 'doors';
case 2
task = 'flanker';
case 3
task = 'N2pc';
case 4
task = 'iaps';
case 5
task = 'interp_ocd';
case 6
task = 'interp_ptsd';
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% get the time
time_list = {'pre','post'};
[indx2,tf2] = listdlg('ListString',time_list);
visit = '';
switch indx2
case 1
visit = 'pre'
case 2
visit = 'post'
end
suffix = [task visit]; % create a concatatione of task and time
%% recode markers if this is iaps
tic
if (indx == 4)
EEG = lpp_fix_markers2(EEG, 1);
end
% Using regex
pattern = '\d*'; % Fits TRAIN SIDs
SUB = regexp(EEG.comments, pattern, 'match');
if isempty(SUB)
error('Unknown SID.');
end
disp(['SID is: ' SUB])
% Create raw eeg, append time to it
disp('Creating raw_eeg...');
raw_eeg = double(EEG.data');
disp('Writing EEG data to file...');
csvwrite(sprintf('%s%s%s%s%s%s%s_eeg.csv',SDIR,'\',SUB{1},'\',SUB{1},'_',suffix) , raw_eeg)
% Create a new cell array for markers
disp('Creating marker cell array...');
mycell = cell(2, length(EEG.event));
for j = 1:length(mycell)
if EEG.event(j).type(1:1) ~= 'X'
mycell(1, j) = num2cell(EEG.event(j).latency);
mycell(2, j) = {EEG.event(j).type};
end % of was not an X marker
end % of for loop for markers
%% mycell = mycell(~cellfun('isempty',mycell)); %% get rid of empyt cells of the array
mycell = transpose (reshape(mycell(~cellfun(@isempty,mycell)),2,[])' );
disp('Saving marker cell array...');
cell2csv(sprintf('%s%s%s%s%s%s%s_mrk.csv',SDIR,'\',SUB{1},'\',SUB{1},'_',suffix), mycell);
disp(['Done! It took ' num2str(toc) ' seconds to complete.']);