To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit da9d210c authored by Ard Kastrati's avatar Ard Kastrati
Browse files

Made the preparator module easier to use

parent 8846aded
......@@ -11,46 +11,54 @@ preparation_config = dict()
# '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'
preparation_config['task'] = 'Position_task'
preparation_config['dataset'] = 'dots'
# We provide two types of preprocessing on the dataset (minimal preprocessing and maximal preprocessing). Choices are
# 'max'
# 'min'
preparation_config['preprocessing'] = 'max' # or min
preparation_config['preprocessing_path'] = 'synchronized_' + preparation_config['preprocessing']
# 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
preparation_config['feature_extraction'] = False
# 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.
preparation_config['preprocessing_path'] = 'synchronized_' + preparation_config['preprocessing']
#The directory of output file and the name
preparation_config['SAVE_PATH'] = '../data/prepared/'
preparation_config['output_name'] = preparation_config['task'] + '_with_' + preparation_config['dataset']
preparation_config['output_name'] = preparation_config['output_name'] + '_' + preparation_config['preprocessing_path']
preparation_config['output_name'] = preparation_config['output_name'] + ('_hilbert.npz' if preparation_config['feature_extraction'] else '.npz')
##################################################################################
# We prepare some helper variables to locate the correct datasets and the files that we need and to use them.
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['ANTISACCADE_HILBERT_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['DOTS_HILBERT_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'
preparation_config['PROCESSING_SPEED_HILBERT_FILE_PATTERN'] = '..._WI2_EEG.mat'
####################################################################################
# Internal information about each dataset (antisaccade, dots, processing_speeed)
##################################################################################
##################################################################################
##################################################################################
##################################################################################
##################################################################################
##################################################################################
##################################################################################
# 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']
......@@ -77,7 +85,4 @@ preparation_config['dots']['tar_pos'] = np.array([
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 ...
\ No newline at end of file
......@@ -109,7 +109,7 @@ class Preparator:
all_EEG.append(trials)
all_labels.append(labels)
subj_counter += 1
subj_counter += 1
# save the concatenated arrays
print('Saving data...')
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment