-
Notifications
You must be signed in to change notification settings - Fork 0
/
Segment_old.m
62 lines (41 loc) · 1.26 KB
/
Segment_old.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
clear all
clc
close all
restoredefaultpath
addpath('C:\eeglab11_0_4_3b\')
addpath(genpath('D:\_INECO\Procesamiento\Toolbox\fieldtrip\'))
%%
file='Paciente9_TMaze.set'
path='D:\_INECO\Pacientes\Paciente9_AlfredoFarinelli\ConMarcas\TMAZE\'
outputf=[path file '_epochs']
eeglab
EEG = pop_loadset('filename', file ,'filepath', path);
EEG = eeg_checkset( EEG );
eeglab redraw
%%
target={'222','223','224','225','212','213','214','215'}
%%
epoca_min=; % En segundos
epoca_max=;
r_baseline='on';
baseline_min=-0.2; % En ms
baseline_max=0;
for i=[1:4 6 7]
EEG = pop_epoch( EEG, { target{i} }, [epoca_min epoca_max], 'xx', 'EDF file resampled epochs', 'epochinfo', 'yes');
[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 1,'setname','xx','gui','off');
EEG = eeg_checkset( EEG );
if strcmo(r_baseline,'on')
EEG = pop_rmbase( EEG, [baseline_min baseline_max]);
[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);
EEG = eeg_checkset( EEG );
end
eeglab redraw
epochs(i).data=EEG.data;
epochs(i).name=target{i};
epochs(i).struct=EEG;
[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 2,'retrieve',1,'study',0);
EEG = eeg_checkset( EEG );
eeglab redraw
end
%%
save(outputf,'epochs')