sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
b2da1aeacd26dd83072456c2ba1d8151e70e9965aa5c3a80003df65e3e50bcd3
MATLAB
1,918
63
function spm_print(job) % Print the graphics window %__________________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % John Ashburner % $Id: spm_print.m 8776 2013-11-14 09:04:48Z roboos $ % Run spm_print always as job to get configured print optio...
b1dd04b477a878f396527553e19d462e4492b7c53acfaaee84f235c6679a722d
MATLAB
1,919
50
% VL_VLAD VLAD feature encoding % ENC = VL_VLAD(X, MEANS, ASSIGNMENTS) computes the VLAD % encoding of the vectors X relative to cluster centers MEANS and % vector-to-cluster soft assignments ASSIGNMENTS. % % X has one column per data vector (e.g. a SIFT descriptor), and % MEANS has one column per component...
0c00e604d0ec0167c99812c065dc9c13a347745c0932eeb46111c8cd9914b0ed
MATLAB
1,920
58
%% calculate the ICC of each connectivity in SWU data %% ICC script downloaded from: https://ww2.mathworks.cn/matlabcentral/mlc-downloads/downloads/submissions/22122/versions/12/download/zip/IPN_agreement.zip %% para sub_num = 120; ob_k = 3; node_num = 48; pro_type = {'No_smooth','Smooth'}; net_type = {'VBM','DBM'}; ...
2b36521b9eee4580af1ca1284f4fe7f205ec66f877762e448e5771828f60fe12
MATLAB
1,920
62
% mglTestMetalRepeatingBlts: an automated and/or interactive test for rendering. % % usage: mglTestMetalRepeatingBlts(isInteractive) % by: Benjamin Heasly % date: 03/10/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Test lots of texture blts, repeated by...
311356f57f6a5563d4497f19eb28b24be13578b456129dfa9a6b3bbb657d7feb
MATLAB
1,920
52
classdef IntracellularStimuliTable < types.hdmf_common.DynamicTable & types.untyped.GroupClass % INTRACELLULARSTIMULITABLE Table for storing intracellular stimulus related metadata. % REQUIRED PROPERTIES properties stimulus; % REQUIRED (TimeSeriesReferenceVectorData) Column storing the reference to the recorded s...
62e8ca9fecd8515ced4099e2e7f1a5ed9d6bfd79010fc0178530417c1357b9c2
MATLAB
1,920
61
function [y1]=rs(y1,T,f2) % [y2] = rs(y1, T) resamples y1 to the target sampling rate y2 using T % [y2] = rs(y1, f1, f2) resamples y1 with f1 to the target sampling rate f2 % % RS does not require overlap data. % % see also: SOPEN, SREAD, SCLOSE, MAT2SEL, SAVE2TXT, SAVE2BKR % % Reference(s): % $Revision: 8776 $ % $I...
88bc434d37efadd468461b01e6fc4dc62176e8be6e35f1a3d40423dee49f351d
MATLAB
1,920
67
function hdr = mayo2nifti1(ohdr,mat) % Convert from an ANALYZE to a NIFTI-1 header % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % % $Id: privatemayo2nifti1.m 8776 2013-11-14 09:04:48Z roboos $ if isfield(ohdr,'magic'), hdr =...
d767c40c2b0d6302db6c0e12ffc6550c2f004ed5c8085acc9b6eed741645639e
MATLAB
1,921
56
function mouseMove(obj, firstClick, reset) persistent fullRange prevPoint range width height ; if ~exist('reset', 'var') reset = false; end if ~exist('firstClick', 'var') firstClick = false; end % get mouse position point = obj.imhandle.Parent.CurrentPoint; point ...
df604587e0a08cd4521693349c4822dad1cc17b3641677a7a7ac18e973f19938
MATLAB
1,922
63
function res = singlepulses(stimchans,ntrials) %function res = singlepulses(stimchans,ntrials) % % This function runs single pulses in both polarities for a total % of ntrials*2 trials. It will take about ntrials/10 minutes to run. % % INPUTS % % stimchans a 1x2 matrix containing the channel numbers acco...
e4a180f76cc9a717a9f37082bf1e79a7cbee832a1d9f588ec3ea249a33d605cd
MATLAB
1,922
67
% processIInj_all.m % % Function that processes current injection data from ephyData in % user-selected pData file(s) % Calls preprocessIInj(). Meant to be run on pData processed before % preprocessIInj() was added to preprocess() % % INPUTS: % none, but prompts user to select pData files to process % % OUTPUTS: % ...
f8a14e46495fee1947618da98c0d8002720cee88957ff0d0c3466296b1c792d7
MATLAB
1,922
79
%tableS4_FA_diffs_pbase_vary_synthetic.m %% clear all; close all; clc; warning('on','all') scriptdirs = {pwd; '..\..\plot'; '..\..\analyze'; '..\..\helper_functions'}; addpath(scriptdirs{:}) datadir = pwd; ssfile = 'subsample1000_pbase_vary.mat'; sspath = fullfile(datadir,ssfile); %% paths tabledir = datadir; tab...
7f8c54120855f933255fa4fc97505d19df370bf367e80066ff30ac29a46a393a
MATLAB
1,923
56
function plot_individualExamples(csInfo, z, segInfo) %% Set up csLoc_cycle = csInfo.timeRel2Cycle_sec; cycleNum = csInfo.cycleNum; figure() cycleExample = tight_subplot(4,1,[.04 .03],[.03 .03],[.01 .01]); %% Fig A: Stim and CS location axes(cycleExample(1)); plot(z.cycleTime_b, nanmean(z.cycleMat_tVel), 'r', 'Line...
be784717973320389dbd1f660d51dd83ed1866b9fbbd2d9903e9d5a0d681f9e6
MATLAB
1,923
51
function channelpos = fillmissingprobe(channelpos) % Fill missing values of a neuropixels probe map % Extract unique x values [xUnique,~,chOrdertmp] = unique(channelpos(~isnan(channelpos(:,1)),1),'stable'); xUnique = xUnique(~isnan(xUnique)); chOrder = nan(1,size(channelpos,1)); chOrder(~isnan(channelpos(:,1))) = chO...
1538929a06d63f799f52fecd782c0b4c7f89e4b315e7e2b4cbd62abd23160621
MATLAB
1,924
63
function [] = Fig06_BidirRespMod_Normalized() % Code for plotting the mean change in ΔF/F after song-type transitions relative to ΔF/F before the transitions in Fig. 6e,h,. GT = 'pIP10'; Target = 'pIP10_NR'; % Fig. 6e % GT = 'pMP2'; Target = 'pMP2_NR'; % Fig. 6h switch Target case 'pIP10_NR' TargetROI = 3...
3e86c117954716bc91017d746f51f36030a97a8f8d58383c73d4d1502affc9b4
MATLAB
1,924
62
function F=makeLMfilters % Returns the LML filter bank of size 49x49x48 in F. To convolve an % image I with the filter bank you can either use the matlab function % conv2, i.e. responses(:,:,i)=conv2(I,F(:,:,i),'valid'), or use the % Fourier transform. SUP=19;%49; % Support of the largest filter (mus...
5eade07ed2f3e6b4ab6b64b22333bab3a184435efee869265b4a9c36dbf9a798
MATLAB
1,925
42
%Put all the volumes in one matrix clc;clear addpath '/Users/Tara/Documents/Projects/CHBHVisit/PerceptualLoad/Data/MRI_Data/'; filePath='/Users/Tara/Documents/Projects/CHBHVisit/PerceptualLoad/Data/MRI_Data/'; % addpath '/Volumes/jenseno-avtemporal-attention/Load/MRI_data/Processed Data/'; % filePath='/Volumes/jensen...
725919eb56fad1759e8cec65190a7a159f9eba8f5220e14207f927dc6df19944
MATLAB
1,925
45
function mltp_compute_bfo_general_average(obj, rotDeg, group) numAngles = 360 / rotDeg; bfo_session_prob_mean = zeros(obj.Experiment.getNumSessions(), numAngles); bfo_session_prob_std = zeros(obj.Experiment.getNumSessions(), numAngles); bfo_session_corr_mean = zeros(obj.Experiment.getNumSessions()...
c1cdfb48212e11f78b1c4232da033b44310a16ad25f0d270deb66c9afa5dff49
MATLAB
1,925
56
% XMLTree: XML Toolbox for MATLAB. % Version 1.3 21-Apr-2008 % % XML file I/O. % xmltree - Constructor (XML parser). % save - Save an XMLTree in a file. % % XML Tree manipulation methods. % add - Add a node in a tree. % attributes - Handle attributes of a node. % branch - Extract a s...
36ee0bbeb0f56069d976ba4340283fdf20397ea9a761f4b763c95074642b1c4c
MATLAB
1,926
73
function [net_config, net_exp_info]=prepare_running_model(train_opts) if train_opts.run_evaonly [net_config, net_exp_info]=do_prepare_evaonly(train_opts); else [net_config, net_exp_info]=do_prepare_train(train_opts); end end function [net_config, net_exp_info]=do_prepare_evaonly(train_...
677d6a3448c7ad1edba839f6a62b86f54f76e63fe127402c8a7f31c9cdf9a736
MATLAB
1,926
51
%Example demonstrating peak interpolation (finds the peak of a function, %interpolated between samples using the peak and its two neighbors). %This is an example of subample delay estimation: finding the subsample %peak of the cross correlation between a signal and its delayed version. %Note that this isn't necessar...
ece14db39ec54cd16c66373a9d6b663948b6ac7da8e45de1345885c8c0a3ff1c
MATLAB
1,926
49
function [delta_jtr] = jitter_delta(spk_delta,jtr_int) % jitter_delta.m - permute binary vector data within intervals % as in Amarasingham et al. (2012) % 7/16/22 KC %inputs: % spk_delta = binary vector, NxM matrix, or Nx1 cell array % -> if matrix: N = # trials, M = # msec/trial % -> 1 = spike occurred in the corre...
52cb4a95573a1185181b3b1aedaede38c4758647780f18b5fa7dc7f9908dcbad
MATLAB
1,928
43
clear file=dir('ACC*reverse*.mat'); k=1; for jj=1:length(file) load(file(jj).name) n=length(outcome); n1=fix(n*0.15);n2=fix(n*0.50); go1=[find(outcome(1:n1,1)==1);find(outcome(1:n1,1)==2);find(outcome(1:n1,1)==5)]; go2=[find(outcome(n1+1:n2,1)==1);find(outcome(n1+1:n2,1)==2);find(outcome(n1+1:...
7f497e9543e0cd01d8667b283d47c9db762fd734ddfa36d3efa67dff3d305d02
MATLAB
1,928
58
clear all base_folder = 'Data\OpenField'; qq=0; uu=0; SesList = getFiles('Data\OpenField',{'opF'},{''}); % exclude Nw (no whiskers) files for Session = SesList' clear Quality Tagging opF Session = cell2mat(Session); iSes = find(strcmp(SesList,Session)); if find(Session=='.'), Sesname ...
2c6185ec40eb06c83ae918e535b94e0dc1baf6d7820e4e6711913d416e76f7a5
MATLAB
1,929
52
function dtseries_var=get_variance_file(dtseries_var_path,handles) %% dtseries_var=get_variance_file(dtseries_var_path) % % This function was made to calculate variance files if they does not exist %% % [exist_variance_file dtseries_var_path]=isfile(dtseries_var_path); [exist_variance_file dtseries_var_path] = check_...
f9bf5c087fc4483670e2ff2ce091cec6c119c428986995df1a00fe11fea83e62
MATLAB
1,929
54
function status = fillSetupOFFParameters( obj, data ) % Fill setup LFP recordings OFF stimulation class % % Syntax: % [ status ] = FILLSETUPOFFPARAMETERS( obj, data ); % % Input parameters: % * obj - object containg data % * data - data from json file(s) % % Output parameters: % * status % % Example: % sta...
5cbd3eb0162ea376d4935db4f1d17287a5532f9abc40ca1d1cfcd38eb549001b
MATLAB
1,930
63
% % 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...
a935759c46051e36a62bfa734c20a69a82fdf4532f9ff7543a29e7823991246d
MATLAB
1,930
75
function dataSize = TDMS_getDataSize(dataType) %TDMS_getDataSize Returns data size in bytes % % This function is used to return the size of raw data for predicting the % # of chunks of raw data % % dataSize = TDMS_getDataSize(dataType) % % INPUTS % ================= % dataType : Labview dataType % % O...
c42f20fc01d3c7347d77386789125b7f985ef8c45f8edab274f40093ea8d3bb1
MATLAB
1,930
58
% detectSpikes.m % % Function that takes in voltage trace and returns indicies of when action % potentials occurred. Action potentials defined by threshold crossings in % first derivative of voltage (dv/dt). Adacent threshold crossings must be % at least refractoryPeriod length of time from each other. % % Returns ...
e7906fa4a3fcd83098becee773ed2167bbee107109d031ac6e150a8c903fc4f9
MATLAB
1,931
76
function [h_line, h_patch] = lpp_plot_shading(xaxis, mean, error, varargin) % usage: [h_line, h_patch] = wani_plot_shading(xaxis, mean, error, varargin) % % input: xaxis, mean, error % % optional_inputs: 'color', 'color_shade', 'alpha', 'linewidth' color = [0.3333, 0.6588, 1.0000]; % default color use_color_shade ...
29ad3abf980b5596aa074c0767dff4a0357f82227f718c65d56c451ac24fd569
MATLAB
1,932
72
function[]=plot_mssVScorrect(cluster_outcome,nbins,tickspacing) % Plots relationship between the mean silhouette score and the percent correct of a cluster combination overall=nan(1,length(cluster_outcome)); pcorr=nan(1,length(cluster_outcome)); for i = 1:length(cluster_outcome) overall(i)=cluster_outcome(i).ove...
261f6efee643681a1af1f9d2dfca3dfc6d2f6d23da080c339edc1c1f9ade179a
MATLAB
1,933
60
% mglTextSet.m % % $Id$ % usage: mglTextSet(fontName,fontSize,fontColor,fontVFlip,fontHFlip,fontRotation,fontBold,fontItalic,fontUnderline,fontStrikeThrough) % Note that in metal, bold, underline and strikeout are not % implemented % by: justin gardner % date: 05/10/06...
2fcf705f6fa4aaf5301ab0352f0cd357cb83b880f68b74652fe116514e6b29a3
MATLAB
1,933
52
classdef IntracellularResponsesTable < types.hdmf_common.DynamicTable & types.untyped.GroupClass % INTRACELLULARRESPONSESTABLE Table for storing intracellular response related metadata. % REQUIRED PROPERTIES properties response; % REQUIRED (TimeSeriesReferenceVectorData) Column storing the reference to the record...
f3391d33dbfdb058ecd43f6f75087c8af4d8631e394bc5238b00bf94d828ec01
MATLAB
1,933
36
function [Ex, Ey, Ez] = bemf3_inc_field_electric(strcoil, Points, dIdt, mu0) % Computes electric field from the coil via the FMM % in terms of the pseudo electric potential evaluated for segment centers % % Copyright SNM 2017-2020 % Compute pseudo potentials N = size(Points, 1); ...
49af562c11585af927b436776b704176ccf66812698f30feb9098f222fbd87da
MATLAB
1,934
42
clear file=dir('ACC*uncertain*.mat'); k=1; for jj=1:length(file) load(file(jj).name) n=length(outcome); n1=fix(n*0.33);n2=fix(n*0.67); go1=[find(outcome(1:n1,1)==1);find(outcome(1:n1,1)==2);find(outcome(1:n1,1)==5)]; go2=[find(outcome(n1+1:n2,1)==1);find(outcome(n1+1:n2,1)==2);find(outcome(n...
3c5573d413b78129004376f991e2f231d4f05dcfe788ebd4eeeab66447b538ad
MATLAB
1,936
88
function [ynn_t,nn_stat,nn_dyn] = SolveNLSNLD(Imat_t,dsr_t,ni,nh,no,tn) maxiter = 2; ynn_t = zeros(tn,no); int_mat_1 = zeros(nh,tn); check1 = Inf; x_in = 0.95.*Imat_t; net_s = newff([0 1].*ones(ni,1),[nh, nh],{'logsig','logsig'},'trainlm'); for iter = 1:maxiter % Training of the dynamic ne...
f5902a75abed65e4f7bb2f7c254f82c264f16e9e1f4466d9d0da6d895339605a
MATLAB
1,938
58
clear; close all; clc; initime = clock; addpath('funcs'); Delta_E = 0.3; Delta_I = 0.027; Iattn = 0.02; allTime = 4000; steps = 201; lateral_start = 0.09; lateral_end = 0.18; strt_prd = 300000; end_prd = allTime/0.01; % container PETAsheet = zeros(steps,16,16,5); PETOsheet = zeros(steps,16,16,5); finalRsheet = zero...
fb9d6b0e0f3802c96b926609e9321a9070a77a91ce6e5177b5dba9725f206ed1
MATLAB
1,938
59
% fictracOnly.m % % Trial Type Function % Only records FicTrac channels % % INPUTS: % settings - struct of ephys setup settings, from ephysSettings() % duration - duration of trial, in seconds % % OUTPUTS: % rawData - raw data measured by DAQ, matrix where each column is data % from a different channel % ...
18c96b3ad1bed27a992cee228f69e68e790a678214ffbf9dd373e1d87af37d28
MATLAB
1,939
65
% Author: Guosheng Lin (guosheng.lin@gmail.com) % this is a simpler demo file for testing on your own images. function demo_test_simple_sal() rng('shuffle'); addpath('./my_utils'); dir_matConvNet='../libs/matconvnet/matlab'; run(fullfile(dir_matConvNet, 'vl_setupnn.m')); run_config=[]; run_config.use_gpu=true; %...
f9b6e6652b2d1cafb2ed60561d1179bc5b66cfb7c73de0d1b5f034e359d58159
MATLAB
1,939
57
clear all; close all; clc %% create figure 2E %% janine.thome@zi-mannheim.de %% SPECIFY: % allgemein groupN = [0,1]; % group coding groupL = ["Controls", "ALS"]; % group labels GroupInd = 2; ...
9751795522aaf153c711b68990897d6027c61aa72dbf0c33dc156a8930a2097a
MATLAB
1,942
54
% extract statistical texture histogram using integral histogram(texture and lbp features) function [featArr] = sp_find_texture_grid(chns, grid_x, grid_y, patch_size) [featArr.texture, ~] = calcMeanandVariance(chns.imtext, grid_x, grid_y, [patch_size, patch_size], 0); x_lo = grid_x; x_hi = grid_x + patch_size - ...
fb40c35dddbff05d6c4ce3d314702178e05cbb164fc22eef85cf3de0b5a43dd0
MATLAB
1,942
60
function dki_nyu = mrtrix2nyu(tensor_mrtrix,kurtosis_mrtrix) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % NYU (dki_fit) % % Tensor % D_ind = % 1 1 % 1 2 % 1 3 % 2 2 % 2 3 % 3 3 % % Kurtosis % W_ind = %1. 1 1 1 1 %...
e6bd62837afee5d43e7c6a97619d14270e9d383a88d4a677c00958363534f9e7
MATLAB
1,944
55
function propValue = TDMS_getPropValue(fid,propDataType,UTC_DIFF,DATE_STR_FORMAT) %TDMS_getPropValue Returns the property value given the Labview DataType % % propValue = TDMS_getPropValue(fid,propDataType,UTC_DIFF) % % See Also: TDMS_getDataTypeName SECONDS_IN_DAY = 86400; CONV_FACTOR = 695422; %datenum('01...
c4d600be2a9161c38cd8bc689c405ce8dcfe91f8b7093dfe0c08887b64534099
MATLAB
1,946
69
function t2(DATA,ROI,AddInfo) % This Aedes plugin calculates T2 map % This function is a part of Aedes - A graphical tool for analyzing % medical images % % Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uku.fi> % % Department of Physics, Department of Neurobiology % University of Kuopio, FINLAND % % Th...
c57742f108aa1e23a9c2eb78ff2a1892b3bd092ad24be61bd321a757f2980cb0
MATLAB
1,946
56
function [] = Fig03_SongTypePref_TN1dsx() % Code for plotting the distribution of song-type preference for TN1 neurons in Fig. 3c. %% parameters nTrials = 6; nStim = 6; T = 1370; % T Thre_Trans = 6; Thre_SongType = 0.05; PreEventImg = 72; % 10 s (71.0443) StimDurImg = 72; % 10 s (71.0443) OneTrialDur = 214; % 30 s (2...
e30c465663137a90dae99be1504b2b65322c498b36809a108ff2d4e0699fb809
MATLAB
1,946
40
function [BTA, behaviorCounts, BTA_std] = fastparallel_BehaviorTriggeredAverage(Concatenated_Behaviors,Concatenated_LEDPowers,BTA_seconds_before_and_after,fps) %This function performs the core BTA caculation downsample_number = 0; seconds_before = BTA_seconds_before_and_after; seconds_after = BTA_secon...
7726a291dce18314b313aaadc8dd21a6861c1d74d0a432a517d3cbaab78643d9
MATLAB
1,947
45
% VL_LOCALMAX Find local maximizers % SEL=VL_LOCALMAX(F) returns the indexes of the local maximizers of % the Q-dimensional array F. % % A local maximizer is an array element whose value is larger than % the value of all its neighbors. The neighbors of an element % i1...iQ have subscripts j1...jQ such that ...
9389bf000185ea870cb5b9aa0381b5c47bbcb8136fc3ced1414d64927db574d1
MATLAB
1,948
64
function []= plot_LDA(X,Y,w,iters) % figure % hold on % utils.set_figure(15) lda_d1=X*w(:,1); lda_d2=X*w(:,2); mixed=find(Y==4); som=find(Y==1); pv=find(Y==2); %null=find(Y==3); cur_mixed=cell(1,iters); cur_som=cell(1,iters); cur_pv=cell(1,iters); cur_null=cell(1,iters); total=length(Y); for i =1:iters tm=len...
b0af050189813d113906c767543502d20af279326ce5cdf4a41eb4183c1d6b2a
MATLAB
1,948
58
function [outlabels] = ReorderLabels(ctrx,ftrx,f2c,expi,jd,varargin) mindswap = myparse(varargin,'mindswap',10); VALS = 1; IMP = 2; TIMESTAMP = 3; cnflies = numel(ctrx); fnflies = numel(ftrx); nframes = max([ctrx.endframe]); clabels = zeros([cnflies,nframes,3]); for i = 1:size(jd.labels(expi).flies,1), fly = jd.la...
cfe86d86b56a4e3cd7918556e6fd1c36567f897320e12a7dd917e5fdc7b1ba0b
MATLAB
1,948
84
function [heatMap, gaze, plotRange] = heatmap(obj, startIdx, endIdx, eye) %% heatMap % generating heatMap data % %% Syntax %# heatMap(obj); %# obj.heatMap(); %# [h, g] = heatMap(obj, startIdx, endIdx); % %% Description % This function generates the data array (heatMap) for visualize a heatmap of the % eyetracker. A...
522c5752e151678b802beeacb9eb03a3a5c7ada65bb83276729cbc14ee35370a
MATLAB
1,949
57
function ideal = comps2ideals(comps, baseim, varargin) % ideal = comps2ideals(comps,varargin) % % Calculate the SNR-adjusted ideal components frm the full components. % % 2018 - Alex Song & Adam Charles %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Input parsing if nargin > 2 k...
97f32439f62daaa975b67f336aa6a3125527f4aab905493ea005e197c8108c44
MATLAB
1,949
60
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % RASTRIGIN FUNCTION % % Authors: Sonja Surjanovic, Simon Fraser University % Derek Bingham, Simon Fraser University % Questions/Comments: Please email Derek Bingham at dbingham@stat.sfu.ca. % % Copyright 2013. Derek Bingham, Simon Fr...
feafcefc2d763468021c3f14289dbd7ca12ecba76ed22c3fac1df69a9e6eee6b
MATLAB
1,949
56
function [df, maxDf] = fir_df(cutoffArray, Fs) % FIR_DF computes default and maximum possible transition band width from % FIR filter cutoff frequency(ies) % % Use as % [df, maxDf] = fir_df(cutoffArray, Fs) % where % cutoffArray filter cutoff frequency(ies) % Fs sampling frequency in Hz % % Required fil...
3f1cdd0efd48207a747fefe568d7f302bc494ec163a3c459eeacb74360f72f18
MATLAB
1,950
69
% computeDFF_all.m % % Function to compute dF/F for all date folders specified in function input % or through gui. % % INPUT: % dateFolderPaths - [] if gui to select one date folder; otherwise, % cell array of full paths to date folders % % OUTPUTS: % None, but creates pData.mat file to save dF/F, timing, an...
a89400cca6eb67a4f58cdb86c89bbf09da39d50f31b2f886e010a71007f1d591
MATLAB
1,950
54
function general_tetrode_init(referenceFolder) projectType = 'general_tetrode'; fprintf('Select the project instance folder (the project scripts will be saved in it)...\n'); instanceFolder = uigetdir(pwd, 'Select project instance folder to create'); if ~exist(instanceFolder, 'dir') fprintf('Creating instance fold...
1c402620b242694b7280a5675810392ae6ecba3f33518a209d21b97bd567ba5e
MATLAB
1,952
49
clear %load F1s.mat filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4',... 'sim_5','sim_6','sim_7','sim_8','sim_9'}; radii = [4:10]; % radii = [4:8]; SNRs = [1:6]; % SNRs = [3:4:23]; [list_Recall, list_Precision, list_F1] = deal(zeros(length(filenames),length(radii),length(SNRs))); parfor n = 1:(length(filenames)...
61be4c88de9adfc6b31995b9c5ab54df49c138d673e9df8b328c2f28a222dfb9
MATLAB
1,952
52
% getCatStepValsCond.m % % Helper function for saveLegStepParamByCond_fly() % Returns step val, as well as leg calls for selected amp and % dur, given keys. Conditions on step value. Operates on single vectors. % Modification of getCatStepValsXYcond.m % % INPUTS: % stepValAll - vector of all step param vals, length...
1d59862472b8ee6ed198f0c34943d9f7ca5384a6be532922dc6aa10c428113b8
MATLAB
1,953
64
% rampVInj.m % % Voltage Injection Function for visual panels. % Delivers linear voltage ramp between user specified values for user % specified duration. Repeats until end of trial. % Voltage values are not scaled, as they are not meant to be sent to the % amplifier. % % INPUTS: % settings - struct returned by ...
33ad94c671cea928e8f2b9d6a699122dbca8941d3f0d3960f1f317dfff2c2af4
MATLAB
1,953
64
function y = ft_preproc_slidingrange(dat, width, varargin) % FT_PREPROC_SLIDINGRANGE computes the range of the data in a sliding time % window of the width specified. Width should be an odd number (since the % window needs to be centered on an individual sample). % % Use as % y = ft_preproc_slidingrange(dat, width, ...
a17db516be4a10ae721239ff6ba937d3c1621bb6fd437fdc53e90fdba46f8124
MATLAB
1,953
87
% script for quick plots of avgFictracOpto figure; hold on; sampRate = 1000; avgWin = 0.1; durInd = 2; for i = 1:length(NDs) % moving average smooth FicTrac data movAvgFwdVel = moveAvgFilt(fwdVelData.means{i,durInd},sampRate,avgWin); plot(durTs{durInd},movAvgFwdVel); end yScale = [-5 20]; xScale = [dur...
dfa6c5e757088c3e106bd7df38523cb3d3f9b5f16b03e4597bdd60e03fac3121
MATLAB
1,953
49
clear %load F1s.mat filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4',... 'sim_5','sim_6','sim_7','sim_8','sim_9'}; radii = [4:10]; % radii = [4:8]; SNRs = [1:6]; % SNRs = [3:4:23]; [list_Recall, list_Precision, list_F1] = deal(zeros(length(filenames),length(radii),length(SNRs))); parfor n = 1:(length(filenames)...
221d5db42ed9894bb7ca900a2f1430dcf702f2e884501a91afdc84074f5f751e
MATLAB
1,954
45
function mltp_compute_bfo_general_placey_average(obj, rotDeg, group) numAngles = 360 / rotDeg; bfo_session_prob_mean = zeros(obj.Experiment.getNumSessions(), numAngles); bfo_session_prob_std = zeros(obj.Experiment.getNumSessions(), numAngles); bfo_session_corr_mean = zeros(obj.Experiment.getNumSes...
7d6c769e55cea7ed8cce76959fcc5f8a7187ff363fb84f79d66c5f7d193195fa
MATLAB
1,954
51
function [r_s,T_s,edges_s,edge_type] = create_mesh(P) % put nodes in position aux_x = P.x0:P.x0:P.max_x0; aux_y = [0:P.y0:P.max_y0 P.max_y0+P.y0/2]; aux_y2 = [0 P.y0/2:P.y0:P.max_y0+P.y0/2]; x_s = []; y_s = []; for l=1:length(aux_x) if mod(l,2) == 1 y_s = [y_s;aux_y']; ...
cde76bed11029bd30f9e22ee8e9ee21133d4b42cae483bd8d10e42a2f58b8c02
MATLAB
1,954
104
clear voxel_folder = {'cb_voxel_1', 'cb_voxel_2', 'cb_voxel_3', ... 'ct_voxel_1', 'ct_voxel_2', 'ct_voxel_3', ... 'or_voxel_1', 'or_voxel_2', 'or_voxel_3', ... 'slf_voxel_1', 'slf_voxel_2', 'slf_voxel_3', ... 'mc_voxel_1', 'mc_voxel_2', 'mc_voxel_3', ... 'vc_voxel_1', 'vc_voxel_2', 'vc_voxel_3', ... 'th_voxel_1', ...
ace39dfe06925655a2bc35069c2289199b59bce47f222fce63eef2d11bf2ec3f
MATLAB
1,955
47
function [im] = textureBasedStimulus(impath, stats, seed, sizex, sizey, libpath) % Outputs a frame of texture generated from original image % (application of Portilla-Simoncelli algorithm) % % [im] = textureBasedStimulus(impath, stats); % impath: string containing path to initial texture % stats: i...
bab5f3c1b522c44e199032c0a40f7e74302ee8220a4dcff75a8d12e65076c87c
MATLAB
1,955
42
function [binned, cut] = from_timestamps_to_binned(DATA, MARKER, neuron, trial, condition, central_marker, bin, m_time, p_time) %% Function to convert timestamps to binned format %% authors: Stefano Diomedi %% date: 22nd February 2024 % %% Inputs: % DATA: Timestamp dataset % MARKER: Corresponding mark...
2658c4e380c0531c667a9c559a2669f6fc6cab253486e74c9ebc97db26ddfb11
MATLAB
1,956
46
function[header]=SONGetBlockHeaders(fid,chan) % SONGETBLOCKHEADERS returns a matrix containing the SON data block headers % in file 'fid' for channel 'chan'. % The returned header in memory contains, for each disk block, % a column with rows 1-5 representing: % Offset to start of block in fil...
3ad4129170dddc5cf87887a3e31034f237b4032197f13d9c2879bb3daba83416
MATLAB
1,956
54
% data_name = 'lowBG=5e+03,poisson=1'; addpath(genpath('.')) %% num_Exp = 10; list_Exp_ID = arrayfun(@(x) ['sim_',num2str(x)],0:(num_Exp-1), 'UniformOutput',false); avg_radius = 6; r_bg_ratio = 3; d0 = 0.8; dir_parent = fullfile('..','data','data_simulation',data_name); dir_masks = fullfile(dir_parent, sprintf('GT M...
eab3661dea108b969d8791978b66569449811025beb191f225e8905fa1540d9e
MATLAB
1,956
50
addpath(genpath('/Users/hyang/Documents/EM-analysis-code/')); bodyCSVPath = '/Users/hyang/Dropbox (Personal)/Wilson Lab/FreeWalkLegTrack/melanogaster_legAndBodyCSVs/melanogaster_trial_5_20181011_103827.csv'; legCSVPath = '/Users/hyang/Dropbox (Personal)/Wilson Lab/FreeWalkLegTrack/melanogaster_legAndBodyCSVs/position_m...
3a777a145554d249a3946261b1c072b3adf631483253fb6ca5b2fdad86a1c595
MATLAB
1,957
84
function [ds_ct_corr,all_ct_corr,ds_ct_matrix] = organize_corrs (ds_partialcorrs,id_list) ds_num=length(ds_partialcorrs); %change this to just load a pooled_clustering file % mice = {'EC1-1R','EC1-1R','FL5-3L','FL5-3L','FU1-00','FU1-00','GE3-00','GE7-1L1R','GE7-1L1R','GS2-1L','GS8-00','GS8-00'}; % dates= {'2021-11-05...
4c6e4b40cbe4e9c35062820401c42e4bb050bfa1173618fa158bd5711d230e59
MATLAB
1,957
63
function CreateDriftMap(rez) %% Adapted from Kilosort function datashift2.m %% by Richard Hardstone (2022_11_30) if getOr(rez.ops, 'nblocks', 1)==0 rez.iorig = 1:rez.temp.Nbatch; return; end ops = rez.ops; % The min and max of the y and x ranges of the channels ymin = min(rez.yc); ymax = max(rez.yc); xmin =...
a828430b81fb7992b90855edf9a26264f8517faad0decdb5cce37e8099b4b586
MATLAB
1,958
93
function [hdr,be] = read_hdr_raw(fname) % Read a NIFTI-1 hdr file % FORMAT [hdr,be] = read_hdr_raw(fname) % fname - filename of image % hdr - a structure containing hdr info % be - whether big-endian or not % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trus...
b422e54557cdc5174e4720c9fd49c7432ef55ee3a1b3d8e0101cb44305e7318d
MATLAB
1,958
65
% renameLegVid.m % % Function that renames all leg video tiff files by generating and calling % Powershell script. % Assumes leg video tiff files are named legVid_dateTime_#.tiff. % % INPUTS: % rawLegVidPath - full path to rawLegVid folder % scriptsPath - full path to folder to save scripts % flyName - name of ...
ce6078c9f6ee58823c249f8aaa05038b2a6f518b97e91bef64f861a2b21ddcd4
MATLAB
1,958
63
%Add Apache POI library to MATLAB's static Java class path % %EXAMPLE USAGE % >> add_poi_path % %INPUT % segment - if '-static', add POI library .jar files to the static path; if % '-dynamic', add to the dynamic path. {default: '-static'} % %VERSION DATE: 20 November 2017 %AUTHOR: Eric Fields % %N...
61ad89394e5f0262899157b15649908fa977458298cdaf810e24526792baab8f
MATLAB
1,959
45
sBA = mouse: 'Thalamus39' date: '20160401' session: 'Emergence' movie: '40' nucleus: 'POm' whiskers: 'W' CSCs: [1 2 3 4 5 6 7 10 11 12 13 14 15 16] fps:...
fa96fee186b9c7eb1f19d8c6c379cc47c33a8b35d3891956302a4a3e6821c987
MATLAB
1,959
68
function [xMean, xStd, Vol, xMedian] = ExtractData(x, ROImap, roiIndex, erodesize, maskBrain) % [xMean, xStd, Vol, xMedian] = ExtractData(x, ROImap, roiIndex, erodesize, maskBrain) %% Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu % % Extract data statistics using ROImap and roiIndex ...
ec73e3088ff05342905a6186f81e97c60fc754515e38d877248841d1f001cc94
MATLAB
1,961
59
% clear; addpath(genpath('.')) addpath(genpath(fullfile('..','ANE'))) %% dir_video=fullfile('E:','data_CNMFE'); list_Exp_ID={'blood_vessel_10Hz','PFC4_15Hz','bma22_epm','CaMKII_120_TMT Exposure_5fps'}; num_Exp = length(list_Exp_ID); eid = 4; Exp_ID = list_Exp_ID{eid}; DirSave = ['Results_',Exp_ID]; dir_manual_draw = f...
33b3c7e009dac926ac779a152c14482903e25ca9c010875db37bad961a6a3d09
MATLAB
1,962
54
function [feat, label] = extr_feat_train(im, imgt, descPara) %% make grid sampling [imh, imw, c] = size(im); if c ~= 3, error('only rgb image is accepted'); end nStride = descPara.nstride_train; patchSize = descPara.patchSize; s = [imw, imh]; nxy = floor((s - patchSize) / nStride) + 1; % s1 = patchSize - s +...
88386e6946a795ee690e1c7816197a4a9933cb8a0a2fa6aa7a80e9373ab0737d
MATLAB
1,962
59
% determineStepLength.m % % Function that determines length of each step (distance moved in xy plane) % In units of body lengths % % INPUTS: % legXPos - matrix of leg x positions over time; num frames x num tracked % pts % legYPos- matrix of leg y positions over time; num frames x num tracked % pts % ...
6026db6a7270dfb45d0ae2d1a2b99a48e00009fc45cf6309d60685ade53b4323
MATLAB
1,963
62
function ft_flush_header(filename, varargin) % FT_FLUSH_HEADER removes the header information from the data queue % this also removes all data associated with the specific header. % % Use as % ft_flush_header(filename, ...) % % See also FT_FLUSH_DATA, FT_FLUSH_EVENT % Copyright (C) 2007-2010 Robert Oostenveld % % T...
67d90d134bf40e395e4cea4761aaeecb64e2cb9a3bbf3d65a2ea0149e58391ac
MATLAB
1,963
51
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %The function rgb2yuv converts the RGB matrix of an image to an YUV format% %matrix for the image. It plots the images, if Plot Flag is equal to 1. % % % %Example ...
2637d90bf6b2f043dd050ebd57f5153dca2f82f1b8b706d1dd0b94a7cac3e489
MATLAB
1,964
55
function [T,allTrials,meanTrials,semTrials,nrTrials, catTrials] = ... simseq_getStimBlocksFromDataRuns(dataAll,trials,params) % Chop data: % er_ChopTSeries2_VaryTriaLength needs data input: TRs/time by voxels % % VoxModel or VoxData are structs with one field for each voxel, % each field has cells wi...
bb2020093b0f6850c1165d2a6849aa5463a45a416d5cd01349f753e2d9a0401b
MATLAB
1,965
37
% Author: Zachary Chiang, Buenrostro Lab, Harvard University % Finds all pixels correlated to a given peak pixel over all images of an % IGS experiment and sums signal into a cycles by channels matrix function[mat spot] = spot_caller(peak, all_stacks, spot_vol, spot_dim, corr_thresh) % get sequencing parameters ...
be29c6d8613577fe2e132fa23792980aa6239df6c4f6f4fda91bd4134f65f106
MATLAB
1,965
59
function [trl] = read_fcdc_trl(fn); % READ_FCDC_TRL reads trial definitions from a file % % Given a file which defines N trials, this function returns a Nx3 % matrix with the begin latency, end latency, and the latency offset % of the first sample of each trial. The latencies are in seconds. % % [trl] = read_fcdc_trl(...
8a6ec54add78432554590bb078024cc32132ca3ba48b89f07451f17c9cbebd93
MATLAB
1,966
74
function create(obj,wrt) % Create a NIFTI-1 file % FORMAT create(obj) % This writes out the header information for the nifti object % % create(obj,wrt) % This also writes out an empty image volume if wrt==1 % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Cen...
df1fc98ff3527f42fecd59f8def6c71a8c8ba8f8fe97736a5dc2db6832811564
MATLAB
1,966
49
classdef CompassDirection < types.core.NWBDataInterface & types.untyped.GroupClass % COMPASSDIRECTION With a CompassDirection interface, a module publishes a SpatialSeries object representing a floating point value for theta. The SpatialSeries::reference_frame field should indicate what direction corresponds to 0 and w...
63d09a6c01bbe3ecfb2ce07be1ada085540ac97d60a1fe42a2ef7741bdcf8494
MATLAB
1,967
69
% Function File: [binMeanX binMeanY binSize] = binxy (x, y, n) % [binMeanX binMeanY binSize] = binxy (x, y, binEdges) % [binMeanX binMeanY binSize binStd] = binxy (...) % % Divides the vector of x-values into n number of equal bins. The % function then takes the co...
d07e2f305536ca0c0f0a5d19669493177d4a7b1bd52ef53bd25b7f6bde1aab76
MATLAB
1,967
52
%Find all effects for a given repeated-measures ANOVA design. % %EXAMPLE USAGE % >> [effects, effects_labels] = get_effects({'Frequency', 'Priming'}) % %REQUIRED INPUTS % factor_names - A cell array of strings of the names of all factors in % the design % %OUTPUTS % effects - An arra...
613de8520590d9a1a2f85fdaa48083c4db33b140561bc809e5edf1173197fbae
MATLAB
1,968
80
function status = om_check_vol(vol) % OM_CHECK_VOL Check meshes of volume conductor for BEM modeling % [STATUS] = OM_CHECK_VOL(VOL) % % returns 1 if there is a problem with geometry % else returns 0 % % Copyright (C) 2010, Alexandre Gramfort, INRIA % $Id: om_check_vol.m 8776 2013-11-14 09:04:48Z roboos $...
8890cb7d37f2c7f2f9ed20934e31c8c9ac2ce6d38137c1c51d4d67aedac278b6
MATLAB
1,969
89
function [ynn_t,nn_stat,nn_dyn,Xi,Ai] = TrainNLSprlNLD(Imat_t,dsr_t,nh,no,tn) maxiter = 10; check1 = Inf; u_s = Imat_t; u_d = Imat_t; dsr_t_s = dsr_t; net_s = newff(Imat_t,dsr_t,nh,{'logsig','purelin'},'trainlm'); net_s.trainParam.max_fail = 1000; % Initializing the Termination Criteria term_crit = I...
88b24058bb67c6ad48a67d3604052194960c1e3c8156ba0da41a0c9fb323c433
MATLAB
1,969
70
% mglPoints2c.m % % $Id$ % usage: results = mglPoints2c(x, y, size, r, g, b, a, isRound, antialiasing) % by: Benjamin Heasly % date: 03/17/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson, Dan Birman (GPL see mgl/COPYING) % purpose: mex function to plot 2D points on the screen open...
4767052b5590c80605114069745de80bb3e71470bff3c26d124e431eafff2e2e
MATLAB
1,970
54
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
382d671806d5a3479962636169085556c9a4362813e78095b69d34122c96a541
MATLAB
1,971
74
% mglPoints3.m % % $Id$ % usage: results = mglPoints3(x, y, z, size, color, isRound, antialiasing) % by: Benjamin Heasly % date: 04/17/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: plot 3D points on a screen opened with mglOpen % usage: resu...
a7653b4b2062552e962a35f7e1f694895ee7f1b948b63fa353a8650c6c449ea8
MATLAB
1,971
54
clear; close all; initime = clock; addpath('funcs'); % get the change of APC in parameter space Delta_e_start = 0; % cannot equal to 0 Delta_e_end = 0.5; % can equal to 0.5 Delta_i_start = 0.035; % cannot equal to 0 Delta_i_end = 0.035; % can equal to 0.5 Delta_steps = 101; Iattn = 0.02; time = 5000; strt_prd = 30000...
3e7b04d4b2a2045844c44131427af900c0037acfb04c4e596b3d98f844458d54
MATLAB
1,972
57
% % 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...
fb324fc9e18203840d840e8589e50d78a6885d1971a2e844455562148452551a
MATLAB
1,972
63
function [H0] = contrasts_wald(fitmodel,emm,L) % Hypothesis testing using Wald t/Z-tests on specified joint coefficients % (i.e. on input contrasts) % Copyright 2019, J. Hartman, Cornell University % % written using Matlab version R2016a % % INPUTS: % fitmodel is a GeneralizedLinearMixedModel object % emm is ...
6cc452191e3aa72d1735e93f62c30db245f1ec7445b1ab631b2591a16743b89a
MATLAB
1,973
60
function varargout = subsref(this,subs) % Subscript referencing for GIfTI objects %__________________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % Guillaume Flandin % $Id: subsref.m 8776 2013-11-14 09:04:48Z roboos $ if length(this) > 1 && ~strc...
7b783f1331aef43a93ffb0878a6b8fa7acd4e994b7e69ff018f38643ab874abf
MATLAB
1,975
53
function [intervalFast,kcenter_timepoint1,kcenter_timepoint2] = TimeIntervals(dicomfolder,sequencenameFast,workingDir,MP2RAGE_postcontrast1File,MP2RAGE_postcontrast2File) %Calculate the interval between the dynamics in the fast DCE scan cd(dicomfolder) s = dir([dicomfolder,'/*.IMA']); nDicoms = size(s,1); iFast = 1; di...
a98c6de2db471a2f7b8547a8578d9f23d3b232a22f32c2c47a9dd431f13c3593
MATLAB
1,975
40
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [output] = ml_algo_bfo_percell_general_single(maps, contextIds, rotationsDeg, MIN_DIFFERENCE_FOR_MAX_CORRELATION) % Force to use two contexts because some cells (almost none) only have data for one. uniqueContextIds ...
23899e58d1f1ebeb74930b85dbfac6e8e53ce8ba0c04c6a8e21af3b928d70dc0
MATLAB
1,976
65
function [varargout] = funname(varargin) % READ_CTF_SHM reads metainformation or selected blocks of data from % shared memory. This function can be used for real-time processing of % data while it is being acquired. % % Use as % [msgType msgId sampleNumber numSamples numChannels] = read_ctf_shm; % or % [data] = re...
47f6875bd217e78f273e6be8e2b164dfa521ec1fb45a715e2320aaf707fe3f57
MATLAB
1,976
63
classdef CellRegistration %UNTITLED2 Summary of this class goes here % Detailed explanation goes here properties CellRegisteredStruct end methods function obj = CellRegistration(cellRegisteredStruct) obj.CellRegisteredStruct = cellRegisteredStruct; end...