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 | ToIntervals.m | .m | data_analysis-master/others_analysis_code/FMAToolbox/General/ToIntervals.m | 1,796 | iso_8859_13 | 21d9458e7d52a9aed5960113161febec | %ToIntervals - Convert logical vector to a list of intervals.
%
% USAGE
%
% intervals = ToIntervals(x,in)
%
% x values, e.g. timestamps
% in logical vector (1 = x value is inside, 0 = x value is outside)
%
% NOTE
%
% Values can also be omitted, in which case the intervals are defi... |
github | hsw28/data_analysis-master | SineWavePeaks.m | .m | data_analysis-master/others_analysis_code/FMAToolbox/General/SineWavePeaks.m | 4,516 | iso_8859_13 | 0bf6a76ef1e221d2772688265f3691e2 | %SineWavePeaks - Find peaks (or troughs) in a sine wave.
%
% Find the peaks (or troughs) in a sine wave. The algorithm can either determine
% the mid-points between the zero-crossings, or the zeros of the derivative of
% the signal. This assumes a minimum of 10 samples per positive/negative phase.
%
% USAGE
%
% [t,... |
github | hsw28/data_analysis-master | ZeroToOne.m | .m | data_analysis-master/others_analysis_code/FMAToolbox/General/ZeroToOne.m | 978 | iso_8859_13 | f1b483dcede4afbf575e6c346038c6da | %ZeroToOne - Normalize values in [0,1].
%
% USAGE
%
% [y,b0,b1...] = ZeroToOne(x,a0,a1,...)
%
% x array to normalize
% a0... additional inputs to transform using the same
% scale as x
% Copyright (C) 2008 by Michaël Zugaro
%
% This program is free software; you can red... |
github | hsw28/data_analysis-master | Array2Matrix.m | .m | data_analysis-master/others_analysis_code/FMAToolbox/General/Array2Matrix.m | 1,346 | iso_8859_13 | 611ae70f739d18b8bec7d40ff2075e3e | %Array2Matrix - Transform an N-dimensional array into a matrix.
%
% Each line in the output matrix lists the subscripts for all dimensions
% (one per column) and the corresponding value in the array.
%
% Copyright (C) 2009 by Michaël Zugaro
%
% This program is free software; you can redistribute it and/or modify
% i... |
github | hsw28/data_analysis-master | IsFirstAfter.m | .m | data_analysis-master/others_analysis_code/FMAToolbox/General/IsFirstAfter.m | 3,484 | iso_8859_13 | c216491c5f178e4a3a0c018ae60e1cd4 | %IsFirstAfter - Identify first item after each of a list of timestamps.
%
% For each element i of a list of test timestamps, find in a list of reference timestamps
% the first element j larger than i. Returns a list of logical indices (the elements of the
% test list which are greater than all the elements of the refer... |
github | hsw28/data_analysis-master | WatsonU2Test.m | .m | data_analysis-master/others_analysis_code/FMAToolbox/General/WatsonU2Test.m | 3,421 | iso_8859_13 | 35628894407f525ca47f713838fc757f | %WatsonU2Test - Test if two samples (circular data) have different means / variances.
%
% This non-parametric test assumes the data comes from a continuous distribution.
%
% USAGE
%
% [h,U2] = WatsonU2Test(group1,group2,alpha)
%
% group1 angles in radians for group 1
% group2 angles in radian... |
github | hsw28/data_analysis-master | ZeroCrossings.m | .m | data_analysis-master/others_analysis_code/FMAToolbox/General/ZeroCrossings.m | 1,648 | iso_8859_13 | 8c772682ce036412087373f11871fbef | %ZeroCrossings - Test zero crossings in a given time series.
%
% This assumes a minimum of 10 samples per positive/negative phase.
%
% USAGE
%
% [up,down] = ZeroCrossings(samples,<options>)
%
% samples an Nx2 matrix of (timestamp,value) pairs
%
% OUTPUT
%
% up logical indices indicating u... |
github | hsw28/data_analysis-master | InIntervals.m | .m | data_analysis-master/others_analysis_code/FMAToolbox/General/InIntervals.m | 4,009 | iso_8859_13 | 091fde99d6905704e4862788df729b9a | %InIntervals - Test which values fall in a list of intervals.
%
% USAGE
%
% [status,interval,index] = InIntervals(values,intervals,<options>)
%
% values values to test (these need not be ordered)
% intervals list of (start,stop) pairs
% <options> optional list of property-value pairs (see... |
github | hsw28/data_analysis-master | Insert.m | .m | data_analysis-master/others_analysis_code/FMAToolbox/General/Insert.m | 1,232 | iso_8859_13 | 3e00594e6f2efeb29ada35600d46b343 | %Insert - Insert lines in a matrix.
%
% USAGE
%
% result = Insert(matrix,lines,indices)
%
% array matrix where the lines should be inserted
% lines list of values to insert
% indices list of (possibly repeated) matrix line numbers
% after which new lines should be... |
github | hsw28/data_analysis-master | Diff.m | .m | data_analysis-master/others_analysis_code/FMAToolbox/General/Diff.m | 2,765 | iso_8859_13 | 295e7208b537c4f8321274af41612e61 | %Diff - Differentiate.
%
% USAGE
%
% derivative = Diff(samples,<options>)
%
% samples data to differentiate
% measured in number of samples (default = no smoothing)
% <options> optional list of property-value pairs (see table below)
%
% ========================================... |
github | hsw28/data_analysis-master | IsExtremum.m | .m | data_analysis-master/others_analysis_code/FMAToolbox/General/IsExtremum.m | 3,302 | iso_8859_13 | e01ff3339b2d5e57537383805073f292 | %IsExtremum - Identify local maxima or minima.
%
% Find the maxima (resp. minima) in a signal by smoothing the signal and then
% finding the points where the derivative goes from positive to negative (resp.
% from negative to positive).
%
% USAGE
%
% status = IsExtremum(samples,<options>)
%
% samples an N... |
github | hsw28/data_analysis-master | RunningAverage.m | .m | data_analysis-master/others_analysis_code/FMAToolbox/General/RunningAverage.m | 3,722 | iso_8859_13 | fd09ddd4730e2ace2851ca94bf9f558b | %RunningAverage - Compute running linear or angular average.
%
% Computes the running average of y=f(x). Variable y can be linear or circular
% (use radians). The error bars are standard errors of the mean for linear
% data, or 95% confidence intervals for circular data.
%
% USAGE
%
% [x,m,e] = RunningAverage(x,y,<... |
github | hsw28/data_analysis-master | Restrict.m | .m | data_analysis-master/others_analysis_code/FMAToolbox/General/Restrict.m | 3,440 | iso_8859_13 | fe20228d71202f26db11d2ed1c942f20 | %Restrict - Keep only samples that fall in a given list of time intervals.
%
% Keep only samples (positions, spikes, LFP, etc.) that fall in a given list of
% time intervals.
%
% The remaining epochs can optionally be 'shifted' next to each other in time,
% removing the time gaps between them (which result from discard... |
github | hsw28/data_analysis-master | barwitherr.m | .m | data_analysis-master/hannah-in-use/include/barwitherr.m | 6,315 | utf_8 | aa29cea697eac5f4230b55f2231ba13b | %**************************************************************************
%
% This is a simple extension of the bar plot to include error bars. It
% is called in exactly the same way as bar but with an extra input
% parameter "errors" passed first.
%
% Parameters:
% errors - the errors to be plotted (extra... |
github | hsw28/data_analysis-master | myfisher.m | .m | data_analysis-master/hannah-in-use/include/myfisher.m | 7,926 | utf_8 | 6f77fba4f88fa44357fac73bbc854dea | function Pout=myfisher(x,varargin)
%P=MYFISHER(X)- Fisher's Exact Probability Test for a RxC matrix.
% Fisher's exact test permits calculation of precise probabilities in situation
% where, as a consequence of small cell frequencies, the much more rapid normal
% approximation and chi-square calculations are liable to... |
github | hsw28/data_analysis-master | mtspectrumpb.m | .m | data_analysis-master/hannah-in-use/include/mtspectrumpb.m | 3,734 | utf_8 | d3f5d03f481dc59e4ab1e046619c4aff |
function [S,f,R,Serr]=mtspectrumpb(data,params,fscorr)
% Multi-taper spectrum - binned point process from CHRONUX
%
% Usage:
%
% [S,f,R,Serr]=mtspectrumpb(data,params,fscorr)
% Input:
% data (in form samples x channels/trials or a single vector) -- required
% params: structure with fields tapers, pad, Fs, ... |
github | hsw28/data_analysis-master | ndnanfilter.m | .m | data_analysis-master/hannah-in-use/include/ndnanfilter.m | 16,758 | utf_8 | cce2c37d629bf4c0bf50d951e6299a92 | function [Y,W] = ndnanfilter(X,HWIN,F,DIM,WINOPT,PADOPT,WNAN)
% NDNANFILTER N-dimensional zero-phase digital filter, ignoring NaNs.
%
% Syntax:
% Y = ndnanfilter(X,HWIN,F);
% Y = ndnanfilter(X,HWIN,F,DIM);
% Y = ndnanfilter(X,HWIN,F,DIM,WINOPT);
% Y = ndnanfilter(X,HWIN,F,DIM,... |
github | hsw28/data_analysis-master | scatplot.m | .m | data_analysis-master/hannah-in-use/include/scatplot.m | 6,493 | utf_8 | 824e85f0e01d59e4435ce9464fce474d | function out = scatplot(x,y,method,radius,N,n,po,ms)
% Scatter plot with color indicating data density
%
% USAGE:
% out = scatplot(x,y,method,radius,N,n,po,ms)
% out = scatplot(x,y,dd)
%
% DESCRIPTION:
% Draws a scatter plot with a colorscale
% representing the data density computed
% using three ... |
github | hsw28/data_analysis-master | uipickfiles.m | .m | data_analysis-master/hannah-in-use/include/uipickfiles.m | 48,328 | utf_8 | 4099453c1ed3a427d93761b05628ad8c | function out = uipickfiles(varargin)
%uipickfiles: GUI program to select files and/or folders.
%
% Syntax:
% files = uipickfiles('PropertyName',PropertyValue,...)
%
% The current folder can be changed by operating in the file navigator:
% double-clicking on a folder in the list or pressing Enter to move furthe... |
github | hsw28/data_analysis-master | distinguishable_colors.m | .m | data_analysis-master/hannah-in-use/include/distinguishable_colors.m | 5,753 | utf_8 | 57960cf5d13cead2f1e291d1288bccb2 | function colors = distinguishable_colors(n_colors,bg,func)
% DISTINGUISHABLE_COLORS: pick colors that are maximally perceptually distinct
%
% When plotting a set of lines, you may want to distinguish them by color.
% By default, Matlab chooses a small set of colors and cycles among them,
% and so if you have more than ... |
github | hsw28/data_analysis-master | circ_kuipertest.m | .m | data_analysis-master/hannah-in-use/include/CircStat2012a/circ_kuipertest.m | 3,076 | utf_8 | 17975f8427b61f430b01b39bea0a0b92 | function [pval, k, K] = circ_kuipertest(alpha1, alpha2, res, vis_on)
% [pval, k, K] = circ_kuipertest(sample1, sample2, res, vis_on)
%
% The Kuiper two-sample test tests whether the two samples differ
% significantly.The difference can be in any property, such as mean
% location and dispersion. It is a c... |
github | hsw28/data_analysis-master | circ_clust.m | .m | data_analysis-master/hannah-in-use/include/CircStat2012a/circ_clust.m | 3,346 | utf_8 | 09f16d972b35b7b7b55b361710748587 | function [cid, alpha, mu] = circ_clust(alpha, numclust, disp)
%
% [cid, alpha, mu] = circClust(alpha, numclust, disp)
% Performs a simple agglomerative clustering of angular data.
%
% Input:
% alpha sample of angles
% numclust number of clusters desired, default: 2
% disp show plot at each ste... |
github | hsw28/data_analysis-master | circ_raotest.m | .m | data_analysis-master/hannah-in-use/include/CircStat2012a/circ_raotest.m | 4,132 | utf_8 | a088b9d557b94032992d192ef76b8fd4 | function [p U UC] = circ_raotest(alpha)
% [p U UC] = circ_raotest(alpha)
% Calculates Rao's spacing test by comparing distances between points on
% a circle to those expected from a uniform distribution.
%
% H0: Data is distributed uniformly around the circle.
% H1: Data is not uniformly distributed around th... |
github | hsw28/data_analysis-master | circ_cmtest.m | .m | data_analysis-master/hannah-in-use/include/CircStat2012a/circ_cmtest.m | 2,127 | utf_8 | b8057e2fbbbaef56584aa347fe5c81cd | function [pval med P] = circ_cmtest(varargin)
%
% [pval, med, P] = circ_cmtest(alpha, idx)
% [pval, med, P] = circ_cmtest(alpha1, alpha2)
% Non parametric multi-sample test for equal medians. Similar to a
% Kruskal-Wallis test for linear data.
%
% H0: the s populations have equal medians
% HA: the s pop... |
github | hsw28/data_analysis-master | circ_wwtest.m | .m | data_analysis-master/hannah-in-use/include/CircStat2012a/circ_wwtest.m | 4,669 | utf_8 | 2fa4cad8c08ca9d37b358392c2a3fa99 | function [pval table] = circ_wwtest(varargin)
% [pval, table] = circ_wwtest(alpha, idx, [w])
% [pval, table] = circ_wwtest(alpha1, alpha2, [w1, w2])
% Parametric Watson-Williams multi-sample test for equal means. Can be
% used as a one-way ANOVA test for circular data.
%
% H0: the s populations have equal m... |
github | hsw28/data_analysis-master | uTest_RunLength.m | .m | data_analysis-master/hannah-in-use/include/RunLength_2017_04_08/uTest_RunLength.m | 16,706 | utf_8 | b2e2409f7dd1960a93c0b5e8ae3a4e3d | function uTest_RunLength(doSpeed)
% Automatic test: RunLength
% This is a routine for automatic testing. It is not needed for processing and
% can be deleted or moved to a folder, where it does not bother.
%
% uTest_RunLength(doSpeed)
% INPUT:
% doSpeed: Optional logical flag to trigger time consuming speed tests.
% ... |
github | hsw28/data_analysis-master | InstallMex.m | .m | data_analysis-master/hannah-in-use/include/RunLength_2017_04_08/InstallMex.m | 11,035 | utf_8 | 91f4a04ef4bf104ede92989b4940c5bf | function Ok = InstallMex(SourceFile, varargin)
% INSTALLMEX - Compile and install Mex file
% The C, C++ or FORTRAN mex file is compiled and additional installation
% routines are started. Advanced users can call MEX() manually instead, but some
% beginners are overwhelmed by instructions for a compilation sometimes.
% ... |
github | hsw28/data_analysis-master | assignvelDEP.m | .m | data_analysis-master/hannah-in-use/deprecated/assignvelDEP.m | 608 | utf_8 | 8a7b2c078da971af156a6d261736bc6f | DEPRECATED
function f = assignvelDEPRECATED(timefile, velo);
%takes input of velocity matric from velocity.m
% makes a vector of velocities at every time stamp so you can make a graph against all time points
% smooths data
%
% ex: f = assignvel(tet11.timestamp, velocitymatrix)
velvector = velo(1,:);
timevector = v... |
github | hsw28/data_analysis-master | contfilt.m | .m | data_analysis-master/hannah-in-use/deprecated/contfilt.m | 6,928 | utf_8 | 3fe8424290e65f5cd8da4caa87bbc66c | function [c filt] = contfilt(c,varargin)
% CONTFILT - filter data in a cont structure
%
% [c filt] = contfilt(c, [name/value arg pairs])
%
% Filter all channels in a cont struct using provided filter or filter
% design criteria. By default, downsamples highly oversampled signals before
% filtering for computational ef... |
github | hsw28/data_analysis-master | create_linearize_fcn_track.m | .m | data_analysis-master/hannah-in-use/inprep/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 | linearize_complex_track.m | .m | data_analysis-master/hannah-in-use/inprep/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 | draw_dynamic_polygon.m | .m | data_analysis-master/hannah-in-use/inprep/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 | movingcorr.m | .m | data_analysis-master/hannah-in-use/inprep/deprecated/movingcorr.m | 731 | utf_8 | 1f9c7e8d109e31826987b6d5f2994a3f | %DEPRECATED
function f = movingcorr(lfp, windowlength)
%window length is in time points
len=length(lfp);
%nwin = floor(len./windowlength);
nwin = windowlength;
moving_window = [1:nwin]';
noverlap=floor(0.9*nwin);
%amount not yet covdred / window
k=floor((len-noverlap)/(nwin-noverlap));
cor = [];
j = 1;
q = 1;
ind... |
github | hsw28/data_analysis-master | wheelRUN.m | .m | data_analysis-master/hannah-in-use/inprep/deprecated/wheelRUN.m | 1,364 | utf_8 | d21bebb724b1e7a0dcf74a966178377f | DEPRECATED
function f = wheelRUN(wheeldegrees);
%input wheel degree vector from wheelPos
% finds sin and smooths over areas where the rat isn't running
% outputs smoothed function
SINwheel = wheeldegrees;
SINwheel(:,2) = sind(wheeldegrees(:,2));
[pks,pkindex] = findpeaks(SINwheel(:,2),'MinPeakWidth', 1);
[valleys,val... |
github | hsw28/data_analysis-master | create_linearize_fcn_track.m | .m | data_analysis-master/hannah-in-use/inprep/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/hannah-in-use/inprep/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/hannah-in-use/inprep/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/hannah-in-use/inprep/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/hannah-in-use/inprep/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 | abovetheta.m | .m | data_analysis-master/hannah-in-use/matlab/abovetheta.m | 1,787 | utf_8 | 8d232a0ac44603a631617615ac617093 |
function p = abovetheta(c,d,y);
% finds peaks from eeg data by bandpass filtering, transforming, and then looking for signals >y dev above mean. returns a vector with the time of each ripple peak
%
% findrip(datavector,timevector,dev-above-mean)
% input data and timestamp structures from gh_debuffer.
% ex:
% findrip(l... |
github | hsw28/data_analysis-master | belowtheta.m | .m | data_analysis-master/hannah-in-use/matlab/belowtheta.m | 1,785 | utf_8 | ae60b281f9454df7888c144e94e98e39 |
function p = abovetheta(c,d,y);
% finds troughs from eeg data by bandpass filtering, transforming, and then looking for signals <y dev above mean. returns a vector with the time of each ripple peak
%
% findrip(datavector,timevector,dev-below-mean)
% input data and timestamp structures from gh_debuffer.
% ex:
% aboveth... |
github | hsw28/data_analysis-master | radonengine.m | .m | data_analysis-master/hannah-in-use/matlab/radonengine.m | 10,021 | utf_8 | 4fb898355da160b4b1338647bd0a4293 | function E = radonengine()
%RADONENGINE creates a radon engine
%
% e=RADONENGINE constructs an engine for computing the radon transform.
%
% A radon engine has the following inputs:
% matrix - input matrix
% dx - sampling interval in x-dimension
% dy - sampling interval in y-dimension
% origin - x and y origi... |
github | hsw28/data_analysis-master | psth.m | .m | data_analysis-master/hannah-in-use/matlab/psth.m | 2,522 | utf_8 | eb93bd6f7e341e26b13cf68f6690d03e |
function varargout=psth(varargin)
%PSTH peri-stimulus time histogram
%
% all inputs must be in columns
%
% h=PSTH(trigger,events) returns the psth for the events, given the in
% the interval [-1 1] around the trigger events. The number of bins in
% the histogram is 51. The trigger should be a sorted vector, the eve... |
github | hsw28/data_analysis-master | csi.m | .m | data_analysis-master/hannah-in-use/matlab/csi.m | 5,910 | utf_8 | 8e8d97e94ef18be21c5823cdaa383d0a | function c = csi(clusters, spike_amp, interval)
%CSI calculate complex spike index
%
% Syntax
%
% c = csi( A [, spike_amp, interval])
%
% Description
%
% This function will calculate the complex spike index for the spike
% train A. Spike_amp is an optional vector of amplitudes for each spike
% in A (def... |
github | hsw28/data_analysis-master | boundedline.m | .m | data_analysis-master/hannah-in-use/matlab/boundedline.m | 12,899 | utf_8 | dc811527d37f26797551c213e917871c | function varargout = boundedline(varargin)
%BOUNDEDLINE Plot a line with shaded error/confidence bounds
%
% [hl, hp] = boundedline(x, y, b)
% [hl, hp] = boundedline(x, y, b, linespec)
% [hl, hp] = boundedline(x1, y1, b1, linespec1, x2, y2, b2, linespec2)
% [hl, hp] = boundedline(..., 'alpha')
% [hl, hp] = boundedline(... |
github | hsw28/data_analysis-master | replay_shuffle_pseudo.m | .m | data_analysis-master/hannah-in-use/matlab/fkReplay/replay_shuffle_pseudo.m | 4,055 | utf_8 | b6d54b79b40c194531ae3827f5d9e46e | function [radonmax, seed, target_out] = replay_shuffle_pseudo( targets, info, n, winL, varargin )
%REPLAY_SHUFFLE_PSEUDO
if nargin<4
help(mfilename)
return
end
options = struct( 'seed', [], ...
'binomialtest', 1, ...
'binomialpvalue', 0.01, ...
'shufflevalue',... |
github | hsw28/data_analysis-master | replay_shuffle_cycle.m | .m | data_analysis-master/hannah-in-use/matlab/fkReplay/replay_shuffle_cycle.m | 3,579 | utf_8 | e689018e81a72eabb4931c29da0bdaba | function [radonmax, seed, target_out] = replay_shuffle_cycle(target,info, n, varargin)
%REPLAY_SHUFFLE_CYCLE
%
%
if nargin<3
help(mfilename)
return
end
options=struct('seed', [], ...
'binomialtest', 1, ...
'binomialpvalue', 0.01, ...
'shufflevalue', [], ...
... |
github | hsw28/data_analysis-master | replay_shuffle_clperm.m | .m | data_analysis-master/hannah-in-use/matlab/fkReplay/replay_shuffle_clperm.m | 4,737 | utf_8 | 539d88a75da556eaefcb7862d574c2df | function [radonmax, seed, target_out] = replay_shuffle_clperm( target, info, n, varargin )
%REPLAY_SHUFFLE_CLPERM
%
%
if nargin<3
help(mfilename)
return
end
options=struct('seed', [], ...
'binomialtest', 1, ...
'binomialpvalue', 0.01, ...
'shufflevalue', [], ...
... |
github | hsw28/data_analysis-master | event_dispatch.m | .m | data_analysis-master/hannah-in-use/matlab/fkRadon/event_dispatch.m | 23,199 | utf_8 | d4b8d2c9c19253ca215969b5f972df1f | function varargout = event_dispatch( hFig, cmd )
%EVENT_DISPATCH setup figure to receive event notification
%
% EVENT_DISPATCH sets up event notifications for the current figure. If
% no figure exist a new one will be created.
%
% EVENT_DISPATCH ON sets up the current figure for event notifications.
%
% EVENT_DISPA... |
github | hsw28/data_analysis-master | struct2param.m | .m | data_analysis-master/hannah-in-use/matlab/fkRadon/struct2param.m | 1,054 | utf_8 | b44fcd44d242b7c67f12e12337ee71f2 | function p = struct2param( s, expand )
%STRUCT2PARAM convert structure to parameter/value pairs
%
% p=STRUCT2PARAM(struct) returns a cell array of parameter/value pairs
% based on the structure.
%
% p=STRUCT2PARAM(struct,expand) expands substructures
%
% Copyright 2005-2008 Fabian Kloosterman
%check input argumen... |
github | hsw28/data_analysis-master | radonengine.m | .m | data_analysis-master/hannah-in-use/matlab/fkRadon/radonengine.m | 10,021 | utf_8 | 4fb898355da160b4b1338647bd0a4293 | function E = radonengine()
%RADONENGINE creates a radon engine
%
% e=RADONENGINE constructs an engine for computing the radon transform.
%
% A radon engine has the following inputs:
% matrix - input matrix
% dx - sampling interval in x-dimension
% dy - sampling interval in y-dimension
% origin - x and y origi... |
github | hsw28/data_analysis-master | findripLFP.m | .m | data_analysis-master/hannah-in-use/matlab/ripples/findripLFP.m | 4,526 | utf_8 | 39666fe5d6ea6670bb39d11c86ee457d |
function [notabletimes, all] = findripLFP(unfilteredLFP, timevector, devAboveMean, posData, varargin);
%IF DONT HAVE VELOCITY PUT 0
%varargin = min ripple length
% finds ripples from eeg data by bandpass filtering, transforming, and then looking for signals >y dev above mean. returns a vector [ripple start; ripplepeak... |
github | rbe051/UPR-master | CPG3D.m | .m | UPR-master/pebi3D/CPG3D.m | 4,398 | utf_8 | 2bff5b515703ad48839f04062ef24bed | function [G,optPts,f,g] = CPG3D(pts, bnd, varargin)
% Construct a 3D centroidal Pebi Grid(CPG). The CPG is found by
% minimizing the CPG energy function using the lbfgs algorithm.
%
% SYNOPSIS:
% [G, optPts, f, g] = CPG3D(pts, bnd)
% [...] = CPG3D(..., 'Name1', Value1,'Name2', Value2,...)
%
% PARAMETERS:
% p ... |
github | rbe051/UPR-master | voronoi2mrstGrid3D.m | .m | UPR-master/pebi3D/voronoi2mrstGrid3D.m | 5,904 | utf_8 | 8804bdbcb9f691b970daa5c336bc56c8 | function G = voronoi2mrstGrid3D(V, C)
% Transform Voronoi diagram stored in a Qhull grid structure to a MRST grid
% structure.
%
% SYNOPSIS:
% G = voronoi2mrstGrid3D(V,C)
%
% PARAMETERS:
% V A nx3 array containing the vertices of the Voronoi diagram,
% as obtained from [V, C] = voronoin(pts)
% ... |
github | rbe051/UPR-master | mirroredPebi3D.m | .m | UPR-master/pebi3D/mirroredPebi3D.m | 2,653 | utf_8 | 61007359f256be7c132b43717061259f | function [G] = mirroredPebi3D(pts, bound)
% Creates 3D voronoi diagram inside a convex boundary
%
% SYNOPSIS:
% G = mirroredPebi3D(pts, bound)
%
% PARAMETERS:
% p A nx3 array containing the voronoi sites.
% bound A kx3 array containing the vertices of the bounding
% polyhedron. The bound... |
github | rbe051/UPR-master | surfaceGrid3D.m | .m | UPR-master/pebi3D/surfaceGrid3D.m | 5,634 | utf_8 | a3b1f373142072930a3c1d84e1ddac3a | function [grids_2] = surfaceGrid3D(surfaces, grids_1, intersections, ds, gamma)
% Find the sites and grids of surfaces such that the 2D PEBI-grids conform to
% the surface intersections.
%
% SYNOPSIS:
% grids_2 = surfaceGrid3D(faults, grids_1, intersections, ds, gamma)
%
% PARAMETERS
% surfaces - cell array ... |
github | rbe051/UPR-master | surfaceSites2D.m | .m | UPR-master/pebi2D/surfaceSites2D.m | 23,499 | utf_8 | c7fda22146c8f6b5e7d06969e0dd0295 | function [F] = surfaceSites2D(faceConstraints,faultGridSize, varargin)
% Places surface sites on both sides of surfaces.
%
% SYNOPSIS:
% F = surfaceSites2D(faceConstraints, faultGridSize)
% F = surfaceSites2D(..., 'Name1', Value1, 'Name2', Value2, ...)
%
% Parameters:
% faceConstraints A cell of arrays. Each nx2... |
github | rbe051/UPR-master | CPG2D.m | .m | UPR-master/pebi2D/CPG2D.m | 4,283 | utf_8 | a28726d9b483248bf4da65a9abfed309 | function [G,optPts,f,g] = CPG2D(pts,bnd,varargin)
% Construct a 2D centroidal Voronoi Diagram (CVD). The CVD is found by
% minimizing the CVD energy function using the lbfgs algorithm.
%
% SYNOPSIS:
% [G, optPts, f, g] = createCVD(pts, bnd)
% [...] = createCVD(..., 'Name1', Value1,'Name2', Value2,...)
%
% PARAMETER... |
github | rbe051/UPR-master | uprBookSection42.m | .m | UPR-master/examples/book-ii/uprBookSection42.m | 4,930 | utf_8 | 0a4a06249a1345a0aa36018d1eb03d48 | %% Section 4.2: Configuring the simplex-conformity methods
% This section discusses how to configure the simple-conformity method
% introduced in uprBookSection41.m. The first two examples demonstrate how
% your can use interpolation of face constraints. The last example
%% Interpolation versus exact representation o... |
github | rbe051/UPR-master | polygonIntersection.m | .m | UPR-master/util/polygonIntersection.m | 2,725 | utf_8 | d88fea5499aafe38ca3e5c4651d37c1b | function int = polygonIntersection(poly_1, poly_2)
tol = 1e-6;
center_1 = mean(poly_1, 1);
poly_1 = bsxfun(@minus, poly_1, center_1);
poly_2 = bsxfun(@minus, poly_2, center_1);
R = rotationMatrixFromPlane(poly_1);
poly_1 = poly_1 * R';
assert(sum(abs(poly_1(:, 3)))<1e-6);
poly_1 = poly_1... |
github | rbe051/UPR-master | interLinePath.m | .m | UPR-master/util/interLinePath.m | 6,704 | utf_8 | 58fad21d5902aaee4d549e4032d52fe3 | function [p] = interLinePath(line, fh, lineDist, sePtn, interpol, varargin)
% Interpolate a line path.
% Arguments:
% line Coordinates of the fault line. Must be ordered.
% fh A function handle for the distance function for the
% interpolation fh = 1 will give equi... |
github | rbe051/UPR-master | mrstGridWithFullMappings.m | .m | UPR-master/util/mrstGridWithFullMappings.m | 3,395 | utf_8 | 22dd2bf326e4acc590887861130f3986 | function G=mrstGridWithFullMappings(G)
% Add all mappings to mrst grid. This is needed for VEM of finte element
% type methods.
%
% SYNOPSIS:
% G=mrstGridWithFullMappings(G)
%
%
% PARAMETERS:
% G - Grid structure as described by grid_structure.
%
% OPTIONAL PARAMETERS:
%
% 'hingenodes' - A struct with ... |
github | rbe051/UPR-master | plot3t.m | .m | UPR-master/util/plot3t.m | 9,754 | utf_8 | 3547ede7d4427660244abfd4c63ca789 | function hiso=plot3t(varargin)
% PLOT3T Plots a (cylindrical) 3D line with a certain thickness.
%
% h = plot3t(x,y,z,r,'color',n);
%
% PLOT3T(x,y,z), where x, y and z are three vectors of the same length,
% plots a line in 3-space through the points whose coordinates are the
% elements of x, y and z. With a rad... |
github | rbe051/UPR-master | sortEdges.m | .m | UPR-master/util/sortEdges.m | 3,717 | utf_8 | ee2a03d17925694bd24541a040c20bc8 | function G = sortEdges(G)
%{
Copyright 2009-2014 SINTEF ICT, Applied Mathematics
%}
assert(G.griddim==2);%??? is this correct
G=sortCellFaces(G);
end
%% Helper function to sortCellFaces
function [edges, m, s] = swap(k, edges, m, s)
% Do one edge swap. With N=size(edges,1), N-1 edge swaps will sort edges.
% Fin... |
github | rbe051/UPR-master | clipPolygon.m | .m | UPR-master/util/clipPolygon.m | 2,238 | utf_8 | db03a923b319e8ebdb9e162505398051 | function [p, symP] = clipPolygon(p, n, x0, symP, bisector,varargin)
% Clip a polygon against a set of bounding planes
%{
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2016 Runar Lie Berge. See COPYRIGHT.TXT for details.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
github | rbe051/UPR-master | lbfgs.m | .m | UPR-master/util/lbfgs.m | 3,434 | utf_8 | 3c0bb8c3747eb1fb6298c5e23526b169 | function [x,f,gNorm] = lbfgs(x0, F, varargin)
% limitet-memory bfgs optimization function
%
% Arguments:
% x0 initial guess
% F Objective function
%
% varargin:
% storedVec Number of vectors used to approximate hessian
% maxIt Maximum number of iter... |
github | rbe051/UPR-master | meshdemond.m | .m | UPR-master/distmesh/meshdemond.m | 987 | utf_8 | 8cc751724cdd17224ee75b97832417fc | function meshdemond
%MESHDEMOND distmeshnd examples.
% Copyright (C) 2004-2012 Per-Olof Persson. See COPYRIGHT.TXT for details.
rand('state',1); % Always the same results
set(gcf,'rend','opengl');
disp('(9) 3-D Unit ball')
fd=inline('sqrt(sum(p.^2,2))-1','p');
[p,t]=distmeshnd(fd,@huniform,0.2,[-1,-1,-1;1,1,1],[])... |
github | xiangruili/dicm2nii-master | nii_tool.m | .m | dicm2nii-master/nii_tool.m | 49,965 | utf_8 | 29f9883f1cd356925a90c18101164280 | function varargout = nii_tool(cmd, varargin)
% Basic function to create, load and save NIfTI file.
%
% rst = nii_tool('cmd', para);
%
% To list all command, type
% nii_tool ?
%
% To get help information for each command, include '?' in cmd, for example:
% nii_tool init?
% nii_tool('init?')
%
% Here i... |
github | xiangruili/dicm2nii-master | RT_moco.m | .m | dicm2nii-master/RT_moco.m | 43,182 | utf_8 | 48f4040fc608c8cba19166a9dcea5d16 | function RT_moco()
% Display and save motion information at real time. It also shows images and the
% progress of scanning, and allows to check motion information for previous
% series/patients.
%
% To make this work, you will need:
% 1. Set up shared folder at the computer running RT_moco.
% The folder default t... |
github | xiangruili/dicm2nii-master | dicm2nii.m | .m | dicm2nii-master/dicm2nii.m | 127,087 | utf_8 | 2fba654c2942c6698374fff43d7c03d3 | function varargout = dicm2nii(src, niiFolder, fmt)
% Convert dicom and more into nii or img/hdr files.
%
% DICM2NII(dcmSource, niiFolder, outFormat)
%
% The input arguments are all optional:
% 1. source file or folder can be a zip or tgz file, a folder containing dicom
% files, or other convertible files... |
github | xiangruili/dicm2nii-master | dicm_hdr.m | .m | dicm2nii-master/dicm_hdr.m | 64,665 | utf_8 | 1c0f8480331630c004fd44657876453a | function [s, info, dict] = dicm_hdr(fname, dict, iFrames)
% Return header of a dicom file in a struct.
%
% [s, err] = DICM_HDR(dicomFileName, dict, iFrames);
%
% The mandatory 1st input is the dicom file name.
%
% The optional 2nd input can be a dicom dictionary returned by dicm_dict. It may
% have only par... |
github | xiangruili/dicm2nii-master | nii_viewer.m | .m | dicm2nii-master/nii_viewer.m | 145,731 | utf_8 | e2289822c0b243567f5be6e8d017f77d | function varargout = nii_viewer(fname, varargin)
% Basic tool to visualize NIfTI images.
%
% NII_VIEWER('/data/subj2/fileName.nii.gz')
% NII_VIEWER('background.nii', 'overlay.nii')
% NII_VIEWER('background.nii', {'overlay1.nii' 'overlay2.nii'})
%
% If no input is provided, the viewer will load included MNI_... |
github | xiangruili/dicm2nii-master | nii_moco.m | .m | dicm2nii-master/nii_moco.m | 10,652 | utf_8 | d8d69ca8e1f51dab16d2d18acc860523 | function varargout = nii_moco(nii, out, ref)
% Perform motion correction to the input NIfTI data.
%
% Syntax:
% p = NII_MOCO(filename_in); % return correction parameter only
% NII_MOCO(filename_in, filename_out); % save corrected image file
% [p, nii_out] = NII_MOCO(nii_in); % also return correct NIfTI without savin... |
github | xiangruili/dicm2nii-master | dicm_save.m | .m | dicm2nii-master/dicm_save.m | 8,154 | utf_8 | 3d9941ffcdcd32420b7d22852898edc9 | function dicm_save(img, fname, s)
% DICM_SAVE(img, dicomFileName, info_struct);
%
% Save img into dicom file, using tags stored in struct, as dicomwrite does.
% The img can have up to 4 dimensions, with 3rd typically RGB and 4th frames.
%
% Comparing to dicomwrite: Advantage 1: DICM_SAVE supports img with any Matlab
%... |
github | xiangruili/dicm2nii-master | java_dnd.m | .m | dicm2nii-master/java_dnd.m | 2,820 | utf_8 | b72dadc83df5d9f523b72cf084b3e056 | function java_dnd(jObj, dropFcn)
% Set Matlab dropFcn for java object, like JavaFrame or JTextField.
% 170421 Xiangrui Li adapted from dndcontrol class by Maarten van der Seijs:
% https://www.mathworks.com/matlabcentral/fileexchange/53511
% Required: MLDropTarget.class under the same folder
if ~exist('MLDrop... |
github | xiangruili/dicm2nii-master | nii_xform.m | .m | dicm2nii-master/nii_xform.m | 10,691 | utf_8 | 3be795464e640d160c7fe947c2bbe22c | function varargout = nii_xform(src, target, rst, intrp, missVal)
% Transform a NIfTI into different resolution, or into a template space.
%
% NII_XFORM('source.nii', 'template.nii', 'result.nii')
% NII_XFORM(nii, 'template.nii', 'result.nii')
% NII_XFORM('source.nii', [1 1 1], 'result.nii')
% nii = NII_XFORM... |
github | tiagofrepereira2012/convex_opt-master | convert_svm_labels.m | .m | convex_opt-master/convert_svm_labels.m | 324 | utf_8 | 826865518a1c526789fe659896f0e5a1 | %%%%
% Converting multiclass labels for the binary class SVM (1/-1)
%%%%
function [ svm_labels ] = convert_svm_labels(labels, target_label)
[n,d] = size(labels);
svm_labels = zeros(n,1);
indexes = find(labels==target_label);
svm_labels(indexes) = 1;
indexes = find(labels~=target_label);
svm_labels(indexes) = -1;
e... |
github | tiagofrepereira2012/convex_opt-master | svm_scoring.m | .m | convex_opt-master/svm_scoring.m | 178 | utf_8 | 5dc419630b9a896725f8d8a6b4f22dc4 | %%%%%%
% svm_scoring.m
%
% @author Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
% @date Thu 2 Jun 2016
%
%%%%%%
function y = svm_scoring(w,b,x)
y = x*w + b;
end
|
github | tiagofrepereira2012/convex_opt-master | svm_plots.m | .m | convex_opt-master/svm_plots.m | 2,245 | utf_8 | 39e928b435b1101166c74ddd0211e0ce | %%%%%%
% svm_plots.m
%
% @author Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
% @date Thu 2 Jun 2016
%
% This code trains an SVM for a binary classification given a 2d data matrix
% and the labels.
% Also it plots the data with the decision boundary enhancing the support
% vectors
% ** Parameters
% data: nx2 ... |
github | tiagofrepereira2012/convex_opt-master | normalize_data.m | .m | convex_opt-master/normalize_data.m | 246 | utf_8 | 2251f2e10db0213e2ebdaf282a17406b | %%%%
% mean, variance data normalization
%%%%
function [ data, mean_data, std_data] = normalize_data(data)
mean_data = mean(data);
std_data = std(data);
[n,d] = size(data);
for i=1:n
data(i,:) = (data(i,:)-mean_data)./std_data;
end
end
|
github | tiagofrepereira2012/convex_opt-master | svm_binary.m | .m | convex_opt-master/svm_binary.m | 1,046 | utf_8 | 4ee51db8245ab2a74fdadd2ce5c03a26 | %%%%%%
% svm_binary.m
%
% @author Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
% @date Thu 2 Jun 2016
%
%%%%%%
function [accuracy_train, accuracy_test, support_vectors_ratio] = svm_binary(data_train, labels_train, data_test, labels_test, soft, C)
epsilon = 0.000001;
[n_train,d] = size(data_train);
[... |
github | tiagofrepereira2012/convex_opt-master | svm_multiclass.m | .m | convex_opt-master/svm_multiclass.m | 1,691 | utf_8 | ffec27d35ab8a7f9a101b00904abb6dc | %%%%%%
% svm_multiclass.m
%
%
% Implements the multiclass SVM in the same fashion as in Bishop's book, chapter 7.1.3.
%
% For a classification task with K classes, K separate binary SVMs are
% contructed in which the kth model yk(x) is trained using the data from
% class Ck as the positive examples and the data from ... |
github | tiagofrepereira2012/convex_opt-master | load_toy_data.m | .m | convex_opt-master/load_toy_data.m | 1,341 | utf_8 | afdc967fc1bc865d0cd33ad2b9f3335a | %%%%%%
% load_toy_data.m
%
% Generate toy dataset normal distributed as the following
%
% class_1 positives = mu=[-0.5 -0.5]; sigma=[[1.00 0.0];[0.0 1.00]];
% class_1 negatives = mu=[1.75 1.75]; sigma=[[1.00 0];[0 1.00]];
%
% class_2 positives = mu=[1.00 1.00]; sigma=[[1.00 0.0];[0.0 1.00]];
% class_2 negatives = mu=[... |
github | tiagofrepereira2012/convex_opt-master | svm_train.m | .m | convex_opt-master/svm_train.m | 1,380 | utf_8 | 9c260f7e0911fd02a84d0a075c406e07 | %%%%%%
% svm_train.m
%
% @author Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
% @date Thu 2 Jun 2016
%
% This code trains an SVM for a binary classification given a 2d data matrix
% and the labels.
% Also it plots the data with the decision boundary enhancing the support
% vectors
% ** Parameters
% data: nx2 ... |
github | MKimiSH/PixMix-inpainting-master | ourUIImage.m | .m | PixMix-inpainting-master/ourUIImage.m | 3,706 | utf_8 | ba786ffb23b1c22eb23188670375caae | function ourUIImage(image)
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
Landmarks = [];
avoidMarks = [];
Lines = [];
startFrame = imread(image);
figure, imshow(startFrame);
hold on;
select = uicontrol('String', 'select', ...
'Callback', {@tmouse, 'select'}, ...
'Position', ... |
github | MKimiSH/PixMix-inpainting-master | ourUI.m | .m | PixMix-inpainting-master/ourUI.m | 3,656 | utf_8 | da9e0bdbb25c0e065985c1ab25bd76f8 | function ourUI(video)
%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
Landmarks = [];
avoidMarks = [];
Lines = [];
v = VideoReader(video);
startFrame = readFrame(v);
imshow(startFrame);
hold on;
select = uicontrol('String', 'select', ...
'Callback', {@tmouse, 'select'}, ...
'P... |
github | MKimiSH/PixMix-inpainting-master | fillOneLevel.m | .m | PixMix-inpainting-master/unused_m_files/fillOneLevel.m | 7,136 | utf_8 | 983fc49099e0d663aeb6fe120ef4c972 | function [filledI, retf] = fillOneLevel(initf, I, M, level, useLineConstr)
% initf is initial value of the mapping f
% Use random sampling and propagation to fill the missing parts of I with
% the known pixels.
% use 8-neighbor for cost_spatial,
% use 5x5 patch for cost_apperance.
global f;
global R;
global C;
globa... |
github | MKimiSH/PixMix-inpainting-master | tooDifferent.m | .m | PixMix-inpainting-master/libs/inpaint/tooDifferent.m | 280 | utf_8 | 8517529a535a144683aa5a468bfa67b8 | function [isdiff] = tooDifferent(im1, im2)
im1 = im2uint8(im1);
im2 = im2uint8(im2);
h1 = histImage(im1);
h2 = histImage(im2);
isdiff = norm(h1-h2) > 0.005
end
function [h] = histImage(im)
h = zeros(255,1);
tot = nnz(im);
for i=1:255
h(i) = nnz(im==i);
end
h = h./tot;
end |
github | MKimiSH/PixMix-inpainting-master | linesNearMask.m | .m | PixMix-inpainting-master/libs/inpaint/linesNearMask.m | 3,895 | utf_8 | eb8aa6a7cb088b626dc3c7c9cfc959ef | function [goodsegs] = linesNearMask(I, M, lvl)
% given an image I and mask M, use Hough transformation to detect the lines
% that is near the mask rectangle.
% adjustable parameters:
% threshold in houghpeaks
% fillgap and minlength in houghlines
%
if ~ismatrix(I)
I = rgb2gray(I);
end
% Gaussian filter before H... |
github | MKimiSH/PixMix-inpainting-master | inpaintSecondFrame.m | .m | PixMix-inpainting-master/libs/inpaint/inpaintSecondFrame.m | 1,453 | utf_8 | 38e2711721e36b01d30e352fce07bff5 | function [I, M, F, C, H, OF, OFOBJ] = inpaintSecondFrame(I, lastI, lastF, lastM, lastC, OF, OFOBJ)
% Inpaint image _I_ with a refence fram _lastI_, between which there exist a
% homography _H_ which satisfies p = p1*H, p \in _I_ and p1 in _lastI_ (row vectors).
% _lastF_ is the px mapping of _lastI_, _C_ the contour p... |
github | pyushkevich/cmrep-master | vtk_polydata_read.m | .m | cmrep-master/scripts/matlab/vtk_polydata_read.m | 7,623 | utf_8 | b0639a796228d95ce503c5b903886fd5 | function p = vtk_polydata_read(file, varargin)
% Read VTK polydata into a struct
% Usage:
% p = vtk_polydata_read(file, pars)
% Parameters:
% pars.encoding One of 'ieee-le', 'ieee-be' (default)
% Return Value:
% p.hdr Header information
% p.points N x 3 array of point ... |
github | pyushkevich/cmrep-master | vtk_polydata_write.m | .m | cmrep-master/scripts/matlab/vtk_polydata_write.m | 3,205 | utf_8 | c15a980a1e3f6e25aace2844d65a34e4 | function vtk_polydata_write(file, p)
% Write polydata to a VTK file (ASCII for compatibility)
% Usage:
% vtk_polydata_write(file, p)
% open the file
fid = fopen(file,'w');
% Write the header
fprintf(fid, '# vtk DataFile Version 3.0\n');
fprintf(fid, '%s\nASCII\nDATASET POLYDATA\n', p.hdr.nam... |
github | l2ior/mocap-master | initSoft.m | .m | mocap-master/func/initSoft.m | 994 | utf_8 | 9e5960d4099b1b30a35feca002b5640d | function [S1, S2] = initSoft(s1,s2,k)
% Init by performing a k-means
% + Input
% - s1: sequence 1
% - s2: sequence 2
% - k: #clusters for pre-clustering
%
% + Output
% - S1: cluster IDs for sequence 1
% - S2: cluster IDs for sequence 2
%
% Wen-Sheng Chu (wschu@cmu.edu)
% Ref: Unsupe... |
github | l2ior/mocap-master | getLabel.m | .m | mocap-master/func/getLabel.m | 1,460 | utf_8 | 9dee5ca638d001de01494957bf5f04ea | function labels = getLabel(catname)
% get the labels for the download youtubes
% catname can be numbers in [1,10] or strings (folder names)
addpath(genpath('D:/dropbox/vcFunc'));
if isnumeric(catname)
catname = getCatname(catname);
end
labeldir = '_labels';
labelers = dir(labeldir);
labelers(1:2) = [];... |
github | l2ior/mocap-master | getTempFeat.m | .m | mocap-master/func/getTempFeat.m | 145 | utf_8 | 850d4d1ae74858eda47c359a821c228f | % compute temporal feature
function feat = getTempFeat(X)
Xobs = normalizeCol( X' )';
Xint = getIntFeat( X );
feat = [Xobs; Xint];
end |
github | l2ior/mocap-master | distEuc.m | .m | mocap-master/func/distEuc.m | 349 | utf_8 | a91abeb4fd0f9efaae79b4e90d97b931 | function D = distEuc(X, Y)
% Compute Euclidean dist between two sets X and Y
D = sqrt(distEucSq(X,Y));
end
function D = distEucSq( X, Y )
% Compute squared Euclidean dist between two sets X and Y
m = size(X,1); n = size(Y,1);
XX = sum(X.*X,2);
YY = sum(Y'.*Y',1);
D = XX(:,ones(1,n)) + Y... |
github | l2ior/mocap-master | initSoftFrm.m | .m | mocap-master/func/mocap/initSoftFrm.m | 913 | utf_8 | 0e7c5734a29e51fcffd23bb4d1ab7969 | function [S1, S2] = initSoftFrm(s1,s2,k)
% Init by performing a k-means
% + Input
% - s1: sequence 1
% - s2: sequence 2
% - k: #clusters for pre-clustering
%
% + Output
% - S1: cluster IDs for sequence 1
% - S2: cluster IDs for sequence 2
%
% Wen-Sheng Chu (wschu@cmu.edu)
% Ref: Uns... |
github | l2ior/mocap-master | getDataShot.m | .m | mocap-master/func/mocap/getDataShot.m | 837 | utf_8 | aa413bf36b3cb9192c972896abc12d32 | function [s1,s2,info1,info2] = getDataShot(type, vID1, vID2)
% Load shots into s1 and s2
% Load labels into lab1 and lab2 if they exist
switch type
case 'mocap'
vid1 = sprintf('86_%02d.mat', vID1);
vid2 = sprintf('86_%02d.mat', vID2);
[X1, info1] = loadMocap(vid1);
... |
github | zhenglab/UnderwaterImageRestoration-master | rgb2hsi.m | .m | UnderwaterImageRestoration-master/underwater image enhancement/codes/滤波方法/3种滤波方法/rgb2hsi.m | 1,485 | utf_8 | 1c2c4a76e1447dc3d7f434eac6438bda |
function hsi = rgb2hsi(rgb)
%RGB2HSI Converts an RGB image to HSI.
% HSI = RGB2HSI(RGB) converts an RGB image to HSI. The input image
% is assumed to be of size M-by-N-by-3, where the third dimension
% accounts for three image planes: red, green, and blue, in that
% order. If all RGB component images are ... |
github | zhenglab/UnderwaterImageRestoration-master | rgb2hsi.m | .m | UnderwaterImageRestoration-master/underwater image enhancement/codes/滤波方法/椒盐噪声中值、均值滤波/rgb2hsi.m | 1,485 | utf_8 | 1c2c4a76e1447dc3d7f434eac6438bda |
function hsi = rgb2hsi(rgb)
%RGB2HSI Converts an RGB image to HSI.
% HSI = RGB2HSI(RGB) converts an RGB image to HSI. The input image
% is assumed to be of size M-by-N-by-3, where the third dimension
% accounts for three image planes: red, green, and blue, in that
% order. If all RGB component images are ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.