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 | tgen/lumosVar2-master | getMeanInRegionsExcludeNaN.m | .m | lumosVar2-master/src/getMeanInRegionsExcludeNaN.m | 1,532 | utf_8 | 047ae10f81e3e7f9048084bc801d97d0 |
function regionMean=getMeanInRegionsExcludeNaN(pos,values,regions)
%getMeanInRegionsExcludeNaN - finds mean of values within each region
%
% Syntax: regionMean=getMeanInRegions(pos,values,regions)
%
% Inputs:
% pos: two column matrix where 1st col is chr and 2nd is pos
% values: values to find mean of, same length... |
github | tgen/lumosVar2-master | calculateNormalMetrics.m | .m | lumosVar2-master/src/calculateNormalMetrics.m | 2,545 | utf_8 | ba3c4e1a6576d69b37f559596ab8ece1 |
function [normalMetrics]=calculateNormalMetrics(NormalData, priorMapError,ploidy)
%calculateNormalMetrics - calculates mean read depths and
%position quality scores for a control sample
%calls parsePileupData.packed.pl to parse samtools output
%
% [normalMetrics]=calculateNormalMetrics(NormalData, priorMapError)
%
% ... |
github | YutingZhang/caffe-recon-dec-master | classification_demo.m | .m | caffe-recon-dec-master/matlab/demo/classification_demo.m | 5,412 | utf_8 | 8f46deabe6cde287c4759f3bc8b7f819 | function [scores, maxlabel] = classification_demo(im, use_gpu)
% [scores, maxlabel] = classification_demo(im, use_gpu)
%
% Image classification demo using BVLC CaffeNet.
%
% IMPORTANT: before you run this demo, you should download BVLC CaffeNet
% from Model Zoo (http://caffe.berkeleyvision.org/model_zoo.html)
%
% *****... |
github | lijiansong/Postgraduate-Course-master | spam.m | .m | Postgraduate-Course-master/Data-Mining/adaboost-bagging/src/spam.m | 4,050 | utf_8 | 3a03399af44909d5f2f7ef06d521cfea | function spam()
%Spam data training and testing result
clc;
I = load('spamtest.ascii','-ascii');
X = I(:,1:57); %:x57
Y = I(:,58); %:x1
T = load('spamtrain.ascii','-ascii');
tX = T(:,1:57); %:x57
tY = T(:,58); %:x1
trees = floor(logspace(0,3,10));
tr_bag = cell(1000,3);
... |
github | lijiansong/Postgraduate-Course-master | adaboost.m | .m | Postgraduate-Course-master/Data-Mining/adaboost-bagging/src/adaboost.m | 3,518 | utf_8 | cdca27d38d605ad049901dc7d93bbb8b | function adaboost()
%Adaboost
clc;
I = load('class2d.ascii','-ascii');
X = I(:,1:2); %80x2
Y = I(:,3); %80x1
trees = [1,10,100,1000];
tr = cell(1000,3);
wt = zeros(1000,1);
err = zeros(1000,1);
%Boosting
for d = 1:3
alpha = ones(80,1);
for i = 1:4
... |
github | lijiansong/Postgraduate-Course-master | bagging.m | .m | Postgraduate-Course-master/Data-Mining/adaboost-bagging/src/bagging.m | 2,444 | utf_8 | bcc0e71f2bcef006d9cdcf37c64512ce | function bagging()
%Bagging
clc;
I = load('class2d.ascii','-ascii');
X = I(:,1:2); %80x2
Y = I(:,3); %80x1
trees = [1,10,100,1000];
tr = cell(1000,3);
%Bagging
for d = 1:3
for i = 1:4
f = 4*(d-1)+i;
figure(f)
remain = 1;
if i ... |
github | lijiansong/Postgraduate-Course-master | splitgini.m | .m | Postgraduate-Course-master/Data-Mining/adaboost-bagging/src/splitgini.m | 1,097 | utf_8 | 95971f11b53ed7b2adf25810163e154b | function split = splitgini(X,Y,alpha,isleaf,minnum)
cl = unique(Y);
Ys = repmat(Y,1,length(cl))==repmat(cl',size(Y,1),1);
Ys = Ys.*repmat(alpha,1,length(cl));
[~,split] = max(sum(Ys,1),[],2);
split = cl(split);
if (~isleaf && size(X,1)>minnum && length(cl)>1)
bestsc = inf;
bestvar = 0;
bestth = 0;
for d=1:size(X,2... |
github | lijiansong/Postgraduate-Course-master | printdt.m | .m | Postgraduate-Course-master/Data-Mining/adaboost-bagging/src/printdt.m | 697 | utf_8 | 895adc09b06bdbe0f8c664511b57320d | function printdt(tree)
% function printdt(tree)
%
% displays a tree in the format returned by traindt
printdthelp(tree,'','','');
function printdthelp(tree,lstem,cstem,rstem)
if (length(tree)==1)
disp(sprintf('%s--[y = %d]',cstem,tree(1)));
else
d = tree{1};
add = sprintf('--[x(%d) < %g]-+',d(1),d(2));
b = blanks... |
github | hagaygarty/mdCNN-master | backPropagate.m | .m | mdCNN-master/mdCNN/backPropagate.m | 8,457 | utf_8 | bcd7467161d20ee1784bf0b1966df388 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2015-16 Hagay Garty.
% hagaygarty@gmail.com , mdCNN library
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [net] = backPropagate(net, input, expectedOut)
% 3 steps to doing back prop , first is feedForward, second is calculating the
% errors , ... |
github | hagaygarty/mdCNN-master | updateWeights.m | .m | mdCNN-master/mdCNN/updateWeights.m | 2,586 | utf_8 | bf040d1713087d37a52fabe31522d1dd | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2015-16 Hagay Garty.
% hagaygarty@gmail.com , mdCNN library
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [ net ] = updateWeights(net, ni, momentum , lambda )
batchNum=net.hyperParam.batchNum;
%update network weights
for k=size(net.layers,2):-1:1
... |
github | hagaygarty/mdCNN-master | initNetWeight.m | .m | mdCNN-master/mdCNN/initNetWeight.m | 19,858 | utf_8 | 383e2a17025ca64a0f8b212d87292a05 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2015-16 Hagay Garty.
% hagaygarty@gmail.com , mdCNN library
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [ net ] = initNetWeight( net )
rng(0);
fprintf('multi dimentional CNN , Hagay Garty 2016 | hagaygarty@gmail.com\nInitializing network..\n');
%init ... |
github | hagaygarty/mdCNN-master | CreateNet.m | .m | mdCNN-master/mdCNN/CreateNet.m | 4,684 | utf_8 | 2c6cff6f4845ff272e1e2ddc6ed1d5df | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2015-16 Hagay Garty.
% hagaygarty@gmail.com , mdCNN library
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [ net ] = CreateNet( conf_file )
%% Constructor for net struct , loads the configuration from conf_file
net = initNetDefaults;
... |
github | hagaygarty/mdCNN-master | verifyBackProp.m | .m | mdCNN-master/mdCNN/verifyBackProp.m | 8,649 | utf_8 | 6137d6dfa243eaf12da18b19c76cfa8f | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2015-16 Hagay Garty.
% hagaygarty@gmail.com , mdCNN library
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [ ] = verifyBackProp(net)
%% verification of network correctnes. Search for implementation errors by verifying the derivitives calculated b... |
github | hagaygarty/mdCNN-master | feedForward.m | .m | mdCNN-master/mdCNN/feedForward.m | 6,835 | utf_8 | b48d6306efe3b3598e47fe8768266c86 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2015-16 Hagay Garty.
% hagaygarty@gmail.com , mdCNN library
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [ net ] = feedForward(net, input , testTime)
%% feedForward - pass a sample throud the net. Returning an array where the first index is th... |
github | hagaygarty/mdCNN-master | getCIFAR10data.m | .m | mdCNN-master/Demo/CIFAR10/getCIFAR10data.m | 2,288 | utf_8 | 152ca38ac7c80f8bf87b9d541f934790 | function [ CIFAR10 ] = getCIFAR10data( dataset_folder )
% this function will download the CIFAR10 dataset if not exist already.
% after downloading it will then parse the raw files and create a CIFAR10.mat file
% containning the test/train images and labels.
% function returns a struct containing the images+labels.... |
github | hagaygarty/mdCNN-master | displayCIFAR10.m | .m | mdCNN-master/Demo/CIFAR10/displayCIFAR10.m | 22,827 | utf_8 | 46bbf153c6ea700239c3bb1399fb2cbe | function varargout = displayCIFAR10(nets, mCIFAR10File , testOnData)
if ( ~iscell(nets) )
tmp{1}=nets;
nets=tmp;
end
if (~exist('testOnData','var'))
testOnData = 0;
end
images = [];
labels = [];
mOutputArgs = {}; % Variable for storing output when GUI returns
mIconCData ... |
github | hagaygarty/mdCNN-master | getMNIST3Ddata.m | .m | mdCNN-master/Demo/MNIST3d/getMNIST3Ddata.m | 5,646 | utf_8 | 1ed7cd4f45036f0ead476de7cf7875a9 | function [ MNIST ] = getMNIST3Ddata( dst_folder )
% this function will download the MNIST dataset if not exist already.
% after downloading it will then parse the files and create a MNIST.mat file
% containing the test/train images and labels.
% function returns a struct containing the images+labels
% I,labels,I_t... |
github | hagaygarty/mdCNN-master | getMNISTdata.m | .m | mdCNN-master/Demo/AutoEnc/getMNISTdata.m | 4,421 | utf_8 | 27ab6b4e73e15d9e9eba4af06ad04400 | function [ MNIST ] = getMNISTdata( dst_folder )
% this function will download the MNIST dataset if not exist already.
% after downloading it will then parse the files and create a MNIST.mat file
% containing the test/train images and labels.
% function returns a struct containing the images+labels
% I,labels,I_test,lab... |
github | hagaygarty/mdCNN-master | displayMNIST.m | .m | mdCNN-master/Demo/MNIST/displayMNIST.m | 23,646 | utf_8 | c9e31fb72c2e8f8a85057020b75e27c5 | function varargout = displayMNIST(nets, dataset_folder)
if ( ~iscell(nets) )
tmp{1}=nets;
nets=tmp;
end
mOutputArgs = {}; % Variable for storing output when GUI returns
mIconCData = []; % The icon CData edited by this GUI of dimension
%... |
github | hagaygarty/mdCNN-master | getMNISTdata.m | .m | mdCNN-master/Demo/MNIST/getMNISTdata.m | 4,562 | utf_8 | 7c5420b0382bdcc938bba7643ec46b8a | function [ MNIST ] = getMNISTdata( dst_folder )
% this function will download the MNIST dataset if not exist already.
% after downloading it will then parse the files and create a MNIST.mat file
% containing the test/train images and labels.
% function returns a struct containing the images+labels
% I,labels,I_tes... |
github | hagaygarty/mdCNN-master | printNetwork.m | .m | mdCNN-master/utilCode/printNetwork.m | 914 | utf_8 | 5e6628fbb920522eeb1bff389249af27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2015-16 Hagay Garty.
% hagaygarty@gmail.com , mdCNN library
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [ ] = printNetwork( net )
disp(struct2table(net.hyperParam));
disp(struct2table(net.runInfoParam));
for k=1:size(net.layers,2)
fprintf('La... |
github | hagaygarty/mdCNN-master | GetNetworkInputs.m | .m | mdCNN-master/Training/GetNetworkInputs.m | 4,395 | utf_8 | 1cf0ffc19a6babd506588af9d76875af | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2015-16 Hagay Garty.
% hagaygarty@gmail.com , mdCNN library
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [ image ] = GetNetworkInputs(image , net , testTime)
%% function manipulate a sample and preperes it for passing into the net first layer
%% preper... |
github | hagaygarty/mdCNN-master | Train.m | .m | mdCNN-master/Training/Train.m | 17,319 | utf_8 | d0eb25c1612f419fa3af950ec9eb14ba | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 2015-16 Hagay Garty.
% hagaygarty@gmail.com , mdCNN library
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [ net ] = Train( dataset , net , numSamplesToTrain )
%% function will train the network on a given dataset
if (~exist('numSamplesToTrain','var'))... |
github | pquochuy/regression_forest-master | do_train.m | .m | regression_forest-master/forest_regression/do_train.m | 1,133 | utf_8 | 9de8d1db686fff6f6b0f41eca2af0d55 | function forest = do_train(tr_X, tr_d, FOREST_CONFIG)
fprintf('building the random forest\n');
forest(1, FOREST_CONFIG.numTree) = DecisionTree();
% use parfor for parallel training instead
%parfor i = 1:FOREST_CONFIG.numTree
for i = 1 : FOREST_CONFIG.numTree
tree = DecisionTree(FOREST_CONFI... |
github | trajtracker/trajtracker_analyze-master | xml2struct.m | .m | trajtracker_analyze-master/matlab/util/xml2struct.m | 6,955 | utf_8 | 58f0b998cc71b30b4a6a12b330cfe950 | function [ s ] = xml2struct( file )
%Convert xml file into a MATLAB structure
% [ s ] = xml2struct( file )
%
% A file containing:
% <XMLname attrib1="Some value">
% <Element>Some text</Element>
% <DifferentElement attrib2="2">Some more text</Element>
% <DifferentElement attrib3="2" attrib4="1">Even more t... |
github | trajtracker/trajtracker_analyze-master | randl.m | .m | trajtracker_analyze-master/matlab/util/randl.m | 1,023 | utf_8 | e04810eb8245f4f9ade58886ee568b76 | % Return random variable(s) with linear distribution within [0,1] and
% 0 outside; m specifies the slope
%
% In other word
% P(x)= mx+b if 0<=x<=1
% P(x)= 0 otherwise
%
% where b=1-m/2 as int P(x) should be 1
%
% Usage: ran=randl(m,SIZE)
%
% E.g. X=randl(1,[20,20])
% X is matrix with size [20,20] and with distribut... |
github | kourouklides/NPBayesHMM-master | sampleFromMatrixNormal.m | .m | NPBayesHMM-master/code/rndgen/sampleFromMatrixNormal.m | 290 | utf_8 | fc9c1da677157415def05d75fcac5769 | %function S = sampleFromMatrixNormal(M,V,K,nSamples=1)
function S = sampleFromMatrixNormal(M,sqrtV,sqrtinvK,nSamples)
if ~exist('nSamples','var'), nSamples = 1; end
[mu,sqrtsigma] = matrixNormalToNormal(M,sqrtV,sqrtinvK);
S = mu + sqrtsigma'*randn(length(mu),1);
S = reshape(S,size(M));
|
github | kourouklides/NPBayesHMM-master | matrixNormalToNormal.m | .m | NPBayesHMM-master/code/rndgen/matrixNormalToNormal.m | 391 | utf_8 | f3b050c133b9819518869bfda1b4e8ab | %function [mu,sigma,a] = matrixNormalToNormal(M,V,K)
%
% Converts the parameters for a matrix normal A ~ MN(M,V,K)
% into a multivariate normal A(:) ~ N(mu,sigma)
%
function [mu,sqrtsigma] = matrixNormalToNormal(M,sqrtV,sqrtinvK)
mu = M(:);
sqrtsigma = kron(sqrtinvK,sqrtV);
% sigma = sqrtsigma'*sqrtsigma;
%... |
github | kourouklides/NPBayesHMM-master | RunTimedMCMCSimForBPHMM.m | .m | NPBayesHMM-master/code/BPHMM/RunTimedMCMCSimForBPHMM.m | 2,835 | utf_8 | 0e52d9151f5a3fda9489bcd9c02def92 | % RunMCMCSimForBPHMM
% Generic harness for running many iterations of MCMC,
% allows sensible reporting/saving of samples and diagnostics
%USAGE
% Usually called from more "user-friendly" function "runBPHMM"
% but if specific data and initial configuration Psi are available,
% >> RunMCMCForBPHMM( data, Psi, algP,... |
github | kourouklides/NPBayesHMM-master | RunMCMCSimForBPHMM.m | .m | NPBayesHMM-master/code/BPHMM/RunMCMCSimForBPHMM.m | 2,798 | utf_8 | 6cab19d0c33a28b0421ee357492ce6bb | % RunMCMCSimForBPHMM
% Generic harness for running many iterations of MCMC,
% allows sensible reporting/saving of samples and diagnostics
%USAGE
% Usually called from more "user-friendly" function "runBPHMM"
% but if specific data and initial configuration Psi are available,
% >> RunMCMCForBPHMM( data, Psi, algP,... |
github | kourouklides/NPBayesHMM-master | sampleSingleFeat_UniqueRJStateSeq.m | .m | NPBayesHMM-master/code/BPHMM/sampler/sampleSingleFeat_UniqueRJStateSeq.m | 9,527 | utf_8 | 470385bdbd73ea5335d2157a32a7d43e | function [Psi, RhoTerms] = ...
sampleSingleFeat_UniqueRJStateSeq( ii, Psi, data, algParams )
% Sample a unique entry in the feature vector of sequence "ii"
% Uses reversible jump to either
% Create new feature ("birth")
% Delete cur feature ("death")
%INPUT
% ii : integer id of specific sequence to examine
%... |
github | kourouklides/NPBayesHMM-master | sampleSingleFeatEntry_UniqueRJ.m | .m | NPBayesHMM-master/code/BPHMM/sampler/sampleSingleFeatEntry_UniqueRJ.m | 8,527 | utf_8 | 88b619d965be1c3bfd4497784c3fd374 | function [Psi, RhoTerms] = ...
sampleSingleFeatEntry_UniqueRJ( ii, Psi, data, algParams )
% Sample a unique entry in the feature vector of sequence "ii"
% Uses reversible jump to either
% Create new feature ("birth")
% Delete cur feature ("death")
%INPUT
% ii : integer id of specific sequence to examine
% P... |
github | kourouklides/NPBayesHMM-master | sampleTransParams_RGS.m | .m | NPBayesHMM-master/code/BPHMM/sampler/RGSSplitMerge/sampleTransParams_RGS.m | 3,143 | utf_8 | d5eb260fbf72f24114d56fb2aa6f441e | function [TS, logQ_RGS] = sampleTransParams_RGS(F, stateSeq, TS, hyperparams, model, objIDs, TargetPsi )
% Sample the transition distribution params stored in transStruct
% state-to-state trans. : pi_z
% init state distribution : pi_init
% Each object ii has Pi_z matrix that is Kz_ii x Kz_ii
% where Kz_... |
github | kourouklides/NPBayesHMM-master | recordMCMCHistory_BPHMM.m | .m | NPBayesHMM-master/code/BPHMM/BPutil/recordMCMCHistory_BPHMM.m | 3,392 | utf_8 | ed65bc3216378b2c59de29aa933058c4 | function ChainHist = recordMCMCHistory_BPHMM( n, outParams, ChainHist, Psi, logPr, Stats )
% Save current state of sampler
% -------------------------------------------------- update logPr trace
if n == 1 || rem( n, outParams.logPrEvery ) == 0
if isfield( ChainHist, 'logPr' )
dC = length( ChainHist.logPr )... |
github | kourouklides/NPBayesHMM-master | lof.m | .m | NPBayesHMM-master/code/BPHMM/BPutil/lof.m | 6,616 | utf_8 | 7bd2ec8c1620411c6972c67103ce33b3 | function [F_sorted sort_ind] = lof(F, recurN, doVerbose)
% Map binary matrices to Left-Ordered Form (lof)
% by ordering columns in descending order from left-to-right
% according to magnitude of binary number expressed by each column.
% Empty columns will be *removed*, so size(F_sorted,2) <= size(F,2)
% Assumes ... |
github | kourouklides/NPBayesHMM-master | assignmentoptimal.m | .m | NPBayesHMM-master/code/BPHMM/BPutil/relabel/assignmentoptimal.m | 7,787 | utf_8 | c9b870578bdec636e05ae1d4d711af41 | function [assignment, cost] = assignmentoptimal(distMatrix)
%ASSIGNMENTOPTIMAL Compute optimal assignment by Munkres algorithm
% ASSIGNMENTOPTIMAL(DISTMATRIX) computes the optimal assignment (minimum
% overall costs) for the given rectangular distance or cost matrix, for
% example the assignment of tracks (in row... |
github | kourouklides/NPBayesHMM-master | readJointAnglesAsMatrixFromAMC.m | .m | NPBayesHMM-master/code/data/mocap/readJointAnglesAsMatrixFromAMC.m | 4,009 | utf_8 | 3dc5dd1694eaf3b2aae070c944f1916c | % readJointAnglesAsMatrixFromAMC.m
% Read data from AMC motion capture file into Matlab matrix
% CREDITS
% Modified from amc_to_matrix.m (Jernej Barbic, CMU, March 2003)
% with further changes by E.Sudderth and E. Fox (MIT, 2008-2009)
% Smoothing Angle suggestion due to N. Lawrence (smoothAngleChannels.m)
functi... |
github | Aureliu/Stock-Analysis-master | Graph.m | .m | Stock-Analysis-master/量化/金工/GUI/Graph.m | 10,406 | utf_8 | 9f108e2c085813ab6fcc0cd4f00e5c09 | function varargout = Graph(varargin)
% GRAPH MATLAB code for Graph.fig
% GRAPH, by itself, creates a new GRAPH or raises the existing
% singleton*.
%
% H = GRAPH returns the handle to a new GRAPH or the handle to
% the existing singleton*.
%
% GRAPH('CALLBACK',hObject,eventData,handles,...) cal... |
github | Aureliu/Stock-Analysis-master | ExcelReader.m | .m | Stock-Analysis-master/量化/金工/GUI/ExcelReader.m | 7,907 | utf_8 | f7e8dbb036e8683b5e6fbdcb65634cae | function varargout = ExcelReader(varargin)
% EXCELREADER MATLAB code for ExcelReader.fig
% EXCELREADER, by itself, creates a new EXCELREADER or raises the existing
% singleton*.
%
% H = EXCELREADER returns the handle to a new EXCELREADER or the handle to
% the existing singleton*.
%
% EXCELREAD... |
github | carlomt/dicom_tools-master | readMeta.m | .m | dicom_tools-master/dicom_tools/pyqtgraph/metaarray/readMeta.m | 1,752 | utf_8 | 274fb9beeede592c8b60dc697d518dcd | function f = readMeta(file)
info = hdf5info(file);
f = readMetaRecursive(info.GroupHierarchy.Groups(1));
end
function f = readMetaRecursive(root)
typ = 0;
for i = 1:length(root.Attributes)
if strcmp(root.Attributes(i).Shortname, '_metaType_')
typ = root.Attributes(i).Value.Data;
break
... |
github | x75/otl-master | sq_dist.m | .m | otl-master/otl_matlab/helpers/KernelHelpers/sq_dist.m | 1,981 | utf_8 | 55df35340656b27e511f3ecbd2fc864a | % sq_dist - a function to compute a matrix of all pairwise squared distances
% between two sets of vectors, stored in the columns of the two matrices, a
% (of size D by n) and b (of size D by m). If only a single argument is given
% or the second matrix is empty, the missing matrix is taken to be identical
% to the fir... |
github | x75/otl-master | EVT_GaussianDF_Gy.m | .m | otl-master/otl_matlab/helpers/EVT_Multivariate/EVT_GaussianDF_Gy.m | 3,644 | utf_8 | a6e3e1c4cda67add62239522e878608d | %% Evaluate the df G_n(y) over densities, y
%
% DC Logbook 22.140
% Equations refer to Clifton et al. (2011), J. Sig. Proc. Sys. (65), pp. 371-389
function Gy = EVT_GaussianDF_Gy(SIGMA, YS)
%% Initialisation
if size(YS, 1) == 1
YS = YS'; % Transpose into a column vector, if necessary
end
Gy = nan(le... |
github | x75/otl-master | EVT_GaussianPDF_gy.m | .m | otl-master/otl_matlab/helpers/EVT_Multivariate/EVT_GaussianPDF_gy.m | 624 | utf_8 | c4b489c2a2b6e75fde50f88d421ea636 | %% Evaluate the pdf g_n(y) over densities, y
%
% DC Logbook 22.140
% Equations refer to Clifton et al. (2011), J. Sig. Proc. Sys. (65), pp. 371-389
function gy = EVT_GaussianPDF_gy(SIGMA, YS)
n = size(SIGMA,2); % Find the dimensionality
omega = 2*pi^(n/2)/gamma(n/2); % Find the total solid angle... |
github | x75/otl-master | Plot_GaussianDensities.m | .m | otl-master/otl_matlab/helpers/EVT_Multivariate/Plot_GaussianDensities.m | 7,687 | utf_8 | 8907a36ddabe773bf4eb078e020f1e11 | %% Plot figures that demonstrate multivariate EVT
% This shows pdfs g_n(y) over the densities, y, of an n-dimensional Gaussian distribution, f_n(x)
% and probability distributions G_n(y) over the same.
%
% Equations refer to Clifton et al. (2011), J. Sig. Proc. Sys. (65), pp. 371-389
% DC, Oct 2010
function Plot_Gauss... |
github | x75/otl-master | EVT_GaussianQuantile_Gy.m | .m | otl-master/otl_matlab/helpers/EVT_Multivariate/EVT_GaussianQuantile_Gy.m | 1,126 | utf_8 | 52fe5f5ed83123ec2749fc28b698298a | %% Find the p-quantile on the df over densities G_y
%
% DC Logbook 22.142
% Equations refer to Clifton et al. (2011), J. Sig. Proc. Sys. (65), pp. 371-389
function y = EVT_GaussianQuantile_Gy(SIGMA, p)
DOPLOT = false;
%% Find the maximum density ymax for this df
n = size(SIGMA,2); % Find the dimensi... |
github | x75/otl-master | EVT_GaussianEVD_FindParams.m | .m | otl-master/otl_matlab/helpers/EVT_Multivariate/EVT_GaussianEVD_FindParams.m | 450 | utf_8 | b0c2c1f8a4c6f0835ef81a0def148c3d | %% Find the alpha (shape) and c (scale) parameters for the EVD pdf G_n^e(y) over densities, y
%
% DC Logbook 22.142
% Equations refer to Clifton et al. (2011), J. Sig. Proc. Sys. (65), pp. 371-389
function [c_m alpha_m] = EVT_GaussianEVD_FindParams(SIGMA, m)
%% Estimate the parameters of the Weibull
c_m = EVT_Gaussia... |
github | x75/otl-master | EVT_GaussianEVD_Ge.m | .m | otl-master/otl_matlab/helpers/EVT_Multivariate/EVT_GaussianEVD_Ge.m | 361 | utf_8 | 6fb9126b3539b60e24f66da3c723849a | %% Evaluate the pdf G_n^e(y) over densities, y
% You might like to get the parameters c_m and alpha_m from EVT_GaussianEVT_FindParams.m
%
% DC Logbook 22.140
% Equations refer to Clifton et al. (2011), J. Sig. Proc. Sys. (65), pp. 371-389
function Ge = EVT_GaussianEVD_Ge(YS, c_m, alpha_m)
Ge = 1 - exp(-(YS./c_m).^alp... |
github | x75/otl-master | EVT_GaussianEVD_Fe.m | .m | otl-master/otl_matlab/helpers/EVT_Multivariate/EVT_GaussianEVD_Fe.m | 654 | utf_8 | d33e7c9938f960cf3c043cbb83f957a0 | %% Evaluate the pdf F_n^e(y) over Mahalanobis radii, r
% You might like to get the parameters c_m and alpha_m from EVT_GaussianEVT_FindParams.m
%
% DC Logbook 22.140
% Equations refer to Clifton et al. (2011), J. Sig. Proc. Sys. (65), pp. 371-389
function Fe = EVT_GaussianEVD_Fe(RS, SIGMA, c_m, alpha_m)
n = size(SIGM... |
github | x75/otl-master | RandomCovar.m | .m | otl-master/otl_matlab/helpers/EVT_Multivariate/RandomCovar.m | 118 | utf_8 | 1767832c0039cc8165635b9eeee466b2 | %% Create a random covariance matrix
% DC Logbook 22.142
function SIGMA = RandomCovar(n)
S = randn(n);
SIGMA = S'*S; |
github | x75/otl-master | distinguishable_colors.m | .m | otl-master/otl_matlab/helpers/PlotHelpers/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 | x75/otl-master | smoothn.m | .m | otl-master/otl_matlab/helpers/smoothn/smoothn.m | 16,852 | utf_8 | 54eb929ec4730522e6e116048d127f45 | function [z,s,exitflag] = smoothn(varargin)
%SMOOTHN Robust spline smoothing for 1-D to N-D data.
% SMOOTHN provides a fast, automatized and robust discretized smoothing
% spline for data of arbitrary dimension.
%
% Z = SMOOTHN(Y) automatically smoothes the uniformly-sampled array Y. Y
% can be any N-D ... |
github | mc225/Softwares_Tom-master | monitor.m | .m | Softwares_Tom-master/GUI/monitor.m | 65,754 | utf_8 | cdd840c3d90ca7c327e11fe824882e53 | %
% Graphical User Interface to control the SLM and laser while monitoring the camera output.
% This tool can be used with all SLM based set-ups, both for quick testing,
% alignment, aberration correction (various methods), and actual measurement.
%
% Current features:
% - control of complex (amplitude and phase) on b... |
github | mc225/Softwares_Tom-master | waveMeter.m | .m | Softwares_Tom-master/GUI/waveMeter.m | 13,654 | utf_8 | d7d127f122cec240fdea0a8a3cb990da | % A GUI to use speckle as a wavelength meter.
% Load a mat file created by analyzeSpeckleImages, and select the camera in use from the menu.
%
function waveMeter(calibrationFileName)
% Find the screen size and put the application window in the center
set(0,'units','pixels');
screenSize=get(0,'screensize')... |
github | mc225/Softwares_Tom-master | determineFrequencyAndBandwidth.m | .m | Softwares_Tom-master/VateriteRotation/determineFrequencyAndBandwidth.m | 9,329 | utf_8 | 00ffd9a872ab4a64a41810e898dadeb9 | % [frequency bandwidth]=determineFrequencyAndBandWidth(signal,samplesPerSecond)
%
%
function [frequency bandwidth]=determineFrequencyAndBandWidth(signal,samplesPerSecond)
close all;
if (nargin<1)
data=load('C:\Users\Tom\Documents\labsoftware\matlab\VateriteRotation\s.10155.mat');
signalA=double(... |
github | mc225/Softwares_Tom-master | voigt.m | .m | Softwares_Tom-master/VateriteRotation/voigt.m | 3,703 | utf_8 | 2ab55608b1e5047d4a76973dfa9d37e9 | % v=voigt(x,gamma,sigma,integratedValue,x0l,x0g)
%
% Calculates the Voigt distribution at points x.
%
% Example:
% x=[-100:.001:100];
% tic;
% v=voigt(x,1,1,10,50,0);
% toc
% plot(x,v);
% sum(v)
%
function v=voigt(x,gamma,sigma,integratedValue,x0l,x0g)
if (nargin<1)
x=[-10:.01:10];
end... |
github | mc225/Softwares_Tom-master | twoParticleRecording.m | .m | Softwares_Tom-master/VateriteRotation/twoParticleRecording.m | 3,714 | utf_8 | 54b54407f80a4b600d5a09967878a4b0 | %
%
%
function twoParticleRecording()
fixedParticlePosition=5e-6; % metric units
movingParticlePositions=-[5:10, 9:6]*1e-6; % metric units
maximumStepSize=.2e-6; % metric units
% Don't go above unity for both combined
fixedParticlePower=0.35;
movingParticlePower=0.35;
fixedPar... |
github | mc225/Softwares_Tom-master | logMessage.m | .m | Softwares_Tom-master/Utilities/logMessage.m | 4,231 | utf_8 | ca34eb3eb53bd5a97c2985e9aa4b5ab0 | % message=logMessage(message,values,recipientEmailToAddresses,attachments)
%
% Logs a message to the command line and to a file called 'log.txt' in the
% current folder with a timestamp prefix. Optionally, it can be sent by e-mail
% as well with (optional) attachments.
% The message is formatted using escape characters... |
github | mc225/Softwares_Tom-master | removeTiltAndPiston.m | .m | Softwares_Tom-master/Utilities/removeTiltAndPiston.m | 975 | utf_8 | 948b7308f117d01530bde9c7454596ed | % [pupilFunctionWithoutTiltAndPiston tilt piston]=removeTiltAndPiston(pupilFunction)
%
% Calculates and removes the tilt and piston from a pupil function measurement.
%
% Output parameters:
% pupilFunctionWithoutTilt: the input with the tilt removed
% tilt: the removed tilt in units of wavelengths per pixel.
% ... |
github | mc225/Softwares_Tom-master | spectrumToRGB.m | .m | Softwares_Tom-master/Utilities/spectrumToRGB.m | 7,556 | utf_8 | ec4f544f967641c392792e9cb31e9976 | % RGB=spectrumToRGB(wavelengths,wavelengthIntensities,constrainValues)
%
% Returns the red green and blue component to simulate a given spectrum.
% The number of dimensions of the returned matrix is equal to that of the
% wavelengthIntensities argument, and the dimensions are the same except
% for the last dimension wh... |
github | mc225/Softwares_Tom-master | calcFullWidthAtHalfMaximum.m | .m | Softwares_Tom-master/Utilities/calcFullWidthAtHalfMaximum.m | 4,461 | utf_8 | 80d5fd3ddb9c6c79e39c476390f70948 | % fullWidthAtHalfMaximum=calcFullWidthAtHalfMaximum(X,Y,method)
%
% Calculates the full width at half the maximum using various methods.
%
% X must be a vector with the sample coordinates or a matrix with the
% coordinates for a sample set in each column. If X is a vector than it
% must have the same number as... |
github | mc225/Softwares_Tom-master | getFrame.m | .m | Softwares_Tom-master/Utilities/getFrame.m | 1,652 | utf_8 | d64d714f6cbb5c8c32e75c5a9a9dc81d | % frm=getFrame(fig,roi)
%
% Figure window capture function that does not capture other things on the
% screen. Functions identical to getframe(fig,rect).
%
% Use the zbuffer or OpenGL renderer for this to work best.
% Example:
% fig=figure('Renderer','zbuffer');
% fig=figure('Renderer','OpenGL');
% fig=figure(... |
github | mc225/Softwares_Tom-master | cropDataCube.m | .m | Softwares_Tom-master/Utilities/cropDataCube.m | 786 | utf_8 | f9a839de04350f32e8fe753085d2ebbf | %[dataCube xRange yRange zRange]=cropDataCube(dataCube, xLim,yLim,zLim, xRange,yRange,zRange)
%
function [dataCube xRange yRange zRange]=cropDataCube(dataCube, xLim,yLim,zLim, xRange,yRange,zRange)
dataCubeSize=size(dataCube);
if (nargin<4 || isempty(xRange))
xRange=[1:dataCubeSize(1)];
end
if (... |
github | mc225/Softwares_Tom-master | czt2fromRanges.m | .m | Softwares_Tom-master/Utilities/czt2fromRanges.m | 2,176 | utf_8 | d3079d5831cd9f2f2c2ba162f53f864f | % f=czt2fromRanges(x,xRange,yRange)
%
% Calculate the partial spectrum of x using the 2-dimensional chirp z transform.
% This would be the same as f=fftshift(fft2(ifftshift(x)))*sqrt(prod(size(x))) for:
% xRange=[0:size(x,1)-1]-floor(size(x,1)/2);yRange=[0:size(x,2)-1]-floor(size(x,2)/2);
% The L2-norm is scaled so tha... |
github | mc225/Softwares_Tom-master | laguerreGaussian.m | .m | Softwares_Tom-master/Utilities/laguerreGaussian.m | 2,460 | utf_8 | 60b0aa63d5e14c6b610a8f80ca7d61e9 | % fieldValues=laguerreGaussian(R,P,Z,pValue,lValue,lambda,beamWaist)
%
% Input:
% R: radial coordinate grid [m]
% P: azimutal coordinate grid [rad]
% Z: axial coordinate grid [m]
% pValue: the p value of the beam (radial)
% lValue: the l value of the beam (azimutal phase index, must be integer)
% ... |
github | mc225/Softwares_Tom-master | cztn.m | .m | Softwares_Tom-master/Utilities/cztn.m | 2,206 | utf_8 | 1d74c2d270bbf524b7787c5ba22409f1 | % f=cztn(x,M,W,A,originCentered)
%
% Calculate the partial spectrum of x using the n-dimensional chirp z transform.
% x: input matrix, centered on central pixel. Implicit zero padding will
% occur at the right and will be corrected for.
% M,W, and A are vectors containing the scalars corresponding to each czt
% per dim... |
github | mc225/Softwares_Tom-master | readDataCubeFromFile.m | .m | Softwares_Tom-master/Utilities/readDataCubeFromFile.m | 2,366 | utf_8 | 52abd793b918c09008c6b1a1add29de4 | % [dataCube maxValue]=readDataCubeFromFile(dataSource,projectionDimensionOrSubCube,frameIndexes,normalize)
%
% Inputs:
% dataSource: string representing the file to read as a data cube, a matfile object, or a VideoReader object.
% projectionDimensionOrSubCube: integer (default []). If not empty, the indicated d... |
github | mc225/Softwares_Tom-master | removeDefocusTiltAndPiston.m | .m | Softwares_Tom-master/Utilities/removeDefocusTiltAndPiston.m | 3,424 | utf_8 | 60ae11d38141188b1b7fcf264f6a3a71 | % [pupilFunctionWithoutDefocusTiltAndPiston defocus tilt piston]=removeDefocusTiltAndPiston(pupilFunction)
%
% Calculates and removes the defocus, tilt, and piston from a pupil function measurement.
%
% pupilFunctionWithoutTilt: the input with the tilt removed
% tilt: the removed tilt in units of Nyquist pixel shifts o... |
github | mc225/Softwares_Tom-master | parsePupilEquation.m | .m | Softwares_Tom-master/Utilities/parsePupilEquation.m | 4,717 | utf_8 | d29b1bb727f91ba713bc8c622fe0889f | % [pupilEquationFunctor argumentsUsed]=parsePupilEquation(pupilEquation,X,Y,time,lambda)
%
% Parses a text string that describes a pupil function into an executable
% matlab function and exectutes it if X and Y are specified.
%
% input:
% pupilEquation: A text string containing the case insensitive variable
% ... |
github | mc225/Softwares_Tom-master | showImage.m | .m | Softwares_Tom-master/Utilities/showImage.m | 10,057 | utf_8 | bcb00fbdb0b3c23fc03dbaf3d31487cb | %
% showImage(imageMatrix,referenceIntensity,X,Y,ax)
%
% imageMatrix: input intensity input between 0 and 1.
% referenceIntensity: Optional argument, the imageMatrix is scaled so that
% its mean intensity(clipped) is equal to referenceIntensity. If
% referenceIntensity is 0, no scaling is applied, if it is -1, the imag... |
github | mc225/Softwares_Tom-master | readDataCubeFromTiffFile.m | .m | Softwares_Tom-master/Utilities/readDataCubeFromTiffFile.m | 3,069 | utf_8 | 42b2b1ffb2e0511874bc46c33899b26c | % [dataCube maxValue]=readDataCubeFromTiffFile(fileName,projectionDimensionOrSubCube,frameIndexes,normalize)
%
% Inputs:
% fileName: string representing the tiff file to read as a data cube
% projectionDimensionOrSubCube: integer (default []). If not empty, the indicated dimension will be returned integrated.
%... |
github | mc225/Softwares_Tom-master | writeDataCubeToTiffFile.m | .m | Softwares_Tom-master/Utilities/writeDataCubeToTiffFile.m | 690 | utf_8 | 048789c54302a950922a9ca9e89235b0 | % writeDataCubeToTiffFile(dataCube,fileName)
%
% Stores a 3D matrix with the frames of a tiff file.
%
% Inputs:
% dataCube: a 3D matrix of real numbers between o and 1.
% fileName: string representing the tiff file to read as a data cube
%
function writeDataCubeToTiffFile(dataCube,fileName)
nbFrames=size(da... |
github | mc225/Softwares_Tom-master | calcOtfGridFromSampleFrequencies.m | .m | Softwares_Tom-master/Utilities/calcOtfGridFromSampleFrequencies.m | 1,260 | utf_8 | 02bdfb7179476c8431955f1d7ab5a07d | % [XOtf,YOtf,fRel]=calcOtfGridFromSampleFrequencies(sampleFrequencies,gridSize,cutOffSpatialFrequency)
%
% sampleFrequencies can be specified as a scalar for both dimensions or as a vector in the order [x y].
% gridSize must thus be specified in the order [y x] instead!
%
% The size of the output arguments equals grid... |
github | mc225/Softwares_Tom-master | getLibraryPath.m | .m | Softwares_Tom-master/Utilities/getLibraryPath.m | 209 | utf_8 | 6d68e5c4ae2f31a57c661868930a2096 | %
% Returns the full path to the matlab/lib/ folder
%
function basePath=getLibraryPath()
functionName=mfilename();
fullPath=mfilename('fullpath');
basePath=fullPath(1:end-length(functionName));
end |
github | mc225/Softwares_Tom-master | ssurf.m | .m | Softwares_Tom-master/Utilities/ssurf.m | 1,967 | utf_8 | a7e13510f9fc04ae5d4eb33b7a91c10a | %
% A replacement for surf that is more friendly to use.
% Data is converted to double and undersampled if required so the system stays responsive.
%
% Use help surf for more information
%
function res=ssurf(varargin)
if (min(size(varargin{1}))<=1),
if (length(varargin{1})>1),
if nargin>1,
... |
github | mc225/Softwares_Tom-master | convertAviToTiff.m | .m | Softwares_Tom-master/Utilities/convertAviToTiff.m | 2,053 | utf_8 | 4298ef4a027d6e77c0b53c2bbc7f0ff4 | % convertAviToTiff(aviFileName,tiffFileName)
%
% Converts a 3D matrix from avi 16 bit format to 16 bit tiff format (lossless compressed).
%
% Inputs:
% aviFileName: the avi file name used as input.
% tiffFileName: (optional) the output file name.
%
function convertAviToTiff(aviFileName,tiffFileName)
if (~st... |
github | mc225/Softwares_Tom-master | readDataCubeFromAviFile.m | .m | Softwares_Tom-master/Utilities/readDataCubeFromAviFile.m | 4,227 | utf_8 | ddce14a073f01179ec8b320eaba40595 | % [dataCube maxValue]=readDataCubeFromAviFile(fileName,projectionDimensionOrSubCube,frameIndexes,normalize)
%
% Inputs:
% fileName: string representing the avi file to read as a data cube, or a VideoReader object.
% projectionDimensionOrSubCube: integer (default []). If not empty, the indicated dimension will b... |
github | mc225/Softwares_Tom-master | saveWithTransparency.m | .m | Softwares_Tom-master/Utilities/saveWithTransparency.m | 1,121 | utf_8 | f33aa5e70c5f09b5d230c8f66234964a | % saveWithTransparency(figHandle,fileName)
%
% Saves a figure as a png image with a transparency
%
function saveWithTransparency(figHandle,fileName)
if (~strcmpi(fileName(end-3:end),'.png'))
fileName=strcat(fileName,'.png');
end
% save the original settings
oldBackGround = get(figHandle,'Color')... |
github | mc225/Softwares_Tom-master | structUnion.m | .m | Softwares_Tom-master/Utilities/structUnion.m | 1,354 | utf_8 | daee76f53f68c07d4875ed91e5be891e | % C=structUnion(A,B)
%
% Combines arrays or structs A and B recursively where leafs (strings and
% scalars) of B have priority. This function is useful in combination with
% the loadjson function.
%
function C=structUnion(A,B)
if (isstruct(A))
if (isstruct(B))
C=A;
for (fieldName=fie... |
github | mc225/Softwares_Tom-master | calcVectorialPsf.m | .m | Softwares_Tom-master/Utilities/calcVectorialPsf.m | 18,363 | utf_8 | 3651612c0d00a7d8e9750789329c0a40 | % [psf, psfField, varargout]=calcVectorialPsf(xRange,yRange,zRange,wavelength,...
% pupilFunctorH,pupilFunctorV,...
% objectiveNumericalAperture,refractiveIndexOfSample,
% objectiveMagnification,objectiveTubeLength,...
% ... |
github | mc225/Softwares_Tom-master | zernikeDecomposition.m | .m | Softwares_Tom-master/Utilities/fitting/zernike/zernikeDecomposition.m | 1,046 | utf_8 | f738c4549c3e2e49d209c22147fbfcf7 | % coefficients=zernikeDecomposition(X,Y,Z,maxTerms)
%
% X, Y and Z should be matrices of real numbers.
%
% Returns:
% coefficients: the vector of standard zernike coefficients, the first of
% which are: piston,
% tip(x),tilt(y),
% defocus, ... |
github | mc225/Softwares_Tom-master | zernikeLinearCombination.m | .m | Softwares_Tom-master/Utilities/fitting/zernike/zernikeLinearCombination.m | 1,130 | utf_8 | 47a385416ec7957becff51b2eff49675 | %The real part of the coefficients are for the even polynomials,
%the imaginary part of the coefficients are for the odd polynomials
function result=zernikeLinearCombination(coefficients,X,Y)
result=zeros(size(X));
[M,N]=getMNFromCoeffiecientUpToIndex(length(coefficients));
for index=1:length(coefficients)
... |
github | mc225/Softwares_Tom-master | zernike.m | .m | Softwares_Tom-master/Utilities/fitting/zernike/zernike.m | 2,529 | utf_8 | 50e1fc9b5c8f7291e2f166ed02d82743 | %
% WARNING: returns two complementary zernike polynomials at the same time as a complex function!
%
% result=zernike(m,n,rho,theta)
% For m>=0, returns the even Zernike polynomial(cos) value as the real part,
% and the odd polynomial(sin) value as the imaginary part. For m<0, the odd
% Zernike value is return... |
github | mc225/Softwares_Tom-master | zernikeComposition.m | .m | Softwares_Tom-master/Utilities/fitting/zernike/zernikeComposition.m | 1,051 | utf_8 | 4405071dfaf5ba4078800f64d46e9cc2 | % Z=zernikeComposition(X,Y,coefficients)
%
% X and Y should be matrices of real numbers.
% coefficients: the vector of standard zernike coefficients, the first of
% which are: piston,
% tip(x),tilt(y),
% defocus, astigmatism-diag,astigmatism-x,
% ... |
github | mc225/Softwares_Tom-master | redHotColorMap.m | .m | Softwares_Tom-master/Utilities/colormap/redHotColorMap.m | 515 | utf_8 | b2a64149ce5f0f2b5893b511cdcfbf6f | % RGB=redHotColorMap(nbEntries)
%
% Creates a color map to be used with the command colormap
% All arguments are optional.
%
% Example usage:
% figure;
% image([0:.001:1]*256);
% colormap(redHotColorMap(256))
function RGB=redHotColorMap(nbEntries)
if (nargin<1 || isempty(nbEntries))
nbEntries=64;
... |
github | mc225/Softwares_Tom-master | spectrumToRGB.m | .m | Softwares_Tom-master/Utilities/colormap/spectrumToRGB.m | 7,556 | utf_8 | ec4f544f967641c392792e9cb31e9976 | % RGB=spectrumToRGB(wavelengths,wavelengthIntensities,constrainValues)
%
% Returns the red green and blue component to simulate a given spectrum.
% The number of dimensions of the returned matrix is equal to that of the
% wavelengthIntensities argument, and the dimensions are the same except
% for the last dimension wh... |
github | mc225/Softwares_Tom-master | colorMapCizmarHighContrastPrint.m | .m | Softwares_Tom-master/Utilities/colormap/colorMapCizmarHighContrastPrint.m | 691 | utf_8 | 51dc78f7fc8819ec4d10e0fab6a8bc5f | % RGB=colorMapCizmarHighContrastPrint(nbEntries)
%
% Based on Tomas' colormap for producing good contrast black and white printouts.
% Creates a color map to be used with the command colormap.
% All arguments are optional.
%
% Example usage:
% figure;
% image([0:.001:1]*256);
% colormap(colorMapCizmarHighContr... |
github | mc225/Softwares_Tom-master | mapColor.m | .m | Softwares_Tom-master/Utilities/colormap/mapColor.m | 1,206 | utf_8 | ecc38ab53fb4a290e9d884eaa8562c56 | % imgRGB=mapColor(img,colorMap)
%
% Converts a gray scale image with values between zero and 1 to an RGB
% image using a color map.
%
% Input parameters:
% img: a two dimensional matrix of intensity values, either uint16,
% uint8, or values between 0 and 1.
% colorMap: a function handle with one input ... |
github | mc225/Softwares_Tom-master | interpolatedColorMap.m | .m | Softwares_Tom-master/Utilities/colormap/interpolatedColorMap.m | 1,053 | utf_8 | ed6b33a97012a75c4a3573a488662222 | % RGB=interpolatedColorMap(nbEntries,colors,colorPositions)
%
% Creates a color map to be used with the command colormap
% All arguments are optional.
%
% Example usage:
% figure;
% image([0:.001:1]*256);
% colormap(interpolatedColorMap(256,[0 .3 0; .7 .3 0; .7 .3 1; .7 1 1],[0 .3 .75 1]))
function RGB=interpo... |
github | mc225/Softwares_Tom-master | examplePartionedSLM.m | .m | Softwares_Tom-master/Examples/examplePartionedSLM.m | 1,632 | utf_8 | 4921f6ad0931333ac6bbc1cc58bf65e1 | %
% examplePartionedSLM()
%
% This example shows how to create two SLM objects that use each a separate part of the same SLM.
% Both parts have different first order deflections and behave entirely independent.
% This method may be used to build a set-up with two spatial light modulators using only one physical device.... |
github | mc225/Softwares_Tom-master | calcCorrectionFromPupilFunction.m | .m | Softwares_Tom-master/AberrationMeasurement/calcCorrectionFromPupilFunction.m | 1,309 | utf_8 | 035663d622768e77fa8cfe3fa093b48f | % pupilFunctionCorrection=calcCorrectionFromPupilFunction(measuredPupilFunction,amplificationLimit)
%
% Calculates the complex value that the SLM has to modulate to counteract
% the aberration specified in measuredPupilFunction. The argument will thus
% be the inverse, and the amplitude will approximatelly be the recip... |
github | mc225/Softwares_Tom-master | aberrationMeasurementZernikeWavefront.m | .m | Softwares_Tom-master/AberrationMeasurement/aberrationMeasurementZernikeWavefront.m | 8,697 | utf_8 | 2042ae8413cb1ccd1e075fdf5be47ce2 | % [measuredPupilFunction zernikeCoefficients Rho Phi]=aberrationMeasurementZernikeWavefront(slm,selectedZernikeCoefficientIndexes,probeFunctor,progressFunctor)
%
% Determines the aberration by tweaking the low-order Zernike terms, hence it cannot correct for amplitude modulations
%
% Input:
% slm: An SLM object
% s... |
github | mc225/Softwares_Tom-master | aberrationMeasurement.m | .m | Softwares_Tom-master/AberrationMeasurement/aberrationMeasurement.m | 15,252 | utf_8 | d9185bb0214172a021f968c69be51b14 | % [measuredPupilFunction eigenVector probeField4DMatrix sampleX sampleY]=aberrationMeasurement(slm,probeGridSize,probeFunctor,progressFunctor)
%
% Determines the aberration based on interference of different deflections
% and calculates the correction function. Multiple probes can be used, such
% as individual pixels o... |
github | mc225/Softwares_Tom-master | selectRegionOfInterestAroundPeakIntensity.m | .m | Softwares_Tom-master/AberrationMeasurement/selectRegionOfInterestAroundPeakIntensity.m | 2,268 | utf_8 | eb0ad4c710b43c1d9d29650c21de21e6 | % [cam centerPos]=selectRegionOfInterestAroundPeakIntensity(cam,slm,roiSizeForCam,centerPos)
%
% Updates the cameras cam's region of interest to a size roiSizeForCam (rows, columns) around the peak intensity, and re-acquires the dark image.
%
% Argument centerPos is optional, when given the algorithm assumes that the
... |
github | mc225/Softwares_Tom-master | aberrationMeasurementCizmarMethod.m | .m | Softwares_Tom-master/AberrationMeasurement/aberrationMeasurementCizmarMethod.m | 14,304 | utf_8 | 470715ef80614ec9134ede2f3097a4c6 | % [measuredPupilFunction pupilFunctionEstimates probeField4DMatrix samplePosX samplePosY]=aberrationMeasurementCizmarMethod(slm,probeGridSize,probeFunctor,progressFunctor)
%
% Determines the aberration using Tomas Cizmar's method as published in Nature Photonics.
%
% Input:
% slm: An Slm object
% probeGridSize: a v... |
github | mc225/Softwares_Tom-master | laguerreGaussian.m | .m | Softwares_Tom-master/Vortices/laguerreGaussian.m | 2,460 | utf_8 | 60b0aa63d5e14c6b610a8f80ca7d61e9 | % fieldValues=laguerreGaussian(R,P,Z,pValue,lValue,lambda,beamWaist)
%
% Input:
% R: radial coordinate grid [m]
% P: azimutal coordinate grid [rad]
% Z: axial coordinate grid [m]
% pValue: the p value of the beam (radial)
% lValue: the l value of the beam (azimutal phase index, must be integer)
% ... |
github | mc225/Softwares_Tom-master | createCellRotationMovie.m | .m | Softwares_Tom-master/LightSheet/createCellRotationMovie.m | 7,854 | utf_8 | 4bd6ac1b97e8b2ad135c26d237d96471 | function createCellRotationMovie(inputFolder,outputFileName)
close all;
if (nargin<1 || isempty(inputFolder))
inputFolder='Z:\RESULTS\2013-05-14_cellspheroidsWGA\2013-05-14_cellspheroidsWGA_filter_ap1-2B';
end
if (nargin<2 || isempty(outputFileName))
outputFileName='rotatingCells.avi';
... |
github | mc225/Softwares_Tom-master | processBeadsDataForResolutionPlot.m | .m | Softwares_Tom-master/LightSheet/processBeadsDataForResolutionPlot.m | 8,844 | utf_8 | 8f3e4c42781b7132bc9478b2ed1fe959 | % processBeadsDataForResolutionPlot(xRange,yRange,zRange,localizationData,testData)
%
%
function processBeadsDataForResolutionPlot(inputFolder)
close all;
if (nargin<1)
% inputFolder='Z:\RESULTS\20120501_alpha7_int1000_g1_littlemorepower_betterfocus_beads_leftofprobe\backwardScans\';
% inputFol... |
github | mc225/Softwares_Tom-master | processWaterImmersionLightSheetVideos.m | .m | Softwares_Tom-master/LightSheet/processWaterImmersionLightSheetVideos.m | 12,633 | utf_8 | 6028c4132c363cffd845cac365f8b6ed | % processWaterImmersionLightSheetVideos(folderNames,reprocessData,centerOffset,scanShear,perspectiveScaling)
%
% Reads the recorded date, converts it the matrices and deconvolves.
%
% Input:
% folderNames: a string or cell array of strings indicating folders with avi and json files.
% reprocessData: When fals... |
github | mc225/Softwares_Tom-master | previewLightSheetRecording.m | .m | Softwares_Tom-master/LightSheet/previewLightSheetRecording.m | 14,251 | utf_8 | bb3e71b726033e265c16bae42cd79784 | % outputFullFileName=previewLightSheetRecording(fileNameGreen,fileNameRed)
%
% A function to show recorded light sheet movies before deconvolution.
% The second argument is optional.
% Instead of two arguments, both file names can be specified as a cell
% array of strings
%
% Returns the full file name path to a video ... |
github | mc225/Softwares_Tom-master | createResolutionPlots.m | .m | Softwares_Tom-master/LightSheet/createResolutionPlots.m | 5,848 | utf_8 | 3926c9cb0e53005fde863d823f74127a | % createResolutionPlots(sourceFolder)
%
%
function createResolutionPlots(sourceFolder)
if nargin<1 || isempty(sourceFolder)
sourceFolder=uigetdir('.','Select Data Folder...');
if (isempty(sourceFolder))
logMessage('User cancelled');
return;
end
end
sliceW... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.