sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
1d22d74fe77a475f7e34ac5291f7cda9d9aa2a98aa394272b18ebbdb874606df | MATLAB | 204 | 5 | function p = z2p(z)
% Transforms z-value (e.g. the output of zBinomialComparison) into a p-value
p = cdf('norm',-(abs(z)),0,1)*2; % 2 as it's two-tailed (we ignore the sign by taking the absolute value) |
f0592b5ea6c6d6c4def023ee0b57b14120cfab8b0313cdabea82892b6b1b9a90 | MATLAB | 204 | 10 | %{
aodpre.Timeseries (imported) # raw trace from each channel
-> aodpre.ScanPoint
-> aodpre.Channel
-----
trace : longblob # fluorescent trace from given channel
%}
classdef Timeseries < dj.Relvar
end |
89718a17dade8748836eec4915bc4eb04958c66076d00f45a80fa3bcd0b60966 | MATLAB | 205 | 11 | function letter=alphabet(index,capital)
if ~exist('capital','var')
capital=false(size(index));
end
list='abcdefghijklmnopqrstuvwxyz';
letter=list(index);
letter(capital)=upper(letter(capital));
|
76bda5abf108693e8f13339489fdb682fbe4b2d4686392f4158a77a29a2edae9 | MATLAB | 206 | 10 | %{
experiment.Software (lookup) #
software : varchar(20) # name of the software
version : char(10) # version
---
%}
classdef Software < dj.Relvar
end |
9cd32b858ade347f30bd54a098d476e50dacb18f1cfb9a2f506922eb396f5436 | MATLAB | 206 | 11 | % Encuentra las secuencias en la matriz Pk_edos. LC
function [sec_Pk_edos]=secuencias(Pk_edos)
picos=size(find(Pk_edos),1);
for sii=1:picos
[aa,ss]=find(Pk_edos==sii);
sec_Pk_edos(sii)=ss;
end;
|
bfd63ea86a878185059febd2071546c5874c0d3129f0d6214993944158a79fb2 | MATLAB | 207 | 10 | clear;
spm_path = '/this/is/for/nipype/spm_path';
pved_path = '/this/is/for/nipype/pved_path';
addpath(spm_path);
addpath(pved_path);
fib_dir = '/this/is/for/nipype/fib_dir';
pved_est(fib_dir, pved_path); |
56656cb4f0c557f0f1e7b733e59697d14750652e0a7f896fd365da9d9607b070 | MATLAB | 208 | 4 | function result = hlp_cpuload
% Get the relative CPU load
osbean = java.lang.management.ManagementFactory.getOperatingSystemMXBean();
result = osbean.getSystemLoadAverage() / osbean.getAvailableProcessors();
|
660763fa45c97e5a919a13818b78ab4630dc7e94e89b5a766153f06e8059b084 | MATLAB | 208 | 5 | function hostip = hlp_hostip()
% Find the host IP address in a platform-independent fashion.
import java.net.InetAddress;
hostip = char(InetAddress.getLocalHost());
hostip = hostip(find(hostip=='/',1)+1:end); |
f9f8ce1f1b35cbbe9e4acc2f65ca6442cdc652e52fcc60a8daef251cdcf3fe69 | MATLAB | 208 | 7 | function [outputArg1,outputArg2] = batchPlotStim(inputArg1,inputArg2)
%BATCHPLOTSTIM Summary of this function goes here
% Detailed explanation goes here
outputArg1 = inputArg1;
outputArg2 = inputArg2;
end
|
4104c41652b147e47919ffa6547bfd92eafb571421a4d09c3ed52ae263e063fe | MATLAB | 209 | 12 | %{
aodpre.ScanPoint (imported) # my newest table
-> aodpre.Set
point_id : smallint # scan point numer
-----
x : float # (um)
y : float # (um)
z : float # (um)
%}
classdef ScanPoint < dj.Relvar
end |
03e9054a1190aea10c6040e81532ad64d32dfd85dc291d08393d378e263b1597 | MATLAB | 210 | 13 | function [rat]=ratiopower(x,y)
%Entrada de dos se�ales x e y. Fs sampling de frequencia.
%Normatization
size(x)
size(y)
%x=x-mean(x);
%y=y-mean(y);
Px=x.^2;
Py=y.^2;
mpx=mean(Px);
mpy=mean(Py);
rat=mpx/mpy;
|
1379e614d4d58c3bdbb4447eaa4a7e5a88d2d6bd057645766da90f79ac34a7d3 | MATLAB | 210 | 8 | function [datapath, ratList, sexList] = my_get_paths
datapath =...
['..' filesep 'Data' filesep 'A_Structs_Final' filesep];
a = load([datapath 'ratList.mat']);
ratList = a.ratList;
sexList = a.sexList;
end |
ce0cdcf72e0f8607236841f427c0992a9c7eed1bd6b0cbc99eab41e467f66f63 | MATLAB | 210 | 7 | function analysisDir = getAnalysisDir(params)
analysisDir = fullfile(params.pth, 'Analysis');
if ~exist(analysisDir, 'Dir')
mkdir(analysisDir);
disp(['Created directory ' analysisDir '!!!']);
end |
ce81cbb683a49931786637aabf125d38841706541f428364fa17a6d1379228dd | MATLAB | 210 | 8 | r = experiment.Session * experiment.AutoProcessing & 'session_date>"2016-02"';
while true
while progress(preprocess.ExtractRaw, r)
parpopulate(preprocess.ExtractRaw, r)
end
pause(1000)
end
|
ef66a735de6cda98df4505c1b0e8001cbf12316289de69005863e56796a47f62 | MATLAB | 210 | 10 | function [rez] = cleaning_ncc(rez,clusterN,Th)
id_i = find(rez.st(:,end)==clusterN);
del_id = find(rez.st(id_i,4)<Th);
id = id_i(del_id);
rez.st(id,:) = [];
rez.best_channel_M(id,:)=[];
|
97cebe9b903857cfd971f7153be1a450b4fa8d1b98a91bb60e2de4c0a03370ee | MATLAB | 211 | 8 | function [out] = FlipLR(sn)
% Wrapper for flipping left-right azimuths for those subjects who had
% channels reversed (pilot 1 and 2)
out.lp = fliplr(sn.lp);
out.hp = fliplr(sn.hp);
out.bb = fliplr(sn.bb);
end
|
acbf0613849e2c2f786d4ed04072c4d760e5e62f930035cb18ac5bf0db2cf8af | MATLAB | 211 | 6 | function fname = make_save_fname(jobname, njob, parm)
% File name for Save
% Result file name
fname = sprintf('%s-%s-%d-%d.mat', parm.savefile, jobname, parm.Ntrain, njob);
fname = [parm.rootdir fname];
|
b16cf7f2447c7378a8ddb00a4b23a09f1c81fa48bbe877bf20dfdf1a01535a2e | MATLAB | 211 | 5 | function hostname = hlp_hostname()
% Find the hostname in a platform-independent fashion.
import java.net.InetAddress;
hostname = char(InetAddress.getLocalHost());
hostname = hostname(1:find(hostname=='/',1)-1); |
db2e2b0abf4ae52431118aaa2c3a6f2b011b616b0a26fe9ab4cd5a1cd6f3820c | MATLAB | 211 | 9 | function X = make_rand_orth(M,N)
% Make M x N random normalized matrix
% X = make_nn_diag(N,K)
if nargin==1, N=M; end;
X = randn(M,N);
X = repmultiply(X, 1./sqrt(sum(X.^2,2)));
%X = X + 0.1*eye(M,N);
|
3b5d8f032b43831718f63f1c60f23e2e50511d402c712d9d13070483909785e8 | MATLAB | 212 | 11 | function r2 = calc_r2( ActualY, EstimatedY )
%CALC_R2 Calculate r2
Rss = sum( ( repmat( ActualY, 1, size(EstimatedY,2) ) - EstimatedY ).^2 );
r2 = 1 - Rss / sum((ActualY-mean(ActualY)).^2);
end
|
17fa6963649babc69276b3c5b9452b7b2b861251da0fab921c27646cb9e7d0b7 | MATLAB | 213 | 15 | function [z] = normalz(p,mu,sigma)
if nargin < 3
sigma = 1;
end
if nargin < 2
mu = 0;
end
if nargin < 1
error('Wrong input argument list.');
end
z = mu+sqrt(2)*sigma*erfinv(2*p-1);
end |
9e26cedf1a7dfb9bf146e09ed4ee4d39790bc5dee3378a8c1c6416f28162f3d2 | MATLAB | 216 | 5 | function [ sitenames,s_sitenames ] = get_sitenames()
% function [ sitenames,s_sitenames ] = get_sitenames()
sitenames = {'A','PHC','EC','H'};
s_sitenames = {'LA','RA','LPHC','RPHC','LEC','REC','LH','RH'};
end |
6f13ca3cfa60686a4ec0d29267ef472a8cda054fb7ed1137f5abf9fc10803d6a | MATLAB | 217 | 16 | function [data] = tapas_sem_hier_prepare_data(data, model, inference)
%% Return a structure ready to be used.
%
% Input
%
% Output
%
% aponteeduardo@gmail.com
% copyright (C) 2016
%
data = data;
end
|
84f0a4880df2d99aa4e4a7637ba9c92c4b8594faa52abfd41ca3455de8193558 | MATLAB | 217 | 8 | function [] = dispL(s,Lmin,L)
%dispL: displays at different levels of verbosity
%if suppled L >= Lmin, message is displayed. otherwise not displayed
%allows for differnet levels of output
if L >= Lmin
disp(s)
end |
bdce37db06c018f2b9825be074f353406b7e0c23a01d5fc133fdb0c53eff5867 | MATLAB | 218 | 10 | %{
experiment.ScanEyeVideo (manual) # name of the running wheel file
-> experiment.Scan
---
filename : varchar(50) # filename of the video
%}
classdef ScanEyeVideo < dj.Relvar
end |
723ad9efbcc715db8818ea5f643546c9a2f0de4610593306941f710108625728 | MATLAB | 219 | 10 | function out = stars(p)
for i = 1:length(p)
if p(i) < 0.001; out{i} = '***';
elseif p(i) < 0.01; out{i} = '**';
elseif p(i) < 0.05; out{i} = '*';
elseif p(i) < 0.1; out{i} = '^';
else out{i} = ' ';
end
end
|
76433c7453820fc0eba578963142d0392fbcd046def5c81548a6a6472b28ebe6 | MATLAB | 219 | 16 | function [data] = tapas_sem_multiv_prepare_data(data, model, inference)
%% Return a structure ready to be used.
%
% Input
%
% Output
%
% aponteeduardo@gmail.com
% copyright (C) 2016
%
data = data;
end
|
99262aaa3d79bbd06a2bf3e0df809ae86f9d3ffec704f7231e1de03a81e61a79 | MATLAB | 220 | 13 | function d = qLength( Q )
% qLength: quaternion length (norm)
% d = qLength( Q )
% IN:
% Q - input quaternion
%
% OUT:
% d - quaternion's norm (length)
%
% VERSION: 03.03.2012
d = sqrt( sum( Q .* Q ));
|
a1b596e68c281aed17c9da157fc56ff3cb5a56f26acf6e7ff08dd2e733ef761b | MATLAB | 220 | 6 | function [plot_value] = pad_nans_to_struct(plot_value)
num_vals = structfun(@(x)numel(x),plot_value);
max_num = max(num_vals)+1;
plot_value = structfun(@(x)[x(:);nan((max_num-numel(x)),1)],plot_value,'un',0);
end
|
bf1699d5415232bda0da27e4d264c221649bcb6e2a45c5eb3dd14156bee72211 | MATLAB | 220 | 15 | function [p] = normalcdf(x,mu,sigma)
if nargin < 3
sigma = 1;
end
if nargin < 2
mu = 0;
end
if nargin < 1
error('Wrong input argument list.');
end
p = 0.5*erfc(-(x-mu)./(sqrt(2).*sigma));
end |
1138dbba4636d35b74e1db70d2268229b8e7f515fea0ac0b4aaef60a9d8dc4c4 | MATLAB | 221 | 13 | %{
# defines the target of segmentation and the channel to use
-> experiment.Scan
-> shared.Field
-> shared.Channel
-> shared.SegmentationMethod
---
-> experiment.Compartment
%}
classdef SegmentationTask < dj.Manual
end |
9da55be75035eabbacc08e5782f1233bfa3e1409ed184cd031fc4899e8e3f3be | MATLAB | 221 | 8 | function [data_bc] = baselineCorrect(T, t1bl, t2bl, data)
[~ , t1] = min(abs(T-t1bl));
[~ , t2] = min(abs(T-t2bl));
baseline = min(mean(data(:,t1:t2), 'omitnan'));
data_bc = data - baseline;
end
|
fff2f7e1d6ce3901ff4d0aeef73720dd9ae3cf6e474961e882b9c6d031829689 | MATLAB | 222 | 9 | function [newdata] = untitled2(array)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
rank = tiedrank(array);
p = rank / ( length(rank) + 1 );
newdata = norminv( p, 0, 1 );
end
|
a89fd304a72a32960a8afed6fed683b44b29923a36cd0e186819e1d1b2527da6 | MATLAB | 223 | 10 | function obj = elbo_subspace(obj)
D = prod(obj.lat);
obj.lbU = trace(obj.ULU + D * obj.iAu) ...
+ D * brca.utils.logdetPD(obj.Au) ...
- D * obj.M;
obj.lbU = - 0.5 * obj.lbU;
end
|
617f60c3492ce3bf48b0d25bcca2f2b5c7677735d14445ee1fbe2cac96195a63 | MATLAB | 224 | 18 | %{
#
-> meso.ScanDone
-> fuse.ScanDone
%}
classdef ScanDoneMeso < dj.Computed
methods(Access=protected)
function makeTuples(self, key)
%!!! compute missing fields for key here
% self.insert(key)
end
end
end |
7cc0da91ed330d535ce0d8e745039f118415ba86f03ec2883c9793030bc1b493 | MATLAB | 224 | 10 | function [f,g,h] = fminunc_wrapper(x,F,G,H)
% [f,g,h] = fminunc_wrapper( x, F, G, H )
% for use with Matlab's "fminunc"
f = F(x);
if nargin > 2 && nargout > 1
g = G(x);
end
if nargin > 3 && nargout > 2
h = H(x);
end
|
80f87fd1393d0d1dd7cdec1cca45bbf7f1d5345572bcd3705f122bb2146fd6d8 | MATLAB | 224 | 18 | %{
#
-> meso.Activity
-> fuse.Activity
%}
classdef ActivityMeso < dj.Computed
methods(Access=protected)
function makeTuples(self, key)
%!!! compute missing fields for key here
% self.insert(key)
end
end
end |
84fd63b45c946770c6eaad4d91f71acf887d92e7ea5c056d86bde300f1dd2e8a | MATLAB | 224 | 10 | %{
# stim type, visual or auditory
stim_type_id : tinyint # 1=visual, 2=auditory
---
stim_type : varchar(32) # name of the type
%}
classdef StimTypes < dj.Manual
end |
c921699fd70efc277c973ad6a7e695ee57dd419d305bee10a487ac5068599249 | MATLAB | 224 | 13 | function y=AtAfunc(x)
% y=AtAfunc(x)
% Testfunction defining a linear operator applied to x.
% Used for testing laneig.
%
% y = A'*(A*x)
% Rasmus Munk Larsen, DAIMI, 1998
global A MxV
y = A'*(A*x);
MxV = MxV + 2;
|
f87b2aa4828fc331e40fed61e9feab8be29f889bd715830717420fd28da8312a | MATLAB | 224 | 11 | %{
experiment.SessionTargetStructure (manual) # specifies which neuronal structure was imaged
-> experiment.Session
-> experiment.Fluorophore
-> experiment.Compartment
---
%}
classdef SessionTargetStructure < dj.Relvar
end |
32ae8711b826aa7cb2f8b761259c18ef98c9683404828a22fa9162350ae77708 | MATLAB | 225 | 8 | function elbo = ELBOloss(x, xPred, zMean, zLogvar)
squares = 0.5*(xPred-x).^2;
reconstructionLoss = sum(squares, [1,2,3]);
KL = -.5 * sum(1 + zLogvar - zMean.^2 - exp(zLogvar), 1);
elbo = mean(reconstructionLoss + KL);
end |
6169d457778a893f184c52828f18b0f486877956f3ef67fc74dda246a72c2028 | MATLAB | 226 | 19 | function y = clamp(x,a,b)
% clamp - clamp a value
%
% y = clamp(x,a,b);
%
% Default is [a,b]=[0,1].
%
% Copyright (c) 2004 Gabriel Peyré
if nargin<2
a = 0;
end
if nargin<3
b = 1;
end
y = max(x,a);
y = min(y,b); |
e5f22dffde329511523c2cb32a64776cc118fc9f12d73b0ab13081a2cce98e81 | MATLAB | 226 | 13 | function Q = qConj( Q1 )
% qConj: quaternion conjugation
% Q = qConj( Q1 )
% IN:
% Q1 - input quaternion
%
% OUT:
% Q - output quaternion
%
% VERSION: 03.03.2012
Q1 = reshape( Q1, 4, 1 );
Q = [Q1(1);-Q1(2:4)]; |
59233a35d69133a378e1eb9f5f6a007c597655b406fd3705f70547d291b64d47 | MATLAB | 227 | 10 | %{
experiment.BrainArea (lookup) # recording brain area
brain_area : char(12) # brain area short name
---
area_description : varchar(2048) #
%}
classdef BrainArea < dj.Relvar
end |
4cfdb8fe0933349bdaf2199feb0794829cf5c0cd1c7b461dcd218508b38fb494 | MATLAB | 229 | 7 | function removeAxis()
%REMOVEAXIS Remove X and Y axis from plot
ax1 = gca; % gca = get current axis
ax1.YAxis.Visible = 'off'; % remove y-axis
ax1.XAxis.Visible = 'off'; % remove x-axis
end
|
c60f955e79e358f90767664639e73c29314e591a3ce48e61509ec93c695c9a77 | MATLAB | 229 | 9 | function cart_data = findCart(kgrid,array)
x_vec = kgrid.x_vec;
y_vec = kgrid.y_vec;
z_vec = kgrid.z_vec;
x_cart = x_vec(array(:,1));
y_cart = y_vec(array(:,2));
z_cart = z_vec(array(:,3));
cart_data = [x_cart y_cart z_cart];
end |
c837198e3f2af1de8bf22d35155908c0641475379766dc327beb07bfcfb62da7 | MATLAB | 229 | 13 | function LRflip = flipCheck(nii1,nii2)
% uses OtsuThreshold
%
% nii1 = nii_load(img1,1);
% nii2 = nii_load(img2,1);
if nii1.hdr.dime.pixdim(1) == -nii2.hdr.dime.pixdim(1)
LRflip = 1;
else
LRflip = 0;
end
|
dad9c239d57a64e7f720e7a3b5561bee7e9cebf5433ac9493c412f124176075a | MATLAB | 229 | 5 | function [c, ceq] = myNonlinearConstraints(x)
% Inequality constraints (c(x) <= 0)
c = x(1:end-1) - x(2:end); % This gives: x1 - x2 <= 0, x2 - x3 <= 0, ..., x(n-1) - x(n) <= 0
ceq = []; % No equality constraints
end |
df95961552a7497d02cd45b6d53d22af65b14933ba887c1f9618212bdd0049bc | MATLAB | 230 | 11 | %{
vis.MovieClipCond (manual) # movie clip conditions
-> vis.Condition
---
-> vis.MovieClip
cut_after : float # (s) cuts off after this duration
%}
classdef MovieClipCond < dj.Relvar
end |
ecbf5a776996c129ab443a725bedf1b790a90562984a238830a158532c02df0b | MATLAB | 230 | 10 | %{
experiment.Anesthesia (lookup) # Anesthesia type
anesthesia : char(20) # anesthesia short name
---
anesthesia_description : varchar(2048) #
%}
classdef Anesthesia < dj.Relvar
end |
0e706710ab1a01f643508eed4869dd30a0b848169743573472f25c85d0b0e5ff | MATLAB | 231 | 8 | function eegplot_readkey(src,evnt)
% eegplot helper function to read key strokes
if strcmp(evnt.Key, 'rightarrow')==1
eegplot('drawp',4);
elseif strcmp(evnt.Key, 'leftarrow')==1
eegplot('drawp',1);
end
|
308e31e7ede44f50b5d0ef84020323c760f0cbd380fe96d4275fbd2e667b4c96 | MATLAB | 231 | 7 | function test_align_axislabels(~,~)
h_a = gca;
[thx,thy,thz] = axislabel_rotation_angle(h_a);
set(get(h_a,'xlabel'),'rotation',thx(1));
set(get(h_a,'ylabel'),'rotation',thy(1));
set(get(h_a,'zlabel'),'rotation',thz(1));
end
|
1666750627f968b0c2bc0aaf0be2057990739351341c4b17e334b441b6f7f51e | MATLAB | 232 | 11 | function axisEqual
% axisNotSoTight;
xlims = get(gca, 'xlim');
ylims = get(gca, 'ylim');
newlim(1) = min([xlims(1) ylims(1)]);
newlim(2) = max([xlims(2) ylims(2)]);
% set the two axes to be the same
xlim(newlim); ylim(newlim);
end |
4ec9a3106ce06a4e34c1a4c362b5e9f8d86fb3e7f83a86b59262b5c37ecad3b0 | MATLAB | 232 | 12 | function y=Atransfunc(x)
% y=Atransfunc(x)
% Testfunction returning the transpose of a linear operator applied to x.
% Used for testing lansvd.
%
% y = A'*x
% Rasmus Munk Larsen, DAIMI, 1998
global A MxV
y = A'*x;
MxV = MxV + 1;
|
6c83a13861cce7405a4e39e58d151efdf36558198f6fde995517d5be2f89911d | MATLAB | 232 | 13 | %{
map.Area (lookup) #
area : enum('V1','P','POR','PM','AM','A','RL','AL','LI','LM') # area name
---
%}
classdef Area < dj.Relvar
methods
function self = Area(varargin)
self.restrict(varargin{:})
end
end
end |
372ce87c79efbf7495142ad686f86b0e27ef75d9c2c28ffdd5bb78e8b3f8ad24 | MATLAB | 233 | 10 | %{
vis.Condition (manual) # trial condition -- one condition per trial. All stimulus conditions refer to Condition.
-> vis.Session
cond_idx : smallint unsigned # condition index
---
%}
classdef Condition < dj.Relvar
end |
6211f502f3de213c3fd60cedc2582ca6498967af5f739db01ae47e7d6e91992e | MATLAB | 233 | 12 |
% this callback is attached by demopanelD
function demopanel_callback(data)
p = data.panel;
p
p.object
disp(['callback fired: object type was "' get(p.object, 'type') '"'])
disp(['panel position was "' num2str(p.position) '"'])
|
7251ae9ce19a9cd3d8bb5e46b388361d47c13daa26d799a73f0d2071955cfbc8 | MATLAB | 233 | 10 | manually make T1 T2 EPI loop, 4x.
T2 - SWI loop, 4x.
T1 - TOF loop, 4x.
T2 - DWI loop, 4x.
then:
ffmpeg -framerate 1 -pattern_type glob -i '*.png' -crf 18 -c:v libx264 -pix_fmt yuv420p T1-T2-EPI.mp4
T2-SWI.mp4
T1-TOF.mp4
T2-DWI.mp4
|
91b70b3f4195df41f152d03277d2c8b1aaa33b48180622b3b0b0c8e23b06ac10 | MATLAB | 233 | 6 | %%%make reconstructed EMG
function [edata] = estEMG(temp,SR,hdat,binlength)
comh = [hdat;zeros(binlength*SR-1,length(hdat))]; %% hdat=1*N?
comh = reshape(comh,1,binlength*SR*length(hdat)); %for comvolution
edata = conv(comh,temp);
|
d44ade51780f9eb2c4955748456f845c8103e8012f2f3e3b273ba8b5eb3bd205 | MATLAB | 233 | 12 | function Q = qInv( Q1 )
% qInv: quaternion reciprocal (inverse)
% Q = qInv( Q1 )
% IN:
% Q1 - input quaternion
%
% OUT:
% Q - reciprocal of Q1, i.e. Q1*Q = 1
%
% VERSION: 03.03.2012
Q = qConj( Q1 ) ./ qLength( Q1 )^2; |
3fcf3966d953055c3272c6415b86fe77dee1ca7b7ff48e8aad11a2481607f82e | MATLAB | 234 | 10 | %{
preprocess.EyeQuality (lookup) # Different eye quality definitions for Tracking
eye_quality : smallint #
---
description : varchar(255) #
%}
classdef EyeQuality < dj.Relvar
end |
2d9383d92295161ff9f56747d1005c16d2155160bf383fa48055f03f88d3f01c | MATLAB | 235 | 9 | function [Y] = spatial_downsample(thisY,d1,d2)
T = size(thisY,3);
C = arrayfun(@(x)imresize(thisY(:,:,x),[d1,d2]),1:T,'UniformOutput',false);
Y = nan(d1,d2,T);
for t = 1:T
Y(:,:,t) = C{t};
end
end
|
65b5b57ab1eabd760a3c5f79f9a3599a118491b4c38894b73b2e62351e619335 | MATLAB | 235 | 7 | function removereject_Callback(hObject, eventdata, handles)
handles.data.calls = handles.data.calls(handles.data.calls.Accept == 1, :);
handles.data.currentcall = 1;
update_fig(hObject, eventdata, handles);
guidata(hObject, handles); |
7cabf9009bc274b305b59b9549b6af2ec979a2a81dc6f575eec0886b67c697dc | MATLAB | 235 | 17 | %{
#
-> preprocess.PrepareGalvoAverageFrame
%}
classdef ManualCellLocations < dj.Imported
methods(Access=protected)
function makeTuples(self, key)
%!!! compute missing fields for key here
%self.insert(key)
end
end
end |
4b55c61ea16c44960fb66a05eeb7db1abc50992327363d2daa42477540d9644d | MATLAB | 236 | 13 | function [inference] = tapas_vlinear_prepare_inference(data, model, inference)
%%
%
% aponteeduardo@gmail.com
% copyright (C) 2016
%
inference = tapas_linear_prepare_inference(data, model, inference);
inference.kernel{3} = [];
end
|
7a0a6d3205e71d30f68b0db27ffeb341e74902209e214948dd164a70481f3ec3 | MATLAB | 236 | 10 | function [rez] = cleaning_amp(rez,channel,clusterN,Th)
id_i = find(rez.st(:,end)==clusterN);
del_id = find(rez.best_channel_M(id_i,channel)>Th);
id = id_i(del_id);
rez.st(id,:) = [];
rez.best_channel_M(id,:)=[];
|
2b1bb5e47bf5deab14016a429ed8500de176893315fab9c61919324b992cefe8 | MATLAB | 237 | 18 | %{
#
-> `pipeline_reso`.`__scan_set`
-> fuse.ScanSet
%}
classdef ScanSetReso < dj.Computed
methods(Access=protected)
function makeTuples(self, key)
%!!! compute missing fields for key here
% self.insert(key)
end
end
end |
51e67b6c51b2b792a2aa93dd6acf16eca49c9576db1e49a02d8ee88521c42c5e | MATLAB | 237 | 6 | =============== grand mean and grand r2
√ MOV GRAND MEAN. "NSD-glmdata-glmBASICorthMID0-42.mp4" + varexp
- taken from "NSD-glmdata-glmBASIC"
-> 6 fps, handbrake (HQ 1080, custom 0000 (for cropping)) -> grandmean.mp4, grandR2.mp4
|
aa3156640df98187424ab2a9cb9eda928e04269e07f9ca52dee6ed7e54e29fe2 | MATLAB | 237 | 18 | %{
#
-> `pipeline_meso`.`__scan_set`
-> fuse.ScanSet
%}
classdef ScanSetMeso < dj.Computed
methods(Access=protected)
function makeTuples(self, key)
%!!! compute missing fields for key here
% self.insert(key)
end
end
end |
048964e8abcdccfad792212659e02bf97d333ef697380f0136501de61a6ee71c | MATLAB | 239 | 17 | %{
# set of all units in the same scan
-> meso.Fluorescence
%}
classdef ScanSet < dj.Computed
methods(Access=protected)
function makeTuples(self, key)
%!!! compute missing fields for key here
% self.insert(key)
end
end
end |
0f86e31ecdf0b9a3f0f6930a8399c8a688228bdefea8260277545ffcef018404 | MATLAB | 239 | 18 | %{
#
-> `pipeline_reso`.`__activity`
-> fuse.Activity
%}
classdef ActivityReso < dj.Computed
methods(Access=protected)
function makeTuples(self, key)
%!!! compute missing fields for key here
% self.insert(key)
end
end
end |
f467b04e77884265f1538db722e5e39d636704298d4f00ddf65dd32f7dac2e97 | MATLAB | 239 | 17 | %{
# set of all units in the same scan
-> reso.Fluorescence
%}
classdef ScanSet < dj.Computed
methods(Access=protected)
function makeTuples(self, key)
%!!! compute missing fields for key here
% self.insert(key)
end
end
end |
37e5bf990fbf978e4ed44257d8ae6e77a3dd5f43c0b349b26b1db0ff87fdb355 | MATLAB | 240 | 17 | %{
# stitches together overlapping rois
-> stack.StackInfo
%}
classdef Stitching < dj.Computed
methods(Access=protected)
function makeTuples(self, key)
%!!! compute missing fields for key here
% self.insert(key)
end
end
end |
5c7aa440c1c3a1b4d81a0b2a021412ff5e9cef56e24a358e9dd8e6b29ca757f8 | MATLAB | 240 | 9 | function oneFigureHandle = checkOneFigureHandle(Params, oneFigureHandle)
if Params.showOneFig
if ~isgraphics(oneFigureHandle)
oneFigureHandle = figure;
end
else
oneFigureHandle = 0;
end
end |
66a22f3ed8af37db36c68a7feefea05c34cb43eea2870c1b2a7b2bf1b1a656a6 | MATLAB | 240 | 4 | function v = hlp_gcc_version()
% Get the GCC version in a numeric format that can be compared with <, >, etc.
% returns [] if the GCC compiler is not installed.
[a,b]=system('gcc --version'); v= str2num(strrep(b(11:15),'.','')); %#ok<ASGLU> |
905d68e08accaa15f8a2e112bc49e16d3d2a5af7a6f60c71742728419fa4a459 | MATLAB | 240 | 18 | %{
#
-> `pipeline_reso`.`__scan_done`
-> fuse.ScanDone
%}
classdef ScanDoneReso < dj.Computed
methods(Access=protected)
function makeTuples(self, key)
%!!! compute missing fields for key here
% self.insert(key)
end
end
end |
bb67b931af0dc524219decaad42e99c4ea4d097a4b64bdf6676ddb78c54b160c | MATLAB | 240 | 18 | function d = nb_dims(x)
% nb_dims - debugged version of ndims.
%
% d = nb_dims(x);
%
% Copyright (c) 2004 Gabriel Peyré
if isempty(x)
d = 0;
return;
end
d = ndims(x);
if d==2 && (size(x,1)==1 || size(x,2)==1)
d = 1;
end |
d3bc7edbdb48ca34ba005ce52cd9e7f43162c1ecc556380a4ee13858c62c7969 | MATLAB | 240 | 11 | function [h,m,s] = sectotime (ts)
%[h,m,s] = sectotime (ts)
%
% ts : time in seconds
% [h,m,s] : hour, minute, second representation of ts
%
% Ziad Saad Oct 22 97
%
h = fix(ts./3600);
m = fix(rem(ts,3600)./60);
s = rem(rem(ts,3600),60);
|
ee4e2ad408af9f97cadb38479d335599d0d52f6a60d12137fae2a28dcd2865ec | MATLAB | 240 | 10 | %{
experiment.Fluorophore (lookup) # calcium-sensitive indicators
fluorophore : char(10) # fluorophore short name
---
dye_description : varchar(2048) #
%}
classdef Fluorophore < dj.Relvar
end |
3dfbebde64919c53c9e075614ca11c8352b62be74d886d495bfda52c753f4f72 | MATLAB | 241 | 10 | %% uility function
function res = SetImgRange(img,range)
imgMax = range(2);
imgMin = range(1);
img(img<imgMin) = imgMin;
img(img>imgMax) = imgMax;
img(isinf(img)) = imgMin;
img(isnan(img)) = imgMin;
res = img;
end |
64d2d7a124f10ecd1fbd845682090de73ef671cbbe6837606c0dd5a442a75afe | MATLAB | 241 | 14 | function ps = cs2psd(cs)
% (C) 2018 Stefan Haufe
[nfreq nchan nchan njack] = size(cs);
coh = cs;
for ijack = 1:njack
for ifreq = 1:nfreq
ps(ifreq, :, ijack) = real(diag(squeeze(cs(ifreq, :, :, ijack))));
end
end
|
e40fc8b279cb25f07da141412af1eb06c2b43ff837702f80e2e298e8a75fe01f | MATLAB | 241 | 10 | %{
experiment.Aim (lookup) # Declared purpose of the scan
aim : varchar(36) # short name for the purpose of the scan
---
aim_description : varchar(255) #
%}
classdef Aim < dj.Relvar
end
|
13a48c336b72056e9510a69badaaf3174b78b774946aff046085cd8be14310f9 | MATLAB | 243 | 7 | function [regressed_tc, regressed_fc] = regress_tc(network_signals, regressor_signals)
X = appendOnes(regressor_signals);
B = pinv(X)*network_signals;
yhat_tc = X*B;
regressed_tc = network_signals - yhat_tc;
regressec_fc = corr(regressed_tc); |
f8f8b78892284b6a9b222d822fc8cdc4de7e3ecf0bc6e55238cd20ce3c3bd526 | MATLAB | 243 | 11 | %{
# dummy test
a : int #
---
c : char(16) #
d : date #
%}
classdef Test < dj.Manual
end |
6214a93941acb2c7bf0f90834429f9904de9d7483e3982491b893bebbdb7fa90 | MATLAB | 244 | 6 | % Wrapper to infGaussLik to remain backwards compatible.
%
% Copyright (c) by Carl Edward Rasmussen and Hannes Nickisch 2016-08-25.
function varargout = infFITC(varargin)
varargout = cell(nargout, 1); [varargout{:}] = infGaussLik(varargin{:}); |
e1f3d3d04cfc59948865fc42ae206e7e8724926b7a6e9710592fd253803847b6 | MATLAB | 244 | 15 | %{
pre.Slice (lookup) # slice numbers
slice : tinyint # slice number
-----
%}
classdef Slice < dj.Relvar
methods
function fill(self)
for i=1:16
self.inserti({i})
end
end
end
end |
f4d87abd32ca0f90a40ca919056f7dbc98d44dd42f4066c2a85a1b45ea80d952 | MATLAB | 244 | 10 | function biosigpathfirst()
% Add BIOSIG at the beginning of the path
str2doublepath = fileparts( which('str2double') );
sopenpath = fileparts( which('sopen') );
if ~strcmp(str2doublepath,sopenpath)
addpath(sopenpath,'-begin');
end
|
1217b7c497b99e4d2a241d5f86a92ee0a5f5693aa5f2c6b196ea1a8b0431a24c | MATLAB | 245 | 6 | % Wrapper to infGaussLik to remain backwards compatible.
%
% Copyright (c) by Carl Edward Rasmussen and Hannes Nickisch 2016-08-25.
function varargout = infExact(varargin)
varargout = cell(nargout, 1); [varargout{:}] = infGaussLik(varargin{:}); |
4737330415566da61a0c0ad8f871edf1142d9ffb0b4f81f3e58444cfae4f219a | MATLAB | 245 | 20 | rng(0)
N = 100;
Ny = 28;
Nx = 21;
Y = randn(N,Ny)*10;
X = randn(N,Nx)*5;
Y = Y-mean(Y);
X = X-mean(X);
Y = bsxfun(@rdivide,Y,std(Y));
X = bsxfun(@rdivide,X,std(X));
[A,B,cc] = cca(Y,X,1,1);
U = Y*A;
V = X*B;
lA = corr(Y,U);
lB = corr(X,V);
|
5ab867dd59b5035d9b9acf224a40715e0a7698ad36fcb919ea8af1c2a4566580 | MATLAB | 245 | 8 | function res = mandatory
% Special keyword (constant function) that can be used in arg*() specifications.
% Used for the default values of arguments that must be specified by the caller.
%
% See also:
% arg_define
res = '__arg_mandatory__';
|
ef9e5b546fe8da759e55eea7804b2b20bdfe45f924b293f5ec9ba22019195b42 | MATLAB | 246 | 5 | % if eye positions are within the circle centered at the peak of membership
% matrix, then include it in the calculations of RF
function eyevalid = isValidEyePos(x, y, center, radius)
eyevalid = ((x-center(2)).^2 + (y-center(1)).^2) < radius^2 ; |
684ff720af99721779f4f396f8a2456513eb8d06fe7d38a37ca2977d3b8da26d | MATLAB | 247 | 11 | function [Result] = iFeta(eta,d1,d2)
%Implemented by Christian Beckmann
res = d1*(1-Feta(eta,d1/d2));
Result = zeros(1,d1);
for k= 1 : d1
%Result(k) = eta(max(find(res>=k)));
Result(k) = eta(find(res>=k,1,'last'));
end
|
b08a861f1eacd589dd9c0a7b4429950143ac5bdf41fcc933d07d6301daea17d1 | MATLAB | 247 | 9 | %{
vis.Matisse2Cache (manual) # cached movies for the the Matisse2 stimulus
cond_hash : char(20) # 120-bit hash (The first 20 chars of MD5 in base64)
-----
movie :longblob # stored movie
%}
classdef Matisse2Cache < dj.Relvar
end |
1a30cf8c85c0381056861b0ee86e92d57968502eb00bf9c9d16173cdf2cd3cdc | MATLAB | 248 | 11 | function [ output_args ] = num_range( X )
%NUM_RANGE( X ) Returns the numerical range of a collection of numbers X.
%
%
% === Jan Moelter, The University of Queensland, 2017 ===================
%
output_args = [ min( X(:) ) max( X(:) ) ];
end
|
2c6165e959ce74764ade12ce9f5722e955fbf3e1ded5a08cc8cb10647ab3e40f | MATLAB | 248 | 13 |
function encoded = algorithm1(conv_output, S)
list = ones(1,S);
list = fliplr(list);
sum_list = sum(list);
encoded = zeros(size(conv_output,1),1);
for i = 1:size(conv_output,1)
encoded(i) = sum(conv_output(i,:) .* list) / sum_list;
end
end
|
f8ed7d1e8365415b1d112ecc9abf17edf60329bd4baa6ea951c05650aaa36d2e | MATLAB | 248 | 15 | function sign = get_asterisk(pvalue, cats)
if nargin < 2
cats = {0.05, '*', 0.01, '**', 0.001, '***'};
end
sign = '';
% get the asterisk
for c = 1:2:length(cats)
if pvalue < cats{c}
sign = cats{c+1};
end
end
end |
6be714699b37529d7cfb3d730c546588b1174ecd2ba769c69e0c5a8b5d77ff6e | MATLAB | 250 | 6 | % Wrapper to infLaplace to remain backwards compatible.
%
% Copyright (c) by Carl Edward Rasmussen and Hannes Nickisch 2016-10-13.
function varargout = infFITC_Laplace(varargin)
varargout = cell(nargout, 1); [varargout{:}] = infLaplace(varargin{:}); |
7cd73d82d087b7482f68150bbf8172ecea806bff84c8323640f5f2dcfedad71d | MATLAB | 250 | 10 | function peaks = FindLocalMaxima(signal)
%FindLocalMaxima - find local peaks
if isdmatrix(signal,'@2'),
iPeaks = FindLocalMaxima(signal(:,2));
peaks = signal(iPeaks,1);
return
end
d = [nan;diff(signal(:))>0];
peaks = strfind(d',[1 0])';
|
b3ed8ffe85e7fd62d505534c56ab8b2e6ef3f81bf628a1efe12f986e78b8e9d2 | MATLAB | 250 | 13 | function v2 = perform_vf_normalization(v1)
% perform_vf_normalization - renormalize a vf.
%
% v2 = perform_vf_normalization(v1);
%
% Copyright (c) 2004 Gabriel Peyré
n = sum(v1.^2,3);
I = find(n<eps);
n(I) = 1;
v2 = prod_vf_sf(v1,1./sqrt(n)); |
96caf301141544fece1d531cb5c01dfcd40aef169a71fd4d144fbfd71b2303e3 | MATLAB | 251 | 18 | %Sindex. LC
function [Y]=sindex(A)
N=size(A,2); %Número de picos
for i=1:N
for j=i:N
Aa=A(:,i);
Ab=A(:,j);
P_punto=dot(Aa,Ab);
Magnitud=norm(Aa)*norm(Ab);
Si=P_punto/Magnitud;
Y(i,j)=Si;
Y(j,i)=Si;
end
end; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.