sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
0115d66d2e579db2ddc964c5617ca74aa74c99b66ac6dba586fb2ed9227aa177
MATLAB
550
15
function stats_combined = stat_summary_seaky(H0_ctrl_403) %function stats_combined = stat_summary(H0_atrial_10, H0_atrial_25, H0_atrial_50, H0_10_25, H0_10_50, H0_25_50) sz = [1 3]; varTypes = {'string','double','double'}; stats_combined = table('Size',sz,'VariableTypes',varTypes); stats_combined.Properties.Variabl...
0ec11638c4e15a6c06aa3f04f4d57060022fc319414ec55d12e6d38d45e2c32c
MATLAB
550
16
function []=examine_outliers(cell_stat,red_vect,chosen_combination,threshold,intensities,info,flatwave_identities,combination_results) silhouettes=combination_results.all_silhouettes{chosen_combination} outliers=find(silhouettes<threshold);% find outliers in isred coordinates centroids=combination_results.centroids...
87913235b20b67fdfe2882d73e6196a18745d01518ce67f739119823b263f742
MATLAB
550
23
clear all close all load('ff_values.mat'); value_list = [.25 .5 .75 1 1.25 1.5]; [~,~,stats] = anova2(ff_values',1,"off"); c1 = multcompare(stats); tbl1 = array2table(c1,"VariableNames", ... ["Group A","Group B","Lower Limit","A-B","Upper Limit","P-value"]) % d = randi(10, 20, 3); % figure(1) ...
7d3064ba34b2979c8386cc435e167781bb7c08f3c03b8f397b8b9c35f89e9c1d
MATLAB
552
15
function p_value=stat_test(data_1,data_2) %%%% data_1 and data_2 should be column vector with one column [mean_data_1,~,~]=bootstrap_mean_and_ci(10000,0.05,data_1(:,1)); [mean_data_2,~,~]=bootstrap_mean_and_ci(10000,0.05,data_2(:,1)); x1_bar_expt=mean_data_1; x2_bar_expt=mean_data_2; n1=size(da...
a6c5eb77c239c0e45ccc945fbdc798aaa6424fc208f58fcdab720f702711e729
MATLAB
552
23
% mglIsMrToolsLoaded.m % % $Id:$ % usage: mglIsMrToolsLoaded() % by: justin gardner % date: 04/20/14 % purpose: Test whether mrtools is in path or not % function tf = mglIsMrToolsLoaded() % check arguments if ~any(nargin == [0]) help mglIsMrToolsLoaded return end if ~exist('mrParamsD...
31b847f8407678442784ee117d13245787eb0bd4a56711756965944944715378
MATLAB
553
14
function [quality] = ml_cai_quality_led_position_difference(x, a) % Compute the difference in the position between frames % This assumes that the frames are sequential and about the same frame rate dv = diff(x); % dv has one less element than ledPosPixel dvMedian = median(dv); dvMAD = median( abs(dv - dvMedian) ); dvM...
33449966a9475f2dfd2892aaebccbea4082eabbb702c2953f150f31fef40ae7b
MATLAB
553
16
function ensure_folder_does_not_exist(raw_file_path) if isempty(raw_file_path) , error('File path cannot be empty') ; end file_path = absolute_filename(raw_file_path) ; if isempty(file_path) , error('File path cannot be empty') ; elseif strcmp(file_path, '/') , error('Not goi...
bf38aab9e4879dee566989ac9f46128980f5f64384b7cd51461c3e0e586485d0
MATLAB
553
12
function position = WAIT(device) % Wait for motion to stop while(0 ~= device.IsMoving('x') || 0 ~= device.IsMoving('y') || 0 ~= device.IsMoving('z') || 0 ~= device.IsMoving('u') || 0 ~= device.IsMoving('v') || 0 ~= device.IsMoving('w')) pause(0.1); end % Wait for axes to be on target ...
cb1c879bb9ce75f2b81b4cc3937226b70e9d5f7216602c7a8d61ccde7b36f578
MATLAB
553
17
rectWidth = 1; rectHeight = 1; nSamples = 1000000; anglesBias1 = ml_alg_center_out_angle_continuous_bias(rectWidth, rectHeight, nSamples); anglesBias2 = ml_alg_center_out_angle_continuous_circle_bias(nSamples); edges = 0:1:360; figure subplot(1,2,1) histogram(anglesBias1, edges) title(sprintf('Picked from uniform re...
48b34be95a842e992d11658ac6e96428511eb78db33c0c7542da58866879e70a
MATLAB
554
27
classdef My_copy_layer < dagnn.ElementWise properties end methods function outputs = forward(obj, inputs, params) outputs = inputs ; end function [derInputs, derParams] = backward(obj, inputs, params, derOutputs) derInputs = derOutputs ; derParams = {} ; end % -----...
e193a9107cd17c25cfbaf314df84d90d69c67f6361a0014151a3e78baeff901a
MATLAB
554
16
function [dwellTimeMap] = ml_placefield_dwelltimemap(xi, yi, ts_s, nbinsx, nbinsy) numSamples = length(xi); % Check the uniformity of the timestamps dts_s = diff([0; ts_s(:)]); % small correction dts_s(1) = median(dts_s(:)); % Perform the dwell time by hand because I don't trust MATLAB...
2c600f2ebcac94d1318f965c55299a8ccbdab2ec8f6350ad2153b28c5e5460af
MATLAB
555
20
function [entropyX] = ml_it_entropy(x, binMethod) if strcmpi(binMethod, 'uniformly_spaced') edges = ml_it_edges_x_uniformly_spaced(x); elseif strcmpi(binMethod, 'uniform_density') edges = ml_it_edges_x_uniform_density(x); else error('Invalid bin type (%s)', binMethod); end ...
a512f83f0e6594590dec91f23926feca6e05e9803068692ff4c4e118158fac74
MATLAB
555
20
function [ theta_new, alpha_new ] = conjugate_rotational_axis( theta, alpha ) % function [ theta_new, alpha_new ] = conjugate_rotational_axis( theta, alpha ); % % Function to return the conjugate rotational axis so that it produces a % mirroring brain response about the mid-sagittal plane. Given theta and % alp...
f86436801e0d2777aa103d693e5eb48ead4f61a126720f041b90e0cd2e07b33d
MATLAB
555
17
function handles = fix_DeleteFly(handles,fly) % find birth and death event for this fly, if it exists % splintered from fixerrorsgui 6/21/12 JAB handles = fix_RemoveBirthEvent(handles,fly); handles = fix_RemoveDeathEvent(handles,fly); fns = fieldnames(handles.trx(fly)); for i = 1:length(fns), fn = fns{i}; handles...
1c806b893ea3898137b487ce4addf704d44eef039ec24d6fe9e071c1b9e184c7
MATLAB
556
24
% userSelectTrial.m % % Function that brings up the user interface for them to select the trial % folder to process. % % INPUTS: % none - but prompts user through folder-selection gui % % OUTPUTS: % uTrialPath - full path of selected trial folder % curDir - present working directory % % CREATED: 5/21/19 % UPDATE...
e6fc06f4b13ad0369151dc532a331fc1f0004385b74279d52fe05e752b6e7a8c
MATLAB
556
10
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [filteredPredictionDatasets] = filter_prediction_datasets(predictionDatasets, params) filteredPredictionDatasets = cell(length(predictionDatasets),1); for iDataset = 1:length(predictionDatasets) predictionDat...
f33022ed69f1e598983c400d4d29ae3b0669a94bfdf3b3c4eb68bdd62cd16322
MATLAB
556
25
function net_run_opts=gen_net_run_opts_basic() net_run_opts=[]; net_run_opts.global_init_fn=[]; net_run_opts.epoch_init_fn=[]; net_run_opts.epoch_finish_fn=[]; net_run_opts.batch_init_fn=[]; net_run_opts.batch_finish_fn=[]; net_run_opts.batch_info_disp_fn=[]; net_run_opts.epoch_info_disp_fn=[]; net_run_opts.batch_...
21f9e97f792360f0a5adbc06dc0fd15fbdfabb85eee074cafb81448aa4088071
MATLAB
557
22
ShowUnitsQs = {'tags[x100]'; 'QA'; 'POm'}; tags = [0 1 0 0]; key = 'tags['; Larray = length(tags); Lkey = length(key); show=1; if find(strncmpi(ShowUnitsQs,key,Lkey)), it = strfind(ShowUnitsQs,key); itrow = min(find(~isempty(it))); tagstr = cell2mat(ShowUnitsQs(itrow)); showtags = tagstr(...
4800628be258a4ff933ada691e275c4fd3ab9823f27028fd60d6c02200c565d0
MATLAB
557
25
% % Compute the number of lines in the definition of a network, i.e., % the number of lines in the out.* file. This is different from the % volume for networks with multiple edges without timestamps, because % these networks aggregate multiple edges into one line. % % PARAMETERS % $network % % INPUT % dat/info.$ne...
4cd708938a60569cb97e212f547fc32b673bc1ed421525d731db32aad2c59315
MATLAB
557
17
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [fieldSets] = helper_load_bfo90_fieldsets_to_record() fieldSets(1).name = 'all'; fieldSets(1).fieldNames = {'any'}; fieldSets(2).name = 'context1'; fieldSets(2).fieldNames = {'context1'}; fieldSets(3).n...
520e35ff82f8c594621f1299763b01744eefeda2881796fb3f194ee80683460a
MATLAB
557
29
function x = calc_FD_HCP_octave(prefix,brain_radius_in_mm) if nargin < 2 brain_radius_in_mm=50; end %% Read the first 6 columns fileID = fopen(prefix,'r'); tline = fgetl(fileID); X = []; while ischar(tline) tline = strtrim(regexprep(tline,' +',' ')); row = str2double(strsplit(tline, ' ')); row = row(1:6...
ac8d9c7564f5ebef10ee477cf87d8c53366b82ce08ca0183f9d94f8b5f32da07
MATLAB
557
15
function [ track_indecies ] = folder_indecies_to_track_indecies( folder_indecies ) %Converts folder indecies to track indecies current_folder_index = 1; track_indecies = zeros(size(folder_indecies)); track_indecies(1) = 1; for index = 2:length(folder_indecies) if folder_indecies(index) ~= current...
bf87217868a7286633f23c99b8d9b2966b37838ca3f097932e5e2f69e7b852d6
MATLAB
557
19
function [kspace,data,msg_out]=mge3d_recon(kspace,Dat,procpar) % This is a custom VNMR k-space reconstruction code for MGE3D data used by % aedes_readvnmr. % If called without input arguments, return the list of sequence names that % this code reconstructs if nargin==0 kspace = {'mge3d'}; return end data=[]; msg...
d82ac0bb40adfc02ef51f4889566a4dcdfb7e3ff62658012cd27082bad5a246c
MATLAB
557
14
function smoothed_x = binary_smoothing(x, window) %smoothes a binary vector over a window (window should be odd) half_window = floor(window/2); votes = zeros(size(x)); for current_window = 1:half_window shift_right = circshift(x, [0, current_window]); shift_right(1:half_window) = x(1); ...
eae7197804cb5ef4e37c4020dacedd7b6f8c917f52c70d34957ae2ab775791cc
MATLAB
558
18
function vector = Blob2Vector(blob, im) % vector = Blob2Vector(blob, image) creates a vector representation of the % blob. Each entry for vector(i,:) is the i-th pixel colour-value of the % blob. % first crop image vector = im(blob.rect(1):blob.rect(3), blob.rect(2):blob.rect(4),:); % reshape image and mask...
245c52bd35c73bbeb66188385b0f829615b6fe4010052d78907b5ca61ecb8fdf
MATLAB
559
17
function p = parent(tree,uid) % XMLTREE/PARENT Parent Method % FORMAT uid = parent(tree,uid) % % tree - XMLTree object % uid - UID of the lonely child % p - UID of the parent ([] if root is the child) %__________________________________________________________________________ % % Return the uid of the parent...
30ed64fbc34ccec3c604d36cd379d913a656756e8a3734f1f83341a8248de523
MATLAB
559
21
function a = reshape(b,varargin) % Overloaded reshape function for file_array objects % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % % $Id: reshape.m 8776 2013-11-14 09:04:48Z roboos $ if length(struct(b))~=1, error('Can only re...
bc042a01873f3aa8eea82c5bb6e19b37e9b9e020051b2e1ad5534d916392dbc7
MATLAB
559
25
function [val1] = GetValFromImage(Im, coords, xform) % % val = GetValFromImage(Im, coords, [xform]) % % Adapted from dtiGetValFromImage in VISTASOFT (interpolation was eliminated) % Cesar Caiafa (2017) if(~exist('xform','var') || isempty(xform)) xform = eye(4); end if(size(coords,2)~=3) coords = coords'; end i...
d8c7513a02f702b8b895177eddef2a75b63d879f11b4b0a2c84fd2c1edfe96e5
MATLAB
559
28
function class_info=gen_class_info_ade() class_info_ADE=load('class_info_ADE.mat'); class_info_ADE=class_info_ADE.class_info_ADE; class_names=class_info_ADE.Name; class_names{end+1}='void'; class_label_values=uint8([1:150 0]); class_info=[]; class_info.class_names = class_names; class_info.class_label_values=...
39eba239eb747dabe57e6f083df8a60aae7c0e190541d0ca344666827223f912
MATLAB
560
17
% mglPrivateListener.m % % $Id: mglPrivateListener.m 18 2006-09-13 15:41:18Z justin $ % usage: mglPrivateListener() % by: justin gardner & Jonas Larsson % date: 04/03/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: plot 2D points on an OpenGL screen ...
e38ba831e12e8d2b62e10328b2f8fcc9b191ba6b1c2f7453f4a2cbfe624c4d48
MATLAB
560
18
% mglPoints2.m % % $Id$ % usage: mglPoints2() % by: justin gardner & Jonas Larsson % date: 04/03/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: plot 2D points on an OpenGL screen opened with mglOpen % usage: mglPoints2(x,y,size,color) % ...
e5a7c2fa190411104d1f1a8c70f3599dca85c9433ce15ee587a0ea28c581f4c7
MATLAB
560
29
% % Labels for combined method/submethods. % % RESULT % labels % .([method "." submethod]) Readable label of the % method/submethod combination % function labels = get_labels_method_submethod() labels = struct(); labels.sym_expo = 'SINH'; labels.sym_rato = 'NEU'; labels.sym_polyo = 'POLY'; labels.sym_polyon = 'P...
b1f7bc48700c0ba55a3012111cbf6197ce41dc3f5ef004853f68d0f39be6bc9f
MATLAB
562
12
function [section, times] = segmentSeries(A) A(1) = 0; A(end)=0; ne0 = find(A~=0); % Nonzero Elements ix0 = unique([ne0(1) ne0(diff([0 ne0])>1)]); % Non-Zero Segment Start Indices eq0 = find(A==0); % Zero Elements ix1 = unique([eq0(1) eq0(diff([...
3529c691a273edec005b20cbb72d1db5ac51b5219cec02b01522903dc5d77930
MATLAB
563
20
function SONSetInitLow(fh, chan, flag) % SONSETINITLOW sets the initial state on an EventBoth (level) channel % % SONSETINITLOW(FH, CHAN, FLAG) % where FH is the SON file handle and CHAN is the channel number. % FLAG is 'TRUE' if the first transition is high-to-low, 'FALSE' otherwise. % No return value % % Author:Mal...
87f7fc83e2951d7732251265ea830d1b9c900bb98b85b6dab23336ce2e5fec92
MATLAB
564
22
function chanData = maestro2dat(filename, samplerate) % Assume sample rate of 50,000 if ~exist('samplerate','var') samplerate = 50000; end %% Load Ephys Data ephys = openmaestro(filename); if isempty(ephys) warning('Something went wrong!') chanData = []; ...
a135c13e22098172d8c69e26f386840e6b29b9467b1df91048116a1ed73683aa
MATLAB
564
22
% % Please cite this paper if you use any component of this software: % S. Soltanian-Zadeh, K. Sahingur, S. Blau, Y. Gong, and S. Farsiu, "Fast % and robust active neuron segmentation in two-photon calcium imaging using % spatio-temporal deep learning," Submitted to PNAS. % % Released under a GPL v2 license. functio...
ac21abaf0406890a6f012f18a8011b798c06b42c970a3c3bd7aa9a0cf09c06d6
MATLAB
565
19
%Function: transform RGB image to the 8-bit HSV index image for color CENTRIST %Input: % rgb_img -RGB image %Output: % idx_img -8-bit HSV index image % Author: Yang Xiao @ IMI NTU (hustcowboy@gmail.com) % Created on 2013.2.13 % Last modified on 2013.2.14 function [idx_img] = hsv_idx_transform(rgb_img)...
0626ced13b26c397a8fc8526e66c37b4485d9f869916eabc4cdad5150a11de93
MATLAB
566
20
% $Id$ % program: mglPolygon.c % by: denis schluppeck, based on mglQuad/mglPoints by eli, % justin, jonas % date: 05/10/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: mex function to draw a polygon in an OpenGL screen % opened with mglOpen. % ...
116bd40aa2d518c2e7048045d27179f721136cf5bea7608f808fc1a6e520ca71
MATLAB
566
24
% mglStencilCreateEnd % % $Id$ % usage: mglStencilCreateEnd % by: justin gardner % date: 05/26/2006 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Ends drawing to stencil % % e.g.: %mglOpen; %mglScreenCoordinates; % %%Draw an oval stencil %mglSte...
13f5d0b8c7e23b8ce602fd6b75b288449a8e5a608e4d61e863688e84b8845c16
MATLAB
568
21
% VL_DEMO_SIFT_OR Demonstrates SIFT orientation detection I = vl_impattern('wedge') ; ur = 1:size(I,2) ; vr = 1:size(I,1) ; % distribute frames on a grid [u,v] = meshgrid(ur(5:10:end-4),vr(5:10:end-4)) ; f = [u(:)';v(:)'] ; K = size(f,2) ; f = [f ; 4 * ones(1,K) ; 0 * ones(1,K)] ; % detect orienntations f = vl_sift...
b78601cc98c1b98cb1433365fb2cd4b072f54eecd9119b338a83b9849c6055c6
MATLAB
568
12
% After unzipping the UFARSA.zip into your desired directory, simply run this % script to add UFARSA to the search path of MATALB. % % Author: Vahid Rahmati (December, 2017) UFARSA_folder = fileparts(mfilename('fullpath')); addpath(sprintf('%s', UFARSA_folder)) addpath(sprintf('%s%sfunctions', UFARSA_folder, fi...
10a2b59c93225fa675ede6059e5637b07c06258cdf3b828b8f5a3905f071653f
MATLAB
569
15
function SONSetFileClock(fh, usPerTime, timePerADC) % SONSETFILECLOCK sets the basic time units and the clocks per ADC conversion % % SONSETFILECLOCK(FH, USPERTIME, TIMEPERADC) % INPUTS: FH the SON file handle % USPERTIME the number of microseconds per clock tick % TIMEPERADC the number of clock ticks ...
3d91d969da17030e6c6ddd14361b823fd7bd635765c35a12d70f2a9899aae062
MATLAB
570
19
clear close all clc addpath(genpath('J:\Data\Matlab')); %% % Select the directory to search directory = uigetdir; % List all .swc files fileList = dir([directory, '\*.swc']); % Loop through each .swc file, copy it and give new extension: .txt for i = 1:numel(fileList) file = fullfile(di...
490b3a79f2c2088cb3d4742c3b7195636c34894873b22ab6faff2a1bc9c177d5
MATLAB
571
25
function [Dmat] = JaccardDist(M1,M2) N1 = size(M1,3); N2 = size(M2,3); M1 = single(reshape(M1,[],N1)); M2 = single(reshape(M2,[],N2)); A1 = M1'*M1; a1 = repmat(diag(A1),1,N2); A2 = M2'*M2; a2 = repmat(diag(A2)',N1,1); intersectMat = M1'*M2; unionMat = a1 + a2 - M1'*M2; JaccardInd = intersectMat./unionMat; Dmat = 1...
271d145e34d401f49ee786da602083dfc491180203140d2857859876d5294817
MATLAB
572
12
function [ score ] = compare_predicted_and_actual_rates(predicted_rates, observed_events) %computes a metric to see how predictive our model is against the actual %observed rates; not used in paper fps = 14; dt = 1/(fps*60); %observed_rates = double(observed_rates)*fps*60; % put it in transitions/min rd...
2d90f1196881440aac0cc8eb3d477c72b685d0b2f411b006193efb31963fcd64
MATLAB
572
19
<<<<<<< HEAD function [FMR, FNMR] = computeDET(gmsVector, imsVector, REJngra, REJnira, base) for ii = 1:length(base) th = base(ii); % define threshold FMR(ii) = computeFMR(imsVector, REJnira, th); FNMR(ii) = computeFNMR(gmsVector, REJngra, th); end ======= function [FMR, FNMR] = computeDET(gmsVector, ims...
52d2f38e58214dab81ecc557288c1e26bc679489b49f20c739febc8fb21b5284
MATLAB
572
19
function name = get_user_name() % GETCOMPUTERNAME returns the name of the computer (hostname) % name = getComputerName() % % WARN: output string is converted to lower case % % % See also SYSTEM, GETENV, ISPC, ISUNIX % % m j m a r i n j (AT) y a h o o (DOT) e s % (c) MJMJ/2007 ...
1ae30dd86a7a86130f20cc9deda20652e21fcd76962448242dd986f56b5abb17
MATLAB
573
19
function SONSetADCScale(fh, chan, scale) % SONSETADCSCALE sets the scale on an ADC channel % % SONADCOFFSET(FH, CHAN, SCALE) % where FH is the SON file handle, CHAN is the channel number and SCALE is % the new value to be written to the file % % An ADC value is converted to a real value as: % Real value=(16-bi...
2f547f5016b76fa2238ea9a0e163efe27de0089b0bc7afeef7e37d666680804a
MATLAB
573
14
function vt_out = f_ListEventClasses() % List event class for ripple classification. For adding more clasess % consider including names after position 7. vt_out = {... 'None';... % Original class 1 'Gamma';... % Original class 2 'Ripple';... % Original class 3 ...
38f1f37f2a5f116af20e0d5d4449c1513e26b40e39cad19534e92b6e35256680
MATLAB
573
25
% mglCameraInfo.m % % usage: cameraInfo = mglCameraInfo; % by: justin gardner % date: 10/07/19 % purpose: Function to get information about connected FLIR cameras % For verbose info % % cameraInfo = mglCameraInfo('verbose=1'); % % For more detailed info: % % ...
70b025ada21a403445e3b49967c84f69944d99bc507ce1940d9c4e1e849c1305
MATLAB
573
19
function colorRGB = varysat(origColor,satValues) % varies the hue of a specified color % origColor is n x 3 % satValues is 1 x m, specifying range of saturation % output is is n x m x 3 % colorHSV = zeros([size(origColor),length(satValues)]); for icond = 1:size(origColor,1) temp = rgb2hsv(origColor(icond,:)); ...
99b0cdb22b871e55d5247080d38638918105366ad4b70455d2bc0955bf0d0e33
MATLAB
573
24
function name = get_host_name() % GETCOMPUTERNAME returns the name of the computer (hostname) % name = getComputerName() % % WARN: output string is converted to lower case % % % See also SYSTEM, GETENV, ISPC, ISUNIX % % m j m a r i n j (AT) y a h o o (DOT) e s % (c) MJMJ/2007 ...
9a850643d03f1d0f4644dc64f19a72c082114b6e4be1ca90baab420f5d6e1168
MATLAB
573
17
function [ratio]=get_ratio(cur_onsets,tr,ds_events,ds) if strcmp (cur_onsets(tr).condition,'SOM') ratio = ds_events(ds).mch_pop_signal(cur_onsets(tr).peak) / ds_events(ds).tdt_pop_signal(cur_onsets(tr).peak); if ds_events(ds).tdt_pop_signal(cur_onsets(tr).peak)<0 ratio = 10; end elseif strcmp (cur_...
d4ce1b045a971c3484c948942ec1f12857b3a2ca19fd706c6a3e8f44303429d2
MATLAB
573
19
function dTickLen=SONTimeBase(fh, dTb) % SONTIMEBASE Get or set the base time units for the file % (usually 1e-6seconds) % DTICKLEN=SONTIMEBASE(FH, DTB) % FH SON file handle % DTB If <= 0 ignored % >0 the new value to set % ...
97f19cfff5a6c00f4c9e83c982918c5f69eca97334999110902b4cfae45b4d49
MATLAB
574
21
% % Please cite this paper if you use any component of this software: % S. Soltanian-Zadeh, K. Sahingur, S. Blau, Y. Gong, and S. Farsiu, "Fast % and robust active neuron segmentation in two-photon calcium imaging using % spatio-temporal deep learning," Submitted to PNAS. % % Released under a GPL v2 license. % func...
08f195005ad41915910bb0eaee9fcb730bd55bb950240377f4b4cbd7adb000ba
MATLAB
575
21
function d=Discriminability(Data) %caculate d-prime for gonogo task %Data=[Hit Miss CR FA] for i=1:size(Data,1) hitrate=Data(i,1)/(Data(i,1)+Data(i,2)); FArate=Data(i,4)/(Data(i,3)+Data(i,4)); if hitrate==1 hitrate=1-1/(2*(Data(i,1)+Data(i,2))); end if hitrate==0 h...
2becd5273384c7c443c86289386d973e79607a7cea9612fc1702975402deb4d4
MATLAB
575
18
function Av = startAvalanche(avCount, cluster, t) if size(cluster,1)~=1; cluster = cluster'; end Av = avalanche; Av.label = avCount; Av.size = length(cluster); Av.startTime = t; Av.endTime = t; %this will be incremen...
ea242cd2aed106c994b003c7edec6b8a00ac5a366fa9d4f25dd931dd3e8296f8
MATLAB
575
14
function [similarity indSim] = SSSimBoxFill(a, b, blobStruct) % Calculate similarity for a single edge. % a is blob a. % b is blob b. % blobStruct is the list of blobStruct newArea = (max(blobStruct.boxes(a,3), blobStruct.boxes(b,3)) - ... min(blobStruct.boxes(a,1), blobStruct.boxes(b,1)) + 1) .* ... ...
0700d20c3fe9e80cedd7ca7d639a67c7438ac4d7712266e1730ac308346dc830
MATLAB
576
25
function chi = delta2chi_tso(delta, D, thresh) % chi = delta2chi_tso(delta, D, thresh) % %% Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu % QSM TKD method warning off all %% threshold based susceptibility mapping (TSO or TKD) delta_k = fftshift(fftn(delta)); IndIll = abs(D) < thresh...
0f01bd16362a9f985b345f74bc919230447ca5cc426a5598a4639f9b85c78269
MATLAB
576
18
function y = vl_gaussian(x) % VL_GAUSSIAN Standard Gaussian density function % Y=VL_GAUSSIAN(X) computes the standard (zero mean, unit variance) % Gaussian density. % % To obtain the Gaussian density of standard deviation S do % % Y = 1/S * VL_GAUSSIAN(X/S). % % See also: VL_DGAUSSIAN(), VL_DDGAUSSIAN(), V...
4d4f934a47513950c5fbea18a46286262589f2e2a7ae45073790b329e332353b
MATLAB
576
11
function nd_sampled_stimulus = centerline_sampled_stimulus_to_nd_sampled_stimulus(centerline_sampled_stimulus, nd) %nd is the number of "zones" to resample to n_centerline_pts = size(centerline_sampled_stimulus,2); spacings = linspace(1, n_centerline_pts+1, nd+1); nd_sampled_stimulus = zeros(size(center...
8ab681567ff5e329dddc10c7e769e46fada448d4e14eb55242bb5da16461a8df
MATLAB
576
23
function mask_bold = BoldIsolate(mask,params) %BoldIsolate 太い主要血管のみをmaskから取り出した画像を返す。 erodePx = params(1); dilatePx = params(2); N = size(mask,3); mask_bold = zeros(size(mask)); for i = 1:N A = squeeze(mask(:,:,i)); B = imerode(A,strel('disk',erodePx)); C = imdilate(B,strel('disk',dilatePx)); ...
b7068fcaadd5b0dd973c5a69bd102ba4f4c52ed77df58b4470f3d9b1402d4998
MATLAB
576
17
function filename = getfilename(tree) % XMLTREE/GETFILENAME Get filename method % FORMAT filename = getfilename(tree) % % tree - XMLTree object % filename - XML filename %__________________________________________________________________________ % % Return the filename of the XML tree if loaded from disk and an em...
2445e2aac6aa1836d51c702a5800e745808bc8ea347b1f53e5d9ca4b41a62f72
MATLAB
577
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: % Real value=...
380ebe499251884556491da71fe56f58f8912c0c97f9d8d656c8ce3a8ade56a3
MATLAB
577
26
clear all clc [data_name] = uigetdir(pwd,'Select the PeakTrain_Joint folder'); cd(data_name); p = dir; cd(p(3).name); pp = dir; load(pp(3).name); fs=10000; acq_time=length(peak_train)/fs/60; %minutes cd ../.. [path_name] = uigetdir(pwd,'Select the NetworkBurstDetectionFiles folder'); cd(path_name); d = dir; ...
6127d7f45e5c8a51cd2ddcc99ca5904b67a249cd6fb6ad322e3ecb5992de10ba
MATLAB
577
18
% mglPoints3.m % % $Id$ % usage: mglPoints3() % by: justin gardner & Jonas Larsson % date: 04/03/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: plot 2D points on an OpenGL screen opened with mglOpen % usage: mglPoints2(x,y,z,size,color) % ...
00ed8185c40b7838826ac0191546e91632af88f6e5714d7be7860fbf4e732419
MATLAB
578
31
function imdb=my_gen_imdb(train_opts, ds_info) task_info_train=[]; task_info_train.data_type='train'; task_info_train.task_idxes=ds_info.train_idxes; task_info_val=[]; task_info_val.data_type='val'; task_info_val.task_idxes=ds_info.test_idxes; imdb=[]; imdb.ds_info=ds_info; imdb.task_info_train=task_info_train;...
25c2fe1997647c9db007493ac9d7e90f5d2448ebab11327869cb943fc90da16e
MATLAB
578
11
figure(1); clf; subplot(121); [hh, ax] = pareto(codingBlue,VarNames); set(ax(2),'visible','off'); set(hh(1),'facecolor','b'); set(ax(1),'view',[90 90],'ylim',[0 max(get(hh(1),'ydata'))],'ytickmode','auto'); subplot(122); [hh, ax] = pareto(codingRed,VarNames); set(ax(2),'visible','off'); ...
ef7b07afdf76193b26fa8701d9efe298c3f01ae3844b196d03ff2ca5f2200072
MATLAB
578
19
function retval=is_filename_absolute(filename) % If you do x=fileparts(x) until you reach steady-state, % the steady-state x will be empty if and only if the initial x is relative. % If absolute, the steady-state x will be "/" on Unix-like OSes, and % something like "C:\" on Windows. % % Note t...
921542db84e23623f2a7de92fbc7457173c1803a072df282737c7fd8ce5b3edc
MATLAB
580
25
function ml_util_draw_correlation_matrix_patches(M) colour = [1,1,1]; m = size(M,1); n = size(M,2); x = 1:n; y = 1:m; edgesX = x - 0.5; edgesX(end+1) = edgesX(end) + 1; edgesY = y - 0.5; edgesY(end+1) = edgesY(end) + 1; hold on [px, py] = meshgrid(edgesX, edgesY); f...
45262939943c07757b9eed19498292afdf3ebb734876092e4a206517c6bed3a7
MATLAB
581
22
function ShowRectsWithinImage(rects, numRow, numCol, image, imageNames) % ShowRects(Rects, numRow, numCol, image) % % Shows only the rectangles of the image if ~exist('imageNames', 'var') imageNames = cell(size(rects,1), 1); for i=1:size(rects,1) imageNames{i} = sprintf('%d', i); end end ...
6f1232a0d4ae4e9440a025f954e8c70baec75464e207038e5d7d6512e45459eb
MATLAB
581
26
function results = vl_test_ihashsum(varargin) % VL_TEST_IHASHSUM vl_test_init ; function s = setup() rand('state',0) ; s.data = uint8(round(16*rand(2,100))) ; sel = find(all(s.data==0)) ; s.data(1,sel)=1 ; function test_hash(s) D = size(s.data,1) ; K = 5 ; h = zeros(1,K,'uint32') ; id = zeros(D,K,'uint8'); next = zer...
04a656df1b3dab321b900002f319df3fac81e4bc5a4f87a84bcaa5f60fa9c695
MATLAB
582
19
f1 = [0.38,0.55,0.63,0.69,0.68,0.71,0.79,0.79,0.79,0.82, 0.78, 0.78]; kappa = [0.01,0.22,0.37,0.45,0.44,0.51,0.64,0.62,0.63,0.67,0.61,0.62]; time = [1,2,3,4,5,6,7,8,9,10,15,20]; clf; axesH = axes; yyaxis left; plot(time, f1, 'LineWidth', 2); ylabel('Weighted-F1 score', 'FontWeight', 'bold') ; xlabel('Epoch len...
0d05866556ce408b89d0649aa034562edde9e18b01aac3b9cbce58583f207ae8
MATLAB
582
20
function SONSetInitLow(fh, chan, flag) % SONSETINITLOW sets the initial state on an EventBoth (level) channel % % SONSETINITLOW(FH, CHAN, FLAG) % where FH is the SON file handle and CHAN is the channel number. % FLAG is 'TRUE' if the first transition is high-to-low, 'FALSE' otherwise. % No return value % % Au...
2076193a7d5345d8c10f6b60ea21833955fa0b6323a0a04e0b0152e9a14575a5
MATLAB
582
18
function [ new_labels ] = combine_watersheds( L, indecies_to_combine ) %This function combines the indecies in indecies_to_combine if length(indecies_to_combine) < 2 new_labels = L; return end BW = im2bw(L, 0); BW_combined_indecies = ismember(L, indecies_to_combine); BW_combined_inde...
3075169d02aea7d4a7cf9568f5cc2f34da54d0dac196243b3f35760a3e5a4d55
MATLAB
582
21
function [ data ] = ml_cai_behavtrackvid_h5_read_all( filename ) % Reads a 'behav_track_vid.hdf5' file specified by the filename given in filename info = h5info(filename); h5Fields = {info.Datasets.Name}; matFields = h5Fields; numFields = length(h5Fields); data = []; for iF = 1:numFields fieldName = sprintf('/%s',...
31f7b9e19e5959d65cd5e43b50a27347697354e32848e2cd59e51f732278de0e
MATLAB
582
15
function flip = spm_flip_analyze_images % Do Analyze format images need to be left-right flipped? The default % behaviour is to have the indices of the voxels stored as left-handed and % interpret the mm coordinates within a right-handed coordinate system. % % Note: the behaviour used to be set in spm_defaults.m, but t...
2dd95607357268c6ce5f3068e8ed1a7a86165e2b38ea63b55ccca96748c09da9
MATLAB
583
21
function [timeRange, pupilSize] = getPupilSize(obj, startIdx, endIdx) assert(isa(obj, 'Edf2Mat'), 'Edf2Mat:plot', ... 'Only objects of type Edf2Mat can be plotted!'); if ~exist('startIdx', 'var') startIdx = 1; end if ~exist('endIdx', 'var') endIdx = numel(obj.Samples.p...
62ca92e316989b9d8e3a02cf6ad15f573b9da9ec5323e8e37225559df44714db
MATLAB
584
22
% testradiipupil % Test pupil radius parameters for initial search function [pupilStart1,pupilStart2] = testradiipupilmanual(img1, img2) % Camera 1 clf; subplot(1,2,1); imagesc(img1); colormap(gray); axis image;box off % Camera 2 subplot(1,2,2); imagesc(img2); colormap(gray); axis image;box off %% Get pupil cen...
62f37946538ed580525706ac459806f31a9d523b009719a3e8585e8c80fd1124
MATLAB
584
29
function fixticks(scale) % FIXTICKS(scale) % Put tick marks outside figure, sizes them according to full figure if ~exist('scale','var') scale = 1; end npoints = 2; h = findall(gcf,'Type','axes'); % Get length of current axes % pos = get(h(1),'Position'); % Based only on maximum VISIBLE axis, use special fun...
8c97eb84cc7aedab31147b38d15d243b2b0eb2403b8145c26684506fa721ed6e
MATLAB
584
15
function SONSetFileClock(fh, usPerTime, timePerADC) % SONSETFILECLOCK sets the basic time units and the clocks per ADC conversion % % SONSETFILECLOCK(FH, USPERTIME, TIMEPERADC) % INPUTS: FH the SON file handle % USPERTIME the number of microseconds per clock tick % TIMEPERADC the number of clock ...
eeee98d241722e182fc20768d6d8adacbbcb8a5ef8cce1a9816b571366c32d42
MATLAB
584
21
% f_GetIdxPosition.m [As a 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 pst_Pos = f_GetIdxPosition(pst_Pos,pst_Data) pst_Pos.s_IdxIni = f_GetIdx(pst_Pos.s_...
1d1b0bfb34a78baa6ac9d61dd403e8142f7066188b6c390f5a1aacfbdb24ae7d
MATLAB
585
26
function [imagesCellTrain, imageSize] = adjustFormat(imagesCellTrain) %compute image size %image size must be a power of 2 im = imagesCellTrain{1}; closPow2 = pow2(floor(log2(size(im,1)))); imageSize = [closPow2 closPow2]; for i = 1 : numel(imagesCellTrain) %load im = imagesCellTrain{i}; %back t...
a3de7ef3fc88ddbc91d48f789addfd9e59f6d561a5b02e875f60cdf7a4df3640
MATLAB
585
24
function deviceNumber = getBoxNumber % Checks connected USB devices and returns the device number corresponding % to the scanner button box (buttonBoxID should be set the the productID of % the button box used locally). % Written by KGS Lab % Edited by AS 8/2014 % change to productID number of local button box buttonB...
cc19f179b9a534e7c38c73c361abafcb87cfa5e27a6628b5a49e8c61d21b9c73
MATLAB
585
21
frame_id = round(rand(1,100)*v.NumFrames); frame_id = frame_id(frame_id>0); % im_rep = []; v.CurrentTime = 0; im_rep = []; disp('Generating Background Model...') for i = 1:length(frame_id) % frame_id = round(rand(1,1)*vid.Duration); get_im = rgb2gray(read(v,frame_id(i))); % get_im = im2gray(readFrame(vid));...
f808f262721278d18d5f4fa6bd830c28553c4011e23185b66674410f8f140d0c
MATLAB
585
25
function [finalmask] = cjlabel( maskin,groups ) finalmask = zeros([size(maskin) groups]); for groupnum = 1:groups bmask = zeros([size(maskin)]); for ii =1:size(maskin,3) L = bwlabel( maskin(:,:,ii) ); if L == 0 bmask(:,:,ii) = maskin(:,:,ii); else [counts, bins...
0a8dcd3df1dd4277825f2f23496ba099756a4c31d01c65013b4e63bae5c6c163
MATLAB
586
16
function dss_message(state, level, message) % Logging based on verbosity level % dss_message(state, level, message) % state DSS state with verbose-parameter % level Used logging level % message Logged message % Copyright (C) 2004, 2005 DSS MATLAB package team (dss@cis.hut.fi). % Distributed by Lab...
fffa90cc4aa6e7cd42890c9608cae754752b1c5810fa8f71c59d5dda23884daf
MATLAB
586
21
function [probe] = toggleModules(probe, moduleidx, modulestate) %TOGGLEMODULES Toggle the active state of a module % Toggles the active state of modules. moduleidx can be either an % integer, or an array of module indeces. modulestate must be 'on' or % 'off'. This changes the fourth column of probe.modules. if (...
b8bd8524ee5453c65b3434ddf252d9ef77014d94f707693ce0accb6232b84e99
MATLAB
587
26
function [Y] = NotchFilter(X,Fs,Fa) % This function is Notch filter function. % % Input£º % X Raw EEG Data, the data format is [Nchans * Ntime], where Nchans % is number of channels (EEG electrodes) and the Ntime is the number of EEG samples % Fs the sampling frequency (in Hz) % Fa Notch ta...
649022ad9331b9e9c096796e20e09492b96ef1a0dd0411902b4973e144586e7b
MATLAB
588
22
function sTracks = storeTracks(tracks,sTracks,counter) if counter == 1 % create an empty array of tracks sTracks = struct(... 'id', {}, ... 'data',{},... 'trackedFrames', 1); end ids = 1:size(vertcat(tracks.id),1) for i = 1:length(ids) IDpos = ids(i); sTrack...
9db6e8d5a4304fdd869c131999ba2902be7906a26e4e9e2011dc377bfb76708c
MATLAB
588
18
function y = vl_dgaussian(x) % VL_DGAUSSIAN Derivative of the Gaussian density function % Y=VL_DGAUSSIAN(X) evaluates the derivative of the standard Gaussian % density. % % To obtain the Gaussian density of standard deviation S, do % % Y = 1/S^2 * VL_DGAUSSIAN(X/S) . % % See also: VL_GAUSSIAN(), VL_DDGAUSS...
1659f22ede87917a44a825ef315acfea37991754d5a934a71bc00df93ac35a0b
MATLAB
589
18
function [ql,qu]=idealf(x) % Compute the ideal fourths for data in x % The estimate of the interquartile range is: % IQR=qu-ql; % Adapted from Rand Wilcox's idealf R function, described in % Rand Wilcox, Introduction to Robust Estimation & Hypothesis Testing, 3rd % edition, Academic Press, Elsevier, 2012 % Cyril Perne...
55bf3f554a3e1c5d06d7588f2c7324e9889971102f9fb816e94282168d8f4f8d
MATLAB
589
14
function [similarity indSim] = SSSimBoxFillOrig(a, b, blobStruct) % Calculate similarity for a single edge. % a is blob a. % b is blob b. % blobStruct is the list of blobStruct newArea = (max(blobStruct.boxes(a,3), blobStruct.boxes(b,3)) - ... min(blobStruct.boxes(a,1), blobStruct.boxes(b,1)) + 1) .* ... ...
bcc857f6793cfb8ddec9a01702370280f6c3461440e98c7524196879511b5900
MATLAB
589
18
function [results] = ml_dir_regexp_files(containerFolder, str, searchAllSubFolders) if searchAllSubFolders == 1 files = dir(fullfile(containerFolder, '**')); else files = dir(fullfile(containerFolder, '*')); end keep = zeros(1, length(files)); for i = 1:length(files) if regex...
46d61299675bf88ff68ab60e3954891ff8808dc16742463b9e760486c9c5f24b
MATLAB
590
38
% % Draw a full graph (with edges) using decomposition data. % % PARAMETERS % x, y (n*1) Coordinates % T (e*2) Edges % dense 0/1 dense plot % function map_line(x, y, T, dense) if dense line_width = 0.1; else line_width = 1; end colors_letter = konect_colors_letter(); if dense style = '-'; else ...
99bd2bab315d6be2343308a017eaddaff53004fa292f1b8962b003412982fb27
MATLAB
591
15
%VL_THREADS Control VLFeat computational threads % [NUM,MAXNUM] = VL_THREADS() returns the current number of % computational threads NUM and the maximum possible number MAXNUM. % % VL_THREADS(NUM) sets the current number of threads to the % specified value. NUM = VL_THREADS(NUM) does the same, but returns % ...
04a5c907199ef1eed4e2fd82a3a656f0f6f813dc4d2cb17f608a039aa6754e96
MATLAB
592
24
% mergeStructs.m % % Function to merge two structs into one struct with fields from both % structs. % NOTE: only works if the two structs don't share fields with the same name % % INPUTS: % struct1 - struct 1 to merge % struct2 - struct 2 to merge % % OUTPUTS: % mergedStruct - single struct with fields from both...
2378d213e94d0a84f62fa564704db44807594aa2acf7cd06d3aa9ebf130dd6be
MATLAB
592
19
function SONSetADCScale(fh, chan, scale) % SONSETADCSCALE sets the scale on an ADC channel % % SONADCOFFSET(FH, CHAN, SCALE) % where FH is the SON file handle, CHAN is the channel number and SCALE is % the new value to be written to the file % % An ADC value is converted to a real value as: % Real valu...
77bd83e89f09e9986eac95a6f88abfdbd40c4087c47ad6a7dbaf00932d96a810
MATLAB
592
19
function dTickLen=SONTimeBase(fh, dTb) % SONTIMEBASE Get or set the base time units for the file % (usually 1e-6seconds) % DTICKLEN=SONTIMEBASE(FH, DTB) % FH SON file handle % DTB If <= 0 ignored % >0 the new value to s...
ca1d762915cca7ed2d1d8751d4aeecd2ed1cc04e5fcf99fded613a9d93588e35
MATLAB
592
27
function res = adjD(y) %y1 = ones(imsize)*y(1)/sqrt(prod(imsize)); %yx = (reshape(y(2:prod(imsize)+1), imsize(1), imsize(2))); %yy = (reshape(y(prod(imsize)+2:end), imsize(1), imsize(2))); res = adjDx(y(:,:,:,1)) + adjDy(y(:,:,:,2)) + adjDz(y(:,:,:,3)); return; function res = adjDz(x) res = x(:,:,[1,1:end-1]) - x;...