forked from neuRowsATL/ContinuousMIEstimation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
analysis_ISI1_ISI2.m~
42 lines (32 loc) · 1.36 KB
/
analysis_ISI1_ISI2.m~
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
36
37
38
39
40
41
classdef analysis_ISI1_ISI2 < MI_KSG_data_analysis
%Each of these objects sets the stage to calculate the mutual
%information between spike count and behavior and stores the results of
%the calculation.
% Detailed explanation goes here
properties
end
methods
function obj = make_ISI1_ISI2(objData,var1)
% var1 is a positive integer to indicate neuron number
obj = MI_KSG_data_analysis(objData, var1);
end
function [xGroups, yGroups] = setXYvars(obj)
% So I propose that we use this method to prep the
% count_behavior data for the MI core and go ahead and run MI
% core from here. Then we can use the output of MI core to fill
% in the MI, kvalue, and errors.
% First, get spike times from neuron
spikeTimes = objData.neurons{1,var1};
% Find ISIs from spike times
ISIs = diff(spikeTimes);
x = ISIs(1:end);
xGroups{1,1} = x;
% Next segment neuron 2 data into cycles
y = objData.dataByCycles(var2,verbose);
% Find total spike count in a cycle
y = sum(~isnan(y),2);
yGroups{1,1} = y;
obj.coeffs = 1;
end
end
end