%% Data preprocessing Example % June 14, 2017 % % Import and standardize data for a single patient %% PARAMETERS % 1. data_dir: Directory containing folders (labeled as patient initials) % 2. rhopls_dir: RHOPLS toolbox directory % 3. patient: Patient initials, also name of folder containing patient % data. Inside this directory are three files: % '_TFR_ao_LowFreq.m', '_TFR_ao.mat', % and '_trial_labels.mat' data_dir = ''; rhopls_dir = ''; patient = 'patient initials'; %% Set up required paths % Install RHOPLS package cd(rhopls_dir); addpath(pwd); savepath; % Install required toolboxes rhopls_setup(); % Check contents of patient directory patient_dir = fullfile(data_dir, patient); %% Load and process ECoG data % Import design matrix for patient k % Create the data matrix that we use for patient k % Description of data loaded: This is a 3-dimensional tensor % Dimensions: (trials X label) - Fred's data std_method = 'flatten_trials'; center = true; scaled = true; rm_outliers = true; overwrite = true; verbose = true; [X, trial_labels, metadata] = load_patient_data(patient_dir, ... 'standardizationMethod', std_method, ... 'center', center, ... 'scaled', scaled, ... 'removeOutliers', rm_outliers, ... 'overwrite', overwrite, ... 'verbose', verbose);