plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | hsw28/data_analysis-master | eventcount.m | .m | data_analysis-master/others_analysis_code/mwl-fabian/fkEvents/eventcount.m | 940 | utf_8 | 5b0a51731b46cd3bf857484861e009f2 | function c = eventcount( events, x )
%EVENTCOUNT cumulative count of events
%
% fcn=EVENTCOUNT(events) returns a handle to a function that accepts a
% single arguments and returns the cumulative count of events up to the
% value of argument.
%
% c=EVENTCOUNT(events,x) returns the cumulative count of events up to x.... |
github | hsw28/data_analysis-master | create_linearize_fcn_track.m | .m | data_analysis-master/others_analysis_code/mwl-fabian/fkEnvironment/create_linearize_fcn_track.m | 10,095 | utf_8 | bd0916dfd72a0bc6f28e85be06947488 | function ctx = create_linearize_fcn_track( pp )
%CREATE_LINEARIZE_FCN_TRACK track linearization functions
%
% ctx=CREATE_LINEARIZE_FCN_TRACK(ctx) For a set of linearization
% contexts, this function will return a new linearization context
% that is a concatenation of the contexts provided ("track"). This
% structur... |
github | hsw28/data_analysis-master | create_env_struct.m | .m | data_analysis-master/others_analysis_code/mwl-fabian/fkEnvironment/create_env_struct.m | 4,178 | utf_8 | 0e048853936d12fd07465233d233eb7c | function env = create_env_struct( kind, posdata )
if ~ischar(kind) || ~ismember(kind,{'simple track','complex track', ...
'circular track', 'rectangular track', 'closed track', ...
'circular field', 'rectangular field', 'custom field'} )
error('create_env_struct:invalidArgument', 'Invalid environme... |
github | hsw28/data_analysis-master | create_linearize_fcn_circle.m | .m | data_analysis-master/others_analysis_code/mwl-fabian/fkEnvironment/create_linearize_fcn_circle.m | 5,500 | utf_8 | d27e4f619a45820c1b0a625f3a59b355 | function ctx = create_linearize_fcn_circle(center, radius)
%CREATE_LINEARIZE_FCN_CIRCLE circle linearization functions
%
% ctx=CREATE_LINEARIZE_FCN_CIRCLE(center,radius) For a circle
% described by a center and radius, this function will return a
% linearization context. This structure contains the following
% fiel... |
github | hsw28/data_analysis-master | create_linearize_fcn_spline.m | .m | data_analysis-master/others_analysis_code/mwl-fabian/fkEnvironment/create_linearize_fcn_spline.m | 7,627 | utf_8 | 23fab500038b2d1f54770854b823b760 | function ctx = create_linearize_fcn_spline(nodes, isclosed)
%CREATE_LINEARIZE_FCN_SPLINE spline linearization context
%
% ctx=CREATE_LINEARIZE_FCN_SPLINE(nodes) For a spline
% described by a set of nodes, this function will return a
% linearization context. This structure contains the following
% fields:
% length... |
github | hsw28/data_analysis-master | create_linearize_fcn_polyline.m | .m | data_analysis-master/others_analysis_code/mwl-fabian/fkEnvironment/create_linearize_fcn_polyline.m | 5,830 | utf_8 | 64cf87be10dc7163805374fa4fe99d81 | function ctx = create_linearize_fcn_polyline(nodes, isclosed)
%CREATE_LINEARIZE_FCN_POLYLINE polyline linearization context
%
% ctx=CREATE_LINEARIZE_FCN_POLYLINE(nodes) For a polyline
% described by a set of nodes, this function will return a
% linearization context. This structure contains the following
% fields:
... |
github | hsw28/data_analysis-master | contbouts.m | .m | data_analysis-master/others_analysis_code/mwl-td_cont_old/cont/contbouts.m | 11,110 | utf_8 | cd4b2567c250a63a6ef137f475b9a67c | function [bouts, th, minevpeak, minpeak] = contbouts(c, varargin)
% CONTBOUTS - find above-threshold periods of a signal in a contstruct
%
% [bouts, th] = contbouts(cont, [name/value pair args]
%
% Args:
% cont = cont structure (or any structure with a 'data' field and optionally a
% 'samplerate' field for args ... |
github | hsw28/data_analysis-master | contfilt.m | .m | data_analysis-master/others_analysis_code/mwl-td_cont_old/cont/contfilt.m | 4,912 | utf_8 | 867327e155f4978d8d3ba79a93568a51 | function [c filt] = contfilt(c,varargin)
% CONTFILT filter a contdata structure
a = struct(...
'filt',[],...
'filtopt', [],...
'newname',[],...
'newchanlabels',[],...
'autoresample', [],...
'cache', []);
a = parseArgsLite(varargin,a);
%%% filter, if requested
if ~xor... |
github | hsw28/data_analysis-master | getfilter.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/Utilities/getfilter.m | 6,988 | utf_8 | fdb563fb2eebe81ce481a040eb979d85 | function [b, s] = getfilter(Fs, band, method, varargin)
%GETFILTER return coefficients for eeg filter
%
% Syntax
%
% [b, s] = getfilter( Fs, band, method )
%
% Description
%
% This function returns the coefficients for a FIR filter. Band
% specifies the frequency band of interest and can be one of: 'theta'... |
github | hsw28/data_analysis-master | xcorr_win.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/HPC_RSC/xcorr_win.m | 1,537 | utf_8 | 3a081c5c9c4358dedb05b56bc8737e82 | function [c, lags] = xcorr_win(x, y, winIdx, maxLag, scaleOpt)
if nargin < 5
scaleOpt = 'none';
end
if ~all(size(x) == size(y))
error('Input vectors X and Y must be the same size');
end
if ~isvector(x) || ~isvector(y);
error('The inputs x and y must be vectors');
end
if ~isvector(winIdx) || ~ismonotonic(... |
github | hsw28/data_analysis-master | calc_inter_ripple_interval.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/HPC_RSC/calc_inter_ripple_interval.m | 1,410 | utf_8 | 26d4e548c361111cb1782d68b61eb0a9 |
function f = calc_inter_ripple_interval(HPC)
clearvars -except MU HPC
iriPk = [];
iriOn = [];
N = numel(HPC);
Fs = timestamp2fs(HPC(1).ts);
iri1 = [];
iri2 = [];
dur = [];
len = [];
for i = 1 : N
fprintf('%d ', i);
% mu = MultiUnit{i};
[ripIdx, ripWin] = detectRipples(HPC(i).ripple, HPC(i).rip... |
github | hsw28/data_analysis-master | plot_ripple_trig_lfp.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/Bilateral/plot_ripple_trig_lfp.m | 584 | utf_8 | 21fd2e95185f9f4175c4989df23fb02a |
function [p, l] = plot_ripple_trig_lfp(data, a)
if nargin == 1 || isempty(a) || ~ishandle(a)
figure();
a = axes();
end
[p(1), l(1)] = error_area_plot(data.ts, data.meanLfp{1}, data.semLfp{1}, 'Parent', a);
[p(2), l(2)] = error_area_plot(data.ts, data.meanLfp{2}, data.semLfp{2}, 'Parent', a);
set(p(1), 'Edg... |
github | hsw28/data_analysis-master | shuffle_counts.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/SandBox/shuffle_counts.m | 1,854 | utf_8 | f70deaa8385e0a92eb773557306ad31a | function counts = shuffle_counts(rep, shuf, varargin)
% SHUFFLE_COUNTS performs the counts on the structures returned by
% replay_line_detection.
%
% counts = shuffle_counts(replay_structure, shuffle_structure, 'epochs',
% {epochs}); performs the counts for the specified epochs
%
% counts = shuffle_counts( ... , 'p_v... |
github | hsw28/data_analysis-master | draw_dynamic_nodes.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/SandBox/draw_dynamic_nodes.m | 5,958 | utf_8 | e7d7a98b04219d21f26a61086d1962d4 | function [nodes, connect] = draw_dynamic_nodes(varargin)
a = axescheck(varargin{:});
if isempty(a)
hFig = figure;
figure(hFig);
a = axes;
else
hFig = get(a, 'Parent');
end
old_motionfcn = get(hFig,'WindowButtonMotionFcn'); %#ok
old_keypressfcn = get(hFig,'KeyPressFcn'); %#ok
old_downfcn = get( hFig, ... |
github | hsw28/data_analysis-master | plot_dset_recon_shuffle_dist_z.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/SandBox/plot_dset_recon_shuffle_dist_z.m | 1,319 | utf_8 | 43cbe6c0de8fed58e3617e28e9ff3d6c |
function f = plot_dset_recon_shuffle(scores, shuffleScores, name)
[scores, bestIdx] = max(scores,[],2);
nScore = numel(scores);
data = [];
bins = 0:.02:.65;
for i = 1:nScore
data(i,:) = histc(squeeze(shuffleScores(i,bestIdx(i), :)), bins);
end
data = smoothn(data, [0 1]);
data = normalize(data,2, 'area',1);
... |
github | hsw28/data_analysis-master | reconstruct.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/SandBox/reconstruct.m | 2,455 | utf_8 | 61dc547b7c6c35fc72a27631219d9772 | function [pdf, tbins, spike_counts] = reconstruct(ts, te, tc, cells, varargin)
args.t_var = 'time';
args.tau = .25;
args.percent_overlap = 0;
args.max_pdf_matrix_size = 50000;
args.max_pdf_comp_size = floor(args.max_pdf_matrix_size / size(tc,1));
args.smooth = 0;
args.kernel = [.9 .4 ... |
github | hsw28/data_analysis-master | compare_ave_firing_rates.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/SandBox/compare_ave_firing_rates.m | 3,151 | utf_8 | d5fac218f50908587043d57dfafcf48d | function data =compare_ave_firing_rates(exp, varargin)
args.epochs = exp.epochs;
args.plot_rates = 1;
args = parseArgs(varargin, args);
args.ind_ignore = [];
data = struct;
for ep = args.epochs
e = ep{:};
if ~isfield(exp.(e).clusters, 'mean_rate_run')
disp('Cluster stats not computed, computing... |
github | hsw28/data_analysis-master | simulateCancer.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/SandBox/simulateCancer.m | 1,754 | utf_8 | 4689a2ab34dccfee5962345f937d98b7 |
function simulateCancer(plateSize, pDivide)
plate = zeros(plateSize, plateSize);
nCells = 1;
cellLocations = zeros(plateSize*plateSize,2);
initX = randi(plateSize);
initY = randi(plateSize);
cellLocations(nCells,:) = [initX, initY];
plate(initX, initY) = 1;
f = figure;
a = axes();
im = imagesc(plate, 'Parent', a... |
github | hsw28/data_analysis-master | replay_line_detection.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/SandBox/replay_line_detection.m | 9,739 | utf_8 | 65d68a2d77c659b00ee5df98e81ce246 | function [rep_dat shuffle_data] = replay_line_detection(exp, varargin)
%REPLAY_LINE_DETECTION runs the line detection algorithm on an experiment
%
% replay_data = REPLAY_LINE_DETECTION(exp) runs the line detection
% algorithm on the entire expirment struct
%
% replay_data = REPLAY_LINE_DETCTION(..., 'epochs', {epoch_li... |
github | hsw28/data_analysis-master | waitbar_text.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/SandBox/waitbar_text.m | 1,239 | utf_8 | b96003dd4ed2628cbb60f7e5c8a170a1 | function s = waitbar_text(val, s)
try
if nargin==1
s = [];
end
if isempty(s)
s.range = [0 1];
s.value = 0;
s.width = 50;
s.min_dValue = range(s.range) / s.width;
s.iter_count = 0;
s.d_iter = 0;
s.first_draw = 1;
end
s.ite... |
github | hsw28/data_analysis-master | draw_dynamic_polygon.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/SandBox/draw_dynamic_polygon.m | 3,941 | utf_8 | 76aa649c7c44517bf734cb235c023587 | function nodes = draw_dynamic_polygon(varargin)
a = axescheck(varargin{:});
if isempty(a)
hFig = figure;
figure(hFig);
a = axes;
else
hFig = get(a, 'Parent');
end
old_motionfcn = get(hFig,'WindowButtonMotionFcn'); %#ok
old_keypressfcn = get(hFig,'KeyPressFcn'); %#ok
old_downfcn = get( hFig, 'WindowBu... |
github | hsw28/data_analysis-master | parse_contour_matrix.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/SandBox/parse_contour_matrix.m | 712 | utf_8 | 47093a7f1017f1a84188332bcc112a93 | function [cont] = parse_contour_matrix(c)
if nargin==0
error('Must provide a contour matrix');
elseif ~ismatrix(c)
error('Must provide a contour matrix');
end
nCont = 0;
while ~isempty( c )
nCont = nCont+1;
[cont(nCont), c] = get_next_contour(c);
end
nPts = arrayfun( @(x) size(x.x, 2), cont);
[~, i... |
github | hsw28/data_analysis-master | plot_dset_recon_shuffle_dist.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/SandBox/plot_dset_recon_shuffle_dist.m | 1,410 | utf_8 | 5e55224e0255568e8b3f781c3eb71a36 |
function f = plot_dset_recon_shuffle(scores, shuffleScores, name)
[scores, bestIdx] = max(scores,[],2);
nScore = numel(scores);
data = [];
bins = 0:.02:.65;
for i = 1:nScore
data(i,:) = histc(squeeze(shuffleScores(i,bestIdx(i), :)), bins);
end
data = smoothn(data, [0 1]);
data = normalize(data,2, 'area',1);
... |
github | hsw28/data_analysis-master | calc_cluster_stats.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/SandBox/calc_cluster_stats.m | 798 | utf_8 | 5da1ee387174a3931e7bf52dd380ce76 | function clust = calc_cluster_stats(exp, epoch)
clust = exp.(epoch).clusters;
pos = exp.(epoch).position;
for i=1:numel(clust)
[clust(i).mean_rate_run, clust(i).mean_rate_stop] = ...
calc_mean_fr(clust(i), pos);
end
end
function [run_rate stop_rate] = calc_mean_fr(cluster, p... |
github | hsw28/data_analysis-master | linearize_complex_track_old.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/PositionProcessing/linearize_complex_track_old.m | 2,185 | utf_8 | 9860ab98fe2448e8e7345f36950c8bcf | function [lin_pos nodes] = linearize_complex_track(xpos, ypos)
% LINEARIZE_CUSTOM_TRACK(xpos,ypos)
%
% A simple gui to subdivide a complex multi-trajectory track into a linear
% environment.
% linear_position is returned which ranges from 0 to x meters with x being
% the user specified length
%
% Order of Operations
% ... |
github | hsw28/data_analysis-master | track_selection.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/PositionProcessing/track_selection.m | 6,523 | utf_8 | 21a84c1b93212549007ab6ca4d3fb35b | function [selection,value] = track_selection(fig, headpos, varargin)
% TRACK_SELECTION(figure, position_struct, 'ListString', str)
% based upon listdlg.m but changed to handle the displaying of a track
% simultaneously.
%
% figure must be a figure handle
% position_struct must be a struct with a headpos... |
github | hsw28/data_analysis-master | linearize_complex_track.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/PositionProcessing/linearize_complex_track.m | 3,359 | utf_8 | 15c05d200ab63b37dc2f4f44205aa32c | function [lin_pos nodes] = linearize_complex_track(xpos, ypos)
% LINEARIZE_CUSTOM_TRACK(xpos,ypos)
%
% A simple gui to subdivide a complex multi-trajectory track into a linear
% environment.
% linear_position is returned which ranges from 0 to x meters with x being
% the user specified length
%
% Order of Operations
% ... |
github | hsw28/data_analysis-master | load_wave_parameters.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/AmplitudeDecoding/load_wave_parameters.m | 4,121 | utf_8 | 48d6526bf268d13bf53283b0843e1ac5 | function [spikes tt_id widths] = load_wave_parameters(session_dir, varargin)
% creates a tetrode map using position data and spike amplitude
% MAKE_TETRODE_MAP(session_dir, varargin)
% arg pairs:
% - data_type: (old/new)
% - pos: position vector (1d)
% - epoch: epoch to load from
args.epoch = 'invalid_epoch_name... |
github | hsw28/data_analysis-master | load_spike_parameters.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/AmplitudeDecoding/load_spike_parameters.m | 1,920 | utf_8 | 11eff9d48e0bac232c17a4849e4dd569 | function [out, width, waveforms] = load_spike_parameters(file, varargin)
args.idx = [];
args.time_range = [];
args.anti_idx = 0;
args = parseArgsLite(varargin,args);
out = ones(0,6);
width = [];
fields = {'waveform', 'timestamp'};
d = dir(file);
if d.bytes < 10000
return;
end
mwlf = mwlopen(file);
if ~isem... |
github | hsw28/data_analysis-master | load_tt_peak_times.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/AmplitudeDecoding/load_tt_peak_times.m | 4,119 | utf_8 | deee26527c03d95cdd9c24f871fa4ab8 | function [spikes tt_id widths] = load_tt_peak_times(session_dir, varargin)
% creates a tetrode map using position data and spike amplitude
% MAKE_TETRODE_MAP(session_dir, varargin)
% arg pairs:
% - data_type: (old/new)
% - pos: position vector (1d)
% - epoch: epoch to load from
args.epoch = 'invalid_epoch_name';... |
github | hsw28/data_analysis-master | loadexp.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/Exp/loadexp.m | 2,859 | utf_8 | facba28b38bf6824dc232bc6533ce0ab | function [exp args] = exp_load(edir, varargin)
%% EXP = LOADEXP(edir, varargin)
%
% loads data from disk and creates a unified data structure for all
% experiment data. This structure will probably require further processing
% before use.
%
% this processing is done by default and can be turned off by passing the
% ke... |
github | hsw28/data_analysis-master | create_exp_pxyabw_files.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/Exp/create_exp_pxyabw_files.m | 1,107 | utf_8 | c4d2598ba2cb4f8b947c75726b0c189a |
function create_exp_pxyabw_files(edir, varargin)
args.binary = 1;
args = parseArgsLite(varargin,args);
disp('Creating PXYABW Files');
parms = 't_px,t_py,t_pa,t_pb,t_maxwd,t_maxht,time,t_h1,t_h2,t_h3,t_h4';
%files = dir(fullfile(edir,'*.tt'));
pos_file = fullfile(edir, 'position.p');
%... |
github | hsw28/data_analysis-master | exp_load.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/Exp/exp_load.m | 2,870 | utf_8 | 36b5654a67c663975b5d00197ad0a222 | function [exp args] = exp_load(edir, varargin)
%% EXP = LOADEXP(edir, varargin)
%
% loadsset data from disk and creates a unified data structure for all
% experiment data. This structure will probably require further processing
% before use.
%
% this processing is done by default and can be turned off by passing the
%... |
github | hsw28/data_analysis-master | load_exp_mu.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/Exp/load_exp_mu.m | 2,800 | utf_8 | fbc62dd67fcb97027e96420750a7088f |
function mu = load_exp_mu(edir, ep, varargin)
% load_exp_multiunit(edir, ep, varargin)
% loads the timestamps of all threshold crossing from all tt files
% contained in edir/extracted_data
%
% tetrodes can be flagged as ignored by using the following key value pair:
% 'ignore_tetrode', {'t01', 't02', 't##'}
args.thres... |
github | hsw28/data_analysis-master | exp_extract.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/Exp/exp_extract.m | 2,879 | utf_8 | 256e43d194578f6dd4c8147324c0d52b | function exp_extract(edir, varargin)
%
% see also exp_process
args.tt_files = 1;
args.pos_file = 1;
args.eeg_files = 1;
args.spike_parm = 1;
args.binary_pxyabw = 1;
args = parseArgs(varargin, args);
raw_dir = fullfile(edir, 'raw');
if ~exist(raw_dir, 'dir')
mkdir (full... |
github | hsw28/data_analysis-master | exp_process.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/Exp/exp_process.m | 2,051 | utf_8 | 342d8daaece3e0864ea5de580b1e07c0 | function exp_process(edir, varargin)
%
% see also exp_extract
args.extract = 1;
args.define_epochs = 1;
args.downsample_eeg =1;
args.eeg_fs = 750;
args = parseArgs(varargin, args);
already_extracted = exist(fullfile(edir, 'meta.extracted'), 'file');
% ------------------- Extract the Data -------------------%
if ~alr... |
github | hsw28/data_analysis-master | load_exp_pos.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/Exp/load_exp_pos.m | 3,276 | utf_8 | a6c7a8b7621b15934db6180b19814eea | function pos = load_exp_pos(edir, ep, varargin)
% LOAD_EXP_POS(edir, ep)
%
% loads position from position.p and linear position from lin_pos.p
% if lin_pos.p doesn't exist the user will be prompted to do the
% necessary actions to create lin_pos.p
%
% depends upon PositionProcessing, MwlIO, and Utilties toolboxs
args.... |
github | hsw28/data_analysis-master | detect_sws.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/MultiUnitRipplesAndSpindles/detect_sws.m | 616 | utf_8 | 89e27c04f205c1dd7562e050415d269f | function sws = detect_sws(ts, lfp)
timestampCheck(ts);
fs = timestamp2fs(ts);
thetaFilt = getfilter(fs, 'theta', 'win');
deltaFilt = getfilter(fs, 'slow', 'win');
theta = filtfilt(thetaFilt, 1, lfp);
delta = filtfilt(deltaFilt, 1, lfp);
k = make_smoothing_kernel(fs);
thetaEnv = abs(hilbert(theta));
deltaEnv = abs(... |
github | hsw28/data_analysis-master | detect_spindles2.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/MultiUnitRipplesAndSpindles/detect_spindles2.m | 3,978 | utf_8 | a75b4c01c4a08cdf87c884e1e1672afa | function [firstTs, spinTs, lastTs, spindleBand] = detect_spindles2(ts, x, varargin)
% Check the inputs
timestampCheck(ts);
Fs = 1 / (ts(2) - ts(1));
ind = 1:numel(ts);
% construct the input arguments
args.band = [7 15];
args.tholdStd = 1.5;
args.eventLen = [.5 2];
args.time_windows = [-inf inf];
args.inter_peak = [1.... |
github | hsw28/data_analysis-master | detect_spindles.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/MultiUnitRipplesAndSpindles/detect_spindles.m | 2,694 | utf_8 | 0da58bb1f51411ef11f51d44dba05d24 | function [events, firstPeakTs, allPeakTs, params, x, spindleEnvelope, smoothedEnvelope] = detect_spindles(ts, x, varargin)
% Check the inputs
timestampCheck(ts);
Fs = 1 / (ts(2) - ts(1));
ind = 1:numel(ts);
% construct the input arguments
args.band = [7 15];
args.tholdStd = 1.5;
args.eventLen = [.5 2];
args.time_wind... |
github | hsw28/data_analysis-master | dset_load_distance_matrix.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/dset/dset_load_distance_matrix.m | 1,118 | utf_8 | d1f66a65e9ceaf6010c6296b04219c38 | function pos = dset_load_distance_matrix(animal, day, epoch, varargin)
% DSET_LOAD_POSITION - loads the positions records (raw and linaear) from disk, if a linear position record doesn't exist the user is prompted to create it
stdArgs = dset_get_standard_args;
args = stdArgs.position;
pos_filepath = dset_get_pos_file_... |
github | hsw28/data_analysis-master | linearize_w_track.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/dset/linearize_w_track.m | 4,462 | utf_8 | af69fdc4c161edc3a86e964b3293b70e | function [lp nodes] = linearize_w_track(pos, varargin)
args.cmperpixel = pos.cmperpixel;
args.bin_size = 1;
args = parseArgs(varargin, args);
rx = pos.x;
ry = pos.y;
xpos = rx;
ypos = ry;
r_ind = 1:length(xpos);
lin_pos = [];%nan(size(r_ind));
more = 'Yes';
nodes = [];
nnodes = 0;
lp.paths.c2l = nan(size(xpos));
... |
github | hsw28/data_analysis-master | dset_load_tuningcurves.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/dset/dset_load_tuningcurves.m | 527 | utf_8 | fb3f6d30b7172a2395fdecb57258c202 | function [tc] = dset_load_tuningcurves(animal, day, epoch)
% DSET_LOAD_TUNINGCURVES - loads tuning curves from disk, if they don't exist then they are calculated
filepath = dset_get_tc_filepath(animal, day, epoch);
if ~exist(filepath,'file')
calc_and_save_tc(animal, day, epoch);
end
tc = ... |
github | hsw28/data_analysis-master | dset_load_position.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/dset/dset_load_position.m | 2,645 | utf_8 | d17691b5ca99e871bdd1fbdc75c43476 | function position = dset_load_position(animal, day, epoch, varargin)
% DSET_LOAD_POSITION - loads the positions records (raw and linaear) from disk, if a linear position record doesn't exist the user is prompted to create it
stdArgs = dset_get_standard_args;
args = stdArgs.position;
linpos_filepath = dset_get_linpos_f... |
github | hsw28/data_analysis-master | dset_linearize_position.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/dset/dset_linearize_position.m | 3,834 | utf_8 | 6c7a868d3233446d807e4d8287d305fa | function [linearposition sections section_index] = dset_linearize_position(xpos, ypos, varargin)
args.cmperpixel = 1;
args.bin_size = 1;
args = parseArgs(varargin, args);
%setup remained vectors
rx = xpos;
ry = ypos;
%setup remainder indecies vector
r_ind = 1:length(xpos);
more = 'Yes';
section_index = zeros(size... |
github | hsw28/data_analysis-master | dset_exp_load_mu_all.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/dset/dset_exp_load_mu_all.m | 4,770 | utf_8 | 3271af8bd555634975f89fb63affd130 | function mu = dset_exp_load_mu_all(edir, epoch)
% load a exp as a dset
% DSET
% - mu
% - rate
% - rateL
% - rateR
% - timestamps
% - fs
% - bursts Nx2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CONVERT MULTI-UNIT ACTI... |
github | hsw28/data_analysis-master | plot_correlation_between_nspike_replay_score.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/dset/plot_correlation_between_nspike_replay_score.m | 675 | utf_8 | e6aa4443b8478a3154915e2d475586de |
function f = plot_correlation_between_nspike_replay_score(results, all)
f(1) = figure('Position', [ 683 612 588 391]);
subplot(211);
hist(results.scoreCorrShuf);
y = get(gca,'YLim');
line([results.scoreCorr, results.scoreCorr], y, 'Color', 'r');
title('Replay Event Score');
subplot(212);
hist(results.perCorrS... |
github | hsw28/data_analysis-master | iff.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/Ripple_Figures/iff.m | 199 | utf_8 | b006632fa226e11d2828a1304ba6d8a7 | %%Artificial if for use in anonymous functions
%TRUE and FALSE are function handles.
function RESULT = iff(CONDITION,TRUE,FALSE)
if CONDITION
RESULT = TRUE;
else
RESULT = FALSE;
end
end |
github | hsw28/data_analysis-master | testFn.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/Ripple_Figures/testFn.m | 101 | utf_8 | a5b77723cf240712dddacd2f277fe1e1 | function [st, i] = testFn()
[st, i] = dbstack
end
function subFun1()
end
function subFun2()
end |
github | hsw28/data_analysis-master | copy_from_jellyroll.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/Ripple_Figures/copy_from_jellyroll.m | 1,125 | utf_8 | c90b28c6f2bcf8983e4acfc4306ce1c1 |
function copy_from_jellyroll(day)
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% JELLY ROLL - greghale@10.121.43.47
% ELDRIDGE - rsx@10.121.43.163
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if nargin==32673
day = 21;
end
% user = 'rsx';
% ip = '1... |
github | hsw28/data_analysis-master | fig3_compute_run_pdf.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/bilateral_figures/fig3_compute_run_pdf.m | 370 | utf_8 | c8902d6831d91a87bc4d715666fac971 |
function [pdf1, pdf2, isMoving] = fig3_compute_run_pdf(r,p)
t = r(1).tbins;
vel = interp1(p.ts, p.lv, t, 'nearest');
isMoving = abs(vel)>.15;
pdf1 = r(1).pdf(:, isMoving,:);
pdf1(:,:,2) = pdf1(:,:,1);
pdf2 = r(2).pdf(:, isMoving,:);
tmp = pdf2(:,:,2);
pdf2(:,:,2) =... |
github | hsw28/data_analysis-master | polar_hist.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/bilateral_figures/polar_hist.m | 4,053 | utf_8 | d41c0b0700ca71df686c0aa5c2b289df | function [h, ax] = polar_hist(ax, data, bins, normalize)
% if the first input argument isn't an axes object, then shift the values
% of the input args appropriately
if isempty( axescheck(ax) )
if nargin==4
error('Invalid axes handle provided');
end
if nargin>=3
normalize = bins;... |
github | hsw28/data_analysis-master | fig3_example_run_recon.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/bilateral_figures/fig3_example_run_recon.m | 267 | utf_8 | be304c4590cd2214ca9d8d34d120164f |
function fig3_example_run_recon(pdf1, pdf2, t, ax)
im = pdf1;
im(:,:,2) = pdf2;
im(:,:,3) = 0;
if isempty(t)
t = 1:size(pdf1,2);
end
imagesc(t, 0:.1:3, im, 'Parent', ax);
set(ax,'YDir', 'normal');
end
|
github | hsw28/data_analysis-master | calc_posidx_distance.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/bilateral_figures/calc_posidx_distance.m | 2,475 | utf_8 | 4cf42a2acfdb22a21a9549b739244b3e | function [d, dFull] = calc_posidx_distance(pos1, pos2, pfE)
p1{1} = removeStart(pos1, pfE(1,1), pfE(1,2) );
p1{2} = removeMiddle(pos1, pfE(2,1), pfE(2,2));
p1{3} = removeEnd(pos1, pfE(3,1), pfE(3,2));
p2{1} = removeStart(pos2, pfE(1,1), pfE(1,2));
p2{2} = removeMiddle(pos2, pfE(2,1), pfE(2,2));
p2{3} = removeEnd(pos2... |
github | hsw28/data_analysis-master | load_tt_file_waveforms.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/DecodingPaperRevisions/load_tt_file_waveforms.m | 1,842 | utf_8 | cb515be686642b2dda3273623d79cdf0 | function [waveforms, times, height, width] = load_tt_waveforms(file, varargin)
args.idx = [];
args.time_range = [];
args.anti_idx = 0;
args = parseArgsLite(varargin,args);
out = ones(0,6);
width = [];
fields = {'waveform', 'timestamp'};
d = dir(file);
if d.bytes < 10000
return;
end
mwlf = mwlopen(file);
i... |
github | hsw28/data_analysis-master | import_waveforms_from_tt_file.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/DecodingPaperRevisions/import_waveforms_from_tt_file.m | 1,136 | utf_8 | 27366dbc9c3e50255a346ea24d087486 | function [waveforms, ts] = import_waveforms_from_tt_file(file, varargin)
if ~exist(file,'file')
warning('%s file does not exist', file);
waveforms = [];
ts =[];
return;
end
args.idx = [];
args.time_range = [];
args.anti_idx = 0;
args = parseArgs(varargin,args);
fields = {'waveform', 'timestamp'};
... |
github | hsw28/data_analysis-master | decode_feature_vs_cluster.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/DecodingPaperRevisions/decode_feature_vs_cluster.m | 4,902 | utf_8 | 36d4418af6bfb85b6218c3f724aaedc2 |
function [P, E, input] = decode_feature_vs_cluster(baseDir, nChan)
%% Load DATA
if ~exist(baseDir,'dir');
error('Invalid directory specified');
end
if ~isscalar(nChan) || ~isnumeric(nChan) || ~ismember(1, [1, 4])
error('nChan must be a numeric scalar equal to 1 or 4');
end
input.description = baseDir;
input... |
github | hsw28/data_analysis-master | decode_feature_vs_cluster_pca.m | .m | data_analysis-master/others_analysis_code/mwl-stuart/DecodingPaperRevisions/misc/old/decode_feature_vs_cluster_pca.m | 5,088 | utf_8 | 571e317599ae6f6795523ad66c040f20 |
function [P, E, input] = decode_feature_vs_cluster_pca(baseDir, ep, methods, varargin)
args.stim_bw = 5;
args.resp_bw = 1;
args = parseArgs(varargin, args);
%% Load DATA
if nargin == 1 || isempty(ep)
ep = 'amprun';
elseif nargin > 20000
ep = 'amprun';
baseDir = '/data/spl11/day13';
end
if nargin<3
m... |
github | hsw28/data_analysis-master | specscope.m | .m | data_analysis-master/others_analysis_code/chronux/spectral_analysis/specscope/specscope.m | 19,600 | utf_8 | 7a80433446556a39374dc808670147c4 | function outdata=specscope(indata)
% record and plot audio spectrogram
%
% Usage: outdata=specscope(indata)
%
% Input: indata (optional)
% Displays a recorded piece of data, if an argument is passed
% Otherwise displays audio data from an attached microphone
%
% Output: outdata (optional)
% If pres... |
github | hsw28/data_analysis-master | rtf.m | .m | data_analysis-master/others_analysis_code/chronux/spectral_analysis/specscope/rtf.m | 5,158 | utf_8 | ef3f23be6203e99d6a822c63a1d42b6d | function rtf(plot_frq,flag_save)
close all
evalin('base','stop=0;');
%=========SET THE BASIC FIGURE=================
fig = figure('Position',[500,500,800,600],...
'NumberTitle','off',...
'Name','Scope',...
'doublebuffer','on',...
'HandleVisibility','on',...
'Ke... |
github | hsw28/data_analysis-master | specscopepp.m | .m | data_analysis-master/others_analysis_code/chronux/spectral_analysis/specscope/specscopepp.m | 20,341 | utf_8 | d9fe57a8dd870b4a1832ba73ec208a29 | function outdata=specscopepp(indata)
global acq;
h=hamming(5);
mins=5e-008;
maxs=1e-004;
% record and plot audio spectrogram
%
% Usage: outdata=specscope(indata)
%
% Input: indata (optional)
% Displays a recorded piece of data, if an argument is passed
% Otherwise displays audio data from an att... |
github | hsw28/data_analysis-master | lfgui.m | .m | data_analysis-master/others_analysis_code/chronux/locfit/m/lfgui.m | 4,018 | utf_8 | 3b6eace9dc5a0057fb2c8b221751aa6d | function varargout = lfgui(varargin)
% LFGUI M-file for lfgui.fig
% LFGUI, by itself, creates a new LFGUI or raises the existing
% singleton*.
%
% H = LFGUI returns the handle to a new LFGUI or the handle to
% the existing singleton*.
%
% LFGUI('CALLBACK',hObject,eventData,handles,...) calls th... |
github | hsw28/data_analysis-master | auto_classify.m | .m | data_analysis-master/others_analysis_code/chronux/wave_browser/auto_classify.m | 25,074 | utf_8 | ba0678a9e6434290035fdb708a1d8009 | function varargout = auto_classify(varargin)
% AUTO_CLASSIFY M-file for auto_classify.fig
% AUTO_CLASSIFY, by itself, creates a new AUTO_CLASSIFY or raises the existing
% singleton*.
%
% H = AUTO_CLASSIFY returns the handle to a new AUTO_CLASSIFY or the handle to
% the existing singleton*.
%
... |
github | hsw28/data_analysis-master | wave_browser.m | .m | data_analysis-master/others_analysis_code/chronux/wave_browser/wave_browser.m | 57,029 | utf_8 | 2587b6831317c05fd90c35f38a964c93 | function varargout = wave_browser(varargin)
% WAVE_BROWSER M-file for wave_browser.fig
% WAVE_BROWSER, by itself, creates a new WAVE_BROWSER or raises the existing
% singleton*.
%
% H = WAVE_BROWSER returns the handle to a new WAVE_BROWSER or the handle to
% the existing singleton*.
%
% ... |
github | hsw28/data_analysis-master | classify_spectra.m | .m | data_analysis-master/others_analysis_code/chronux/wave_browser/classify_spectra.m | 108,297 | utf_8 | 93fe2f22d145ba63cb667b18b3b33d0d | function varargout = classify_spectra(varargin)
% CLASSIFY_SPECTRA M-file for classify_spectra.fig
% CLASSIFY_SPECTRA, by itself, creates a new CLASSIFY_SPECTRA or raises the existing
% singleton*.
%
% H = CLASSIFY_SPECTRA returns the handle to a new CLASSIFY_SPECTRA or
% the handle to
% the ex... |
github | hsw28/data_analysis-master | configure_classify.m | .m | data_analysis-master/others_analysis_code/chronux/wave_browser/configure_classify.m | 17,864 | utf_8 | d66bfd4213ddebc5ac867dcafec8703a | function varargout = configure_classify(varargin)
% CONFIGURE_CLASSIFY M-file for configure_classify.fig
% CONFIGURE_CLASSIFY, by itself, creates a new CONFIGURE_CLASSIFY or raises the existing
% singleton*.
%
% H = CONFIGURE_CLASSIFY returns the handle to a new CONFIGURE_CLASSIFY or the handle to
... |
github | hsw28/data_analysis-master | FAnalyze.m | .m | data_analysis-master/others_analysis_code/chronux/fly_track/FAnalyze/functions/FAnalyze.m | 28,275 | utf_8 | 00157164be68669eaae8ee557d8f0e27 | function varargout = FAnalyze(varargin)
% FANALYZE
% For all your trajectory analysis needs! . See documentation for usage details.
%Written by Dan Valente
%November 2007
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui... |
github | hsw28/data_analysis-master | videoReader.m | .m | data_analysis-master/others_analysis_code/chronux/fly_track/videoIO/videoIO_2006b/@videoReader/videoReader.m | 5,758 | utf_8 | 66a56561d4e6c547cf2bac07861a94f6 | function vr = videoReader(url, varargin)
% videoReader class constructor
% Creates a object that reads video streams. We use a plugin
% architecture in the backend to do the actual reading. For example,
% on Windows, DirectShow will typically be used and on Linux, the
% ffmpeg library is often used.
... |
github | hsw28/data_analysis-master | videoWriter.m | .m | data_analysis-master/others_analysis_code/chronux/fly_track/videoIO/videoIO_2006b/@videoWriter/videoWriter.m | 11,485 | utf_8 | 0869234180baa12b3217c3ac04df67ed | function vw = videoWriter(url, varargin)
% videoWriter class constructor
% Creates a object that writes video files. We use a plugin
% architecture in the backend to do the actual writing. For example,
% on Windows, DirectShow will typically be used and on Linux, the
% ffmpeg library is often used.
%... |
github | hsw28/data_analysis-master | videoReader.m | .m | data_analysis-master/others_analysis_code/chronux/fly_track/videoIO/videoIO_2006a/@videoReader/videoReader.m | 5,758 | utf_8 | 66a56561d4e6c547cf2bac07861a94f6 | function vr = videoReader(url, varargin)
% videoReader class constructor
% Creates a object that reads video streams. We use a plugin
% architecture in the backend to do the actual reading. For example,
% on Windows, DirectShow will typically be used and on Linux, the
% ffmpeg library is often used.
... |
github | hsw28/data_analysis-master | videoWriter.m | .m | data_analysis-master/others_analysis_code/chronux/fly_track/videoIO/videoIO_2006a/@videoWriter/videoWriter.m | 11,485 | utf_8 | 0869234180baa12b3217c3ac04df67ed | function vw = videoWriter(url, varargin)
% videoWriter class constructor
% Creates a object that writes video files. We use a plugin
% architecture in the backend to do the actual writing. For example,
% on Windows, DirectShow will typically be used and on Linux, the
% ffmpeg library is often used.
%... |
github | hsw28/data_analysis-master | videoReader.m | .m | data_analysis-master/others_analysis_code/chronux/fly_track/videoIO/videoIO_2007a/@videoReader/videoReader.m | 5,758 | utf_8 | 66a56561d4e6c547cf2bac07861a94f6 | function vr = videoReader(url, varargin)
% videoReader class constructor
% Creates a object that reads video streams. We use a plugin
% architecture in the backend to do the actual reading. For example,
% on Windows, DirectShow will typically be used and on Linux, the
% ffmpeg library is often used.
... |
github | hsw28/data_analysis-master | videoWriter.m | .m | data_analysis-master/others_analysis_code/chronux/fly_track/videoIO/videoIO_2007a/@videoWriter/videoWriter.m | 11,485 | utf_8 | 0869234180baa12b3217c3ac04df67ed | function vw = videoWriter(url, varargin)
% videoWriter class constructor
% Creates a object that writes video files. We use a plugin
% architecture in the backend to do the actual writing. For example,
% on Windows, DirectShow will typically be used and on Linux, the
% ffmpeg library is often used.
%... |
github | hsw28/data_analysis-master | FTrack.m | .m | data_analysis-master/others_analysis_code/chronux/fly_track/FTrack/functions/FTrack.m | 20,317 | utf_8 | ec3ca4a2695761e114cd56210fe3ac51 | function varargout = FTrack(varargin)
% FTRACK
% For all your fly-tracking needs! . See documentation for usage details.
% Last Modified by GUIDE v2.5 26-Nov-2007 18:07:29
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui... |
github | hsw28/data_analysis-master | ssgtest.m | .m | data_analysis-master/others_analysis_code/chronux/spikesort/ssg/ssgtest.m | 5,824 | utf_8 | 82b751da52006147c8b8c37bab15515a | function ssgtest(spikes, assignments, show, mode)
% temporary script to translate the SSG_DATABROWSE functions into a GUI.
if (~ismember(mode, {'xy','xyz'})), error('Unknown mode.'); end;
if (isempty(assignments))
if (isfield(spikes, 'hierarchy') && isfield(spikes.hierarchy, 'assigns'))
assignment... |
github | hsw28/data_analysis-master | ssg_featureselect.m | .m | data_analysis-master/others_analysis_code/chronux/spikesort/ssg/ssg_featureselect.m | 10,495 | utf_8 | 78691a318b997773227f0b84bc2a3402 | function varargout = ssg_featureselect(varargin)
% SSG_FEATURESELECT M-file for ssg_featureselect.fig
% SSG_FEATURESELECT(axes_handle) creates a new SSG_FEATURESELECT. Not
% a user GUI; intended for internal use by SS GUI applications.
% Begin initialization code - DO NOT EDIT
gui_Singleton = 0;
gui_... |
github | hsw28/data_analysis-master | fancy.m | .m | data_analysis-master/others_analysis_code/chronux/spikesort/utility/graphicstyles/fancy.m | 4,083 | utf_8 | a3e9eebd83491ee8edec5224b2695b83 | function fancy(select)
%FANCY Collection of graphics test figures.
% fancy(1) Sphere with a cloudy (transparency-mapped) ring
% fancy(2) World map, mapped onto a sphere, with transparent oceans
% fancy(3) 3-D relief model of a US penny, with colored lighting
%
% Each of the figures will... |
github | hsw28/data_analysis-master | report_addpage.m | .m | data_analysis-master/others_analysis_code/chronux/spikesort/utility/matlabtools/report_addpage.m | 3,802 | utf_8 | 9139378ce94647a2b6e57b0f7d022f61 | function report_addpage(filename, fighandle, hangfraction, overlaytext)
%REPORT_ADDPAGE Builds up a PS report by appending Matlab figures.
% REPORT_ADDPAGE(FILENAME, FIGUREHANDLE) prints FIGUREHANDLE and appends
% it to the Postscript file FILENAME (or creates FILENAME if it does not
% already exist) -- note t... |
github | hsw28/data_analysis-master | sindata.m | .m | data_analysis-master/others_analysis_code/chronux/spikesort/utility/datatools/sindata.m | 3,079 | utf_8 | e770a06c467699eb2e7dd058279e6921 | function [Y,t] = sindata(dur, Fs, W, A, P, N)
%SINDATA Generate noisy sinuisoidal data.
% [Y,t] = SINDATA(DUR,Fs) returns vectors t and Y such that plot(t,Y)
% draws the sinusoid sin(2*pi*t) on the interval 0..DUR with sampling
% rate Fs.
%
% [Y,t] = SINDATA(DUR,Fs,W), for W scalar, instead retu... |
github | hsw28/data_analysis-master | smooth3f.m | .m | data_analysis-master/others_analysis_code/chronux/spikesort/utility/datatools/smooth3f.m | 3,212 | utf_8 | f205e6a39ee8fcd946941a37e61e41b9 | function smoothed = smooth3f(data, filt, sz, arg)
%SMOOTH3F Smooth 3D data (fast version).
% W = SMOOTH3F(V) smoothes input data V with a Gaussian kernel. The
% smoothed data is returned in W.
%
% W = SMOOTH3F(V, 'filter') Filter can be 'gaussian' or 'box' (default)
% and determines the convo... |
github | hsw28/data_analysis-master | linelabel.m | .m | data_analysis-master/others_analysis_code/chronux/spikesort/utility/uitools/linelabel.m | 4,997 | utf_8 | d956de3a07758d544ed0809d5600557e | function linelabel(vectors)
%LINELABEL Labels plotted lines.
% LINELABEL(LIBRARY), allows the user to select points and labels each
% with the row number of its closest (Euclidean) match among the rows of
% the matrix LIBRARY. When the mouse is clicked in the axis, the
% nearest point is selected ... |
github | hsw28/data_analysis-master | CB_movieplayer.m | .m | data_analysis-master/others_analysis_code/chronux/spikesort/utility/uitools/private/CB_movieplayer.m | 8,257 | utf_8 | 21b8ad6dbc174a20ddda061fed06ac46 | function CB_movieplayer(handle, events)
%CB_MOVIEPLAYER Callback for UImyfunc.
persistent running direction renderer;
if (isempty(running)), running = 0; end;
if (isempty(direction)), direction = 1; end;
info = guidata(handle); % get data & associated info
% Constants
fpsupdate = 8;
switch(handle),
case {in... |
github | hsw28/data_analysis-master | CB_colorshift.m | .m | data_analysis-master/others_analysis_code/chronux/spikesort/utility/uitools/private/CB_colorshift.m | 3,817 | utf_8 | e08df67ca0e87ab2a2aef43eeda4ab24 | function CB_colorshift(handle, events)
%CB_COLORSHIFT Callback for UIcolorshift.
% Fields for UserData structure:
% fighdl - parent figure hndl mouseroot - global coords initial click
% target - data axes hndl climsinit - initial clim
% cimage - colorbar image hndl limitSEL - 1 = bottom limit, 2 = ... |
github | hsw28/data_analysis-master | pp.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/misc/pp.m | 67,629 | utf_8 | 8ac0d22631f71dbb23bce722f777b9eb | function [line_handle] = pp(varargin)
%PP Plots and manipulates polar plots
%
% PP(THETA,R) plots the polar representation of THEATA and R with the
% centre and max values being the minimum and maximum values of R.
%
% PP(THETA,R,S) plots as above, where S is a character string made from
% standard p... |
github | hsw28/data_analysis-master | gh_cos_phase_model.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/misc/gh_cos_phase_model.m | 4,983 | utf_8 | 68caed8c183bb42129ab11025d1c7b72 | function varargout = gh_cos_phase_model(varargin)
% GH_COS_PHASE_MODEL - fits a rate offset sinwave to binned phase counts
%
% fit a cos wave to a circularly distributed random variable
% inputs can be either
% A: a vector of phases. These will be converted to circular histogram
% with n_bins bins (defined in the... |
github | hsw28/data_analysis-master | circ_from_points.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/misc/circ_from_points.m | 4,752 | utf_8 | 757eb2edfe5ee154ada2c6ff3d28c0d0 | function [x_center,y_center,r] = circ_from_points(xs,ys,varargin)
p = inputParser();
p.addParamValue('n_tests',0);
p.addParamValue('draw_intermediates',false);
p.addParamValue('draw_final',false);
p.addParamValue('n_test_points', 50);
p.addParamValue('rad_mean_and_var', [10, 2]);
p.addParamValue('use_test_data', false... |
github | hsw28/data_analysis-master | nextDate.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/misc/nextDate.m | 541 | utf_8 | 870570e6b872e82a48da0675fc024ce7 | function newDateString = nextDate(oldDateString)
y = str2double(oldDateString(5:6));
m = str2double(oldDateString(1:2));
d = str2double(oldDateString(3:4));
if (d == 31)
d = 1;
m = m + 1;
if (m == 13)
m = 1;
y = y + 1;
end
else
d = d + 1;
end
newDateString = [myNumToStr(m), m... |
github | hsw28/data_analysis-master | quick_eeg.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/misc/quick_eeg.m | 3,875 | utf_8 | 02f3deec60d3794459d4d71b620f4abc | function [eeg, opt] = quick_eeg(varargin)
p = inputParser();
p.addParamValue('timewin',[]);
p.addParamValue('file1',[]);
p.addParamValue('file2',[]);
p.addParamValue('file3',[]);
p.addParamValue('file4',[]);
p.addParamValue('system_list',{'ad','ad'});
p.addParamValue('f1_ind',[]);
p.addParamValue('f2_ind',[]);
p.addPa... |
github | hsw28/data_analysis-master | date_ad_to_alpha.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/misc/date_ad_to_alpha.m | 526 | utf_8 | 59a1f7b901cdd772f03f893502ff11f5 | function alphabetized_datestring = date_ad_to_alpha(old_datestring)
month = old_datestring(1:2);
day = old_datestring(3:4);
year = old_datestring(5:6);
lfun_assert_valid_date(month,day,year);
alphabetized_datestring = [year,month,day];
end
function lfun_assert_valid_date(month,day,year)
assert( length(day) == ... |
github | hsw28/data_analysis-master | gh_psth.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/gh_xcorr/gh_psth.m | 4,631 | utf_8 | a21c941493d1908fe12f70432f43f978 | function [counts, ts, aux_data] = gh_psth(triggers,spikes,varargin)
p = inputParser();
p.addParamValue('return_units','binned_counts',@(x) any(strcmp(x,{'binned_counts','binned_rates','smoothed_rates','times'})));
p.addParamValue('window_length',2); % seconds
p.addParamValue('bin_length',0.001); % seconds
p.addParamV... |
github | hsw28/data_analysis-master | theta_delta_ratio.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/sleep_score/theta_delta_ratio.m | 1,976 | utf_8 | 803d3165cfba75f804aaba914213b0d9 | function tdr = theta_delta_ratio(eeg_r_for_theta,varargin)
p = inputParser();
p.addParamValue('smooth_t',30);
p.addParamValue('eeg_r_for_delta',[]);
p.addParamValue('resample',true);
p.addParamValue('draw',false);
p.parse(varargin{:});
opt = p.Results;
if(opt.resample)
if(isfield(eeg_r_for_theta,'raw') && eeg_r_f... |
github | hsw28/data_analysis-master | depricated_gh_draw_segs.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/sleep_score/depricated_gh_draw_segs.m | 877 | utf_8 | d70e556559b452633f797c95d7369cec | function gh_draw_segs(segs, varargin)
p = inputParser();
p.addParamValue('names',[]);
p.addParamValue('ys',[]);
p.parse(varargin{:});
opt = p.Results;
if(~iscell(segs{1}))
segs = {segs};
end
if(~iscell(opt.names) && ~isempty(opt.names))
opt.names = {opt.names};
end
if(isempty(opt.ys))
n_seg = numel(segs... |
github | hsw28/data_analysis-master | depricated_gh_intersection_segs.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/sleep_score/depricated_gh_intersection_segs.m | 1,502 | utf_8 | 3219e60075e2a0680c1e3327fc02f13e | function new_s = gh_intersection_segs(s1,s2,varargin)
% ||||| |||| |||||||||| || |||| s1
% || |||| ||||||||||| | s2
%
% || || ||||||| | new_s
p = inputParser();
p.addParamValue('draw',false);
p.parse(varargin{:});
opt = p.Results;
ss = cellfun(@(x) lfun_i... |
github | hsw28/data_analysis-master | sv_phase_pair.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/spike_view/sv_phase_pair.m | 7,280 | utf_8 | b9ca90afd15d79671f95aa6baf6cbb33 | function f = sv_phase_pair(sdat,varargin)
% f = SV_PHASE_PAIR (sdat, ['rat_conv_table',conv_table], ['m',blue_cell_index],
% ['n',green_cell_index],['draw_extras',bool],
% ['trode_groups', trode_groups], ['overlay', bool],
% ['draw_phase_extents... |
github | hsw28/data_analysis-master | sv_xcorr_browse.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/spike_view/sv_xcorr_browse.m | 1,235 | utf_8 | d94c8e54c144066fdfc320de902111cc | function f = sv_xcorr_browse(xcorr,varargin)
p = inputParser();
p.addParamValue('m',1,@isreal);
p.addParamValue('n',2,@isreal);
p.parse(varargin{:});
data.m = p.Results.m;
data.n = p.Results.n;
data.sdat = sdat;
data.f = figure('Position',[50 50 400 300],'KeyPressFcn',@localfn_figure_keypress);
localfn_plot_xcorr(x... |
github | hsw28/data_analysis-master | sv_field_browse.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/spike_view/sv_field_browse.m | 3,747 | utf_8 | 46b3b4af2815309bc7974807dddd7716 | function [f] = sv_field_browse(sdat, varargin)
p = inputParser();
p.addParamValue('pos_info',[]);
p.parse(varargin{:});
data.use_pos = ~isempty(p.Results.pos_info);
if(data.use_pos)
data.pos_info = p.Results.pos_info;
end
data.keep_list = [];
data.f = figure('Position',[50 50 400 300],'KeyPressFcn',@localfn_figu... |
github | hsw28/data_analysis-master | shift_sdat.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/shift_and_reconstruct/shift_sdat.m | 4,091 | utf_8 | ad1b9adba9207aaae7c546b892bc669c | function new_sdat = shift_sdat(sdat, rat_conv_table, mod_opt, varargin)
% sdat = SHIFT_SDAT(sdat,conv_table,mod_opt,['draw',false])
% Slide spikes forward in backward in time
p = inputParser();
p.addParamValue('compensation',1);
p.addParamValue('draw',false);
p.parse(varargin{:});
opt = p.Results;
% Find the appropr... |
github | hsw28/data_analysis-master | gh_polar_clust.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/subthresh/gh_polar_clust.m | 10,259 | utf_8 | e77e308b9c65284e4ae7a9bc1111b9d3 | function [cluster_points_inds, ts, amps] = gh_polar_clust(ts,amps,varargin)
p = inputParser();
p.addParamValue('r_thresh',300);
p.addParamValue('timewin',[]);
p.addParamValue('immediate_drop_high_amp_thresh',5000);
p.addParamValue('dim1',1);
p.addParamValue('dim2',2);
p.addParamValue('dim3',3);
p.addParamValue('disp_m... |
github | hsw28/data_analysis-master | gh_polar_3d_hist.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/subthresh/gh_polar_3d_hist.m | 3,931 | utf_8 | f487141ae93df6d4eaa33ea50bfee31e | function [counts, bin_centers_rs, bin_centers_ang] = gh_polar_3d_hist(rs,angs,varargin)
p = inputParser();
p.addParamValue('n_ang_bins',20);
p.addParamValue('ang_limits',[-1,1]);
p.addParamValue('n_rs_bins', 50);
p.addParamValue('rs_limits',[0, 3000]);
p.addParamValue('rs_smooth', 100);
p.parse(varargin{:});
opt = p.R... |
github | hsw28/data_analysis-master | gh_smooth_cont.m | .m | data_analysis-master/others_analysis_code/mwl-gh-code/gh_cont/gh_smooth_cont.m | 982 | utf_8 | 49545a3ad750ef809dcc7f38942d259d | function new_cdat = gh_smooth_cont(cdat, kernel_width_t,varargin)
p = inputParser();
p.addParamValue('n_passes',1);
p.addParamValue('draw',false);
p.parse(varargin{:});
opt = p.Results;
ts = conttimestamp(cdat);
dt = ts(2) - ts(1);
n_kernel_x = lfun_next_odd( (kernel_width_t/2 / dt) * 4 ); % 4 std devs
kernel_t_lim ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.