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 | BottjerLab/Acoustic_Similarity-master | teststat.m | .m | Acoustic_Similarity-master/code/fileExchange/resampling_statistical_toolkit/statistics/teststat.m | 20,496 | utf_8 | d2bfb11cf5e6a0d7221866a5ff6cd823 | % teststat - EEGLAB statistical testing function
%
% Statistics are critical for inference testing in Science. It is thus
% primordial to make sure than all the statistics implemented are
% robust and at least bug free. Statistical function using complex
% formulas are inherently prone to bugs. EEGLAB functions are a... |
github | BottjerLab/Acoustic_Similarity-master | ttest2_cell.m | .m | Acoustic_Similarity-master/code/fileExchange/resampling_statistical_toolkit/statistics/ttest2_cell.m | 4,634 | utf_8 | cb20a27eff3e4cd6eb3c9ae82e863eed | % ttest2_cell() - compute unpaired t-test. Allow fast computation of
% multiple t-test using matrix manipulation.
%
% Usage:
% >> [F df] = ttest2_cell( { a b } );
% >> [F df] = ttest2_cell(a, b);
% >> [F df] = ttest2_cell(a, b, 'inhomogenous');
%
% Inputs:
% a,b = data consisting of UN... |
github | BottjerLab/Acoustic_Similarity-master | concatdata.m | .m | Acoustic_Similarity-master/code/fileExchange/resampling_statistical_toolkit/statistics/concatdata.m | 3,384 | utf_8 | 3637abb212e22ffda6377169e5e9f80a | % concatdata - concatenate data stored into a cell array into a single
% array. only concatenate along the last dimension
% Usage:
% [dataarray len dims] = concatata(cellarraydata);
%
% Input:
% cellarraydata - cell array containing data
%
% Output:
% dataarray - single array containing all data
%... |
github | BottjerLab/Acoustic_Similarity-master | ttest_cell.m | .m | Acoustic_Similarity-master/code/fileExchange/resampling_statistical_toolkit/statistics/ttest_cell.m | 3,107 | utf_8 | a669e2ffb5b0d990717a40eda3db4a2f | % ttest_cell() - compute paired t-test. Allow fast computation of
% multiple t-test using matrix manipulation.
%
% Usage:
% >> [F df] = ttest_cell( { a b } );
% >> [F df] = ttest_cell(a, b);
%
% Inputs:
% a,b = data consisting of PAIRED arrays to be compared. The last
% dime... |
github | BottjerLab/Acoustic_Similarity-master | corrcoef_cell.m | .m | Acoustic_Similarity-master/code/fileExchange/resampling_statistical_toolkit/statistics/corrcoef_cell.m | 2,948 | utf_8 | da74fe42ac5921d717809eedaccd7f21 | % corrcoef_cell() - compute pairwise correlations using arrays and
% cell array inputs.
%
% Usage:
% >> c = corrcoef_cell( data );
% >> c = corrcoef_cell( data );
%
% Inputs:
% data - [cell array] data consisting of PAIRED arrays to be compared.
% The last dimension of e... |
github | BottjerLab/Acoustic_Similarity-master | anova1_cell.m | .m | Acoustic_Similarity-master/code/fileExchange/resampling_statistical_toolkit/statistics/anova1_cell.m | 4,420 | utf_8 | 1013b1b3f49e9b71df057025fdf4f1d8 | % anova1_cell() - compute F-values in cell array using ANOVA.
%
% Usage:
% >> [F df] = anova1_cell( data );
%
% Inputs:
% data = data consisting of PAIRED arrays to be compared. The last
% dimension of the data array is used to compute ANOVA.
% Outputs:
% F - F-value
% df - degree of f... |
github | BottjerLab/Acoustic_Similarity-master | fdr.m | .m | Acoustic_Similarity-master/code/fileExchange/resampling_statistical_toolkit/statistics/fdr.m | 2,273 | utf_8 | 0339630d5b76067fde504d464d26a9bf | % fdr() - compute false detection rate mask
%
% Usage:
% >> [p_fdr, p_masked] = fdr( pvals, alpha);
%
% Inputs:
% pvals - vector or array of p-values
% alpha - threshold value (non-corrected). If no alpha is given
% each p-value is used as its own alpha and FDR corrected
% array is ret... |
github | BottjerLab/Acoustic_Similarity-master | anova2_cell.m | .m | Acoustic_Similarity-master/code/fileExchange/resampling_statistical_toolkit/statistics/anova2_cell.m | 6,961 | utf_8 | 0dbba037045407d82eca356a53792acf | % anova2_cell() - compute F-values in cell array using ANOVA.
%
% Usage:
% >> [FC FR FI dfc dfr dfi] = anova2_cell( data );
%
% Inputs:
% data = data consisting of PAIRED arrays to be compared. The last
% dimension of the data array is used to compute ANOVA.
% Outputs:
% FC - F-value for... |
github | BottjerLab/Acoustic_Similarity-master | searchST.m | .m | Acoustic_Similarity-master/code/fileExchange/ukkonen/searchST.m | 2,048 | utf_8 | 0282dd1c42a6ee3b55906d7c341749ab | function indices = searchST(T,Str,Qry)
%searchST checks if a string is in a suffix tree and returns occurrence indices
% suffix tree root: T
% original string : Str
% query string : Qry
if ~isempty(T.transitions)
curr_state = T; % store current state for the iterative approach
qrylen = length(Qry); % st... |
github | BottjerLab/Acoustic_Similarity-master | create_generalized_suffix_tree.m | .m | Acoustic_Similarity-master/code/fileExchange/ukkonen/create_generalized_suffix_tree.m | 1,270 | utf_8 | 634a95f2eb19b9d3e6ed8b110e6ad7a8 | function [root, sfstring] = create_generalized_suffix_tree(varargin)
% CREATE_GENERALIZED_SUFFIX_TREE produces a generalized suffix tree
% for multiple strings using the CREATE_SUFFIX_TREE function
% (Ukkonen '95)
%
% string terminators to separate multiple strings
terminators = '!§$%&/()=?';
% check how many ... |
github | BottjerLab/Acoustic_Similarity-master | initEvents.m | .m | Acoustic_Similarity-master/code/eventUtil/initEvents.m | 1,331 | utf_8 | 77ca6c2126f8465349decd5e0fd1de34 | function events = initEvents(N, exampleEvent)
% function EVENTS = INITEVENTS(N)
%
% initialize sparse coding of status, using events, which will be a struct
% array
%
% all events have the following fields:
% type: a label
% start: the start of the clip (in seconds)
% stop: the end of the clip (in seconds)
% idxStart: ... |
github | BottjerLab/Acoustic_Similarity-master | trainSongRecognizer.m | .m | Acoustic_Similarity-master/code/recognition/trainSongRecognizer.m | 6,684 | utf_8 | cd95cb2e3cf8275eed3f6e494ee0ed56 | function [prototypeSong, syllableFxns] = trainSongRecognizer(songStruct, alignedSongs, songSylls, params, varargin)
if nargin < 4
params = defaultParams;
end;
params = processArgs(params, varargin{:});
fs = 1/songStruct.interval;
% apply pre/postroll to all songs first
nSongs = numel(alignedSongs);
for ii = 1:nSo... |
github | BottjerLab/Acoustic_Similarity-master | specscope.m | .m | Acoustic_Similarity-master/code/chronux/spectral_analysis/specscope/specscope.m | 18,968 | utf_8 | b67aa0a85101a9f8f5061995b2d4dcb9 | 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 present, will ... |
github | BottjerLab/Acoustic_Similarity-master | rtf.m | .m | Acoustic_Similarity-master/code/chronux/spectral_analysis/specscope/rtf.m | 4,927 | utf_8 | 643598d912d578b46cdc9aa085fa78f8 | 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',...
'KeyPressFcn', @k... |
github | BottjerLab/Acoustic_Similarity-master | specscopepp.m | .m | Acoustic_Similarity-master/code/chronux/spectral_analysis/specscope/specscopepp.m | 19,677 | utf_8 | 36533b75a54fc2d7689db8409d0d285c | 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 attached micropho... |
github | BottjerLab/Acoustic_Similarity-master | lfgui.m | .m | Acoustic_Similarity-master/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 | BottjerLab/Acoustic_Similarity-master | auto_classify.m | .m | Acoustic_Similarity-master/code/chronux/wave_browser/auto_classify.m | 24,375 | utf_8 | d6715f4c02b4802b386ebbbb058fed4c | 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 | BottjerLab/Acoustic_Similarity-master | wave_browser.m | .m | Acoustic_Similarity-master/code/chronux/wave_browser/wave_browser.m | 55,349 | utf_8 | 31e3e1f789441ceb592f2d267f9bbcfc | 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*.
%
% WAVE_BR... |
github | BottjerLab/Acoustic_Similarity-master | classify_spectra.m | .m | Acoustic_Similarity-master/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 | BottjerLab/Acoustic_Similarity-master | configure_classify.m | .m | Acoustic_Similarity-master/code/chronux/wave_browser/configure_classify.m | 17,395 | utf_8 | 081c0712e35fc389b4df1270cb307bb7 | 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 | BottjerLab/Acoustic_Similarity-master | FAnalyze.m | .m | Acoustic_Similarity-master/code/chronux/fly_track/FAnalyze/functions/FAnalyze.m | 27,521 | utf_8 | 3a1409d90fce239af9d011484fe9c3f7 | 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_Singleton... |
github | BottjerLab/Acoustic_Similarity-master | videoReader.m | .m | Acoustic_Similarity-master/code/chronux/fly_track/videoIO/videoIO_2006b/@videoReader/videoReader.m | 5,622 | utf_8 | ae0c7daa1ec7e2618347338bff619af5 | 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 | BottjerLab/Acoustic_Similarity-master | videoWriter.m | .m | Acoustic_Similarity-master/code/chronux/fly_track/videoIO/videoIO_2006b/@videoWriter/videoWriter.m | 11,246 | utf_8 | a6a2b6d2d9552d4c6e352fc015b8e3dd | 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.
%
% v... |
github | BottjerLab/Acoustic_Similarity-master | videoReader.m | .m | Acoustic_Similarity-master/code/chronux/fly_track/videoIO/videoIO_2006a/@videoReader/videoReader.m | 5,622 | utf_8 | ae0c7daa1ec7e2618347338bff619af5 | 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 | BottjerLab/Acoustic_Similarity-master | videoWriter.m | .m | Acoustic_Similarity-master/code/chronux/fly_track/videoIO/videoIO_2006a/@videoWriter/videoWriter.m | 11,246 | utf_8 | a6a2b6d2d9552d4c6e352fc015b8e3dd | 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.
%
% v... |
github | BottjerLab/Acoustic_Similarity-master | videoReader.m | .m | Acoustic_Similarity-master/code/chronux/fly_track/videoIO/videoIO_2007a/@videoReader/videoReader.m | 5,622 | utf_8 | ae0c7daa1ec7e2618347338bff619af5 | 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 | BottjerLab/Acoustic_Similarity-master | videoWriter.m | .m | Acoustic_Similarity-master/code/chronux/fly_track/videoIO/videoIO_2007a/@videoWriter/videoWriter.m | 11,246 | utf_8 | a6a2b6d2d9552d4c6e352fc015b8e3dd | 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.
%
% v... |
github | BottjerLab/Acoustic_Similarity-master | FTrack.m | .m | Acoustic_Similarity-master/code/chronux/fly_track/FTrack/functions/FTrack.m | 19,662 | utf_8 | 29bb346b9fcedc49122cc6f916b3f783 | 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_Singleto... |
github | BottjerLab/Acoustic_Similarity-master | mostCommonSubstring.m | .m | Acoustic_Similarity-master/code/grammar/mostCommonSubstring.m | 1,220 | utf_8 | f0f718d8b632979dea5c98a57c2a1d1b | function [subStrSorted, countsSorted, locations] = mostCommonSubstring(string,N, M)
% returns the most common substrings of length N, with more than M
% occurrences
if nargin < 3
M = 1;
end
[subStr, counts, locations] = n_gram(string, N);
[countsSorted, sortIdx] = sort(counts, 'descend');
su... |
github | BottjerLab/Acoustic_Similarity-master | extract_features.m | .m | Acoustic_Similarity-master/code/features/extract_features.m | 14,572 | utf_8 | ad19fddda62ac137339201446c681e36 | %function [m_spec_deriv , m_AM, m_FM ,m_Entropy , m_amplitude ,gravity_center, m_PitchGoodness , m_Pitch , Pitch_chose , Pitch_weight , m_amplitude_band_1 , m_Entropy_band_1 , m_amplitude_band_3 , m_Entropy_band_2 , m_amplitude_band_3 , m_Entropy_band_3]=deriv(TS,fs);
function [m_spec_deriv , m_AM, m_FM ,m_Entropy , m_... |
github | BottjerLab/Acoustic_Similarity-master | multLinearRegress.m | .m | Acoustic_Similarity-master/code/features/multLinearRegress.m | 2,052 | utf_8 | d36768199d2c90c52ddff3138a4e2fe3 | function [corrSig, sigLevel, corrSigP]=multLinearRegress(xStruct, yStruct, varargin)
% remove
% convert xStruct to column data
[X, xNames] = structArrayToColumn(xStruct);
% convert yStruct to column data
[allY, yNames] = structArrayToColumn(yStruct);
% clean zeroed data (is this an exact match?)
Xclean = X;
X... |
github | jamesjun/vistrack-master | poolTrials_location.m | .m | vistrack-master/poolTrials_location.m | 2,704 | utf_8 | 73ca9c9380e5c9950acc7d7647326faf | function S = poolTrials_location(vsTrial, iAnimal)
%Distance to landmark and IPI
pixpercm = 1053.28/(sqrt(2)*100);
%landmark locations
xy0 = vsTrial(1).xy0;
xyf = [789, 681]; rf = 1; %cm, radius
xy1 = [966, 418]; r1 = 2.216*2.54/2; %*1.1222; %cm, radius
xy2 = [975, 790]; r2 = 3.545*2.54/2; %*1.1222; %cm, radi... |
github | jamesjun/vistrack-master | struct_fun.m | .m | vistrack-master/struct_fun.m | 318 | utf_8 | 6748d64bc402276e82165758b57b288a | % 7/20/2018
% James Jun
function varargout = struct_fun(varargin)
% S_save = struct_copy_(handles, csField)
if nargin==0
vcCmd = 'help';
else
vcCmd = varargin{1};
end
switch vcCmd
case 'help', help_();
case 'copy', copy_();
case 'get', get_();
case 'set', set_();
end %switch
end %func
|
github | jamesjun/vistrack-master | prctile_.m | .m | vistrack-master/prctile_.m | 6,604 | utf_8 | 2cb0ab8814ae7c82533f03c822732cbe | function y = prctile_(x,p,dim)
%PRCTILE Percentiles of a sample.
% Y = PRCTILE(X,P) returns percentiles of the values in X. P is a scalar
% or a vector of percent values. When X is a vector, Y is the same size
% as P, and Y(i) contains the P(i)-th percentile. When X is a matrix,
% the i-th row of Y contains ... |
github | jamesjun/vistrack-master | plotAnimals_EODA.m | .m | vistrack-master/plotAnimals_EODA.m | 1,656 | utf_8 | 284d489e6f8e2cd7bb9a3ba663351686 | function plotAnimals_EODA(vsTrialPool_E, vsTrialPool_L, vsTrialPool_P, strVar, fun1)
% plot correlatoin coefficient
csPhase = {'E', 'L', 'P'};
csAnimal = {'A', 'B', 'C', 'D', 'All'};
csZone = {'AZ', 'LM', 'NF', 'F'};
cvLM = cell(4,3);
mrLM = zeros(4,3);
figure;
% suptitle([strVar ', ' func2str(fun1)]);
%------------... |
github | jamesjun/vistrack-master | calcGridStats.m | .m | vistrack-master/calcGridStats.m | 1,787 | utf_8 | 8e774ca996f9f96d64df19dded24592b | function [mnVisit, mnVisit1] = calcGridStats(vsTrialPool, img0, varname, fun2, mlMask)
% pixpercm = 1053.28/(sqrt(2)*100);
% nGrid = 20; %2.6854cm/grid
nGrid = 25; %3.3567cm/grid
% nGrid = 25;
% nTime = 1; %20 msec
fEODAs = 0;
vrX = poolVecFromStruct(vsTrialPool, 'vrX');
vrY = poolVecFromStruct(vsTrialPool, 'vrY');
s... |
github | jamesjun/vistrack-master | wef.m | .m | vistrack-master/wef.m | 18,409 | utf_8 | a6aa27254651d2be7199663247ca0c36 | function varargout = wef(vcCommand, arg1, arg2, arg3, arg4)
% wef command
if nargin<1, vcCommand='help'; end
if nargin<2, arg1=''; end
if nargin<3, arg2=''; end
if nargin<4, arg3=''; end
if nargin<5, arg4=''; end
switch vcCommand
case 'help'
help_();
case {'traj', 'trajectory'}
traj_(arg1);
... |
github | jamesjun/vistrack-master | resize_figure.m | .m | vistrack-master/resize_figure.m | 764 | utf_8 | bd43731bf60d356799068cb14e203419 | %--------------------------------------------------------------------------
function hFig = resize_figure(hFig, posvec0, fRefocus)
if nargin<3, fRefocus = 1; end
height_taskbar = 40;
pos0 = get(groot, 'ScreenSize');
width = pos0(3);
height = pos0(4) - height_taskbar;
% width = width;
% height = height - 132; %width ... |
github | jamesjun/vistrack-master | plotAnimals_var.m | .m | vistrack-master/plotAnimals_var.m | 2,069 | utf_8 | 0f41a69599533668ddc4b5c75ad48ebc | function plotAnimals_var(vsTrialPool_E, vsTrialPool_L, vsTrialPool_P, strVar, fun1)
% plot correlatoin coefficient
vsPhase = {'E', 'L', 'P'};
cvLM = cell(4,3);
mrLM = zeros(4,3);
figure;
suptitle([strVar ', ' func2str(fun1)]);
%-------------------
% Plot per animal stats
for iZone = 1:4
subplot(3,2,iZone);
f... |
github | jamesjun/vistrack-master | detectBlink.m | .m | vistrack-master/detectBlink.m | 2,789 | utf_8 | 4d77e592274809685aebd0257f16fd1f | function [iFrame, xyLED] = detectBlink(handles, mode, fAsk)
% Returns the absolute frame
if nargin<3, fAsk = 1; end
mode = lower(mode);
vidobj = handles.vidobj;
switch mode
case 'first'
FLIM1 = [1, 300];
FLIM1(2) = min(FLIM1(2), vidobj.NumberOfFrames);
xyLED = []; % auto-detect
case 'last'
... |
github | jamesjun/vistrack-master | keyFcnPreview.m | .m | vistrack-master/keyFcnPreview.m | 3,585 | utf_8 | 33c946fb326af699a27132c483b27ed4 | function keyFcnPreview(hFig, event)
% ensure the figure is still valid
if ~ishandle(hFig), return; end
timer1 = get(hFig, 'UserData');
S = get(timer1, 'UserData');
fRunning = strcmpi(timer1.Running, 'on');
handles = guidata(S.hObject);
nFrames = size(handles.MOV,3);
[~, vcDataID, ~] = fileparts(handles.vidFname... |
github | jamesjun/vistrack-master | untitled.m | .m | vistrack-master/untitled.m | 3,151 | utf_8 | 4e530a31eed8acf850dfab148815a7bb | function varargout = untitled(varargin)
% UNTITLED MATLAB code for untitled.fig
% UNTITLED, by itself, creates a new UNTITLED or raises the existing
% singleton*.
%
% H = UNTITLED returns the handle to a new UNTITLED or the handle to
% the existing singleton*.
%
% UNTITLED('CALLBACK',hObject,ev... |
github | jamesjun/vistrack-master | imCorr.m | .m | vistrack-master/imCorr.m | 1,331 | utf_8 | 460780e6a045f95e65824afb696993ff | function mrC = imCorr(mrA, mrB)
% dimension of mrA, mrB must the same
nwin = 21;
nwinh = (nwin-1)/2;
h = size(mrA, 1);
w = size(mrA, 2);
mrA1 = zeros([h+nwinh*2, w+nwinh*2], class(mrA));
mrB1 = zeros([h+nwinh*2, w+nwinh*2], class(mrB));
mrA1(nwinh+1:end-nwinh, nwinh+1:end-nwinh) = mrA;
mrB1(nwinh+1:end-nwinh, nwinh+1... |
github | jamesjun/vistrack-master | rgbmix.m | .m | vistrack-master/rgbmix.m | 1,572 | utf_8 | 284be1bb60a191cfe2408ae5f2ac0186 | % mix the RGB to RGBbk in the masked area
function RGB = rgbmix(RGBbk, RGB, MASK, mode, mixRatio)
% RGB = rgbmix(RGBbk, RGB, MASK, 'mix', mixRatio)
% RGB = rgbmix(RGBbk, RGB, [], 'transparent', mixRatio)
if nargin<3, MASK = []; end
if nargin<4, mode = ''; end
if nargin<5, mixRatio = []; end
if isempty(mixRatio), mi... |
github | jamesjun/vistrack-master | vistrack_20181015.m | .m | vistrack-master/vistrack_20181015.m | 122,295 | utf_8 | 08229098a0e298ed9b80430eefd19127 | function varargout = vistrack(varargin)
vcCmd = 'help';
if nargin>=1, vcCmd = varargin{1}; else vcCmd = 'help'; end
if nargin>=2, vcArg1 = varargin{2}; else vcArg1 = ''; end
if nargin>=3, vcArg2 = varargin{3}; else vcArg2 = ''; end
if nargin>=4, vcArg3 = varargin{4}; else vcArg3 = ''; end
if nargin>=5, vcArg4 = varargi... |
github | jamesjun/vistrack-master | GUI1.m | .m | vistrack-master/GUI1.m | 39,474 | utf_8 | 73c7bcc6f99941d6a80fc883cdefffa5 | function varargout = GUI(varargin)
% GUI MATLAB code for GUI.fig
% GUI, by itself, creates a new GUI or raises the existing
% singleton*.
%
% H = GUI returns the handle to a new GUI or the handle to
% the existing singleton*.
%
% GUI('CALLBACK',hObject,eventData,handles,...) calls the local
% ... |
github | jamesjun/vistrack-master | trackFish_old.m | .m | vistrack-master/trackFish_old.m | 8,690 | utf_8 | 528800942109768d306dcddfdff7ad25 | function [XC, YC, AC, Area, S] = trackFish(S, FLIM)
% S.{AreaTarget, ThreshLim, img0, fShow, vec0, thresh, WINPOS}
MEMLIM = 200; %number of frames to load to memory at a time
nRetry = 3; %number of retries for loading a video file
% Parse input variables
WINPOS = S.WINPOS;
vecPrev = S.vec0;
thresh = S.thresh;
nframes ... |
github | jamesjun/vistrack-master | plotChevron.m | .m | vistrack-master/plotChevron.m | 899 | utf_8 | 353d8f5e104f3e11b650ff03086b3985 | function h = plotChevron(XI, YI, vrColor, ANGLE, scale)
% XI: [x_tip, x_tail], YI: [y_tip, y_tail]
if nargin<3, vrColor = []; end
if nargin<4, ANGLE = 60; end
if nargin<5, scale = 1; end
if isempty(vrColor), vrColor = [1,0,0]; end % plot red
% tip of the chevron
vrX(2) = XI(1);
vrY(2) = YI(1);
% Rotate vectors
vec0 ... |
github | jamesjun/vistrack-master | vid_read.m | .m | vistrack-master/vid_read.m | 2,724 | utf_8 | 248ffb5c942eee1a4619fdc52b8591c5 | % 7/22/2018 JJJ: created
function tmr = vid_read(vidobj, viF, nSkip_img)
if nargin<3, nSkip_img = []; end
if isempty(nSkip_img), nSkip_img = 1; end
if isempty(viF), viF = 1:vidobj.NumberOfFrames; end
nFrames_parfor = 300;
nThreads = 4; % number of parallel threads to run for loading video
fprintf('Loading video (... |
github | jamesjun/vistrack-master | makeMask.m | .m | vistrack-master/makeMask.m | 1,671 | utf_8 | 0252571c9fc244b8f288068c944853cb | function mlMask = makeMask(xy0, d1, img0, strShape, r)
% d1: diameter
% r: range expansion
if nargin < 5
r = 0;
end
d1 = round(d1);
if d1 < 1
mlMask = false(size(img0)); %none included
return;
end
if nargin < 4
strShape = 'CIRCLE';
end
fig = figure;
warning off;
image(false(size(img0)));
switch upp... |
github | jamesjun/vistrack-master | imgray2rgb.m | .m | vistrack-master/imgray2rgb.m | 1,225 | utf_8 | 9c6ace56ed8de2c203251d5385fb1379 | function RGB = imgray2rgb(I, inputrange, vcColorMap)
% imgray2rgb converts image to RGB scaled image, unit8
% JJJ function
if nargin<3, vcColorMap = 'jet'; end % PARULA, HSV, HOT, PINK
if ~exist('inputrange')
if strcmp(class(I), 'uint8')
inputrange = [0 255];
else
inputrange = [min(I(:)) ... |
github | jamesjun/vistrack-master | plotErrorbar2014.m | .m | vistrack-master/plotErrorbar2014.m | 1,706 | utf_8 | e4615e604347ae8ce8426016bff657db | function plotErrorbar(mrX, mlPath_E1, mlPath_L1, bootFcn, ystr)
%n by 3 (val, low, high)
[vrY, vrE, p] = bootCI_P(bootFcn, mrX(mlPath_E1), mrX(mlPath_L1));
% [bootFcn(mrX(mlPath_E1)), bootFcn(mrX(mlPath_L1))];
n = numel(vrY);
vrX = 1:n;
errorbar(vrX, vrY, vrE, 'r.'); hold on;
bar(vrX, vrY, .5);
set(gca, 'XLim', [.5 n... |
github | jamesjun/vistrack-master | GUI.m | .m | vistrack-master/GUI.m | 55,337 | utf_8 | fc24bd99ae97b09ea6eef5e96f186e54 | function varargout = GUI(varargin)
% GUI MATLAB code for GUI.fig
% GUI, by itself, creates a new GUI or raises the existing
% singleton*.
%
% H = GUI returns the handle to a new GUI or the handle to
% the existing singleton*.
%
% GUI('CALLBACK',hObject,eventData,handles,...) calls the local
% ... |
github | jamesjun/vistrack-master | vistrack.m | .m | vistrack-master/vistrack.m | 125,344 | utf_8 | 6eccf114256329640ec7f83ea2a3f60c | function varargout = vistrack(varargin)
vcCmd = 'help';
if nargin>=1, vcCmd = varargin{1}; else vcCmd = 'help'; end
if nargin>=2, vcArg1 = varargin{2}; else vcArg1 = ''; end
if nargin>=3, vcArg2 = varargin{3}; else vcArg2 = ''; end
if nargin>=4, vcArg3 = varargin{4}; else vcArg3 = ''; end
if nargin>=5, vcArg4 = varargi... |
github | jamesjun/vistrack-master | plotAll.m | .m | vistrack-master/plotAll.m | 4,148 | utf_8 | 94238f7577558d1809a95ef0fbd2995a | function plotAll(csTrials, csCmd, viZone, csX, nCols)
% csCmd: pair: command, ylabel
% iZone: optional. default 1
% csX: optional. default: {E,L,P}
% pair: condition, XTickLabel
vcAnimal = 'o^sd'; %animal's shape
vcPhase = 'rbg';
csLine = ':';
mrMean = zeros(4,3);
mrSem = zeros(4,3);
if nargin < 3
viZone = 1... |
github | jamesjun/vistrack-master | semcorr.m | .m | vistrack-master/semcorr.m | 308 | utf_8 | 01320eb8567e22c3cddc96fde0a5bbaa | function semc = semcorr(vr)
% sem based on correlation time
vr = vr(~isnan(vr));
sd = std(vr);
n = numel(vr) / corrTime(vr);
semc = sd / sqrt(n);
end
function tau = corrTime(vrX)
thresh = 1/exp(1);
vrC = xcorr(vrX - mean(vrX), 'coeff');
vrC = vrC(ceil(end/2):end);
tau = find(vrC < thresh, 1, 'first');
end |
github | jamesjun/vistrack-master | plotAll_pooled.m | .m | vistrack-master/plotAll_pooled.m | 3,983 | utf_8 | 710272e9cba4738938be88a56d3d8eff | function plotAll_pooled(csTrials, csCmd, viZone, csX, nCols)
% csCmd: pair: command, ylabel
% iZone: optional. default 1
% csX: optional. default: {E,L,P}
% pair: condition, XTickLabel
vcPhase = 'rbg';
csLine = ':';
mrMean = zeros(4,3);
mrSem = zeros(4,3);
if nargin < 3
viZone = 1;
strZone = '';
end
if i... |
github | jamesjun/vistrack-master | delete_empty_files.m | .m | vistrack-master/delete_empty_files.m | 715 | utf_8 | 92ed2cb4e4d9a756a8faa526079062f5 | function delete_empty_files(vcDir)
if nargin<1, vcDir=[]; end
delete_files_(find_empty_files_(vcDir));
end %func
function csFiles = find_empty_files_(vcDir)
% find files with 0 bytes
if nargin==0, vcDir = []; end
if isempty(vcDir), vcDir = pwd(); end
vS_dir = dir(vcDir);
viFile = find([vS_dir.bytes] == 0 & ~[vS_dir.i... |
github | jamesjun/vistrack-master | plotAnimals.m | .m | vistrack-master/plotAnimals.m | 4,347 | utf_8 | ddb97126edb10da86acc2d8a550cdbd9 | function [AX, AX1, cvZ] = plotAnimals(vsTrialPool_E, vsTrialPool_L, vsTrialPool_P, strVar, fun1, strY)
% cvZ: cell of animal, zone, phase
% plot correlatoin coefficient
csPhase = {'E', 'L', 'P'};
csPhaseColor = {'r', 'b', 'g'};
csDiffColor = {'m', 'c'};
csAnimal = {'All', 'A', 'B', 'C', 'D'};
csZone = {'AZ', 'LM', 'NF... |
github | jamesjun/vistrack-master | file2struct.m | .m | vistrack-master/file2struct.m | 2,959 | utf_8 | 4c6f8fed62b505c3807c064499fbc400 | % James Jun
% 7/19/2018: Can pass cell strings to evaluate
% 2017 May 23
% Run a text file as .m script and result saved to a struct P
% _prm and _prb can now be called .prm and .prb files
function S_file2struct = file2struct(vcFile_file2struct)
% S_file2struct = file2struct(vcFile_txt)
% S_file2struct = file2struct(... |
github | jamesjun/vistrack-master | trackFish.m | .m | vistrack-master/trackFish.m | 11,490 | utf_8 | be76bcc7d067cac5471e3806dc0cd88b | function [XC, YC, AC, Area, S, MOV, XC_off, YC_off] = trackFish(S, FLIM)
% S.{AreaTarget, ThreshLim, img0, fShow, vec0, thresh, WINPOS}
% AC: degree unit
% XC, YC: pixel unit
MEMLIM = 300; %number of frames to load to memory at a time
nRetry = 3; %number of retries for loading a video file
% Parse input variables
WIN... |
github | g4idrijs/DeepLearnToolbox-master | myOctaveVersion.m | .m | DeepLearnToolbox-master/util/myOctaveVersion.m | 169 | utf_8 | d4603482a968c496b66a4ed4e7c72471 | % return OCTAVE_VERSION or 'undefined' as a string
function result = myOctaveVersion()
if isOctave()
result = OCTAVE_VERSION;
else
result = 'undefined';
end
|
github | g4idrijs/DeepLearnToolbox-master | isOctave.m | .m | DeepLearnToolbox-master/util/isOctave.m | 108 | utf_8 | 4695e8d7c4478e1e67733cca9903f9ef | %detects if we're running Octave
function result = isOctave()
result = exist('OCTAVE_VERSION') ~= 0;
end |
github | g4idrijs/DeepLearnToolbox-master | makeLMfilters.m | .m | DeepLearnToolbox-master/util/makeLMfilters.m | 1,895 | utf_8 | 21950924882d8a0c49ab03ef0681b618 | function F=makeLMfilters
% Returns the LML filter bank of size 49x49x48 in F. To convolve an
% image I with the filter bank you can either use the matlab function
% conv2, i.e. responses(:,:,i)=conv2(I,F(:,:,i),'valid'), or use the
% Fourier transform.
SUP=49; % Support of the largest filter (must be... |
github | g4idrijs/DeepLearnToolbox-master | caenumgradcheck.m | .m | DeepLearnToolbox-master/CAE/caenumgradcheck.m | 3,618 | utf_8 | 6c481fc15ab7df32e0f476514100141a | function cae = caenumgradcheck(cae, x, y)
epsilon = 1e-4;
er = 1e-6;
disp('performing numerical gradient checking...')
for i = 1 : numel(cae.o)
p_cae = cae; p_cae.c{i} = p_cae.c{i} + epsilon;
m_cae = cae; m_cae.c{i} = m_cae.c{i} - epsilon;
[m_cae, p_cae] = caerun(m_cae, p_cae, x... |
github | pervadepyy/robust-initialization-rcpr-master | rcprTrain.m | .m | robust-initialization-rcpr-master/rcprTrain.m | 6,314 | utf_8 | d65cc055a4566913791100b0b64fccb5 | function [regModel,pAll] = rcprTrain( Is, pGt, varargin )
% Train multistage robust cascaded shape regressor
%
% USAGE
% [regModel,pAll] = rcprTrain( Is, pGt, varargin )
%
% INPUTS
% Is - cell(N,1) input images
% pGt - [NxR] ground truth shape for each image
% varargin - additional params (struct or name... |
github | pervadepyy/robust-initialization-rcpr-master | lbp.m | .m | robust-initialization-rcpr-master/lbp.m | 6,516 | utf_8 | 6d971cd03cebfaf0d188a7321674f26a | %LBP returns the local binary pattern image or LBP histogram of an image.
% J = LBP(I,R,N,MAPPING,MODE) returns either a local binary pattern
% coded image or the local binary pattern histogram of an intensity
% image I. The LBP codes are computed using N sampling points on a
% circle of radius R and using map... |
github | pervadepyy/robust-initialization-rcpr-master | getmapping.m | .m | robust-initialization-rcpr-master/getmapping.m | 5,410 | utf_8 | 69a52d082d09c6f19245bcbdc8124233 | %GETMAPPING returns a structure containing a mapping table for LBP codes.
% MAPPING = GETMAPPING(SAMPLES,MAPPINGTYPE) returns a
% structure containing a mapping table for
% LBP codes in a neighbourhood of SAMPLES sampling
% points. Possible values for MAPPINGTYPE are
% 'u2' for uniform LBP
% 'ri... |
github | pervadepyy/robust-initialization-rcpr-master | rcprTest1.m | .m | robust-initialization-rcpr-master/rcprTest1.m | 8,554 | utf_8 | 3900532ff3790e91ae4488605b09076d | function pout = rcprTest1( Is, regModel, p, regPrm, iniData, ...
verbose, corrindex, prunePrm)
% Apply robust cascaded shape regressor.
%
% USAGE
% p = rcprTest1( Is, regModel, p, regPrm, bboxes, verbose, prunePrm)
%
% INPUTS
% Is - cell(N,1) input images
% regModel - learned multi stage shape regressor (s... |
github | pervadepyy/robust-initialization-rcpr-master | regTrain.m | .m | robust-initialization-rcpr-master/regTrain.m | 9,295 | utf_8 | 89b7e0fe00811be7ba431a49658b6411 | function [regInfo,ysPr]=regTrain(data,ys,varargin)
% Train boosted regressor.
%
% USAGE
% [regInfo,ysPr] = regTrain( data, ys, [varargin] )
%
% INPUTS
% data - [NxF] N length F feature vectors
% ys - [NxD] target output values
% varargin - additional params (struct or name/value pairs)
% .type... |
github | pervadepyy/robust-initialization-rcpr-master | shapeGt.m | .m | robust-initialization-rcpr-master/shapeGt.m | 26,026 | utf_8 | e11051d7e887e7704a94fa95300474f5 | function varargout = shapeGt( action, varargin )
%
% Wrapper with utils for handling shape as list of landmarks
%
% shapeGt contains a number of utility functions, accessed using:
% outputs = shapeGt( 'action', inputs );
%
% USAGE
% varargout = shapeGt( action, varargin );
%
% INPUTS
% action - string specifying... |
github | pervadepyy/robust-initialization-rcpr-master | regApply.m | .m | robust-initialization-rcpr-master/regApply.m | 4,183 | utf_8 | 0194db40af69d752f32ff351e055bdfc | function ysSum = regApply(p,X,regInfo,regPrm)
% Apply boosted regressor.
%
% USAGE
% ysSum = regApply(p,X,regInfo,regPrm)
%
% INPUTS
% p - [NxD] initial pose
% X - [NxF] N length F feature vectors
% regInfo - structure containing regressor info, output of regTrain
% regPrm
% .type -... |
github | janismac/RacingTrajectoryOptimization-master | SL_acceleration_constraint_tangent.m | .m | RacingTrajectoryOptimization-master/SL_acceleration_constraint_tangent.m | 834 | utf_8 | 23a7dcf138c6c6075d65520f18e8f361 | % Calculates a tangent to the elliptical acceleration constraints.
% p = parameter struct
% i = index of tangent
% x = [px,py,vx,vy] (previous state vector)
% Resulting constraint: Au * [ax,ay] <= b
function [Au,b] = acceleration_constraint_tangent(p,i,x)
vx = x(3);
vy = x(4);
v_sq = vx*vx + vy*vy;
v ... |
github | janismac/RacingTrajectoryOptimization-master | testTrack1.m | .m | RacingTrajectoryOptimization-master/testTrack1.m | 1,856 | utf_8 | aa34787390e575cba25e6438fcb6cc98 | function checkpoints = testTrack1
trackWidth = 7;
checkpoints = struct;
checkpoints.left = [0; trackWidth/2];
checkpoints.right = [0; -trackWidth/2];
checkpoints.center = [0; 0];
checkpoints.yaw = 0;
checkpoints.forward_vector = [1; 0];
checkpoints = add_turn(checkpoints, 0, 76, track... |
github | janismac/RacingTrajectoryOptimization-master | mod1.m | .m | RacingTrajectoryOptimization-master/track_polygons/mod1.m | 80 | utf_8 | 6792ced4447cf40b17de293cde024282 | % Modulo for one-based indices
function y = mod1(i,N)
y = mod(i-1,N)+1;
end
|
github | janismac/RacingTrajectoryOptimization-master | add_overlaps.m | .m | RacingTrajectoryOptimization-master/track_polygons/add_overlaps.m | 2,956 | utf_8 | 09372d8e3c3b5ccd2c19d0b72383ca46 |
function new_track = add_overlaps(track)
% convert to constraints
for i = 1:length(track.polygons)
[track.polygons(i).A,track.polygons(i).b] = vert2con(track.vertices(:,track.polygons(i).vertex_indices)');
end
% find neighbor intersections
for i1 = 1:length(track.polygons)
... |
github | scstein/fSOFI-master | fourierInterpolation.m | .m | fSOFI-master/fourierInterpolation.m | 17,839 | utf_8 | 520266ebc2bfb7df2c9cf8cc13445ebc | function [ img ] = fourierInterpolation( img, itp_fac, mirrorMode )
% USAGE: [ img ] = fourierInterpolation( img, itp_fac, padding )
% Interpolation of a 2D or 3D input image using zero padding in the Fourier
% domain. The input data can be mirrored along the lateral/axial or both
% dimensions to make the borders perio... |
github | wmacnair/TreeTop-master | install_treetop.m | .m | TreeTop-master/install_treetop.m | 6,879 | utf_8 | f80b92397578e60037a763ef93353b2f | %% install_treetop: function to add treetop to the path, and check that several necessary compiled functions are functional
function [] = install_treetop()
% set up path
treetop_path()
% check compiled functions
check_compiled_functions()
end
function treetop_path()
% save changes to path and startup.m
prompt ... |
github | wmacnair/TreeTop-master | treetop_trees.m | .m | TreeTop-master/TreeTop/treetop_trees.m | 14,107 | utf_8 | 2a595d55ff801ddcce2abf31f74b5d49 | %% treetop_trees: (1) load data, calculate density, take subsample (2) identify outlier / downsample points
% (3) do kmeans++ seeding, allocate each point to closest seed (4) repeatedly: sample one point from each cluster, fit tree
% between them, record marker values and which celltypes these were (5) do layouts
funct... |
github | wmacnair/TreeTop-master | treetop_example_runs.m | .m | TreeTop-master/TreeTop/treetop_example_runs.m | 13,165 | utf_8 | 93c8b8279cbdd776aef54f94d9d3d23e | %% treetop_example_runs: Set of runs which reproduce the results in the paper.
% These are based on the entries in zip file treetop_data.
% data_dir is the parent path of where treetop_data was unzipped.
% output_dir is the parent path of where you would like outputs to be stored.
% run_switch is the index of which ru... |
github | wmacnair/TreeTop-master | treetop_layout.m | .m | TreeTop-master/TreeTop/treetop_layout.m | 7,508 | utf_8 | 7f075097a93221d57942407aa812496d | %% treetop_layout: do layouts for this run
function [] = treetop_layout(input_struct, options_struct)
% check inputs
[input_struct, options_struct] = check_treetop_inputs(input_struct, options_struct);
% do force-directed graph layout
calc_force_directed_layout(input_struct, options_struct);
% which markers sh... |
github | wmacnair/TreeTop-master | treetop.m | .m | TreeTop-master/TreeTop/treetop.m | 4,712 | utf_8 | 563f191b9e4f61a4d12ecae367db4bee | %% treetop: Runs treetop for specified inputs, with specified options.
%
% Data for input into TreeTop is specified via the input_struct object. The
% required fields of input_struct are as follows:
% data_dir String defining path to directory where input files
% are stored
% output_dir String defining path t... |
github | wmacnair/TreeTop-master | treetop_recursive.m | .m | TreeTop-master/TreeTop/treetop_recursive.m | 29,988 | utf_8 | c8fc2f52359836c95db63e8fee443049 | %% treetop_recursive: First sample ensemble of trees, do layouts. Then check whether we think there are further bifurcations.
function treetop_recursive(input_struct, options_struct)
fprintf('\nrunning TreeTop recursively\n')
% check whether pool is present
[input_struct, options_struct] = check_treetop_inputs(inp... |
github | wmacnair/TreeTop-master | treetop_branching_scores.m | .m | TreeTop-master/TreeTop/treetop_branching_scores.m | 12,172 | utf_8 | d294c6bd413cf9fe16918dc07944ee21 | %% treetop_branching_scores: calculate bifurcation score for given treetop run
function [] = treetop_branching_scores(input_struct, options_struct)
% check inputs
[input_struct, options_struct] = check_treetop_inputs(input_struct, options_struct);
% define set of thresholds
threshold_list = 0.99:-0.01:0.01;
... |
github | wmacnair/TreeTop-master | treetop_plots.m | .m | TreeTop-master/TreeTop/treetop_plots.m | 19,357 | utf_8 | 9683e1a142bffa061aca23c794782fcb | %% treetop_plots: plot marker values on layout, sample arrangement, and bifurcation outputs
% maybe also do ANOVA thing?
function treetop_plots(input_struct, options_struct)
% parse inputs
[input_struct, options_struct] = check_treetop_inputs(input_struct, options_struct);
% get outputs we need
treetop_struct =... |
github | wmacnair/TreeTop-master | treetop_pre_run.m | .m | TreeTop-master/TreeTop/treetop_pre_run.m | 9,717 | utf_8 | 5b3c54d00801b3d973120a385b9c70d5 | %% treetop_pre_run: Run this before running TreeTop, to check that the markers used are useful.
% Outputs are plots of marginal distributions of all markers, split by input file, and plots of
% mutual information (MI) between markers. High MI between two markers indicates that they share
% information, and therefore... |
github | wmacnair/TreeTop-master | nmi.m | .m | TreeTop-master/TreeTop/private/nmi.m | 961 | utf_8 | 141d32dc4a49246746638949cb2e05c8 | %% nmi:
function z = nmi(x, y)
% Compute normalized mutual information I(x,y)/sqrt(H(x)*H(y)) of two discrete variables x and y.
% Input:
% x, y: two integer vector of the same length
% Ouput:
% z: normalized mutual information z=I(x,y)/sqrt(H(x)*H(y))
% Written by Mo Chen (sth4nth@gmail.com).
assert(numel... |
github | wmacnair/TreeTop-master | remove_zero_ball.m | .m | TreeTop-master/TreeTop/private/remove_zero_ball.m | 993 | utf_8 | 5670cf42c5b637c9e1be2959cf2faa23 | %% remove_zero_ball: removes 'ball' of observations which are close to zero
function [all_struct] = remove_zero_ball(all_struct, options_struct)
if ~isfield(options_struct, 'zero_ball_flag') || options_struct.zero_ball_flag == false
return
end
% calculate L1 values
used_data = all_struct.used_data;
switch opt... |
github | wmacnair/TreeTop-master | kmedoids_fn.m | .m | TreeTop-master/TreeTop/private/kmedoids_fn.m | 1,927 | utf_8 | 83c71dabdc7d731eb22c816d235b5f06 | %% kmedoids_fn: calculates kmedoids algorithm with given distance matrix, and weights
% inputs are: D, distance matrix; kk, number of clusters; weights, vector of weights
% uses algorithm from Park and Jun, 2009
function [cluster_labels, medoids_idx, energy] = kmedoids_fn(D, kk, weights)
% check inputs
[weights, nn] ... |
github | wmacnair/TreeTop-master | calc_density.m | .m | TreeTop-master/TreeTop/private/calc_density.m | 4,683 | utf_8 | 2cdba04b91ef6e9de4e371923c0b8ce1 | %% calc_density: calculates density values
function [density_vector] = calc_density(sample_struct, options_struct)
% do we want to save some of these outputs?
kmedoids_flag = isfield(options_struct, 'kmedoids_flag') && options_struct.kmedoids_flag;
% define how big a reference to do
% and sigma values
% unpack
... |
github | wmacnair/TreeTop-master | pool_check.m | .m | TreeTop-master/TreeTop/private/pool_check.m | 632 | utf_8 | bd821e843005cd6bbc79a85d6268541d | %% pool_check: checks that a pool is running
function [pool_flag] = pool_check(options_struct)
if options_struct.pool_flag == false
pool_flag = false;
fprintf('running without pool\n')
return
end
% is matlab version earlier than 2013b?
version_str = version('-release');
[~, idx] = sort({'2013b', version... |
github | wmacnair/TreeTop-master | get_non_branching_distn.m | .m | TreeTop-master/TreeTop/private/get_non_branching_distn.m | 1,440 | utf_8 | d9c419340abdeebd3f45c844c5be2522 | %% get_non_branching_distn:
function non_branching_distn = get_non_branching_distn(n_ref_cells, n_points, n_dims)
if n_points <= 1000
fprintf('too few observations for proper non-branching comparison distribution; all scores normalized to 0\n');
non_branching_distn = Inf;
return
end
% load all non-branching... |
github | wmacnair/TreeTop-master | mst_expanded.m | .m | TreeTop-master/TreeTop/private/mst_expanded.m | 5,640 | utf_8 | a223982eef8698514c8b6eae8fb64923 | function [adj, adj2, cost_value] = mst_expanded(X, working_mode, exclude_adj)
% Minimal or Minimum Spanning Tree based on Euclidian distances
% MST in short: use (X)(n x p) to form (n-1) lines to connect (n) objects in the shortest possible way in the (p)
% dimensional variable-space, under the condition 'no closed loo... |
github | wmacnair/TreeTop-master | check_treetop_inputs.m | .m | TreeTop-master/TreeTop/private/check_treetop_inputs.m | 4,879 | utf_8 | 89c40b12c90908f15bbf49307f8669cf | %% CHECK_TREETOP_INPUTS: Checks that inputs to TreeTop are ok. Adds default values where none given.
% [input_struct, options_struct] = CHECK_TREETOP_INPUTS(input_struct, options_struct) checks both input_struct
% and options_struct, and amends them with default values where necessary.
% [input_struct, ~] = CHECK_TREET... |
github | wmacnair/TreeTop-master | get_layout_struct.m | .m | TreeTop-master/TreeTop/private/get_layout_struct.m | 3,135 | utf_8 | d0483d0d744fd9e573fd5d0d69db737d | %% get_layout_struct:
function layout_struct = get_layout_struct(input_struct, options_struct, recursive_flag)
% define default input
if ~exist('recursive_flag', 'var')
recursive_flag = false;
end
% double check inputs
[input_struct, options_struct] = check_treetop_inputs(input_struct, options_struct);
% ... |
github | wmacnair/TreeTop-master | set_up_figure_size.m | .m | TreeTop-master/TreeTop/private/set_up_figure_size.m | 358 | utf_8 | 8d4a148f9e69dac457392036608109be | %% set_up_figure_size: helper function to make figure ok for printing to pdf
function [] = set_up_figure_size(fig, units, fig_size)
set(fig, 'units', units);
set(fig, 'paperunits', units);
set(fig, 'paperposition', [0, 0, fig_size]);
set(fig, 'papersize', fig_size);
set(fig, 'position', [0, 0, fig_size]);
set(fig... |
github | wmacnair/TreeTop-master | kmeans_plus_plus.m | .m | TreeTop-master/TreeTop/private/kmeans_plus_plus.m | 17,733 | utf_8 | eee2fee42f73274bef501dd1dfb7ad4f | % kmeans_plus_plus.m
% See Scalable K-Means++, Bahmani et al., 2012
% Initializes first cluster selection for k-means, using squared distances from other points to ensure points are well spaced
% Approximate but distributed method.
% X rows = observations, columns = fields
% kk number of clusters
% ll oversampling ... |
github | wmacnair/TreeTop-master | get_graph_struct.m | .m | TreeTop-master/TreeTop/private/get_graph_struct.m | 9,355 | utf_8 | d23289c93133ab594cdb057e3decda77 | %% get_graph_struct:
function [graph_struct] = get_graph_struct(input_struct)
fprintf('loading summaries of ensemble of trees\n')
% open needed graphs
[inv_freq_graph, dist_graph] = get_tree_files(input_struct);
% calculate maximally sparse connected graphs for each of these
[sparse_inv_freq_graph, sparse_... |
github | wmacnair/TreeTop-master | partition_cells.m | .m | TreeTop-master/TreeTop/private/partition_cells.m | 4,780 | utf_8 | 436bd8e1e5ccf64c107d06aea4ff5e15 | %% partition_cells: given a list of points to be downsampled and a list of ouliers, identifies
% centroids via k-means ++ seeding amongst those that have been downsampled (downsample_idx includes outlier_idx)
function [centroids_idx, cell_assignments] = partition_cells(sample_struct, outlier_idx, downsample_idx, optio... |
github | wmacnair/TreeTop-master | save_txt_file.m | .m | TreeTop-master/TreeTop/private/save_txt_file.m | 1,067 | utf_8 | ecf553c2da76347fc2365241e62baf87 | %% save_txt_file:
function [] = save_txt_file(save_filename, header, save_data)
if isempty(header)
dataSpec = ['%4.4f' repmat('\t%4.4f', 1, size(save_data,2) -1) '\n'];;
fid = fopen(save_filename, 'w');
for ii = 1:size(save_data,1)
fprintf(fid, dataSpec, save_data(ii,:));
end
fclose(fid);
else
% ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.