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 | AllenBrainAtlas/SWDB-2016-master | fn_filecontrol.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_filecontrol.m | 2,297 | utf_8 | d46e36a0b26a64b03ebeb47a4d898bb4 | function hu = fn_filecontrol(varargin)
% function hu = fn_filecontrol([hu,]'property1',value1,...)
%---
% Set the properties of a regular uicontrol with style 'edit' so that
% clicking in it lets user select a file.
%
% Input
% - hu uicontrol handle
% - 'property1',value1,... pairs of property nam... |
github | AllenBrainAtlas/SWDB-2016-master | fn_axispixel.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_axispixel.m | 1,929 | utf_8 | 42ada2b9f3c86dcae7832d191e3223c1 | function fn_axispixel(ha)
% function fn_axispixel([ha])
%---
% set axes size such that there will be an integer ratio between the
% pixels in the image and on the screen display
% Thomas Deneux
% Copyright 2010-2012
% define axes handle, and possibly also image handle
if nargin==0
ho = findobj('type','... |
github | AllenBrainAtlas/SWDB-2016-master | fn_drawspline.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_drawspline.m | 3,091 | utf_8 | 83880e1772755968b7221e1946109d82 | function X = fn_drawspline(varargin)
% function X = fn_drawspline(tidx,X/[],command)
% Thomas Deneux
% Copyright 2004-2012
if nargin==0, varargin={1:10}; end
% Input
tidx = varargin{1};
nt = length(tidx);
tstart = tidx(1);
tlength = tidx(end)-tstart;
if nargin<2 || isempty(varargin{2});
X = tidx;
np = 2;
... |
github | AllenBrainAtlas/SWDB-2016-master | fn_readxml.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_readxml.m | 2,985 | utf_8 | 746391a3697a2ba1acc3747de1ef884e | function s = fn_readxml(fname,version)
% function s = fn_readxml(fname[,version])
%---
% This function is a wrapper for function xml_read.m downloaded on Matlab
% File Exchange.
% Additionally, the structure is slightly simplified.
%
% Input:
% - fname file name
% - version 'xml_read' to use MatlabExchange Ja... |
github | AllenBrainAtlas/SWDB-2016-master | fn_figureletter.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_figureletter.m | 941 | utf_8 | 3e7d2cddac90b1d37c1e96a4052c6785 | function ha = fn_figureletter(varargin)
% function ha = fn_figureletter([ha,]letters)
if nargin==0, help fn_figureletter, return, end
% Input
ha = [];
for k=1:nargin
a = varargin{k};
if ischar(a)
letters = a;
else
ha = a;
end
end
% prepare
n = length(letters);
if isempty(ha)
ha = ... |
github | AllenBrainAtlas/SWDB-2016-master | fn_slider.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_slider.m | 29,157 | utf_8 | f47ba25bde20589c3ab83cd1691d7454 | classdef fn_slider < hgsetget
% function fn_slider([hp,][properties])
%---
% Slider
%
% Detail on some properties:
% - mode 'point' [default], 'area' or 'area+point'
% - layout 'auto' [default], 'left', 'right', 'up' or 'down'
% - scrollwheel 'off' [default], 'on' or 'default'
... |
github | AllenBrainAtlas/SWDB-2016-master | montage.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/montage.m | 21,116 | utf_8 | af39ae2af1b57a70d6dd7d51a2799c14 | classdef montage < interface
properties
im = immodel('empty');
X
context
showmarks = true;
end
methods
function M = montage(fname)
hf = figure('name','montage','integerhandle','off');
M = M@interface(hf,'Montage');
... |
github | AllenBrainAtlas/SWDB-2016-master | fn_cd.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_cd.m | 8,309 | utf_8 | 2a67529afabfb2e8760ad1c611256cbd | function repout = fn_cd(flag,varargin)
% function rep = fn_cd(flag,relpath)
% function fn_cd('edit')
% function fn_cd('list')
%---
% This function allows user to rapidly change the current directory or get
% the full path to some files.
%
% - Type 'fn_cd edit' to launch a GUI interface that enables you to defi... |
github | AllenBrainAtlas/SWDB-2016-master | memorypoolitem.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/memorypoolitem.m | 3,334 | utf_8 | 1df36373dc6bccb232769dd9c52072c1 | classdef memorypoolitem < handle
properties
data
memsize
description
weight
rank
end
properties (Access='private')
pool
end
% Single item manipulations
methods
function item = memorypoolitem(pool,data,description,weight)
... |
github | AllenBrainAtlas/SWDB-2016-master | fn_imageop.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_imageop.m | 1,554 | utf_8 | a41d07f5dfabb61b36fc8a51281ba0aa | function x = fn_imageop(x,par)
% function a = fn_imageop(a[,par])
% function par = fn_imageop('par')
%---
% Apply a series of transformations to an image
%
% Input/Output:
% - a 2D (or more) array - image (or movie, ...) to be modified
% - par structure - parameter of operations to apply; fields are:
% ... |
github | AllenBrainAtlas/SWDB-2016-master | fn_4Dview.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_4Dview.m | 76,344 | UNKNOWN | 17b6d52771f357afefe342926ea26440 | function varargout = fn_4Dview(varargin)
% function fn_4Dview(option1,optionArgs1,...)
% function varargout = fn_4Dview(action,actionArgs)
%---
% displays spatial or temporal slices of multi-dimensional data
% by default: data is considered to be 3D, 4D or 5D (dimensions ordered as
% x-y-z-t-m) and is displayed a... |
github | AllenBrainAtlas/SWDB-2016-master | fn_savefig.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_savefig.m | 14,480 | utf_8 | 5adeda7e6c54cf81e997a2eb2221e2af | function fn_savefig(varargin)
% function fn_savig([hf][,fname][,options...])
%---
% Save an image of one or several figure(s). Large number of options
% are available.
% If function is called with no argument, or only with hf, an interface is
% displayed that lets user choose the saving options.
%
% Input:
%... |
github | AllenBrainAtlas/SWDB-2016-master | fn_deletefcn.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_deletefcn.m | 1,184 | utf_8 | 47df2beb5440929bbdd8e59160eff1f9 | function fn_deletefcn(hu,deletefcn)
% function fn_deletefcn(hu,deletefcn)
%---
% Set the 'DeleteFcn' property of a graphic object in such a way that
% several functions can be executed upon its deletion.
if ishandle(hu)
if isappdata(hu,'fn_deletefcn')
funset = getappdata(hu,'fn_deletefcn');
else
... |
github | AllenBrainAtlas/SWDB-2016-master | fn_poly2mask.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_poly2mask.m | 2,704 | utf_8 | 9b6a982af2c036b9f7fe6d7520b5fb61 | function mask = fn_poly2mask(xpoly,ypoly,m,n)
% function mask = fn_poly2mask(xpoly,ypoly,m,n)
% function mask = fn_poly2mask(poly,sizes)
%---
% Do the same as Matlab poly2mask without needing the Image Toolbox
% Except use different convention!! I.e. x = first coordinate, y = second
% coordinate.
% input
swit... |
github | AllenBrainAtlas/SWDB-2016-master | fn_watch.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_watch.m | 858 | utf_8 | 6c83e333bf09677d504881c4f9673531 | function fn_watch(hf,flag)
% function fn_watch(hf[,'startnow|start|stop'])
% Thomas Deneux
% Copyright 2012-2012
if nargin<2, flag = 'startnow'; end
switch flag
case {'startnow' 'on'}
setappdata(hf,'fn_watch','busy')
startwatch(hf)
case 'start'
if isappdata(hf,'fn_watch'), return, end... |
github | AllenBrainAtlas/SWDB-2016-master | fn_structedit.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_structedit.m | 1,116 | utf_8 | 98fcbd60d1d48afb72c3d72227e5f41a | function s = fn_structedit(s,varargin)
% function s = fn_structedit(s[,spec][,hp][,other fn_control arguments...])
% function s = fn_structedit(fieldname1,value1,fieldname2,value2,...)
%---
% allow user to interactively modify a structure, and returns the modified
% structure; returns an empty array if the figure is cl... |
github | AllenBrainAtlas/SWDB-2016-master | fn_menu.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_menu.m | 3,668 | utf_8 | 052510155c3cfda9b8d2c8c52ee08cb3 | function varargout = fn_menu(varargin)
% function m = fn_menu([fig,]'h'|'v',title,width,height,'FramePropertyName',FramePropertyValue,...)
% function u = fn_menu(m,'UIControlPropertyName',UIControlPropertyValue,...)
% function [m u] = fn_menu([menu options],'add',[first control options],'add',[second control options],.... |
github | AllenBrainAtlas/SWDB-2016-master | fn_spectrogram.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_spectrogram.m | 4,323 | utf_8 | 6c4325e87a6ec070e4317240dcbdd806 | function [y freqs yticklog yticklabel] = fn_spectrogram(x,dt,varargin)
% function [y freqs yticklog yticklabel] = fn_spectrogram(x,dt[,freqscaling][,freqs])
% function fn_spectrogram(['display',]y,dt|tt,freqs,yticklog,yticklabel[,freqscaling][,clip])
%---
% This is a wrapper of Matlab Wavelet Toolbox 'cwtft' function t... |
github | AllenBrainAtlas/SWDB-2016-master | fn_coordinates.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_coordinates.m | 4,959 | utf_8 | 798a1629a26b0abf136840e607f66e4d | function varargout = fn_coordinates(varargin)
% function [orig scale] = fn_coordinates([handle,]refchangetag)
% function x2 = fn_coordinates([handle,]refchangetag,x1,'position')
% function v2 = fn_coordinates([handle,]refchangetag,v1,'vector')
%---
% Change coordinates between screen (pixels), figure, axes
% The "refer... |
github | AllenBrainAtlas/SWDB-2016-master | fn_registernd.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_registernd.m | 6,041 | utf_8 | 59d99f7615dcdc8ff8552a34617d28cb | function [mov check] = fn_registernd(ref,test,sigma,hp)
% function [mov check] = fn_registernd(ref,test,sigma,hp)
%---
% register z-stack test to the z-stack ref and returns the distance to move
% in pixels
%
% Input:
% - ref ND array
% - test ND array, sizes smaller than ref
% - sigma nrep*ndim a... |
github | AllenBrainAtlas/SWDB-2016-master | spk_calibration.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/spk_calibration.m | 8,835 | utf_8 | 466e895378f7f7a88aa1c79ce694eb7b | function [pest fit drift rcalcium] = spk_calibration(spikes,F,varargin)
% function [pest fit drift rcalcium] = spk_calibration(spikes,F,pcal|dt[,other parameters])
% function pcal = spk_calibration('par'[,dt][,'drift|trend'][,other parameters])
% function [pest fit drift] = spk_calibration(spikes,F,pcal,pest) % no esti... |
github | AllenBrainAtlas/SWDB-2016-master | fn_framedesign.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_framedesign.m | 12,024 | utf_8 | 2adc337d216a1c31b9b79748fbe1fc3b | function [pos cmd] = fn_framedesign(grob,pos,resetflag)
% function [pos cmd] = fn_framedesign([grob[,pos|cmd[,resetflag]]])
%---
% utility for positioning frames in a figure
%
% Input:
% - grob structure with fields the names of graphic objects
% considered and values their handles; their must be o... |
github | AllenBrainAtlas/SWDB-2016-master | fn_mouse.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_mouse.m | 16,606 | UNKNOWN | fbcceab8d1bfc7a483670251e4282860 | function varargout = fn_mouse(varargin)
% function poly = fn_mouse([axes handle],'point|cross|poly|free|ellipse'[,msg])
% function [x y] = fn_mouse([axes handle],'point|cross'[,msg])
% function rect = fn_mouse([axes handle],'rect'[,msg])
% function [center axis e] = fn_mouse([axes handle],'ellipse'[,msg])
% functi... |
github | AllenBrainAtlas/SWDB-2016-master | spk_autosigma.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/spk_autosigma.m | 3,557 | utf_8 | 5853dc0f96ba078612084742d77ffae4 | function varargout = spk_autosigma(varargin)
% function psig = spk_autosigma('par'[,presetflag])
% function sigmaest = spk_autosigma(calcium,dt[,psig|presetflag])
%---
% Estimation of the level of noise in the calcium signal.
%
% Input:
% - calcium numerical vector or cell array thereof - calcium signal(s)
% - dt ... |
github | AllenBrainAtlas/SWDB-2016-master | fn_controlpositions.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_controlpositions.m | 3,686 | utf_8 | d586d0a018a18cca4fc9eeb30d7aa995 | function fn_controlpositions(hu,hp,posrel,pospix)
% function fn_controlpositions(hu,hp,posrel,pospix)
%---
% set the position of controls relatively to an axes, and set the
% appropriate listeners to automatically update those positions in case of
% change of figure position, etc...
%
% Input
% - hu control handle... |
github | AllenBrainAtlas/SWDB-2016-master | fn_getline.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_getline.m | 12,787 | UNKNOWN | 36e8b9f56f7a1797c9f1796ffa7bea55 | function varargout = fn_getline(varargin)
% function varargout = fn_getline([ha])
% modifications de getline
% - on suppose qu'on a d�j� cliqu� une fois dans la fenetre
% - si la s�lection ne commence pas par un d�placement bouton enfonc�, on
% retourne seulement un point
% Callback syntaxes:
% fn... |
github | AllenBrainAtlas/SWDB-2016-master | interface.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/interface.m | 13,315 | utf_8 | 1d3fd248c02815ba15cff1fd8c25d498 | classdef interface < hgsetget
% Interface class provide utilities for designing a graphic interface,
% such as allowing the user to resize the graphical elements, loading
% and auto-saving program options, etc..
%
% Notes:
% - to make a new interface, define a new class having interface as a
... |
github | AllenBrainAtlas/SWDB-2016-master | fn_sliderenhance.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_sliderenhance.m | 1,999 | utf_8 | 2ccc0e7edcbe528076b7c7052a43423b | function fn_sliderenhance(hu,varargin)
% function fn_sliderenhance(sliderhandle)
%---
% allows a slider uicontrol to evaluate its callback during scrolling
% (instead of only at the moment that the mouse if released)
% just call 'fn_sliderenhance(sliderhandle)' once
%
% notes:
% - the function sets a 'WindowButtonDown... |
github | AllenBrainAtlas/SWDB-2016-master | fn_buttonmotion.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_buttonmotion.m | 5,166 | utf_8 | 074d22ae6920ba7d2f0585991275c4f9 | function varargout = fn_buttonmotion(fun,varargin)
% function varargout = fn_buttonmotion(fun[,hf][,'doup'][,'pointer',pointer])
% function fn_buttonmotion('demo')
%---
% utility for executing a task while mouse button is pressed
%
% See also fn_moveobject
% Thomas Deneux
% Copyright 2007-2012
% Note on the implemen... |
github | AllenBrainAtlas/SWDB-2016-master | spk_autocalibration.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/spk_autocalibration.m | 24,891 | utf_8 | 7ae237af818c1cffe6b8259e4ec8b282 | function varargout = spk_autocalibration(varargin)
% function [tau amp sigma events] = spk_autocalibration(calcium,dt|pax)
% function [sigma] = spk_autocalibration(calcium,dt|pax,'sigmaonly')
% function pax = spk_autocalibration('par',dt,other parameters...)
%---
%
% Input:
% - calcium calcium signals (can be the ... |
github | AllenBrainAtlas/SWDB-2016-master | fn_moveobject.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_moveobject.m | 4,382 | utf_8 | 57ea856c91a148777bfaf33bc80b72e7 | function dp = fn_moveobject(hobj,varargin)
% function dp = fn_moveobject(hobj[,'latch'][,'point',i])
% function dp = fn_moveobject(hobj,vector)
%---
% moves objects while mouse button is pressed
% the second syntax moves the object by a fixed vector
%
% Options
% - 'latch' when button is released, brings objects b... |
github | AllenBrainAtlas/SWDB-2016-master | fn_readxmllabview.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_readxmllabview.m | 1,699 | utf_8 | 23197b351ab263dcd709a9f1286bcfe9 | function x = fn_readxmllabview(fname)
% function x = fn_readxmllabview(fname)
% Thomas Deneux
% Copyright 2008-2012
if nargin==0
fname = fn_getfile('*.xml');
end
Pref = struct('Str2Num',false);
s = fn_readxml(fname,Pref);
if isfield(s,'Version') % this is the normal case
s = rmfield(s,{'Version','ATTRIBU... |
github | AllenBrainAtlas/SWDB-2016-master | fn_control.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_control.m | 59,854 | utf_8 | 28a15c19556bf11adf44931398d84fc5 | classdef fn_control < hgsetget
% function X = fn_control(s[,fun][,spec][,hparent] ...
% [,'okbutton|nobutton'][,'ncol',n][,'title',titl])
% function fn_control('demo')
%---
% cluster of controls representing the structure s (changing the
% control changes the values in X, and changing the valu... |
github | AllenBrainAtlas/SWDB-2016-master | fn_imvalue.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_imvalue.m | 19,299 | UNKNOWN | 9acf30992e243a54af60a0677f31cfb7 | function fn_imvalue(varargin)
% fn_imvalue [image] [xy|xonly]
% fn_imvalue clean
% fn_imvalue end
% fn_imvalue('chgx'|'chgy'|'chgxy',newax[,ha])
% fn_imvalue('register'[,ha][,command])
% fn_imvalue('unregister'[,ha])
% fn_imvalue demo
%---
% Link images with same dimensions via a crosshair pointer, prints
% v... |
github | AllenBrainAtlas/SWDB-2016-master | fn_fit.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_fit.m | 1,422 | utf_8 | 3406bd3f7ee8741077b2a9c436d2dc7e | function varargout = fn_fit(x,y,fun,startpoint)
% function [par1 ... parN yfit] = fn_fit(x,y,@(x,par1,..,parN)fun,startpoint)
% function [a b yfit] = fn_fit(x,y,'affine')
% Thomas Deneux
% Copyright 2008-2012
if nargin==0, help fn_fit, return, end
if ~any(size(x)==1), error('x must be a vector'), end
x = x(:);
nx ... |
github | AllenBrainAtlas/SWDB-2016-master | fn_listedit.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_listedit.m | 5,824 | utf_8 | a755e8c4731ecd48a2d76a60dd19dfa6 | function indices = fn_listedit(varargin)
% function indices = fn_listedit(A[,B...][,indices])
%---
% Manually select and reorder items in one or multiple lists (in the case
% of multiple lists, the item are aligned in a single table).
%
% Input:
% - A,B,... numerical or cell array - a list
%
% Output:
%... |
github | AllenBrainAtlas/SWDB-2016-master | fn_structdisp.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_structdisp.m | 2,377 | utf_8 | ac1bcc692cff9ff05141fe2ffb900dcb | function fn_structdisp(Xname)
% function fn_structdisp Xname
% function fn_structdisp(X)
%---
% Recursively display the content of a structure and its sub-structures
%
% Input:
% - Xname/X one can give as argument either the structure to display or
% or a string (the name in the current workspace of t... |
github | AllenBrainAtlas/SWDB-2016-master | spk_distance.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/spk_distance.m | 8,385 | utf_8 | cba2b0085a6f32bde9fb319314130c54 | function varargout = spk_distance(varargin)
% function [d desc] = spk_distance(tli,tlj[,cost])
% function [misses falsep] = spk_distance(tli,tlj[,cost],'basic')
% function cost = spk_distance('par')
%---
% Compute a distance and a more lengthy description of the differences
% between two spike trains.
%
% Input:
% - tl... |
github | AllenBrainAtlas/SWDB-2016-master | spk_calcium.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/spk_calcium.m | 7,833 | utf_8 | fb71d81ed9c50c71e08cd5176cdf70ea | function varargout = spk_calcium(varargin)
% function [F F0 drift] = spk_calcium(spikes,par|dt+other parameters)
% function par = spk_calcium('par'[,'3exps'][,dt[,T]][,other parameters])
%---
%
% Input:
% - spikes vector, array or cell array - spike times or spike counts
% - dt frame acquisition time
% - T ... |
github | AllenBrainAtlas/SWDB-2016-master | fn_errorbar.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_errorbar.m | 6,283 | utf_8 | 73704a664bea98fc0519affa6c7f2f71 | function hl = fn_errorbar(varargin)
% function hl = fn_errorbar([x,]y,ey[,flag],line options)
% function hl = fn_errorbar([x,]yy[,flag],line options)
% function hl = fn_errorbar(x,ex,y,ey,'xerror',line options)
% function hl = fn_errorbar(xx,yy,'xerror',line options)
%---
% ym and ystd can be vectors or arrays
% if e i... |
github | AllenBrainAtlas/SWDB-2016-master | fn_email.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_email.m | 5,070 | utf_8 | 13f423513ef037fa84167bfa309847c3 | function m = fn_email(flag)
% function fn_email
% function fn_email('setserver')
%--------------
% sends an email !!
% prompts for recipient, title, attachments and text
% Thomas Deneux
% Copyright 2004-2012
if nargin==1
if ~strcmp(flag,'setserver'), error argument, end
setserver
return
end... |
github | AllenBrainAtlas/SWDB-2016-master | pixelposwatcher.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/pixelposwatcher.m | 4,041 | utf_8 | c186d46e1b286a4326285a98d164ac95 | classdef pixelposwatcher < handle
% A 'pixel position watcher' object
%
% This object becomes quite useless in R2014b, but we keep it for
% compatibility reason.
% See also: fn_pixelposlistener, fn_pixelsizelistener, fn_pixelpos, fn_pixelsize
properties (SetAccess='private')
pixelpos... |
github | AllenBrainAtlas/SWDB-2016-master | fn_userconfig.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_userconfig.m | 2,037 | utf_8 | 81bf7e2db967b3615bb863304cb090f9 | function varargout = fn_userconfig(flag,varargin)
% function [var1 var2 var3...] = fn_userconfig(flag)
% function fn_userconfig(flag,var1,var2,var3...)
% function name = fn_userconfig('configfolder|codefolder'[,filename])
%---
% Save or load variables in/from the file
% [prefdir '/interface_options/' flag '.mat']
% F... |
github | AllenBrainAtlas/SWDB-2016-master | fn_xregister.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_xregister.m | 2,740 | utf_8 | 0a38e2d226b030609c6ad7acd88379aa | function d = fn_xregister(a,b,maxshift)
% function d = fn_xregister(a,b,maxshift)
%---
% register images a and b using cross-correlation
% based on the Matlab code for normxcorr2, and normalization is improved
% when a is not inside b
%
% Input:
% - a,b images to register
% - maxshift value between 0 ... |
github | AllenBrainAtlas/SWDB-2016-master | fn_figmenu.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_figmenu.m | 8,369 | utf_8 | f50cf1d15be2344731cc46380bd7851f | function fn_figmenu(hf,varargin)
% function fn_figmenu
% function fn_figmenu(hf)
%---
% adds a custom menu to figure
%
% Note that function fn_figmenu makes use of fn_cd, and in order to be
% able to use it to save figures in the predefined directory 'capture',
% you should use 'fn_cd edit' to define where is this dire... |
github | AllenBrainAtlas/SWDB-2016-master | tps_mlspikes.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/tps_mlspikes.m | 61,947 | utf_8 | 423414101e3300d04433435aca7904e4 | function varargout = tps_mlspikes(varargin)
% function [n Ffit par LL xest|PP drift] = tps_mlspikes(F,par|dt[,other parameters]) = estimate spikes from calcium fluorescence
% function Fpred = tps_mlspike(n,par); = predict calcium from spikes
% function par = tps_mlspike('par'[,dt][,other paramete... |
github | AllenBrainAtlas/SWDB-2016-master | fn_eegdisplay.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/fn_eegdisplay.m | 5,983 | utf_8 | 32d2fc1ba5d549ee60b4938aad088b82 | function fn_eegdisplay(xidx,yrange,eeg)
% function fn_eegdisplay([xidx,yrange,]eeg)
%---
% (old) display of 2D data, with possibility to toggle between image or
% multi-curves displays
%
% See also fn_eegplot
% Thomas Deneux
% Copyright 2005-2012
if nargin==0, help fn_eegdislay, end
if nargin<3
eeg = xidx;
... |
github | AllenBrainAtlas/SWDB-2016-master | xml_write.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/private/xml_write.m | 14,110 | utf_8 | 2a354c0e54bf3fdfcc45fefe182df91f | function DOMnode = xml_write(filename, tree, RootName, Pref)
%XML_WRITE Writes Matlab data structures to XML file
%
% DESCRIPTION
% xml_write( filename, tree) Converts Matlab data structure 'tree' containing
% cells, structs, numbers and strings to Document Object Model (DOM) node
% tree, then saves it to XML f... |
github | AllenBrainAtlas/SWDB-2016-master | xml_read.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/private/xml_read.m | 16,286 | utf_8 | 66f153a64e9bf944a51cabf242a4e42f | function [tree, RootName, DOMnode] = xml_read(xmlfile, Pref)
%XML_READ reads xml files and converts them into Matlab's struct tree.
%
% DESCRIPTION
% tree = xml_read(xmlfile) reads 'xmlfile' into data structure 'tree'
%
% tree = xml_read(xmlfile, Pref) reads 'xmlfile' into data structure 'tree'
% according to y... |
github | AllenBrainAtlas/SWDB-2016-master | ps2pdf.m | .m | SWDB-2016-master/Projects/Reza_Code/anatoly_code/cux2_l4_275/private/ps2pdf.m | 17,503 | utf_8 | 160fe61bd1654351149d04ee8c37c1f0 | function ps2pdf(varargin)
%PS2PDF Function to convert a PostScript file to PDF using Ghostscript
%
% Converts a postscript file into PDF. The resulting PDF file will contain
% one page for each page defined in the postscript files, so a multi-page
% postscript file, like those generated by using the '-append' o... |
github | nemo8130/FusionImaging_mfm-master | objectdetect.m | .m | FusionImaging_mfm-master/objectdetect.m | 40,656 | utf_8 | 9b67af98dbee7ccff78da013a37498ac | function [objN objco Igrm AgN0 els2 perim sED2 dmaxO sSOL2 subimg Graygrain_whole_selected] = OBJECTDETECT(file,glevel,rK,Aco);
%% OBJECTDETECT: A program to detect objects from a Force-Microscopy Image
% And filter objects based on the set of criteria enlisted below
%
% 1. Thresholding: A certain 'level' is used to se... |
github | nemo8130/FusionImaging_mfm-master | scaleIntenMM.m | .m | FusionImaging_mfm-master/scaleIntenMM.m | 2,256 | utf_8 | af343d0cf2e0c8432a12bf9742baac46 |
function [I1sc]=scaleIntenMM(file)
%file='aptes_010_obj.tif.obj';
datmm='Min_Max_Table_example_phase_data.format.2';
[MinV,MaxV] = returnMinMax(file,datmm);
fprintf('%s %f %s %f\n','MinV:',MinV,'MaxV:',MaxV)
dtall=importdata(file);
dt=dtall.data;
I1=dt(:,4);
Iscale = ((MaxV-MinV)/255);
fprintf('%s %s %d %s %d\n'... |
github | nemo8130/FusionImaging_mfm-master | runcalNN_draw.m | .m | FusionImaging_mfm-master/runcalNN_draw.m | 4,574 | utf_8 | a869240aed7ae4fb19fd98b9155ab5df | % Draw corresponding objects from a pairwise Nearest-Neighbor Algo and
% replicate it for all images
% listfile='aptes_newMM.list';
% USAGE: runcalNN_draw('aptes_newMM.list')
%
function runcalNN_draw(listfile)
load aptes_refdat.mat;
list=importdata(listfile);
file1=list(1,:);
f1=importdata(char(file1));
iitarg = [1:... |
github | nemo8130/FusionImaging_mfm-master | runcalNNnew_oneIm_minmax.m | .m | FusionImaging_mfm-master/runcalNNnew_oneIm_minmax.m | 14,796 | utf_8 | 9d877b9bc38bab8ce4f07fbdf788e562 | % runcalNNnew_oneIm_minmax: Program to plot Intensity vs. Lift-height for a given
% sample (MFM). For example: APTES;
% This program is to be run after running objectdetect.m on all lift-height
% MFM images for a given sample (e.g., APTES)
% The inputs to this program are the outputs generated by o... |
github | nemo8130/FusionImaging_mfm-master | FusionImaging_mfm.m | .m | FusionImaging_mfm-master/FusionImaging_mfm.m | 13,210 | utf_8 | 9492f4614537a381ae437d714c366d76 | % FusionImaging_mfm is a MATLAB code for processing and analyses of Images
% generated from Magnetic Force Microscopy (MFM)
% The code was compiled in MATLAB Version: 9.0.0.341360 (R2016a)
% Users are recommended to use this or higher version with the
% 'Image Processing Toolbox' installed.
%
% The software converg... |
github | mallochio/neuroCredit-master | nearestneighbour.m | .m | neuroCredit-master/data/nearestneighbour.m | 14,158 | utf_8 | 8733ae554d1b0be16af34656a10b5d02 | function [idx, tri] = nearestneighbour(varargin)
%NEARESTNEIGHBOUR find nearest neighbours
% IDX = NEARESTNEIGHBOUR(X) finds the nearest neighbour by Euclidean
% distance to each point (column) in X from X. X is a matrix with points
% as columns. IDX is a vector of indices into X, such that X(:, IDX) are
... |
github | mallochio/neuroCredit-master | optimizeVariance.m | .m | neuroCredit-master/src/pca+clustering/InvPow_SparsePCA_V2_0/optimizeVariance.m | 1,063 | utf_8 | 60878ea4ccd260fd8d335e35d2a74823 | % Finds the optimal variance for a given sparsity pattern ind
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Cop... |
github | mallochio/neuroCredit-master | computeTradeOffCurve.m | .m | neuroCredit-master/src/pca+clustering/InvPow_SparsePCA_V2_0/computeTradeOffCurve.m | 12,950 | utf_8 | 744298d6100a6848acd905ec484e6f5c | % Computes the sparse PCA components using the nonlinear inverse power
% method (NIPM), as described in the paper
%
% M. Hein and T. Buehler
% An Inverse Power Method for Nonlinear Eigenproblems with Applications
% in 1-Spectral Clustering and Sparse PCA
% In Advances in Neural Information Processing Systems 23 ... |
github | mallochio/neuroCredit-master | invPow.m | .m | neuroCredit-master/src/pca+clustering/InvPow_SparsePCA_V2_0/invPow.m | 1,831 | utf_8 | 0eb8aca2330eef2de65c36d097a3d6d9 | % Performs one run of the inverse power method for sparse PCA as
% described in the paper
%
% M. Hein and T. Buehler
% An Inverse Power Method for Nonlinear Eigenproblems with Applications in 1-Spectral Clustering and Sparse PCA
% In Advances in Neural Information Processing Systems 23 (NIPS 2010)
% Available onl... |
github | mallochio/neuroCredit-master | adjustedVariance.m | .m | neuroCredit-master/src/pca+clustering/InvPow_SparsePCA_V2_0/adjustedVariance.m | 744 | utf_8 | 0bc53e1f2b6310ccb2124b7f81c3fa55 | % Computes the (cumulative) adjusted variance via QR decomposition
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
%... |
github | usc-mrel/DCE_direct_recon-master | genRGA.m | .m | DCE_direct_recon-master/genRGA.m | 13,151 | utf_8 | db9f9b1cf95f5cb6e062231e3e7dde9f | function [petable, kspace] = genRGA(FOVy, FOVz, ky, kz, totlength, flag_option, precontrast, splitN, randprob, pertangle, hdRESy, period, randseed, pertseed, initangle)
% [petable, kspace] = genRGA(FOVy, FOVz, ky, kz, totlength, flag_option, precontrast, splitN, randprob, pertangle, hdRESy, period, randseed, pertseed,... |
github | usc-mrel/DCE_direct_recon-master | WolfeLineSearch.m | .m | DCE_direct_recon-master/minFunc_2012/minFunc/WolfeLineSearch.m | 10,590 | utf_8 | f962bc5ae0a1e9f80202a9aaab106dab | function [t,f_new,g_new,funEvals,H] = WolfeLineSearch(...
x,t,d,f,g,gtd,c1,c2,LS_interp,LS_multi,maxLS,progTol,debug,doPlot,saveHessianComp,funObj,varargin)
%
% Bracketing Line Search to Satisfy Wolfe Conditions
%
% Inputs:
% x: starting location
% t: initial step size
% d: descent direction
% f: function v... |
github | usc-mrel/DCE_direct_recon-master | minFunc_processInputOptions.m | .m | DCE_direct_recon-master/minFunc_2012/minFunc/minFunc_processInputOptions.m | 3,936 | utf_8 | 167c0b9848cba950f05d4efec5667d66 |
function [verbose,verboseI,debug,doPlot,maxFunEvals,maxIter,optTol,progTol,method,...
corrections,c1,c2,LS_init,cgSolve,qnUpdate,cgUpdate,initialHessType,...
HessianModify,Fref,useComplex,numDiff,LS_saveHessianComp,...
Damped,HvFunc,bbType,cycle,...
HessianIter,outputFcn,useMex,useNegCurv,precFunc,...
... |
github | yjq8812/efficientSegmentation-master | GeneralClassifier_SOSVM.m | .m | efficientSegmentation-master/GeneralClassifier_SOSVM.m | 6,927 | utf_8 | 2201c6ebc87860c7882e76d4787b2763 | function [model,sparm,state,iteration] = GeneralClassifier_SOSVM(sparm, oldstate)
global numIterations
state = bundler(); % initialize state
state.lambda = 1 ./ (sparm.C);
if (~isfield(sparm,'convergenceThreshold'))
sparm.convergenceThreshold = 0.008;
end
maxIterations = 1000;
sparm.w = zeros(sparm.sizePsi,1);... |
github | yjq8812/efficientSegmentation-master | bundler.m | .m | efficientSegmentation-master/bundler.m | 3,663 | utf_8 | 2ba1475f4843ca43341cd405c2af93f5 | % BUNDLER
%
% Solves the problem
%
% min_{w,xi} lambda/2 |w|^2 + xi, xi >= b_t - <a_t, w> for t = 1, ..., T
%
% Optionally, it also enforces additional hard constraints
%
% <a_p,w> >= b_p, p = 1, ..., P
%
% The algorithm uses the dual to do so. Introducing Lagrange
% multipliers alpha_i, beta_j:
%
% ... |
github | yjq8812/efficientSegmentation-master | implement_SOSVM_Learning.m | .m | efficientSegmentation-master/implement_SOSVM_Learning.m | 12,860 | utf_8 | d09a037f2e907a44b9d0351a33898dc9 | function [w, model,iteration,parm]=implement_SOSVM_Learning(Xtrain,Ytrain,C,ifuseDD,ifuseADMM,ADMMrho,setfn)
if ~exist('setfn','var')
setfn.type = 'modular';
setfn.function = @lossFunction;
setfn.falsevalue = [1 1];
end
% ------------------- data property ----------------------------%
parm.patterns = Xtr... |
github | yjq8812/efficientSegmentation-master | violateLossADMM.m | .m | efficientSegmentation-master/violateLossADMM.m | 8,644 | utf_8 | e2f8beb7eee86c2f44436ab5a05bab6c | function ybar = violateLossADMM(param,lossFn,model,x,y,y_a,y_b_old,rho,u)
% Function Callback by VIOLATEMARGINADMM.m
% problem: argmin_ybar -\Delta(y,ybar) + rho/2*norm(y_a-ybar+u)^2
% via a method depends on the submodularity of the loss
% with y: groundtruth
% y_a: fixed
m = size(x.features,1);
n = size(x.featu... |
github | yjq8812/efficientSegmentation-master | sfo_pspiel_get_path.m | .m | efficientSegmentation-master/sfo/sfo_pspiel_get_path.m | 6,326 | utf_8 | c2e26be6e29fed2233a871af637d30cf | % Andreas Krause (krausea@gmail.com)
% pSPIEL Helper function: Convert tree into tour using the spanning
% tree heuristics (2 approx). Allows visiting the same node twice
% Based on implementation by Amarjeet Singh
%
% function [tour, E, cost] = sfo_pspiel_get_path(A,D)
% A: set of nodes
% D: distance matrix (A indice... |
github | yjq8812/efficientSegmentation-master | sfo_mi_cluster.m | .m | efficientSegmentation-master/sfo/sfo_mi_cluster.m | 1,023 | utf_8 | 8bf6497159e3347b1c4de7cb94d71a46 | % Example program for clustering using mutual information
% Author: Andreas Krause (krausea@gmail.com)
%
% Greedily picks k "most informative" representatives
% Then finds the mutual information mincuts separating the cluster centers
% returns the partition P into clusters, and centers Agreedy
%
% function [P,Agreedy]=... |
github | yjq8812/efficientSegmentation-master | sfo_dist.m | .m | efficientSegmentation-master/sfo/sfo_dist.m | 450 | utf_8 | 8d03bd90783d6eebcdd11ac64a21a381 | % Andreas Krause (krausea@gmail.com)
% Compute Euclidean distances between a set of vectors
%
% function D = sfo_dist(coords)
% coords: N x D matrix of points (each of the N rows is a vector)
% returns an N x N matrix of Euclidean distances
%
% Example: coords = rand(10,2); D = sfo_dist(coords)
function D = sfo_dist(c... |
github | yjq8812/efficientSegmentation-master | sfo_charvector.m | .m | efficientSegmentation-master/sfo/sfo_charvector.m | 255 | utf_8 | b5143dfb79c6fb1cfd33a266ea111434 | % returns characteristic vector of A
% Author: Andreas Krause (krausea@gmail.com)
%
% function w = sfo_charvector(V,A)
% V: index set
% A: subset of V
%
% Example: sfo_charvector([2,1,4],[4,2])=[1 0 1]
function w = sfo_charvector(V,A)
w = ismember(V,A);
|
github | yjq8812/efficientSegmentation-master | sfo_greedy_lazy.m | .m | efficientSegmentation-master/sfo/sfo_greedy_lazy.m | 2,665 | utf_8 | 29c9443951b77f1995c8695d258ff7bb | % Andreas Krause (krausea@gmail.com)
% compute the greedy subset selection using lazy evaluations
%
% function [sset,scores,evalNum] = sfo_greedy_lazy(F,V,B,opt)
% F: submodular function
% V: index set
% B: budget
% opt: optional parameter struct, with following entries:
%
% cost: Cost vector (optional). i-th element... |
github | yjq8812/efficientSegmentation-master | sfo_octavize.m | .m | efficientSegmentation-master/sfo/sfo_octavize.m | 373 | utf_8 | 62a5dd4788c6b62a0c6fb0cf3c627897 | % Helper function that makes an sfo_fn_* object Octave ready
% This is required since Octave handles function objects differently
%
% Author: Andreas Krause (krausea@gmail.com)
%
% function F = sfo_octavize(F_input)
% F_input: sfo_fn_* function object
%
% Example: F = sfo_octavize(sfo_fn_example);
%
function F = sfo_oc... |
github | yjq8812/efficientSegmentation-master | sfo_inv_downdate.m | .m | efficientSegmentation-master/sfo/sfo_inv_downdate.m | 525 | utf_8 | f718b9ffb4b88c75c0310ee7bea03e4b | % Andreas Krause (krausea@gmail.com)
% Updates a precision matrix by removing a variable
% Based on implementation by Ram Rajagopal
%
% function precNew = sfo_inv_downdate(prec,k)
% prec: old precision (inverse covariance) matrix
% k: index of variable (column) to be removed
%
% Example: See use in @sfo_fn_mi
function... |
github | yjq8812/efficientSegmentation-master | sfo_celf.m | .m | efficientSegmentation-master/sfo/sfo_celf.m | 1,163 | utf_8 | d69caec1f96acb3230994c0fb9690c9d | % The CELF algorithm from Leskovec et al, KDD '07
% Author: Andreas Krause (krausea@gmail.com)
% It performs cost benefit optimization, by simultaneously running the
% cost-benefit greedy and the cost-agnostic greedy algorithm;
% the better of the two solution is guaranteed to obtain a constant
% fraction .5*(1-1/e) ap... |
github | yjq8812/efficientSegmentation-master | sfo_maxbound_welfare.m | .m | efficientSegmentation-master/sfo/sfo_maxbound_welfare.m | 808 | utf_8 | 984832e6fde6eee2a45343c91c07f674 | % Getting an online bound on the optimal solution for submodular welfare
% Implementation by Andreas Krause (krausea@gmail.com)
%
% function bound = sfo_maxbound_welfare(F,V,As)
% F: Submodular function
% V: index set
% As: current sets (cell array of sets)
% Returns: bound on optimal solution
%
% Example:
% F = sfo... |
github | yjq8812/efficientSegmentation-master | sfo_greedy_welfare.m | .m | efficientSegmentation-master/sfo/sfo_greedy_welfare.m | 1,785 | utf_8 | 7f7668784e0b43c9b36cd0807353b94e | % Andreas Krause (krausea@gmail.com)
% greedy algorithm for submodular welfare
% (maximization on partition matroid)
% Solves the problem
% [A1',...,Ak'] = max_{A1,...,Ak} sum_i F_i(A_i)
%
% function A_part = sfo_greedy_welfare(Fs,V,k)
% Fs: cell array of monotonic submodular functions
% V: index set
% k: #elements to... |
github | yjq8812/efficientSegmentation-master | sfo_greedy_splitting.m | .m | efficientSegmentation-master/sfo/sfo_greedy_splitting.m | 1,293 | utf_8 | 5876149ce603345c2527474d97cc76b7 | % Implements Greedy splitting by Zhao et al
% Repeatedly uses Queyranne's algorithm to find the optimal two-partition
% minimizing the energy E(A)+E(V\A)
% author: Andreas Krause (krausea@gmail.com)
%
% function P = sfo_greedy_splitting(E,V,k)
% E is the energy function per cluster
% V is the index set
% k is the numbe... |
github | yjq8812/efficientSegmentation-master | sfo_maxbound.m | .m | efficientSegmentation-master/sfo/sfo_maxbound.m | 1,313 | utf_8 | b38d47975083bc53b25db5d176c08a5c | % Getting an online bound on the optimal solution for budgeted maximization
% Implementation by Andreas Krause (krausea@gmail.com)
%
% function bound = sfo_maxbound(F,V,A,B,C)
% F: Submodular function
% V: index set
% A: current set (optional)
% B: Budget
% C: Cost (optional). C(i) is cost of V(i)
% Returns: bound on o... |
github | yjq8812/efficientSegmentation-master | sfo_ls_lazy.m | .m | efficientSegmentation-master/sfo/sfo_ls_lazy.m | 1,668 | utf_8 | 65b19c427b24e7d11f127fa88b2a5335 | % Andreas Krause (krausea@gmail.com)
% implements the (deterministic) local search procedure for maximizing
% nonnegative submodular functions by Feige, Mirrokni, Vondrak
% Obtains a 1/3 approximation to max_A F(A)
% The algorithm implements lazy evaluations for efficiency
%
% function sset = sfo_ls_lazy(F,V,B,C,useCB)... |
github | yjq8812/efficientSegmentation-master | sfo_balance.m | .m | efficientSegmentation-master/sfo/sfo_balance.m | 5,987 | utf_8 | 6023907d5e526e747281e3451b5ca885 | % Andreas Krause (krausea@cs.cmu.edu)
% balanced submodular coverage. Gives a 6 approximation to the problem of
% finding a collection of disjoint sets A1...Am, together containing at
% most k elements, that maximize min_i F(A_i)
% The algorithm is described in Krause et al, IPSN '09
%
% function [A_res,scores] = sfo_b... |
github | yjq8812/efficientSegmentation-master | sfo_chol_update.m | .m | efficientSegmentation-master/sfo/sfo_chol_update.m | 1,080 | utf_8 | 94213ad206e0a91208eb6af62a4f4c6d | % Andreas Krause (krausea@gmail.com)
% This function is used to update the Cholesky decomposition of the
% X'X(A,A) matrix when a new variable is added to the model
% It checks whether the addition causes X'X(A,A) to become singular and
% returns a flag indicating that
% Based on implementation by Ram Rajagopal
%
% fun... |
github | yjq8812/efficientSegmentation-master | sfo_logdet.m | .m | efficientSegmentation-master/sfo/sfo_logdet.m | 359 | utf_8 | 30a6f4ab724247ae76399cc51b4de7be | % Compute the log determinant of a positive definite matrix using stable
% cholesky decomposition
% Author: Andreas Krause (krausea@gmail.com)
%
% function D = sfo_logdet(sigma)
% sigma: Covariance matrix
% set: subset of variables
%
% Example: D = sfo_logdet(0.5*ones(3)+0.5*eye(3))
function D = sfo_logdet(sigma)
L = ... |
github | yjq8812/efficientSegmentation-master | sfo_opt_get.m | .m | efficientSegmentation-master/sfo/sfo_opt_get.m | 402 | utf_8 | e5e0f32d7626fe6bf87c1a752ff28b78 | % Andreas Krause (krausea@cs.cmu.edu)
% Get a value from an option struct
%
% function val = sfo_opt_get(opt,name,default)
% opt: option struct (created using sfo_opt)
% name: field name
% default (optional): default value
%
% Example: TOL = sfo_opt_get(opt,'tolerance',1e-10)
function val = sfo_opt_get(opt,name,defaul... |
github | yjq8812/efficientSegmentation-master | sfo_pspiel_orienteering.m | .m | efficientSegmentation-master/sfo/sfo_pspiel_orienteering.m | 2,610 | utf_8 | 18c0218848a97a8a4b5e961aa2015cd7 | % Andreas Krause (krausea@gmail.com)
% Algorithm for informative path planning, based on pSPIEL
% algorithm by Krause et al. (IPSN '06)
%
% function [A, E, result] = sfo_pspiel_orienteering(F,V,B,D,maxIter,R)
% F: monotonic submodular function
% V: index set
% B: budget
% D: Cost matrix. D(i,j) is edge cost from V(i) t... |
github | yjq8812/efficientSegmentation-master | sfo_min_norm_point_tutorial_callback_image.m | .m | efficientSegmentation-master/sfo/sfo_min_norm_point_tutorial_callback_image.m | 170 | utf_8 | 95b0f6e866d2f6d66e89f20e52a3a7a4 | % Helper callback function for visualizing inference in Ising model
function sfo_min_norm_point_tutorial_callback_image(Abest, img)
img(Abest)=1;
imshow(img)
pause(.1);
|
github | yjq8812/efficientSegmentation-master | sfo_max_dca_lazy.m | .m | efficientSegmentation-master/sfo/sfo_max_dca_lazy.m | 4,764 | utf_8 | 569739815dccaa0daa6d9a11697261ab | % The data-correcting algorithm for maximizing general submodular functions
% of Goldengorin et al.
% Implemented by Andreas Krause (krausea@gmail.com), using lazy evaluations
% This is a worst-case exponential branch & bound algorithm
%
% function A = sfo_max_dca_lazy(F,V,opt)
% F: submodular function
% V: index set
%... |
github | yjq8812/efficientSegmentation-master | sfo_unique_fast.m | .m | efficientSegmentation-master/sfo/sfo_unique_fast.m | 321 | utf_8 | 229181b36385c7ae83747bc2845f5cda | % Helper for quickly computing the unique set representation
% Author: Andreas Krause (krausea@gmail.com)
%
% function C=sfo_unique_fast(A)
% A: set (array) of positive integers
%
% Example: C = sfo_unique_fast([1 3 3 7 2 3 2 8])
function C=sfo_unique_fast(A)
mx = max(A);
vals = zeros(1,mx);
vals(A)=1;
C = find(vals);... |
github | yjq8812/efficientSegmentation-master | sfo_pspiel.m | .m | efficientSegmentation-master/sfo/sfo_pspiel.m | 2,856 | utf_8 | bba9f967bcdeab683356c092d8ca9aad | % Andreas Krause (krausea@gmail.com)
% Trade off utility F and (tree) connection cost using
% the pSPIEL algorithm of Krause et al. (IPSN '06)
%
% function [A, E, result] = sfo_pspiel(F,V,Q,D,opt)
% F: monotonic submodular function
% V: index set
% Q: quota
% D: Cost matrix. D(i,j) is edge cost from V(i) to V(j)
% op... |
github | yjq8812/efficientSegmentation-master | sfo_eval_maxvar.m | .m | efficientSegmentation-master/sfo/sfo_eval_maxvar.m | 669 | utf_8 | 2047d41d1e089ca02e36117d1f9336fd | % computes the Gaussian maximum posterior variance after conditioning on
% subset set
% Author: Andreas Krause (krausea@gmail.com)
%
% function v = sfo_eval_maxvar(sigma,set)
% sigma: Covariance matrix
% set: subset of variables
%
% Example: v = sfo_eval_maxvar(0.5*eye(3)+0.5*ones(3),1);
function v = sfo_eval_maxvar(s... |
github | yjq8812/efficientSegmentation-master | sfo_min_norm_pointYu.m | .m | efficientSegmentation-master/sfo/sfo_min_norm_pointYu.m | 4,070 | utf_8 | cb5ec34ebc2390e482ff446557cbaf40 | % Finding the minimum of a submodular function using Wolfe's min norm point
% algorithm [Fujishige '91]
% Implementation by Andreas Krause (krausea@gmail.com)
%
% function A = sfo_min_norm_point(F,V, opt)
% F: Submodular function
% V: index set
% opt (optional): option struct of parameters, referencing:
%
% minnorm_ini... |
github | yjq8812/efficientSegmentation-master | sfo_minbound.m | .m | efficientSegmentation-master/sfo/sfo_minbound.m | 469 | utf_8 | 9cb0fcde7355dd521e4fb0d9209a11c4 | % Get bound on suboptimality / certificate of optimality [Edmonds '71]
% Implementation by Andreas Krause (krausea@gmail.com)
%
% function bound = sfo_minbound(F,V,A)
% F: Submodular function
% V: index set
% A: set to be tested
% Returns bound <= min_A F(A)
%
% Example: bound = sfo_minbound(sfo_fn_example,1:2,[1])
fu... |
github | yjq8812/efficientSegmentation-master | sfo_setdiff_fast.m | .m | efficientSegmentation-master/sfo/sfo_setdiff_fast.m | 346 | utf_8 | 1145d62a2761aafc1659a96cea4d0ece | % Helper for quickly computing the set difference
% Author: Andreas Krause (krausea@gmail.com)
%
% function C=sfo_setdiff_fast(A,B)
% A, B: sets (arrays) of positive integers
%
% Example: C = sfo_setdiff_fast([1 3 7 8], [3 7])
function C=sfo_setdiff_fast(A,B)
mx = max([max(A),max(B)]);
vals = zeros(1,mx);
vals(A)=1;
v... |
github | yjq8812/efficientSegmentation-master | sfo_s_t_mincut.m | .m | efficientSegmentation-master/sfo/sfo_s_t_mincut.m | 781 | utf_8 | 3cb309ab53d757e3596acde6d365bcbf | % Finding the minimum A of a submodular function such that s in A and t not in A
% Implementation by Andreas Krause (krausea@gmail.com)
%
% function A = sfo_s_t_mincut(F,V,s,t)
% F: Submodular function
% V: index set
% s: element in V to include
% t: element in V to exclude
% opt (optional): options, depending on
%
%... |
github | yjq8812/efficientSegmentation-master | sfo_max_delta_lazy.m | .m | efficientSegmentation-master/sfo/sfo_max_delta_lazy.m | 1,264 | utf_8 | fe3a4da3d66f18c2502c8bd08d2c3def | % Helper routine for computing lazy increments / decrements
% Implemented by Andreas Krause (krausea@gmail.com)
%
% function A = sfo_max_delta_lazy(F,S,T,pm,bound)
% F: submodular function
% S,T: sets, S subset of T
% pm: if +1, will compute increments for adding, -1 for removing elements
% bound: upper bound for lazy ... |
github | yjq8812/efficientSegmentation-master | sfo_inv_update.m | .m | efficientSegmentation-master/sfo/sfo_inv_update.m | 551 | utf_8 | effacd47ea3fefa28c4635ab694e7dbb | % Andreas Krause (krausea@gmail.com)
% Updates a precision matrix by adding a new variable
% Based on implementation by Ram Rajagopal
%
% function precNew = sfo_inv_update(prec,sigma_Ax,sigma_xx)
% prec: old precision (inverse covariance) matrix
% sigma_Ax: column vector of cross-covariances
% sigma_xx: variance of new... |
github | yjq8812/efficientSegmentation-master | sfo_plot_subgraph.m | .m | efficientSegmentation-master/sfo/sfo_plot_subgraph.m | 743 | utf_8 | f90b29a534b96fb5d8321e7b001df5f2 | % Plots a subgraph on known coordinates
% author: Andreas Krause (krausea@gmail.com)
%
% function sfo_plot_subgraph(coords,edges,steinernodes)
% plots a placement generated by the computePlacement function.
% Red squares are the selected nodes, rest are support (communication)
% nodes
%
% Example: See sfo_tutorial.m
f... |
github | yjq8812/efficientSegmentation-master | sfo_queyranne.m | .m | efficientSegmentation-master/sfo/sfo_queyranne.m | 1,501 | utf_8 | e66c8fe5cdcd9cf9eb5c63de0dbcf1dd | % implements Queyranne's algorithm for minimizing symmetric submodular
% functions
% author: Andreas Krause (krausea@gmail.com)
%
% function R = sfo_queyranne(F,V)
% F is the symmetric submodular function
% V is the index set
% Returns an optimal solution to min F(A) s.t. 0<|A|<n
%
% Example:
% G = [1 1 0; 1 0 1; 0 ... |
github | yjq8812/efficientSegmentation-master | sfo_saturate.m | .m | efficientSegmentation-master/sfo/sfo_saturate.m | 2,486 | utf_8 | 2b22ae2195f2b777062a447f83062658 | % Andreas Krause (krausea@cs.cmu.edu)
% outer binary search loop for saturate algorithm
%
% function [ssetMax,ssetMin,maxc,minc] = sfo_saturate(F,V,k,task,opt)
% F: thresholdable submodular function (takes set and threshold)
% V: index set
% k: #elements to pick
% task: 'maxthresh' or 'minthresh' for maximizing thresho... |
github | yjq8812/efficientSegmentation-master | sfo_opt.m | .m | efficientSegmentation-master/sfo/sfo_opt.m | 485 | utf_8 | 65503da64a6f4efb095255282388519d | % Andreas Krause (krausea@cs.cmu.edu)
% Generate a default option struct used to specify options in various
% algorithms.
%
% function opt = sfo_opt(vals)
% vals: cell array of form vals = {'NAME1',VAL1,'NAME2',VAL2,...}
%
% Example: opt = sfo_opt({'val',3.14,'color','red'})
function opt = sfo_opt(vals)
opt = [];
opt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.