preparation_config.py 4.22 KB
Newer Older
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
##################################################################
# Data preparation configurations
import time
import os
import numpy as np

preparation_config = dict()

# The task for which we want to prepare the data. Possible choices that are implemented so far are:
# 'LR_task' (dataset: 'antisaccade'):
# 'Direction_task' (dataset: 'dots' or 'processing_speed'):
# 'Position_task' (dataset: 'dots'):
# 'Segmentation_task' (dataset: 'antisaccade', 'dots', or 'processing_speed'):
preparation_config['task'] = 'LR_task'
preparation_config['dataset'] = 'antisaccade'

# We provide two types of preprocessing on the dataset (minimal preprocessing and maximal preprocessing). Choices are
# 'max'
# 'min'
preparation_config['preprocessing'] = 'max'  # or min

# We provide also dataset where features are extracted
# (typically used for training with standard machine learning methods).
# The feature extraction that we have implemented is hilbert transformed data for phase and amplitude.
preparation_config['feature_extraction'] = True

# Maybe for later we can also include the bandpassed data on
# top of the feature extracted data (this is not implemented yet).
preparation_config['including_bandpass_data'] = False  # or True (for later)

##################################################################################
##################################################################################
##################################################################################
##################################################################################
# We prepare some helper variables to locate the correct datasets that we need and to use them.
36
preparation_config['preprocessing_path'] = 'synchronized_' + preparation_config['preprocessing']
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

preparation_config['LOAD_ANTISACCADE_PATH'] = '../data/measured/antisaccade_task_data/' + preparation_config['preprocessing_path'] + '/'
preparation_config['SAVE_ANTISACCADE_PATH'] = '../data/prepared/antisaccade_task_data/' + preparation_config['preprocessing_path'] + '/'
preparation_config['ANTISACCADE_FILE_PATTERN'] = '[go]ip_..._AS_EEG.mat'

preparation_config['LOAD_DOTS_PATH'] = '../data/measured/dots_data/' + preparation_config['preprocessing_path'] + '/'
preparation_config['SAVE_DOTS_PATH'] = '../data/prepared/dots_data/' + preparation_config['preprocessing_path'] + '/'
preparation_config['DOTS_FILE_PATTERN'] = '(ep|EP).._DOTS._EEG.mat'

preparation_config['LOAD_PROCESSING_SPEED_PATH'] = '../data/measured/processing_speed_data/' + preparation_config['preprocessing_path'] + '/'
preparation_config['SAVE_PROCESSING_SPEED_PATH'] = '../data/prepared/processing_speed_data/' + preparation_config['preprocessing_path'] + '/'
preparation_config['PROCESSING_SPEED_FILE_PATTERN'] = '..._WI2_EEG.mat'


####################################################################################
# Internal information about each dataset (antisaccade, dots, processing_speeed)

preparation_config['saccade_trigger'] = ['L_saccade', 'R_saccade']
preparation_config['fixation_trigger'] = ['L_fixation', 'R_fixation']
preparation_config['blink_trigger'] = ['L_blink', 'R_blink']

# Anti-saccade dataset
preparation_config['antisaccade'] = dict()
preparation_config['antisaccade']['cue_trigger'] = ['10', '11']
preparation_config['antisaccade']['matlab_struct'] = 'EEG'

#Dots dataset
preparation_config['dots'] = dict()
preparation_config['dots']['cue_trigger'] = list(map(str, range(1, 28))) + list(map(str, range(101, 128)))
preparation_config['dots']['end_cue_trigger'] =['41']
preparation_config['dots']['matlab_struct'] = 'sEEG'
preparation_config['dots']['tar_pos'] = np.array([
        [400, 300], [650, 500], [400, 100], [100, 450], [700, 450], [100, 500],
        [200, 350], [300, 400], [100, 150], [150, 500], [150, 100], [700, 100],
        [300, 200], [100, 100], [700, 500], [500, 400], [600, 250], [650, 100],
        [400, 300], [200, 250], [400, 500], [700, 150], [500, 200], [100, 300],
        [700, 300], [600, 350], [400, 300]
    ])

# Processing speed dataset
preparation_config['processing_speed'] = dict()
preparation_config['processing_speed']['matlab_struct'] = 'sEEG'

preparation_config['matlab_struct'] = preparation_config[preparation_config['dataset']]['matlab_struct']


#Maybe we should do logging here as well ...