-
Notifications
You must be signed in to change notification settings - Fork 12
Tutorial: User Defined Variables
There are two methods for defining user-defined variables that will align to the session, including variable values at spike times.
Setting b_myvar will define a variable that aligns and epochs just like other fields (eg: root.cel_myvar will act like root.cel_ts). Only a single variable can be defined at a time, and no additional functionality is provided.
This is a custom defined class that allows the storage of any number of named variables to be stored. Variables are epoched and spike times aligned, just like root.myvar. Additionally, tuning curve functions are provided. Currently we provide: PolarPlot (analogous to head direction tuning curve), SpatialPlot(shows mean of the variable in each spatial bin), and SpeedPlot (shows mean of the variable for a given running speed). More tuning curves may be added over time.
For example, here we find the tuning of a given neuron in response to the movement direction of the animal
dy = [NaN; diff(root.b_y)]; dx = [NaN; diff(root.b_x)];
heading = atan2(dy, dx);
root.myvar2 = [];
root.myvar2 = root.myvar2.add('heading',heading,root.b_ts,root.b_ts,1);
%first is root timestamps, second is myvar timestamps, in case they are not sampled at the same rate
root.myvar2.get('heading')
root.myvar2.PolarMap('heading',root,'ifPlot',1)
root.myvar2.SpatialMap('heading',root,'ifPlot',1)
Copyright (c) 2016, Trustees of Boston University, All Rights Reserved