Beauchamp:TensorECOG: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
Line 19: Line 19:
# MATLAB Tensor Toolbox Version 2.6
# MATLAB Tensor Toolbox Version 2.6


Before using this package, a user should  
Before using this package, a user should configure




Install the package with the commands
<code>
    % Install RHOPLS package
    cd(rhopls_dir);
    addpath(pwd);
    savepath;
    % Install required toolboxes
    rhopls_setup();
</code>


==Processing ECoG Data for Analysis==
==Processing ECoG Data for Analysis==

Revision as of 11:14, 21 June 2017

Template:PAGE UNDER CONSTRUCTION

Regularized Higher-Order Partial Least Squares Analysis for ECoG Data

By Frederick Campbell and Kelly Geyer, June 2017

Introduction

This page contains documentation of our MATLAB package for the tensor factorization algorithm Regularized Higher-Order Partial Least Squares (RHOPLS). This algorithm is specifically designed for electrocorticography (ECoG) data, with dimensions consisting of electrodes, epoch time, and frequency.

Current capabilities:

  1. Data pre-processing: multiple methods for scaling data and removing outlier trails

Upcoming capabilities:

  1. RHOPLS algorithm implementation
  2. Visualization of final factorization results, along with capabilities to view data during processing. Potential functionality for SUMA visualization

Requirements

Required Software:

  1. R
  2. MATLAB Tensor Toolbox Version 2.6

Before using this package, a user should configure


Install the package with the commands

   % Install RHOPLS package
   cd(rhopls_dir);
   addpath(pwd);
   savepath;
   % Install required toolboxes
   rhopls_setup();

Processing ECoG Data for Analysis

%% 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: % '<patient_initials>_TFR_ao_LowFreq.m', '<patient_initials>_TFR_ao.mat', % and '<patient_initials>_trial_labels.mat' data_dir = '/Users/beauchamplab/Documents/kg_stuff/for_kelly'; rhopls_dir = '/Users/beauchamplab/Documents/kg_stuff/for_kelly/open-source-rhopls/rhopls_code'; patient = 'YAK';


%% 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);

ECoG RHOPLS

parameter tuning, fit model

Results

do analysis here, show plots

References

  1. Frederick Campbell, "Interpretable Brain Decoding for Electrocorticography Data though Regularized High Order Partial Least Squares." In progress.
  2. Brett W. Bader, Tamara G. Kolda and others. MATLAB Tensor Toolbox Version 2.6, Available online, February 2015. URL: http://www.sandia.gov/~tgkolda/TensorToolbox/.