sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
35034d3add4e9411e366e305ccf4abae9a67ddeadcaa5c19fb14ef2b08cb99e2 | MATLAB | 593 | 26 | function [tracks,nextId] = newTracks2(tracks,unassignedDetections,DT,nextId)
%% create new tracks (could be lit)
data = DT(unassignedDetections, :);
for i = 1:size(data, 1)
centroid = data(i,:);
% Create a new track.
newTrack = struct(...
'id', nextId, ...
'data', data(i,:), ...
't... |
a0072b2aa3378c637be8d9a173e7762e2a402c1bb0b3b8f80060c0a17914de5e | MATLAB | 593 | 18 | % f_AskSignalTime.m [Part of HFO Detection Project]
% Written by:
% Miguel G. Navarrete Mejia
% Electrical Engineering MS candidate
% UNIVERSIDAD DE LOS ANDES
% Colombia, 2012
% mnavarretem@gmail.com
function [s_TotalTimeMin s_TotalSamples] = f_AskSignalTime(ps_SampleRate,...
... |
250dbbf05112105105759bcc09be0547ea31a68cce63b452eab468fc0c7fdd71 | MATLAB | 594 | 16 | function mat2file(a,val,varargin)
% Function for writing to file_array objects.
% FORMAT mat2file(a,val,ind1,ind2,ind3,...)
% a - file_array object
% val - values to write
% indx - indices for dimension x (int32)
%
% This function is normally called by file_array/subsasgn
% ___________________________________... |
26b045f81c5b48ac204ea01267ad91c763ceaded5150edc9a8dc59aeadad88b4 | MATLAB | 594 | 24 | function threshold = find_best_threshold(Image)
% get best binary threshold for the worm
threshold = 0;
%imshow(Image, []);
while threshold < 0.3
BW = im2bw(Image, threshold);
BW = bwmorph(BW, 'fill');
STATS = regionprops(BW,'Eccentricity');
% imshow(BW, []);
% S... |
4952f25897caba88a4a5284a0b6b795803ecf3dd2c7a76572e9b188f5e07cf91 | MATLAB | 594 | 32 | %
% Return whether a network has timestamps.
%
% ARGUMENTS
% network Name of network
%
% INPUT FILES
% uni/out.$network
%
% RETURN VALUE
% 1/0 True/false
%
function [ret] = has_timestamps(network)
filename= sprintf('uni/out.%s', network);
FILE = fopen(filename, 'r');
if FILE < 0,
error(sprintf('opening "%s"'... |
b8adc6d97541c0a3f7c505a07aa0f47d7660f95b171c7224daeb1baa3f20b2fa | MATLAB | 595 | 18 | function SONSetADCOffset(fh, chan, offset)
% SONSETADCOFFSET sets the offset on an ADC channel
%
% SONADCOFFSET(FH, CHAN, OFFSET)
% where FH is the SON file handle, CHAN is the channel number and OFFSET is
% the new value to be written to the file
%
% An ADC value is converted to a real value as:
% Rea... |
15894a86328c59ef489ac26a380d88580b5b377661a50186913ee689986e2f5f | MATLAB | 597 | 20 | function trigger_times = trigger_times_pretreatment_multi_traildelete(upindex,trial_from,interval,...
trial_number,delete,h)
trigger_times = upindex*interval;
total_trial_number_in_file = length(trigger_times);
if trial_number > total_trial_number_in_file - trial_from + 1
trial_number = total_trial_number_in_... |
fbdeeddcf93ea2018d1f2d5c5cffa39b2aec6054abd27ed709aa54e480c4e3ab | MATLAB | 598 | 25 | function fh=MakeMATFile(filename)
% Create MAT-file and write header
%
% This function is used by the MATLAB SON library
%
% Malcolm Lidierth 07/06
% Copyright © The Author & King's College London 2006
fh=fopen(filename,'w');
str=['MATLAB 5.0 MAT-file, Platform: ' computer ', Created on: ' datestr(clock)...
' by S... |
b858e5f12cd3887617241149ec5e97866747c047e0a36d05ab478b35217d59fe | MATLAB | 599 | 16 | function val = file2mat(a,varargin)
% Function for reading from file_array objects.
% FORMAT val = file2mat(a,ind1,ind2,ind3,...)
% a - file_array object
% indx - indices for dimension x (int32)
% val - the read values
%
% This function is normally called by file_array/subsref
% ______________________________... |
ebcab9af6069a4f42817ff9b83a2db5851f78644add8e56e9233d17b83de856c | MATLAB | 599 | 24 | % mglStencilSelect
%
% $Id$
% usage: = mglStencilSelect(stencilNumber)
% by: justin gardner
% date: 05/26/2006
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: Sets which stencil to use, 0 for no stencil
%
% e.g.:
%mglOpen;
%mglScreenCoordinates;... |
1478169c5bd18bf9081c05c5f56f6940c917b62d9d20a1e5e2d2e033684f9c97 | MATLAB | 600 | 19 | function [matchingRows] = ml_util_find_row_matches(x1, x2)
% x1 and x2 should be cell arrays with the same number of columns and
% strings as data
matchingRows = []; %zeros(size(x1,1),2);
for i = 1:size(x1,1)
for j = 1:size(x2,1)
isFound2 = true;
for k = 1:size(x1,2)
... |
afb9bab77af9cec3f63c02f0339e6987b01867ae947821b56b0f515eaab952d3 | MATLAB | 600 | 17 | % Copyright 2018 The MathWorks, Inc.
% Sample file to show how to use the alluvialflow function
% There are four video gamers...
left_labels = {'Arun', 'Kaushik', 'Federico', 'Dave'};
% ...who play video games during all parts of the day.
right_labels = {'Morning', 'Afternoon', 'Evening'};
% data(i, j) = hours playe... |
ee6691f37a594906301f5ae91da2893b05c1cd431013a1192f3776c60e36ca3d | MATLAB | 600 | 29 | %
% Draw a permutation plot. Given two eigenvector matrices, this will
% draw a square matrix of cosine similarities using black for 1 and
% white for 0.
%
% PARAMETERS
% u1,u2 (n*r) Eigenvectors to be compared
%
function evol_permutation(u1, u2)
font_size = 20;
cm = 1:-0.01:0;
cm = [cm.^.6' cm.^.6' cm.^.9'];
... |
46624124694016a0b321e96809d91dec4517cd68443a7b01d7f5b90f7479ca9c | MATLAB | 601 | 21 | function [projectsAvailable, projectsFolder] = mulana_project_helper_get_list()
testFile = 'mulana_project_list.m';
testFileFound = which(testFile);
if isempty(testFileFound)
error('Something must be wrong with your MuLaNA installation because the file %s could not be found.', testFile);
end
dt = dir(testFileFoun... |
7ebc0c33a5f927c49096eef851e0043ee97d0f303267b0788c81780ece32a3a7 | MATLAB | 601 | 18 | function yml=simplify_mbml(xml)
%SIMPLIFY_MBML simplifies the MbML representation by removing attributes with default values
%Syntax: yml=simplify_mbml(xml)
%Description:
% - Input arguments -
% xml is a MbML XML statement (string)
% - Output arguments -
% yml is the simplified version (string)
%
%Jonas ... |
ec85ffbc38232b14fe3c9632c08b90c057165bb1f559fb7126786f575d6894c0 | MATLAB | 602 | 11 | function binId = ml_util_discretize_binid(x, cm_per_bin)
% This discretizes the values in x in terms of the cm_per_bin. A result
% of 0 means the value is in [-cm_per_bin/2, +cm_per_bin/2]. Positive
% bin values are to the right of the origin, and negative bin values
% are to the left of the origin. Sin... |
7cdd5d5a1de6e828a6afa126c7ab757a370bbd2ca9effeac785d1b3b7a7a9371 | MATLAB | 603 | 14 | function ideals = findDoubleProfiles(ideals, cnmf, suite2p, pcaica)
TMP = unique(cnmf.allpairs.strongpairs(:,1));
ideals.doubling.cnmf = find(hist(cnmf.allpairs.strongpairs(:,1),TMP)>1);
ideals.doubling.cnmf = TMP(ideals.doubling.cnmf);
TMP = unique(cnmf.allpairs.strongpairs(:,1));
ideals.doubling.suite2p = find(hist(... |
84b3d2dfe713368ef759e099d4908fbe99983f9e7723bad16501964e079367b3 | MATLAB | 604 | 17 | % VL_ERFILL Fill extremal region
% MEMBERS=VL_ERFILL(I,ER) returns the list MEMBERS of the pixels which
% belongs to the extremal region represented by the pixel ER.
%
% The selected region is the one that contains pixel ER and of
% intensity I(ER).
%
% I must be of class UINT8 and ER must be a (scalar) index of ... |
b6dd6d5db7c6b8c37babefd9448c7c6b57d18d1cd2e6f5f77171516668933416 | MATLAB | 604 | 16 | function dspec = addCovariatePremotor(dspec, covLabel, stimLabel, desc, basisStruct, varargin)
if nargin < 4 || isempty(desc); desc = covLabel; end
if nargin < 5
basisStruct = basisFactory.makeNonlinearRaisedCos(10, dspec.expt.binSize, [0 100], 2);
end
assert(ischar(desc), 'Description must be a string');
offse... |
0f429651fe77ac8c6e844949e14cffc88d46ce57e9c9fa1849edb7b9ad54ea78 | MATLAB | 605 | 22 | function [threshold,obj] = autoFindThreshold_gmm(data,k,replicates)
if nargin < 3 || isempty(replicates)
replicates = 10;
end
if ~isa(class(data),'double')
data = double(data);
end
obj = gmixPlot(data,k,[],[],true,[],[],[],replicates);
[~,sortIdx] = sort(obj.mu,'descend')... |
3eb47c51c4e7cd7b7ab5df65fd4273a44fc1b25fcb2c82b7bbad98ec11bcaf58 | MATLAB | 605 | 13 | function [ Velocity ] = find_velocity(Speed, Direction, Centerlines, image_size)
%generates the velocity vector that gets binarized into "directionality"
direction_vector = [Speed.*-cosd(Direction); Speed.*sind(Direction)];
% direction_vector = [Speed.*-cos(Direction), Speed.*sin(Direction)];
head_vector =... |
85a0ab560dd661f27dffda4f78e869b1443eade27cfc8e7d1add6144b6f712d5 | MATLAB | 605 | 17 | function [SC,OPT_S]= had_interval(SC,OPT_S)
%interval function - assess score and change exposure accordingly, while keeping constant SNR
ind_it = OPT_S.ind_it;
ind_val = floor(ind_it/OPT_S.val_interval);
orig_exp = OPT_S.this_exp;
%% adjust exposure value
this_int = mean(OPT_S.total_ints(1,end-5:end-1));
this_exp = OP... |
26c6434531551617b2393aa71ae20c0ea73caf1bd0cc8c4552e04bf74a1a9f8e | MATLAB | 606 | 21 | function [qx, qy] = ml_util_minimum_bounding_box_map(r, tx, ty)
% Now transform the data so the rectangles are axis aligned
ax = r(2,1) - r(1,1);
ay = r(2,2) - r(1,2);
ma = sqrt(ax.^2 + ay.^2);
ax = ax ./ ma;
ay = ay ./ ma;
bx = r(4,1) - r(1,1);
by = r(4,2) - r(1,2);
mb = sqrt(bx.^2 ... |
82eff01b36739f982268b589c93f2b9750e099cfd14b0aa852206fb1c6a64bc4 | MATLAB | 607 | 27 | function imgfill = imfill3(img)
%% Author: Xu Li
% Affiliation: Radiology @ JHU
% Email address: xuli@mri.jhu.edu
%
% use imfill to fill holes in 3D volume
% imfill in 3 directions and only fill in those holes for all directions
N = size(img);
imgXfill = zeros(N);
imgYfill = zeros(N);
imgZfill = zeros(N);
for ii = 1... |
971c78de5d8785154529f0033de44776407f45630a53d6984e36625d731f7bc3 | MATLAB | 608 | 31 | function y = wmean(x,n);
%
% weighted mean of struct X
% if iscell(x), x=cell2mat(squeeze(x)); end;
% if iscell(n), n=cell2mat(squeeze(n)); end;
x=(squeeze(x));
n=(squeeze(n));
[R C] = size(x);
% [r c] = size(n);
% if R ~= r, n = n'; end
% [R C] = size(x);
% [r c] = size(n);
% if R ~= r, x = x'; e... |
b680174ce597b623f966e57cbadfa132f22dc4cbad3ae43c5210ad20ba070a65 | MATLAB | 608 | 19 | function [timeScaleFactor] = ml_util_timeunit_conversion_scalefactor( timeUnitsFrom, timeUnitsTo )
% A to s
f1 = convert_to_seconds( timeUnitsFrom );
f2 = convert_to_seconds( timeUnitsTo );
timeScaleFactor = f1 / f2;
end % function
function [ timeScaleFactor ] = convert_to_seconds( timeUnits )
swit... |
bc451e3f1df27b8b4bb02c1f61002a99fd0eb7ea179c040672ca9230c43ebd32 | MATLAB | 608 | 24 | function fix_PlotFrame(handles)
% plot a single video frame
% splintered from fixerrorsgui 6/21/12 JAB
% plot image
im = handles.readframe(handles.f);
if( handles.flipud )
for channel = 1:size( im, 3 )
im(:,:,channel) = flipud( im(:,:,channel) );
end
end
set(handles.him,'cdata',im);
% plot flies
for fly =... |
5c890074663495159b3522f0cac27ffe3c1b58e319daea82bbfe81d542596ccd | MATLAB | 609 | 25 | close all
clear all
clc
%function demo_hasselmo_function()
%a = 100;
%poly = [0 0; a, 0; a, a; 0, a];
% Define the polygon/arena
a = [0, 20];
b = [0, 0];
c = [30, 0];
d = [30, 20];
refCanPts = [a(1), b(1), c(1), d(1); a(2), b(2), c(2), d(2)];
poly = refCanPts';
% Mouse location
mousePosition = [10 10];
% Mouse headi... |
8e354f0cb2ef2924bc4619449fc085a7407f50e451906f883a79ad42ac2693c1 | MATLAB | 610 | 33 | function S = LoadSpikes(tfilelist)
% adapted from M-clust function LoadSpikes
%-------------------
% Check input type
%-------------------
if ~isa(tfilelist, 'cell')
error('LoadSpikes: tfilelist should be a cell array.');
end
nFiles = length(tfilelist);
S = cell(nFiles, 1);
for iF = 1:nFiles
tfn = tfilelist{i... |
c56f09d8f23154b57311e93436dc4777577dfba13272e0d9f4896aa60844f470 | MATLAB | 610 | 21 | % I dont wanna have to use node.js or php for the human recognition script,
% so this MATLAB script will rename all the files in a given directory to a
% number
% Assume that parpool is open
for imageClass = { 'GY', 'Healthy', 'Other' }
imagePath = fullfile( 'C:\wamp64\www\Salento-Grapevine-Yellows-Datase... |
6d77462ec880f07db9f0924de10bdbc6e806121290d585763a5d6273c9f2ee10 | MATLAB | 611 | 18 | function ret = format_number(number)
fprintf(1, 'format %d\n', number);
if number < 1000
ret = sprintf('%d', number);
elseif number < 1000000
ret = sprintf('%d,%03d', floor(number/1000), mod(number,1000));
elseif number < 1000000000
ret = sprintf('%d,%03d,%03d', floor(number/1000000), mod(floor(number/... |
bcf84f10afda3891e2a80eaa8fd72bad0c49e0f5b6f53aa369a42f8ada928f36 | MATLAB | 611 | 35 | %
% Plot the clustering coefficient degree distribution.
%
% PARAMETERS
% $network
%
% INPUT
% dat/cluscod.$network.mat
%
% OUTPUT
% plot/cluscod.[a].$network.eps
%
network = getenv('network');
font_size = 22;
line_width = 3;
data = load(sprintf('dat/cluscod.%s.mat', network));
c_local = data.c_local;
F = cd... |
cba6c0255ca5deef94a5c6a5f6e0cabcf3b22ceef7bc620f36973c6b37a4819f | MATLAB | 611 | 18 | % Finds potential error outputs of FIRST
filePath='/Users/Tara/Documents/Projects/CHBHVisit/PerceptualLoad/Data/MRI_Data/Processed_Data/';
allSubs=35;
errorLogs=cell(allSubs,1);
for nSub=1:allSubs
cd(filePath)
if numel(num2str(nSub))==1; Subject=['S0' num2str(nSub)]; else; Subject=['S' num2str(nSub)]; end %Cr... |
558c8b5d0b1ccb413d15b068f5520b2e529185ec2855095314f9999a68cfddb2 | MATLAB | 612 | 20 | function [ ] = bemf1_graphics_coil_CAD(P, t, flag)
% Coil 2D/3D plot with several options
%
% Copyright SNM 2017-2020
p = patch('vertices', P, 'faces', t);
if flag == 0 % non-transparent coil
p.FaceColor = [1 0.75 0.65]; % [0.72 0.45 0.2];
p.EdgeColor = 'none';
p.FaceAlpha =... |
4a37b991ab0853d87fd80bb68625bd9e22c48953cea377a4c1a1185c6d1d2305 | MATLAB | 613 | 22 | clear
close all
%
DataFolderName = '../../data/exampledata'; % Edit to point to file folder
FileList = dir([DataFolderName, '/*/*.par']); % list original datasets
nfile = length(FileList);
tableData = cell(nfile, 2); % use var name "tableData"
for subii = 1:nfile ... |
73fdaa2d030f907563bd76f0841f53e993b5781ee6900865e574802e00279914 | MATLAB | 613 | 23 |
function cluster = getCurrentClusters(active, activeAdjmat, absoluteNode)
%if absoluteNode is true then I want to use the actual node from the
%original graph, otherwise it is a relative index with resepct to the
%activeadjmat matrix. If it is false then the active input can be set to
%empty
%clusters will be... |
7542ab298a015f3d719d0b5c6133ea110346e3adfbf54f63aafaef1014456609 | MATLAB | 613 | 20 | % mglGetMouse.m
%
% $Id$
% usage: mglGetMouse
% by: justin gardner
% date: 09/12/06
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: Return state of mouse buttons and its position. Position is
% in global screen coordinates unless a target s... |
c7acf8e8b78d54059b2bdbbe0c5985b37e2e809529c713a4220e1db87d369716 | MATLAB | 613 | 21 | function [xc,yc,R,a] = circfit(x,y)
%
% [xc yx R] = circfit(x,y)
%
% fits a circle in x,y plane in a more accurate
% (less prone to ill condition )
% procedure than circfit2 but using more memory
% x,y are column vector where (x(i),y(i)) is a measured point
%
% result is center point (yc,xc) and radius R
% ... |
9cf9082a3a5a999c3c7d2d0d59d7d7641841324b651b5c8e8b82e71e7c125436 | MATLAB | 615 | 29 | function [r2, maxr2, maxr2_location] = linearityAlign(x, y)
% If input vectors are not the same length, shorten the longer one
if length(x) < length(y)
y = y(1:length(x));
elseif length(x) > length(y)
x = x(1:length(y));
end
r2 = nan(3901,1);
for i = -4000:-100
if i < 0
x2 = x(... |
d735d879d6036c80e667e4748c7bd87b008891cff784a692b2e6331ae1b3ec09 | MATLAB | 615 | 18 | function spk_delta = run_spk_t2delta(spk_t,data_len)
%1/30/21
%wrapper as a post-hoc fix for existing in-house spk_t2delta function
% it can return a vector that contains one extra element (due to rounding)
runWarn = false;
spk_delta_raw = spk_t2delta(spk_t,data_len);
if isvector(spk_delta_raw)
spk_... |
0e61a5135b911e36866e3e6848e718b11443040ce1e53b4bd6759bb17880aa4e | MATLAB | 616 | 21 | function im3d = highlightRegions(im, pix, color)
[imh, imw, imc] = size(im);
imsz = imh * imw;
if imc == 1,
if islogical(im),
imReal = uint8(zeros(imh, imw));
imReal(im) = 255;
else
imReal = im;
end
im3d = uint8(zeros(imh, imw, 3));
im3d(:, :, 1) = imReal;
im3... |
6f0e8c18f50ea3278c2f2861ea916b994d0914e4794edaf723f3c3ffa4ca89e4 | MATLAB | 616 | 24 | function s1 = resize_scales(s0,dim,args)
% Resize scalefactors
% _________________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
%
% $Id: resize_scales.m 8776 2013-11-14 09:04:48Z roboos $
dim = [dim ones(1,max(numel(args)-numel(dim),0))];... |
ba8c06fe86b6047e0cf966398f4f5f2ec63289a2d184ea0808504c99a6166928 | MATLAB | 616 | 26 | function lab= convertLab(lab,nlab)
lab=char(lab)
for i=1:nlab
ilab=lab(i,:);
ilab(ilab=='_')=[];
ind= strfind(ilab,'VOL');
ilab(ind:ind+2)=[];
ind= strfind(ilab,'lnorm');
ilab(ind+1:ind+4)=[];
ind= strfind(ilab,'rnorm');
ilab(ind+1:ind+4)=[];
ind= strfind(ilab,'bnorm');
ilab(... |
fe15f54304f7386bd00bd1179a6c92fc936463e403a238e0d9ce5b79bb00a5e6 | MATLAB | 616 | 17 | function save_raw_timecourses_flag = ask_save_raw_timecourses()
%% Promt user to ask about saving raw timecourses
prompt={'Do you want to save timecourses (it requires extra space)?'};
answer = questdlg(prompt, ...
'Do you want to save timecourses?', ...
'Yes','No','No');
% Handle response
switch answer
... |
d02b5410b62cb3da098869a9846170c8afc60bd24f36b502f8979ef5e0dbcb2a | MATLAB | 617 | 15 | function [probe] = getTotalOptodeCount(probe)
%GETTOTALOPTODECOUNT Derive total number of optodes (regardless of active)
% Determines the total number of sources and detectors of all modules,
% regardless of their active state. Returns an integer value for srcs,
% dets, and optodes = srcs+dets.
results = probe.r... |
7918aac88001fc86d1ded968c3bb522d275de0efab0d92443a2b54a15136d158 | MATLAB | 618 | 26 | function lab= convertLab(lab,nlab)
lab=char(lab)
for i=1:nlab
ilab=lab(i,:,:);
ilab(ilab=='_')=[];
ind= strfind(ilab,'VOL');
ilab(ind:ind+2)=[];
ind= strfind(ilab,'lnorm');
ilab(ind+1:ind+4)=[];
ind= strfind(ilab,'rnorm');
ilab(ind+1:ind+4)=[];
ind= strfind(ilab,'bnorm');
ila... |
0fa4e01aa8f536ed7150e39207e1fe3606aec6f183bea4221c00eb15a8c88032 | MATLAB | 619 | 16 | function flag=SONKillRange(fh, chan, startTime, endTime)
% SONKILLRANGE attempts to discard data from a file between two times
%
% FLAG=SONKILLRANGE(FH, CHAN, STARTTIME, ENDTIME)
% FH is the SON file handle, CHAN is the channel number and STARTTIME and
% ENDTIME specify the time range (in clock ticks within which to ... |
5415bd74552753c719781c19f33307414b5d31801d88573531b495beab4ba267 | MATLAB | 619 | 22 | % Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024
function [b] = barplot_with_errors(Y,E, colours)
Y = Y';
E = E';
x = 1:size(Y,1);
numGroups = size(Y,1);
numBars = size(Y,2);
b = bar(x, Y, 'grouped', 'FaceColor','flat');
for k = 1:size(Y,2... |
7c9d27f1879310a29cad35c49ae8b3bb2a935a5e10c7a7118066e9ac0b361eed | MATLAB | 619 | 33 | function R = qGetR( Qrotation )
% qGetR: get a 3x3 rotation matrix
% R = qGetR( Qrotation )
% IN:
% Qrotation - quaternion describing rotation
%
% OUT:
% R - rotation matrix
%
% VERSION: 03.03.2012
w = Qrotation( 1 );
x = Qrotation( 2 );
y = Qrotation( 3 );
z = Qrotation( 4 );
Rxx = ... |
daf9228f08c1555b16e80fd0be522479039924eaccc4701a92f471e8d46bb852 | MATLAB | 619 | 16 | <<<<<<< HEAD
function [FNMR] = computeFNMR(gmsVector, REJngra, threshold)
%FNMR = (length(find(sort(gmsVector) < threshold)) + REJngra) / (length(gmsVector) + REJngra);
%distribuzione con valori grandi tipici degli impostori (es. iride)
=======
function [FNMR] = computeFNMR(gmsVector, REJngra, threshold)
%FNMR = (... |
45834061771237f2f4e6cd229536d308ae593f85beadd0a2f3d9cd4d14d5401e | MATLAB | 620 | 25 | function [numRows numColumns area] = BoxSize(bbox)
% [numRows numColumns Surface] = BoxSize(bbox)
%
% Retrieves number of rows, columns, and surface area from bounding box
%
% bbox: 4 x N Bounding box as [rowBegin colBegin rowEnd colEnd]
%
% numRows: Number of rows of boxes
% numColumns: Number o... |
62f922219aa52ea2cc7951d6f80a6bf9fa5e5411688a78e47ed27876c1ae9fbb | MATLAB | 620 | 39 | %
% One iteration step in mask approximation.
%
% It must hold: a = a .* w; (i.e. a must be zero where w is zero.)
%
% PARAMETERS
% u (m*1) The previous eigenvector
% a (m*n) Adjacency matrix
% w (m*1) The weight (or mask) matrix
%
% RESULT
% v (n*1)
%
function v = mask_step(u, a, w)
if size(u,2) ~= 1
error ... |
97f307d2dfc160e69d3c4188f8a1805f7ce1e487f1546a76ade1883c55412913 | MATLAB | 620 | 28 | function colorList=slanCM(type,num)
% @author : slandarer
% -----------------------
% type : type of colorbar
% num : number of colors
if nargin<2
num=256;
end
if nargin<1
type='';
end
slanCM_Data=load('slanCM_Data.mat');
CList_Data=[slanCM_Data.slandarerCM(:).Colors];
disp(slanCM_Data.author);
if isnumeric(... |
bf81d8736673349b34f6211771f9937aeb65d4d5a7e0c78cb1dc0b6ec6d7093f | MATLAB | 620 | 15 | function [result] = ml_egomaps_batch_compute(...
animal_pos_x_cm, animal_pos_y_cm, animal_facing_angle_deg, ...
pop_cell_activation, ...
ARENA_WIDTH_CM, ARENA_HEIGHT_CM, RADIUS_CM, EGOMAPS_CM_PER_BIN)
DISCRETIZATION_SCALE_FACTOR = 100;
EgoTable = ml_egomaps_compute_segment_table(...
animal_... |
53811e7c8f4a083c26d38654ca95c021518fb20a25db17eb3144ad5e1473662c | MATLAB | 621 | 21 | function C=clustering_coef_wu(W)
%CLUSTERING_COEF_WU Clustering coefficient
%
% C = clustering_coef_wu(W);
%
% The weighted clustering coefficient is the average "intensity" of
% triangles around a node.
%
% Input: W, weighted undirected connection matrix
%
% Output: C, clustering coef... |
6701f4a5db77928bd55a242bf2d65782933ae72806f276a8a9e5e397efa8bcbd | MATLAB | 621 | 24 | function tiflink = tifappend(tiflink,image,tag,blocksize,imnum,filename)
% tiflink = tifappend(tiflink,image,tag,blocksize,imnum,filename)
%
% Function to write append the next scanned image to disk
%
% 2019 - Alex Song
if(mod(imnum,blocksize)==1 && imnum>1)
tiflink.close();
clear tiflink
i = ceil(imnum/blocksi... |
f12f8c8ceb95b16bcc0b4f26beb79ec7f3e5cd9efc065cf3c394fd0022e4b0ef | MATLAB | 621 | 21 | function MakeDriftMapUsingKS25(basepath,config_version)
cd(basepath)
%% Config File
disp(['Running Kilosort with user specific settings ' config_version]);
config_string = str2func(['Kilosort25Configuration_' config_version]);
ops = config_string([]);
%% GPU
gpuDeviceNum = 1;
disp(['Initializing GPU: ' num2str(gpuDev... |
1c33563ead2102dbe22ba5c86c61fa3ed149895fcd53c572a714a9e53873c6c4 | MATLAB | 622 | 19 | function s = struct(this)
% Struct method for GIfTI objects
% FORMAT s = struct(this)
% this - GIfTI object
% s - a structure containing public fields of the object
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
% Guillau... |
9c0b418ef5dc04163396c1b25c58e7cd7b985fd10ce6326ff7ae0ce36593f21f | MATLAB | 622 | 18 | % SONFILTER tests whether a set of markers are included in the set defined
% by a filter mask
%
% Implemented though SONFilter.dll
%
% ANS=SONFILTER(MARKERS, FILTERMASK)
%
% INPUTS: MARKERS is EITHER
% 1. a TMarker structure as defined in the SON system
% or
% 2. a 4-byte uint8 v... |
a76e33511c143a0f8a8002511e2a66a5ea79cfcf98d6470f79eccc9161f89d7d | MATLAB | 622 | 23 | function bslCorrectedDataRuns = simseq_baselineCorrectDataRuns(dataRuns, prepostBlankTRsForBslCorrection,varargin)
[nFrames, ~] = size(dataRuns);
if nargin==3
nFrames = varargin{1};
nRuns = 1;
end
if nargin==4
nFrames = varargin{1};
nRuns = varargin{2};
end
% Take first X TRs are blank and last X TRs... |
089700c838a085e0f8e89ccc9d05f0a492bdcd7dce29ffd75807ba16bf086147 | MATLAB | 623 | 18 | function [CellGroup] = getCellGroup(Sesname,CellGroupName)
globals;
if ~exist('XLtxt','var') || isempty(XLtxt),
%read excel file
[XLnum,XLtxt,XLraw] = xlsread('opF rmap summary.xlsx');
end
% Sesname = '20160730Thalamus43_opF_W';
% CellGroupName = 'o-t nice graded';
titles = XLtxt(1,:);
iSesCo... |
bb987df3c41137ac930a27946287998d0e537f88d4db4648873de43002d1741c | MATLAB | 623 | 19 | %
% $Id: mglOpen.m 334 2008-12-28 02:49:05Z justin $
% usage: mglResolution(<whichScreen>, <screenWidth>, <screenHeight>, <frameRate>, <bitDepth>)
% by: justin gardner
% date: 12/28/08
% copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING)
% purpose: Gets or sets the res... |
ebf400b58fd3c804ce89220abaf4254cd683c6fc8e93ee2ed00665dc767cd1ae | MATLAB | 623 | 21 | function G=Gaussiankernel3d(D, sigma)
% function G=Gaussiankernel3d(D, sigma)
% D can be window size or size of matrix
% Author: Xu Li
% Affiliation: Radiology @ JHU
% Email address: xuli@mri.jhu.edu
r = round((D-1)/2); % radius
if length(D) == 1
[XX,YY,ZZ]=meshgrid(-r:r,-r:r... |
60f5adbd7a072a0bd99b4e505198674d758eab715e65121ecdfcc1879a0c59cd | MATLAB | 625 | 18 | function outpath = JaneliaLinux2WinPath(inpath,varargin)
if ~ispc,
warning('Converting to windows path on a non-PC...');
end
if iscell(inpath),
outpath = cell(size(inpath));
for i = 1:numel(inpath),
outpath{i} = JaneliaLinux2WinPath(inpath{i},varargin{:});
end
return;
end
outpath = inpath;
... |
c4cc7a0c119610bd53a4438623c08e4b0dcf608e0099886ed84d7f2688ec3807 | MATLAB | 625 | 16 | function dspec = addCovariateSpiketrain(dspec, covLabel, stimLabel, desc, basisStruct, varargin)
if nargin < 4 || isempty(desc); desc = covLabel; end
if nargin < 5
basisStruct = basisFactory.makeNonlinearRaisedCos(10, dspec.expt.binSize, [0 100], 2);
end
assert(ischar(desc), 'Description must be a string');
off... |
c1b2edeb270dfcaaf767b712546f5e4118619488647902ae1e9f7f167605293a | MATLAB | 626 | 17 | <<<<<<< HEAD
function [FMR] = computeFMR(imsVector, REJnira, threshold)
%FMR = length(find (sort(imsVector) >= threshold)) / (length(imsVector));
%distribuzione con valori grandi tipici degli impostori (es. iride)
FMR = length(find (sort(imsVector) <= threshold)) / (length(imsVector));
=======
function [FMR] = comp... |
e4b65b701b989a0ac2946dd943dd279cbb77cfdf2a0056d02027f6561ce5291d | MATLAB | 626 | 22 | function [scores index] = BoxBestOverlap_depre(testBoxes, gtBox)
% [scores index] = BoxBestOverlap(testBoxes, gtBox)
%
% Get overlap scores (Pascal-wise) for test boxes
%
% test: Test boxes
% groundTruthBox: ground truth box
%
% scores: Highest overlap scores for ea... |
5f14093dc2241b3d1da59bba9796c565ab5db9c1d0cc4e4f70161df57be07356 | MATLAB | 627 | 33 | clc;
clear;
close all;
addpath('functions');
addpath('Scripts');
laser_off;
try
%% Settings
settings_script;
save_name = 'deep_neuron_400um';
%% Initialize
Initialize_system;
%% Original images
capture_original;
%% Optimization
Optimization_script;
... |
c5b4a53772af10ccd9b55d319de408a0c4094b8fcdec948127e978a2f4aed462 | MATLAB | 627 | 23 | % ShowUnitsQs = {'tags[x100]'; 'QA'; 'POm'};
% tags = [0 1 0 0];
%
% key = 'tags[';
function [show] = tagsOK(tags,ShowUnitsQs,key)
Larray = length(tags);
Lkey = length(key);
show=1;
if find(strncmpi(ShowUnitsQs,key,Lkey)),
it = strfind(ShowUnitsQs,key);
itrow = min(find(~isempty(it)));
tagst... |
e33aa71957b55b429920b018e4e81801298cd3327d57b8a4e080a7835e4effaa | MATLAB | 627 | 22 | function output = convCut2(stimulus, impulse, nTerms)
% convCut2(stimulus, impulse, nTerms)
%
% Function similar to convCut.m, but now for matrices
% INPUTS -----------------------------------------------------
% stimulus : a 2D flattened stimulus time course
% impulse : an impulse response function
% nTerms : nu... |
53c679402601ec21250876cd17817b1c2ebdec7ac7d4457cd33d762e5a393f0e | MATLAB | 628 | 30 | function [info] = p_w_identities(info)
pockels=info.pockels;
wavelengths=info.wavelengths;
% Function that takes vector of integers for each pockels value used as
% well as each wavelenth that was used
% OUTPUTS:
% identities = p x w matrix with strings of wavelength @ pockel
%% POPULATE "IDENTITIES"
nwaves ... |
2e6fd476632aa1d73b3241e20811558725064bd073e08662dc081a4403d30b80 | MATLAB | 629 | 19 | function deleteIfFile(path)
% Delete a file if it exists, bypassing the recycle bin
%
% function deleteIfFile(path)
%
% Purpose
% Private to +webupload. Used for the temporary zip and the curl config, which holds the
% token, so neither may linger in a recycle bin. The previous recycle setti... |
79f931a45dedc40417759f284fb960a262e0a80300bd53e5f51d79cad65304bb | MATLAB | 629 | 14 | function names = allowedNames()
% File names (exact, case-sensitive) the brainsaw server keeps
%
% function names = webupload.allowedNames()
%
% Purpose
% Copy of allowedNames in the shared contract (upload_core/tests/upload_contract.json); the
% server's BS_ZIP_ALLOWED_NAMES must match it, ... |
8966607e4478f4112e3e829effacb292e0efecc46d0de592509699d3c7035ecd | MATLAB | 629 | 22 |
function colors = distrtest_colors()
colors = struct();
colors.normal = [ 1 0 1];
colors.lognormal = [ 1 .3 1];
colors.logistic = [ 0 1 0];
colors.loglogistic = [.3 1 .3];
colors.cauchy = [ 1 0 0];
colors.logcauchy = [ 1 .3 .3];
colors.gumbel = [.2 .7 .7];
colors.weibull = [ 0 .7 .7]... |
abb2a76d6fea6aae5ed901fffa21546abe8705a7a05e228b9880eaff245b2b48 | MATLAB | 629 | 15 | %% predict new locations of tracks
function [tracks] = predictLocation2(tracks,sTracks)
for i = 1:length(tracks)
tracks(i).age = tracks(i).age+1;
% Predict the current location of the track.
if tracks(i).age==1
tracks(i).predictedCentroid = tracks(i).data;
elseif tracks(i).consecutiveInvisibleCo... |
df2075333db2d6d9b6781593eccb36f79537d5cc649df831ed7e1a49336a4e7a | MATLAB | 629 | 23 | function img = highlightSegments(rgb_image, segments, givenSegs, color, withBorder)
% initialize the output
% if isdouble(rgb_image(:, :, 1)),
if isa(rgb_image,'double')
img = im2uint8(rgb_image);
else
img = rgb_image;
end
[imgH, imgW] = size(img(:, :, 1));
sz = imgW * imgH;
% if borders are nee... |
3a7f4751b8ed48db6c5dbf54b6d67d9271a63bf7c96dd5e0d56d22d937f419d5 | MATLAB | 630 | 19 | function ml_savefig(hFig, outputFolder, fnPrefix, formats)
for iFormat = 1:length(formats)
format = formats{iFormat};
fn = [];
if ismember(format, {'png', 'pdf', 'svg'})
fn = fullfile(outputFolder, sprintf('%s.%s', fnPrefix, format));
saveas(hFig, fn);
elseif strcmp... |
325a5252087a2794100dcac5c2001bf782bd0fa231ffcf35e28f5efec212bf7c | MATLAB | 631 | 19 | % This example creates a square module and tessellates it over a
% rectangular ROI. Since only the minimum number of design parameters are
% defined (module geometry and ROI geometry), the only characterization
% that can be outputed in the number of modules.
% Design Parameters (module, roi, SD sep range)
probe.modu... |
86d6f0fb73bd303df6c5925590fa0e2a1c79d6171b2727dad66930fe07cc0e31 | MATLAB | 631 | 21 | function [ ] = bemf1_graphics_coil_CAD_nolight(P, t, flag)
% Coil 2D/3D plot with several options
%
% Copyright SNM 2017-2019
p = patch('vertices', P, 'faces', t);
if flag == 0 % non-transparent coil
p.FaceColor = [0.4 0.94 0.94]; % [0.72 0.45 0.2];
%p.FaceColor = [0.5 0.5 0.5]; % [... |
af4989b08b5bc1a785d27ceb33b2bcff4219ca93f33d68eaa5c4f04aabb1fe41 | MATLAB | 631 | 17 | function strech_force = strech(P, l0, nu)
%calculates the force streching the two ends
head_direction = P(1,:) - P(2,:);
head_direction = head_direction/norm(head_direction);
tail_direction = P(end,:) - P(end-1,:);
tail_direction = tail_direction/norm(tail_direction);
l = sum(sqrt(sum((P(2:end... |
395987d8858367a640c29ea40879faf9b9c6545d12de2c3dc0313a7644e2d914 | MATLAB | 633 | 22 | function [hFig] = ml_egomaps_draw_colourwheel()
binSystem = ml_egomaps_binsystem_create(10, 0.05);
angleMap = ml_egomaps_binsystem_anglemap(binSystem);
distanceMap = ml_egomaps_binsystem_distancemap(binSystem);
angleDiskMap = angleMap;
angleDiskMap(distanceMap > RADIUS_CM) = nan;
angleDiskMap... |
5ee5568ea2f03fab273c4574ba25292a02bc6fa0507705c43e05966ce44432c0 | MATLAB | 633 | 24 | function trx = fix_FixIgnoredFields(handles)
% Some trx fields are ignored during tracking/editing, because they can be
% re-derived from existing data. This function does that.
%
% splintered from fixerrorsgui 6/23/12 JAB
trx = handles.trx;
% fix timestamps
if isfield(handles,'timestamps'),
for i = 1:numel(handles... |
6bcbc64fdc6a4f1be7bc84d9136ba3e083269d03e57febeb2ca67ba970a1ceef | MATLAB | 633 | 22 | function y = vl_sigmoid(x)
% VL_SIGMOID Sigmoid function
% Y = VL_SIGMOID(X) returns
%
% Y = 1 ./ (1 + EXP(X)) ;
%
% Remark::
% Useful properties of the sigmoid function are:
%
% - 1 - VL_SIGMOID(X) = VL_SIGMOID(-X)
% - Centered sigmoid: 2 * VL_SIGMOID(X) - 1 ;
% - VL_SIGMOID(X) = (EXP(X/2) - ... |
2db86a86008e449a3b22b6158cfd17175ad40facd0485c20e03fdac2017ed138 | MATLAB | 634 | 16 | function dspec = addCovariatePopActivity(dspec, covLabel, stimLabel, desc, basisStruct, offset,varargin)
if nargin < 4 || isempty(desc); desc = covLabel; end
if nargin < 5
basisStruct = basisFactory.makeNonlinearRaisedCos(10, dspec.expt.binSize, [0 100], 2);
end
assert(ischar(desc), 'Description must be a string... |
58a01ac6e169dc258f7926eff2175a680d8676803e68a2d8db63aaaa125bb938 | MATLAB | 634 | 16 | function flag=SONKillRange(fh, chan, startTime, endTime)
% SONKILLRANGE attempts to discard data from a file between two times
%
% FLAG=SONKILLRANGE(FH, CHAN, STARTTIME, ENDTIME)
% FH is the SON file handle, CHAN is the channel number and STARTTIME and
% ENDTIME specify the time range (in clock ticks within whic... |
9660820f06b69e8d59768a4130462bbae92ef98e40c0a5cd905ab27af4c971e2 | MATLAB | 634 | 11 | function [personal_feat, enviro_feat, relative_feat, personal_units, enviro_units, relative_units] = feat_names_and_units()
% names of features to be computed
personal_feat = {'vel','ang_vel','min_wing_ang','max_wing_ang',...
'mean_wing_length','axis_ratio','fg_body_ratio','contrast'};
... |
1deafe1ed3ab3c493f90ae18872da60be2f2e97a2918c91dd2338afa82a817cb | MATLAB | 635 | 24 | function IBW_List = IBWconnect(location)
%% set up
fprintf('Creating Concatenated Data File...\n\n')
cd(location);
fileList = dir;
IBW_List = zeros(length(fileList),10000);
len = length(fileList);
%% Cycle through each ibw file and make a matrix of thier data
for i = 1:floor(length(fileList))
entry = fileList(i);... |
2d98d9e77822936c670124153ab5f771328eee457a34224400cd1adbc2acb626 | MATLAB | 635 | 19 | function names = selectUploadable(dirPath)
% File names (not paths) in dirPath that the server will keep
%
% function names = webupload.selectUploadable(dirPath)
%
% Purpose
% Returns a cell row; empty when nothing matches. Only files whose name is exactly one of
% webupload.allowedNames are... |
963da657adb06fbbac0dad1e8a271ec019f5ba6d5e93a00ad97ed6c758d0416f | MATLAB | 635 | 14 | function [angleDiff_deg] = ml_alg_center_out_difference(coa1_deg, coa2_deg)
% Compute the angle difference. How much we have to rotate the second map
% counter clockwise (in image coordinates) to align with the first map.
aunit = [cosd(coa1_deg), sind(coa1_deg)];
bunit = [cosd(coa2_deg), sind(coa2_deg)... |
90e1cf0234ef19fe556721a5aa0bdaa5a5c5dee55c1bc92bbffb615e8f234d09 | MATLAB | 637 | 14 | function [name, is_folder, file_size, modification_datetime] = simple_dir(template)
s_raw = dir(template) ;
name_raw = {s_raw.name} ;
is_bs = ismember(name_raw, {'.', '..'}) ;
s = s_raw(~is_bs) ;
name = {s.name} ;
is_folder = [s.isdir] ;
file_size = [s.bytes] ;
modification_datetime = da... |
8525c747c82f2530e0a0ccb27a46a26d7276ba429406d57c8fac305ea2f28c66 | MATLAB | 639 | 18 | % SONFILTER tests whether a set of markers are included in the set defined
% by a filter mask
%
% Implemented though SONFilter.dll
%
% ANS=SONFILTER(MARKERS, FILTERMASK)
%
% INPUTS: MARKERS is EITHER
% 1. a TMarker structure as defined in the SON system
% or
% 2. a 4-by... |
9387ca3f5b25b87d4c252a2ad762d2d4774e91aeaf307a91de9f2da2d3be415d | MATLAB | 639 | 18 | function fh=SONCreateFile(filename, nChan, extra)
% SONCREATEFILE creates a new SON file
% FH=SONCREATEFILE(FILNAME, NCHANS, EXTRA)
% FILENAME = string wiht file and path
% NCHAN = number of channels 32 to 256
% EXTRA = number of bytes to reserve for user specified data
% area in... |
93d6f97b090bd3d35ee9e3a18c4e90899e2c6940977b5b7ffdb0cba473a68d91 | MATLAB | 639 | 23 | function [sliceIndices] = ml_nlx_nvt_find_slice_indices( nlxTimeStamps_mus, slice_separation_threshold_s)
% Convert the threshold in second to microseconds
endTrialIfGapMoreThanThis = slice_separation_threshold_s * 10^6;
breaks = find(diff(nlxTimeStamps_mus) > endTrialIfGapMoreThanThis);
borders = [1 breaks+1 length(n... |
d60283d7073861b22f6d815a6b227452d8b4e87d340e870b7b86ff15a275f859 | MATLAB | 639 | 21 | function mulana_project_create(projectType)
[projectsAvailable, projectFolder] = mulana_project_helper_get_list();
if nargin ~= 1
error('A project type must be specified as one of the following: %s', [strjoin(projectsAvailable, ', ') '.']);
end
if ismember(projectType, projectsAvailable)
referenceFolder = fu... |
d7d1c6daca7d4873a88bdc3df340ee155936e01bd0e3c0391d87d2a6dd683716 | MATLAB | 640 | 14 | function [filtered_folders, filtered_tags] = filter_folders(folders, folder_tags, selected_tag)
% this function filters the experimental folders by tag
filtered_folders = [];
filtered_tags = [];
for folder_index = 1:length(folders)
current_folder_tags = folder_tags{folder_index};
binary_... |
ee227bdcf326606d8e0856f9e85d411d712bdc33817f4649287a702685d0346a | MATLAB | 640 | 19 | function y = vl_ddgaussian(x)
% VL_DDGAUSSIAN Second derivative of the Gaussian density function
% Y=VL_DDGAUSSIAN(X) computes the second derivative of the standard
% Gaussian density.
%
% To obtain the second derivative of the Gaussian density of
% standard deviation S, do
%
% Y = 1/S^3 * VL_DDGAUSSIAN(X/S... |
5bada915647a20f0c35ef4fb3efece3a01b43d35d3da8e423d671ae20ca727b9 | MATLAB | 641 | 25 | function [SeqOnsets]= sequenceness_onsets(X,T,lags)
% input:
% X - reactivation probility, time x state matrix
% T - transform matrix, state x state matrix
% lag - lags to compute, 1D array
% output:
% SeqOnsets - time x lag onsets
fprintf('Computing onsets\n')
warning off
%% Cor... |
99e7e0ab6a5d4d3af19c60b0fd3c089b3994b2cb70a616c7416c47b7ed4eb434 | MATLAB | 641 | 28 | %
% Compute the Rank-1 mask approximation (only when there is
% no "zero"). See mask.m
%
% PARAMETERS
% a Adjacency/biadjacency matrix
% at (e*2) Vertex pairs for which to compute predictions
% format
% weights
%
% RESULT
% predictions{submethod} Struct by submethod name of (e*1) Predictions
% 'main' (only SIGNED... |
ea3fef055868aeb4af4ecc24b91fce0677c1c89a6e58b6a1643e018878abaf72 | MATLAB | 641 | 16 |
function distances = distanceMEA(xy1, xy2, xy3, conf)
% Definita la posizione degli elettrodi calcolo la matrice delle distanze
for k = 1:length(xy1)
if strcmp(conf, '4QMEA') || strcmp(conf,'120MEA') || strcmp(conf, '240MEA') % TO CHECK
for j = 1:length(xy1)
distanc... |
40aca9a293413b07f1ad3ced2337b487f359cdc0d226e4d6e09a43547a0becee | MATLAB | 642 | 20 | function ensure_folder_exists(raw_folder_path)
folder_path = absolute_filename(raw_folder_path) ;
ensure_folder_exists_helper(folder_path) ;
end
function ensure_folder_exists_helper(folder_path)
if exist(folder_path, 'file') ,
if exist(folder_path, 'dir') ,
% do nothing, all is well, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.