sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
dba8afd280d3f3cff2d776283f98044307c83862bae2581e9a109cb69109e22c
MATLAB
5,859
176
function [pls_repro,splitflag]=split_half_PLS(x,y,n_con,numsplits,lv,CI,dist_flag) % [pls_repro,cca_repro,splitflag]=split_half_PLS(x,y,n_con,numsplits,lv,CI,dist_flag) % % computes the cosines between singular vectors U and V from numsplit % random splits of X and Y data % n_con= number of conditions % nsplits: number...
0ce758e5cf18be88d7ff5fc2b480a55cecf08f1b09bc481908f73d5a5ac662d0
MATLAB
5,864
163
function imData=bigread2(path_to_file,sframe,num2read) %reads tiff files in Matlab bigger than 4GB, allows reading from sframe to sframe+num2read-1 frames of the tiff - in other words, you can read page 200-300 without rading in from page 1. %based on a partial solution posted on Matlab Central (http://www.mathworks....
11bc786a41992c83eb3491d1344543f55b4df93e4e3c2f3119b9e391ab7aacda
MATLAB
5,866
194
%% plotSDO % % Command script for the collection of plotter methods used to visualize % the SDO and SDO effects. % % All called plotSDO subscripts may be called independently. % % PREREQUISITES: % computeSDO() % INPUT PARAMETERS % sdoStruct: 'sdo' structure % XT_SDO_CH_NO: Row index for the sdo structure, point...
459b75affa10936bc017c2fc4589b0fae994bfee1aae53ef0a67738b9983ed18
MATLAB
5,866
191
%% Run this script to initialize PMTK3 % This file is from pmtk3.googlecode.com set(0,'DefaultAxesFontSize',15,'DefaultTextFontSize',15); format compact more off; % especially important in Octave - init may fail without it verbose = true; if verbose disp('initializing pmtk3'); end isMatlab = ~isempty(ver('...
72038cb8312a34f878636b7187ba3db0a9abaa1d78a4ee7d6bd8101a320c1919
MATLAB
5,869
149
function ArgStruct=parseArgs(args,ArgStruct,varargin) % Helper function for parsing varargin. % % % ArgStruct=parseArgs(varargin,ArgStruct[,FlagtypeParams[,Aliases]]) % % * ArgStruct is the structure full of named arguments with default values. % * Flagtype params is params that don't require a value. (the valu...
1e759d1fd9dd68ca8c263acea7cb0bd3ac246f05759e831671eb40719aa256a2
MATLAB
5,870
178
function [fracwrong_cv,fracwrong,hsPr_cv,probs_cv,ferns,hsPr,probs] = fernsClfCrossValidation( data, hs, varargin ) % Compute cross-validation error of random ferns classifier % % See "Fast Keypoint Recognition in Ten Lines of Code" by Mustafa Ozuysal, % Pascal Fua and Vincent Lepetit, CVPR07. % % Dimensions: % ...
b530cc41802c4e31249f1067842a4a0a465b7f022338c3074e8d9b846b6ea9a0
MATLAB
5,872
214
function S = dtvoting( E, s, sg, m, d, v ) % STVOTING Applies dense 2D tensor voting for ridge detection by steerable filters over % every slice of a tomogram at X, Y and Z axes. % INPUT: % E - Input tomogram (foreground dark) % s - Scale factor % sg - variance for gaussian prefilteri...
1ace732dc7ca68698dfb699632d8099c35ba264cfc7e6811f699ed9aa9848fa7
MATLAB
5,873
193
function [dip_score,cutpoint,info]=isocut5(samples,sample_weights,opts) if nargin<1, test_isocut5; return; end; if nargin<2, sample_weights=[]; end; if (nargin<3), opts=struct; end; if (~isfield(opts,'already_sorted')) opts.already_sorted=0; end; if (~isfield(opts,'return_info')) opts.return_info=[]; end; info=struct...
ec4e6a51b087159d7075f393324ee211b7413342a4671105eb602ded1a05ed0b
MATLAB
5,873
227
% meg_plotDecodeGroup.m %% setup expt = 'TANoise'; user = 'mcq'; paramType = 'Analysis'; loadAnalysisFiles = 1; % directories exptDir = meg_pathToTAMEG(expt, user); % figDir = sprintf('%s/figures/%s', dataDir, analStr); % sessions sessionNames = meg_sessions(expt); sessionNames = sessionNames([1:8 11:20]) % params...
18357853142c313c130b00915e462b5fe8e1a4aedfdbb0eff79216a303848552
MATLAB
5,874
97
for RecordingNum=1:length(Recording) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
528190bfb7d6b6d495475749acf446ee60fdcd980b504687041bd11158f29fe3
MATLAB
5,874
153
function ArgStruct=parseArgs(args,ArgStruct,varargin) % Helper function for parsing varargin. % % % ArgStruct=parseArgs(varargin,ArgStruct[,FlagtypeParams[,Aliases]]) % % * ArgStruct is the structure full of named arguments with default values. % * Flagtype params is params that don't require a value. (the valu...
f72eb6c324741a3f1785e63cad899e609c61c0e9a020a740863325d48ed4637b
MATLAB
5,875
214
function S = dtvoting( E, s, sg, m, d, v ) % STVOTING Applies dense 2D tensor voting for ridge detection by steerable filters over % every slice of a tomogram at X, Y and Z axes. % INPUT: % E - Input tomogram (foreground dark) % s - Scale factor % sg - variance for gaussian prefilteri...
22db03e3ae00eb27a1bb36166cabee90ca4b19176f4d2f601e79294375dd323d
MATLAB
5,876
125
function [zmatGroupMean,zmatGroupStd,grouplabel,bins] = group_fc_data(corrmat,subjectdata,groupby,nshuffle,nboot,nsubsample,indices,EYOedges) % groupby options {'EYO','MCxSex','EYOxSex'} % adapted from util_pipeline_DIAN where you can see the group counts and % average age etc. % updated 220302: the groups if seprated ...
571d62dd7f19bbd73d2222950816380b975cf6d431354a671fbf7418c90fe9fd
MATLAB
5,876
222
% Shameless Port of Krishnamoorthy's "Two Poisson Means" fortran code % % Port by Andrew Leifer % leifer@princeton.edu % 24 January 2018 % % Fortran program: computes the p-value for testing the difference between % two Poisson means. [Source: Krishnamoorthy, K and Thomson, J. (2004) % A more powerful test for comp...
83d2ea3a740214895908fcb9ab5c61d6076fc0d3a5e362d9fe6900d03389c630
MATLAB
5,876
168
function [obj] = ft_determine_units(obj) % FT_DETERMINE_UNITS tries to determine the units of a geometrical object by % looking at its size and by relating this to the approximate size of the % human head according to the following table: % from 0.050 to 0.500 -> meter % from 0.500 to 5.000 -> decimeter % ...
3636d984db5fedc1ef48a97b7075bee320fdeac09a0bb5f401f403b6f0d56354
MATLAB
5,877
171
function Matrix_Org3(Min,key,buffer,lims,Cmap,fig,CmapData) % This function organizes a sorted matrix using lines to add visual % separation between modules and block colors along the left and bottom. % This 3rd version of Matrix_Org is designed to support rectangular input % matrices. It will also work with squa...
6b0a78e1b74fdde0c42184fc3e78c1f2d8a3da3057d3727e90d1fe8375f8facb
MATLAB
5,877
171
function Matrix_Org3(Min,key,buffer,lims,Cmap,fig,CmapData) % This function organizes a sorted matrix using lines to add visual % separation between modules and block colors along the left and bottom. % This 3rd version of Matrix_Org is designed to support rectangular input % matrices. It will also work with squa...
8e921807a92af7e055b99c9881c70131c0af0ce69cf4828b6f3065227dc8eca8
MATLAB
5,878
140
function convertIMStoEXP(yamlfile) %CONVERTIMSTOEXP Convert the IMS files from a multi-view acquisition using %the YAML file for an experiment. %Use a YAML file to load the parameters for a large experiment yamlspecs = ReadYaml(yamlfile); %The YAML files might have extra quotes so remove them EXPERIMENT_NAME = strrep...
e4a95f33599d65ec8efbbc6e60970ac49c0c695909a5cae66a761bc63826d130
MATLAB
5,878
141
function run_analysis(res, analysis, item, resdir) % RUN_ANALYSIS runs an analysis step on an item and saves the results to % the output `resdir` % % :param res: the Mapper output result as struct for the item % :type res: 2D matrix % % :param analysis: the config definition of a specific analysis. Minimally, it % ...
03e7507cd4a3592879c4f09fc396501a36df1baf296d727aff81628be2165d24
MATLAB
5,880
128
%%% Fig 5 - Multi-channel addpath("HelperFunctions") load(fullfile(DataPath, 'MultiElecData.mat')) load(fullfile(DataPath, 'MultiChannelData_Processed.mat')) load(fullfile(DataPath, 'Localization')) SetFont('Arial', 9) [palmar_mask, palmar_template, dorsal_mask, dorsal_template] = GetHandMasks(); %% Plot if exist('fig...
85112afae9e63a4554afe112d3bec9a40836f40d1d4da78f17c2383051ee49b4
MATLAB
5,880
212
function [ h ] = circles(x,y,r,varargin) % h = circles(x,y,r,varargin) plots circles of radius r at points x and y. % x, y, and r can be scalars or N-D arrays. % % Chad Greene, March 2014. Updated August 2014. % University of Texas Institute for Geophysics. % %% Syntax % circles(x,y,r) % circles(...,'points',...
8cde2608314de7be60f97e40885ff3ccb78d3c73bc6e2817280441426a495b30
MATLAB
5,881
165
function FWHM=w_Smoothest_Surf(SurfFiles, ResidualFiles, MskFiles) % Estimate global FWHM for surface files % %------------------------------------------------------------------------ % Usage: FWHM=w_Smoothest_Surf(SurfFiles, ResidualFiles, MskFiles) % % Input: % SurfFiles - Surface file list, nx1 cell. e.g., {'f...
170bef0e222adfc300f653c528f7591bf3815537de6757ed99cab36064be8135
MATLAB
5,884
236
function [data,times] = fiff_read_raw_segment(raw,from,to,sel) % % [data,times] = fiff_read_raw_segment(raw,from,to,sel) % % Read a specific raw data segment % % raw - structure returned by fiff_setup_read_raw % from - first sample to include. If omitted, defaults to the % first sample in data % to - ...
22b759f491f106101c8a69ebd440573367cd7e1a286f447222beb9d1692cac94
MATLAB
5,886
219
% run_mediation_all2all % by Ariel Zylberberg load(fullfile(saveLoc, 'sig_allSessions'),... 'sigSL') S = sigSL; % Analysis parameters max_coh = 0.1; minRT = 0.67; maxRT = 2; start_t = 0; end_t = 0.6; session = S.session; times = S.t; dt = times(2) - times(1); choice = S.choice; RT = S.rt; coh = S.sig_coh; S = si...
5675d314f496f2540f7a935e9bc9384474ea6763f34bbb841ade3f1fe01ded0b
MATLAB
5,887
149
function [event] = read_ricoh_event(filename, varargin) % READ_RICOH_EVENT reads event information from continuous, % epoched or averaged MEG data that has been generated by the Ricoh % MEG system and software and allows those events to be used in % combination with FieldTrip. % % Use as % [event] = read_ricoh_event...
921b39b21c4f275768f283257d5218808d5fb022668faab3b5ec13027239e0b0
MATLAB
5,888
149
function [event] = read_ricoh_event(filename, varargin) % READ_RICOH_EVENT reads event information from continuous, % epoched or averaged MEG data that has been generated by the Ricoh % MEG system and software and allows those events to be used in % combination with FieldTrip. % % Use as % [event] = read_ricoh_event...
f0f1b71e7aa5493e5c336d77171b24517f33bc625f40948c896e7a90a7d2b9ba
MATLAB
5,889
218
function [w, sigma, logpostTrace]=linregFitSparseEmFrancois(X, y, param, varargin) % Use EM to fit linear or probit regression with sparsity promoting prior % See the paper "Sparse Bayesian nonparametric regression" % by F. Caron and A. Doucet, ICML2008. % %PMTKauthor Francois Caron % % -- INPUTS -- % % X: N*D design ...
6866ce4bdc968c4a5907e19ccdaafee2ee24b78f94a23364f06a705708babc5a
MATLAB
5,890
189
function [Mean_MMT_Elbow] = Muscle_Moment_G4(x) % MATLAB code provided by Seyed Mohammad Ali Rahmati % Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA. % This script computes the maximum muscle moment averaged over the cycle as a function...
9d2a5bc47da786b1d2b280b0e7ffcade0733343d7c86c7c6fa10d44aa96470ea
MATLAB
5,891
177
%% pxTools.getPxtFromXt() % Core method for converting an time series data signal (xt) and a % set of spike times (st) into perispike state distributions (pxt); % pre-spike (px_x0) and post-spike (px_x1). % % Different intervals for prespike/postspike distributions, delays between % intervals, or delays between spikes...
3743a302368936a4ad403a2557df0c5c22060f1e21f2cab28192cd36600ac559
MATLAB
5,892
116
function [U] = l3ddir(srcinfo,targ,pgt) % L3DDIR Direct (slow) 3D Laplace kernel sums (reference for LFMM3D). % % U = l3ddir(srcinfo,targ,pgt) % % Laplace direct evaluation in R^3: evaluate all pairwise particle % interactions with targets. This is the slow O(N^2) direct code used % as a reference for testing the...
90404da6c4a08a6c99ff62c53be65d84c2c3d69a60fade9e6cca02869065d9b5
MATLAB
5,892
169
function data = analyze_synapses_5xFAD(params,roi,synchannels) %calculates CaMKii volume, signal, and # of objects outside of morphology %and ABeta channels folder = params.parentfolder; %Extract parameters xystep = params.xystep; zstep = params.zstep; nchannels = length(synchannels); for im1 = 1:nchannels %nested l...
82d9ce3c059ee4af838730d5dc727a6fe1228643b31741a26daf3b0e80eaea28
MATLAB
5,893
123
%% Description % In this example, we demonstrate that model outputs can be combined with % each other using the combineModels() function. This can be useful, for % example, when you want to have multiple input light sources, such as % beams. It can also be useful for heavy simulations that require a lot of % statistics...
ccac2bc731b7d9b31667d94e744d98a63117984aab2a66693484f3ab90dd31c5
MATLAB
5,895
109
% Aggregate Channel Features Detector Overview. % % Piotr's Computer Vision Matlab Toolbox Version 3.40 % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] % Licensed under the Simplified BSD License [see external/bsd.txt] % % %%%%%%%%%%%%%%%%%%%%%%%%%%%% 1. Introduction. %%%%%%%%%%%%%%%%%%%%%%%%%%% % % The det...
84eb24260e00cffafb41bddeb7c84792a461aff480eebfda75f7459d0bddd3ee
MATLAB
5,901
171
% plot_FigS7 %% Plot distribution of weights usePerc = 1 : 2; colms = 3; distr_detect = 2; % Which weights to use for predicted proportion of Tin: 1 = raw weights; 2 = perceptile within session dimms = [63 20 61 7]; clear ws figure('Position', [200 10 800 600]); hold on histbins = [-0.5 : 0.0...
cf2beb65603fa890ef884cf782089186b6de8ba93a7043bb0ffebf03f10de433
MATLAB
5,901
250
% % Name: demo_ICA.m % % Description: Demonstrates the use of ICA for source separation % % Author: Brian Moore % brimoor@umich.edu % % Date: November 12, 2016 % %% ICA demo (signals) rng(42); % Knobs n = 1000; % # sample...
93896a5d8044e6c973bbd549ad0cae5fd672efff4e5b120944d5e3269f1026dc
MATLAB
5,902
184
function cortex = read_nimh_cortex(filename, varargin) % READ_NIMH_CORTEX % % Use as % cortex = read_nimh_cortex(filename, ...) % % Optional input arguments should come in key-value pairs and may % include % begtrial = number (default = 1) % endtrial = number (default = inf) % epp = read the EP...
e034f2a71225dc46c7e3114d97d6fa0a2e5fd35ee65fdfcf58dc5cb229481216
MATLAB
5,903
186
function [tfr,rtfr,hat] = tfrrspwv(x,t,N,g,h,trace); %TFRSPWV Reassigned smoothed pseudo Wigner-Ville distribution. % [TFR,RTFR,HAT] = TFRRSPWV(X,T,N,G,H,TRACE) % computes the smoothed pseudo Wigner-Ville distribution and its % reassigned version. % % X : analysed signal. % T : the time instant(s) (defau...
553d9093cb3981bb5aca42c2c654ec6fbb09d4d0ac8eff55ee3ca49d4311f020
MATLAB
5,904
152
% Seven-point stencil on the unit cube, constant-coefficient Poisson equation, % Dirichlet boundary conditions. % % This is the same as FD_CUBE1 but using HIFDE3X. % % Inputs (defaults are used if not provided or set empty): % % - N: number of discretization points in each dimension (default: N = 32) % - OCC: tree ...
5701463630b7d2d5b2f5c4689b68bf1d58cc5a3b956b7151e089f53fe5c1128f
MATLAB
5,905
137
brainstorm %% clear patient_id = 'P2'; %% %%%%%%%%%%%%%%% load anatomy information %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% load([patient_id '/anatomy/cortex_fs_in_curryspace.mat']); load([patient_id '/anatomy/projected_resection_to_fs_cortex.mat']); load([patient_id '/rnn_test.mat']) load(['../../anatomy/dis_matrix_fs_20k.mat'...
db90bf338e31474a13dae37f34892c1c058f983b42844efac6d76b273e956129
MATLAB
5,906
99
%% Description % This example illustrates refraction and reflection using the smoothed and % interpolated Sobel filter method published by A. Tran and S. Jacques in % J. of Biomedical Optics, 25(2), 025001 (2020) % https://doi.org/10.1117/1.JBO.25.2.025001). % % This example reproduces figure 3 of that paper. A hemisph...
7df0c46bad41a3b411ecef77f7f85397791583bcfc4370d10ec02af3cec3d158
MATLAB
5,910
179
function [I_SSD,I_NCC,Idata]=template_matching(T,I,IdataIn) % TEMPLATE_MATCHING is a cpu efficient function which calculates matching % score images between template and an (color) 2D or 3D image. % It calculates: % - The sum of squared difference (SSD Block Matching), robust template % matching. % - The norma...
769bc6a140e4f4b13fc7bfcefc494b6591e9f10d2874bf5135c8aa0f4ffbf626
MATLAB
5,911
184
function cortex = read_nimh_cortex(filename, varargin) % READ_NIMH_CORTEX % % Use as % cortex = read_nimh_cortex(filename, ...) % % Optional input arguments should come in key-value pairs and may % include % begtrial = number (default = 1) % endtrial = number (default = inf) % epp = read the EP...
43ece3ac2c714a75a677038528cab7630d24f475ea95b1aa023965373b49f001
MATLAB
5,913
153
function SinglechanBandAnalysis(config,varargin) %% if strcmp(mfilename,'') || nargin==0 opts=Analyze.Libet.Config_BasicLinearModel; else opts=feval(config,varargin{:}); end if ~exist(opts.ResultsDir,'dir'); mkdir(opts.ResultsDir); end ConfigureSubject(opts.Subject); for dateIDX=1:length(opts.D...
2dd7b2fead2f00d6571a99bbd9c4c5c47c74d0f5838496d2ac9dea706f35d6f6
MATLAB
5,914
148
function [ferns,ysPr] = fernsRegTrain( data, ys, varargin ) % Train boosted fern regressor. % % Boosted regression using random ferns as the weak regressor. See "Greedy % function approximation: A gradient boosting machine", Friedman, Annals of % Statistics 2001, for more details on boosted regression. % % A few notes ...
6b79dab7f7f2dd759682176a9fe672aef19a26536616b195c5f5d55920653ece
MATLAB
5,914
187
%% Heatmaps of cosine similarity & within-trial correlation of diffusion across signals % ------------------------------------------------------- % Calculate within-trial correlation fw = 80; x = 0:1:fw; y = gaussmf(x,[fw/4 fw/2]); filtW = y / sum(y); fw = 50; x = 0:1:fw; y = gaussmf(x,[fw/4 fw/2]); filtW50 = y...
75de4c03bba965e24be80c5155e4884e120cf404b2553a5e02572c5b0d0dc25b
MATLAB
5,914
160
function colors = distinguishable_colors_0(n_colors,bg,func) % DISTINGUISHABLE_COLORS: pick colors that are maximally perceptually distinct % % When plotting a set of lines, you may want to distinguish them by color. % By default, Matlab chooses a small set of colors and cycles among them, % and so if you have more tha...
8a8acabf2e5f31fa66d017909914a3610ef60f6c5b332d02729d5961741f58f4
MATLAB
5,917
166
function [M, I] = permn(V, N, K) % PERMN - permutations with repetition % Using two input variables V and N, M = PERMN(V,N) returns all % permutations of N elements taken from the vector V, with repetitions. % V can be any type of array (numbers, cells etc.) and M will be of the % same type as V. If V is empty...
f9604ba1ab4d201f9e3af594a4713e07872587b72a60e73118fbc91a4fa62e1e
MATLAB
5,917
160
%% parameters setting clear; hemi={'lh';'rh'}; hm=1;%editme 1-L 2-R surf_tpe='inflated'; %edit me % surf_tpe='sphere'; dataDir = '/home/xianchige/YZY/20220523data/sub01/session01/GLManalysis'; %% load data ssname='sub01'; interptype = 'linear'; % what type of interpolation? surfsuffix='orig'; [numlh, numrh] = cvnrea...
6ca2258ff640c779d14ce8500e6cead31f5b8d1f1729a7c1ae281248a2e2e2e9
MATLAB
5,919
150
function [X, HMM, features, Kernel, err] = simulate_transprobs_nostates(datadir, hmmdir, HMM_name, n_subj, betwgroup_diff) % [X, HMM, features, Kernel, err] = simulate_transprobs_nostates(HMM_name, n_subj, betwgroup_diff) % % simulate timecourses for two groups where the group difference lies in % the transition pr...
99fa4764cf3232c198555d0880d8313169015f683a8dfadb68811b8e65f04b6a
MATLAB
5,919
188
% add missing data to lbld %% paths addpath /groups/branson/home/bransonk/behavioranalysis/code/Jdetect/Jdetect/misc; addpath /groups/branson/home/bransonk/behavioranalysis/code/Jdetect/Jdetect/filehandling; datatype = 'roian'; switch datatype, case 'stephen' nnrootdatadir = '/groups/branson/bransonlab/mayank...
f15c8557c72d532c2bb64a3c82d4fac1db67601279866baffe10d63c32c4f04e
MATLAB
5,920
165
% create_RandomSubset_mice_all.m % Sarah West % 2/22/22 % Takes mice_all and gets a list of a subset of stacks distributed across % all days per mouse, randomly chosen within days. Is so you don't have to % use as much resources for SVD compression on MSI. % Parameters for directories clear all; experiment_name='Ran...
c9bc0c0e5a393d9b741c94dec15700e46280e999b33bbf486381e9d215e4cdc8
MATLAB
5,925
155
classdef StoreDB < handle_light % The StoreDB class is a handle class to manage caching in Manopt. % % To create an object, call: storedb = StoreDB(); % Alternatively, call: storedb = StoreDB(storedepth); to instruct % the database to keep at most storedepth store's in its history. % (Note that clean up only happ...
5674c3d9683891bc6fd2b696e3b22f0a9dcae284499156fc77085c0e3df00c99
MATLAB
5,926
139
function [select] = select_channel_list(label, select, titlestr) % SELECT_CHANNEL_LIST presents a dialog for selecting multiple elements % from a cell-array with strings, such as the labels of EEG channels. % The dialog presents two columns with an add and remove mechanism. % % select = select_channel_list(label, ini...
91a5a18f60a21fb0208b68ec1f5e30773a4fdcf8f69737e94d85c03c163d94dc
MATLAB
5,926
139
function [select] = select_channel_list(label, select, titlestr) % SELECT_CHANNEL_LIST presents a dialog for selecting multiple elements % from a cell array with strings, such as the labels of EEG channels. % The dialog presents two columns with an add and remove mechanism. % % select = select_channel_list(label, ini...
dc01aaebc2d3d6d241b1f7880d15e694770a3198e8844bcc608587335357af1c
MATLAB
5,926
179
lambdas = 1e-9*[500 510 520 530 540]; samp = 400e-9; % sampling distance (m) ds = 2.5e-3*[1 101/3]; % propagation distances (m) pds = 7.4250e-5; % spacing in weights (m) sp = round(pds/samp); % spacing in samp of weights sz = ds(2)/ds(1)*sp; % n_adj = 4; % weights around center to consider adj_sz = sp*(2*n_adj+1...
692a44051cd18d01cb37fb0f183708a0d721ffa3d0886f699ce8a56d5b477ad2
MATLAB
5,927
247
%%% 2024-10-01: Example T2 map script, working on phantom data %%% Phantom data acquired using 3D single SE and 2D TSE, reconstructed %%% using exponential fitting and dictionary %%% Author: Shaihan Malik, King's College London saveresults = 0; % if 1 this runs optimization, if 0 it loads stored results addpath...
8e2de518e37be7c651ca6f2ec5b6bc85e9b7afc53ed6c25ea206ff5d865c2e54
MATLAB
5,928
154
% Second-kind integral equation on the unit square, Helmholtz single-layer. % % This example solves the Lippmann-Schwinger equation for Helmholtz scattering % on the unit square, which can be ill-conditioned even though it is formally % second-kind. The problem is discretized as in IE_SQUARE1. We assume that the % pote...
a0fcc87a618cddf244881d253a34825b7a1013072e12141fc69ed67ce86cd139
MATLAB
5,929
116
%% =============== Demo ======================== %% %% ============== Licensce ========================================== %% % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS % "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT % LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABI...
9673a9dff25218f6dd3236c4a8dd845b4d41d53a4291e4f868da3812aa34e56b
MATLAB
5,931
153
function [Data, VoxelSize, FileList, Header] = yw_ReadAll(InputName) %% yw_ReadAll - Read various types of data files % % This function reads data from multiple file formats including .nii, .nii.gz, % .gii, .mat, .xlsx, .csv, and .txt. It can handle single files or multiple % files in a directory. % % Inputs: % Inp...
4b4237f50aeca5056539da11bf1767bc4fcdba4023dcc98bd9f1c8e7769575bb
MATLAB
5,932
151
%% Call data and functions addpath C:\code\spm12 % addpath D:\ECoG_Atlas\functions addpath C:\Users\ICN_guest\Charité - Universitätsmedizin Berlin\Interventional Cognitive Neuromodulation - PROJECT ECoG Atlas Connectomics\functions; addpath C:\code\wjn_toolbox spm('defaults','eeg') %% Load info data tf_data_path = 'C...
99128b3debd3368f151427684172b32876c5e564340640817157d12623e4ad4f
MATLAB
5,933
117
function [] = ground_truth_replay_sequence_analysis_addon(folders,BAYSESIAN_NORMALIZED_ACROSS_TRACKS) for nfolder = 1:length(folders) tic cd(workingDir) cd(folders{nfolder}) load extracted_place_fields_BAYESIAN % % % RUN SHUFFLES % % disp('running shuffles') % num_shuffles=1000;...
35e3a888a7219edef87d6244e56840dcc2fc9f326a9b6119add4db33fddc4825
MATLAB
5,934
131
function [targetedVariance,targetedRs,randomRs] = parameterSweepStatistics(targetedSubjRinROIpair,randomSubjRinROIpair,varargin) %Calculates statistics from parameter sweep. if ~isempty(varargin) combatstruct = varargin{1}; doComBat = true; else doComBat = false; end ...
7f8bfd5444ec9cd0ac4e932c420d899e7bb7a6f4baed22d9f569733540976274
MATLAB
5,935
173
function el = ET_setup_JQK(setup, el, subNo, phase, irun) % setup.ET.ELdummymode | play pretend? % setup.ET.falsePupilRec | record false pupil? % el | eye link parameters % subNo | subject number (string) % phase | not applicable here, just set to 1 % irun | index of current run ...
aeff816b715afd271038179eb750c4c24b12a5a96cc97630aa659459e6c9dd29
MATLAB
5,936
170
% runShuffledDecoding.m % % Similar to varyDecodeParam.m % This script runs decoding on a single parameter point of a simulation % result generated by simulateParameterGrid.m. % At the selected parameter point, it randomly shuffles cell identity, % either within clusters or independently of clusters, then runs the % de...
e3f5424c29b6d18a419cdfc03334457dfc59e33344800fdf7d8fb5410512694c
MATLAB
5,936
179
% make results movies function MakeCtraxResultsMovieWrapper(moviefile,trxfile,xvidfile,movietitle,ctraxresultsmovie_params) %% ctrax movie parameters defaulttempdatadir = '/groups/branson/bransonlab/projects/olympiad/TempData_FlyBowlMakeCtraxResultsMovie'; if ~isfield(ctraxresultsmovie_params,'tempdatadir'), ctraxr...
0e33da477683a62ca2528c408ea5a7bccd7510118e59e478a18e0a5dbcd81bf3
MATLAB
5,938
132
function h_doubleClickMakeRoi3 % global h_img3 [currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3; % h_unselectAll3(handles); obj = get(handles.imageAxes, 'Children');%unselectAll. set(obj, 'Selected', 'off');%unselectAll. roiobj = findobj(gcf,'Tag','ROI3'); annotationROIObj = fin...
ca5e92331f7f8bcd6a33abdf7ada7dfc6540d081ab3668653a1bc5310ac705dc
MATLAB
5,938
211
function [y,x,x0,eta,e,u] = VBA_simulate (n_t,f_fname,g_fname,theta,phi,u,alpha,sigma,options,x0,fb) % samples times series from sDCM generative model % [y,x,x0,dTime,eta,eta0] = % VBA_simulate (n_t,f_fname,g_fname,theta,phi,u,alpha,sigma,options,x0) % % This function creates the time series of hidden-states and measur...
eecf05ebfdc5b7ca11381a9eb234f1cb68b33629f112eaa56593f01341f62afb
MATLAB
5,938
162
%% empirical_var_to_spwcgc % % Calculate sampling distribution for pairwise-conditional frequency-domain % MVGCs from generated time series data for a specified VAR model % % <matlab:open('empirical_var_to_spwcgc.m') code> % %% Syntax % % fE = empirical_var_to_spwcgc(A,SIG,m,N,fres,H0,nsamps,mtrunc,decayfac,regmode...
ff8d0f0961427678d876d1e31754ede0206aabe27f387f3564fffe1d1a722c17
MATLAB
5,939
161
function [SigmoidFun, coeffs, rnorm, residuals, jnd, warn] = FitSigmoid(x, y, varargin) % Simple weighted sigmoid fitting function NumCoeffs = 2; % By default we assume there is a slope and x-offset term % Coefficients Growth term, x-offset, y-max, y-offset Constraints = zeros(4,2); % [NumCoeffs x 2] (l...
13c21eeab0214a392697e08836c19e6bcbeaeb19764128c449072ac3e466fcc9
MATLAB
5,940
199
classdef TrackingVisualizerTracklets < TrackingVisualizerBase % Tracklet visualization % - landmarks via TVMT (TrackingVisualizerMT) % - trx/target label via tvtrx (TrxVisualizerMA) % % Non-gobject model state lives on the associated % TrackingVisualizerTrackletsModel (accessed via obj.tvm_). properties ...
4ba576fcba252d553c02526164052c149290ca163725e5e052c734acd0d1e630
MATLAB
5,940
174
% Function that generazes the feedforward and recurrent connectivity % matrices. % Chengcheng Huang's code: % https://github.com/hcc11/SpatialNeuronNet % https://github.com/hcc11/FI_SpatialNet function [Wrr,Wrf]=gen_weights(Ne,Ni,Nx,sigmaRX,sigmaRR,Prr,Prx,dimension) % sigmaRR=[sigmaee, sigmaei; sigmaie, sigmaii]; 2x...
10d0c297b5c51c220b9a6bd13edc4c7b3ad3f4dc08ba2038e338b8e86d126e9c
MATLAB
5,941
196
function [model] = linregFit(X, y, varargin) % Fit a linear regression model by MLE or MAP estimation % INPUTS % X ... N*D design matrix % y ... N*1 response vector % OPTIONAL INPUTS: % weights ... N*1 weight vector for eg weighted least squares % regType ... L1, L2, none, scad (only...
da15fe60ce94cee8945b0fa805f4811c5ada44d788780bbd37f156d522d07763
MATLAB
5,941
162
function [res_x, idx_of_result] = knee_pt(y,x,just_return) %function [res_x, idx_of_result] = knee_pt(y,x,just_return) %Returns the x-location of a (single) knee of curve y=f(x) % (this is useful for e.g. figuring out where the eigenvalues peter out) % %Also returns the index of the x-coordinate at the knee % %...
9135e319606f67e5428b38c9a740ffe23d793c2f2ada3cbdada1330a7785d2f9
MATLAB
5,942
112
%% Analysis code for the Auditory and Visual Sensory Thalamic Localizer Task % Released under the GNU Public License version 3. %% Code authors: % John C. Williams, Srineil Nizambad, Philip N. Tubiolo, Yash Patel, % and Jared X. Van Snellenberg % Department of Psychiatry and Behavioral Health % Department of Biomedc...
677a663fbdfa35734525171a848d070c20b15df8aef9c28ca13201c68ae4508d
MATLAB
5,943
171
function [obj] = ft_determine_units(obj) % FT_DETERMINE_UNITS tries to determine the units of a geometrical object by % looking at its size and by relating this to the approximate size of the % human head according to the following table: % from 0.050 to 0.500 -> meter % from 0.500 to 5.000 -> decimeter % ...
f4cfdc6686578312ec84a01c0b7927961cc2406fa1163a00852b6a51b9e2a9c2
MATLAB
5,947
101
%STEP 1 close all; %% preparing for the data % subjNO = {'SUBJ03'}; % load the anatomy T1name = ['/home/xianchige/YZY/20220523data/sub01/sub01/mri/T1.nii.gz'];%T1路径,是原始数据转格式之后的T1,并非freesurfer重构出的T1像 vol1 = load_untouch_nii(gunziptemp(T1name)); vol1size = [1 1 1]; % 1mm isotropic 结构像分辨率 vol1 = double(vol1.img); vol1(i...
93aefb42d1a0e64456bd039f9e2ff616db57766ced1eac133e2e16651dc8edac
MATLAB
5,949
164
% create_RandomSubset_mice_all_RunAnalysis.m % Sarah West % 2/22/22 % Takes mice_all and gets a list of a subset of stacks distributed across % all days per mouse, randomly chosen within days. Is so you don't have to % use as much resources for SVD compression on MSI. % Parameters for directories experiment_name='Ra...
d4687e61d1d28ce04a3cb8b45ef29ae894d0cb04d09e99c137e215297958ae73
MATLAB
5,949
222
function SPT_timedata(basename,tet2use,unit,session) SR=20000; SR_trk=30; resofs=load([basename '.resofs']); sessionfile = [basename(1:9) '_' num2str(session,'%02.f') '_trkRun.mat']; load(sessionfile,'trk'); whl = trk; res=load([basename '.res.', num2str(tet2use)]); %spike times of all the units in the s...
0e06b069c9c6b1f0190c9dc3ffc42503be519e1913f4b9efc291d7a304514640
MATLAB
5,950
120
function PARAMS = display_2AFC( subjectID ) % (c) Coraline Rinn Iordan 10/2017, 03/2018 if nargin < 1, error( 'Must provide subject ID.' ); end % Load latest version of saved PARAMS ; should match PARAMS.INFOFILE info.loadStartTime = GetSecs; load( [ './data/info-' subjectID '.mat' ] ); % PARAMS info.loadEndTime = Ge...
1c3b48144f8694ec44632903e1e8afb0f60d6bd8f348495069fb5b4020661d1a
MATLAB
5,950
170
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% [svlImg, xVoxels, yVoxels, zVoxels, svlResolution, xmin, xmax, ymin, ymax, zmin, zmax] = ctf_svl2spm(svlFile) %% %% reads and converts CTF SAM (.svl) files to Analyze (.img) format for SPM %% and mri3dX. %% The SAM image is saved as axi...
10dc3bbc1460f39e5a8a4f648bad364c3dee779c5b072a4380631c570a9f1956
MATLAB
5,952
184
function events = wlProc_getEvSegmentsByComparingDual( ... databigger, datasmaller, samprate, ... threshfactpeak, threshfactend, maxglitch, maxdrop); % function events = wlProc_getEvSegmentsByComparingDual( ... % databigger, datasmaller, samprate, ... % threshfactpeak, threshfactend, maxglitch, maxdrop); % % T...
e063e2e9ac5c3ef0a38b5d30a5f3f6ca46468cf7b6f74d9021cf3e0e88fb1515
MATLAB
5,953
164
% Five-point stencil on the unit square, variable-coefficient Poisson equation, % Dirichlet boundary conditions. % % This is basically the same as FD_SQUARE1 but with a variable quantized high- % contrast random coefficient field that makes the problem especially ill- % conditioned. % % Inputs (defaults are used if not...
77e1ae856a6132427e7bba1641184b36347b6061c32d5b4fd414c685b4dc66ba
MATLAB
5,954
159
function lan_master_gui_tfsp_plot(LAN_var, mainfig, parent_) LAN = LAN_var; if nargin < 2 mainfig = figure; end figure(mainfig) sp1 = subplot(8,1,[2 3 4], 'parent', parent_); sp2 = subplot(8,1,[5 6 7], 'parent', parent_); sp2_queue = false; chan = 1; lfp = LAN.data{1}(chan,:); cfs = lan_cspec_load(LAN, chan); ...
c801f5eadca2ebd20e6901764789ed88288ba6454fb8293a6c91db5e73b8977c
MATLAB
5,954
163
classdef MouseVocDetector < FeaturesDetector properties recording NW K PVal NFFT FreqLow FreqHigh ConvWidth ConvHeight MinObjArea MergeHarmonics MergeHarmonicsOverlap MergeHarmonicsRatio M...
d091cb1bee2dd82357c329692c8a7a577ca5b56288b9176ce59f99851e844ab0
MATLAB
5,954
152
function lan_master_gui_tfsp(LAN_var, mainfig, parent_) LAN = LAN_var; outdir = ''; if nargin < 2 mainfig = figure; end figure(mainfig); %%%%%%%%%%%%%% CHOOSE FOLDER cfg_control(1) = uicontrol('style', 'text', 'units', 'norm',... 'position', [.04 .92 .6 .05], 'string', 'channel(s) : ',... 'horizontalali...
cfee4d4c3380981aa888bb70c0586eaa657fff0c8dec94a0f94928e736803f26
MATLAB
5,956
189
%% Choose the right lambda for ridge regression % We use CV and empirical bayes % % This is a simplified version of linregPolyVsRegDemo.m n = 21; setSeed(0); [xtrain, ytrain, xtest, ytestNoisefree, ytest, sigma2] =... polyDataMake('sampling','thibaux','n',n); deg = 14; addOnes = false; if ~addOnes % To avoid...
c2c2f2fc8ed9c4ab54debb680b4aa8bd6f0d4a68c9996599c7957ba3cf8853f5
MATLAB
5,957
203
function bootstrapping_onsets_timedec(within,across,diff) % set parameters bootstrap_samples = 1000; chance = 0; % input data data_W = within(:,11:110); data_W_base=within(:,:); data_X= across(:,11:110); data_X_base=across(:,:); data_D = diff(:,11:110); data_D_base=diff(:,:); %% bootstrapping rng('shuffle') fo...
190181d7e4a5b0b63ed6e8582ed7e1530597ac58be1519e466972382b76946d6
MATLAB
5,959
157
%TPS3DWARP Calculates a 3D Thin Plate Spline, then applies it to the moving %Tile input (tileM). Keypoints for moving (keyM) and fixed (keyF) are %intended to outputs from the calc_affine function, ie, vetted %correspondence points that are stored as a Nx3 vector format. outDim is %the size of the (padded) output image...
16c35a29542a3cc8f7f0bd082acdef0c0f70db91d11276fe0e56cf4a599f7730
MATLAB
5,960
198
function CreateTestAPTProject(fmoviefilelist,smoviefilelist,kinelistfile,savefile,varargin) % CreateTestAPTProject(fmoviefilelist,smoviefilelist,kinelistfile,savefile,...) % Creates an APT project with one video per fly from the input list of % videos. % Inputs: % fmoviefilelist: Text file containing a list of fro...
1fa865209bbfea3f077e6a167acb5e16586d233482aad333b50b04937fa4de4a
MATLAB
5,960
176
clear all; % clear all variables close all; % close all open graphs clc % clear command window %% data metadata %%%%FILLIN with the path to where the data is stored %%%%FILLIN name the file file_name_1 = ''; %% FILLIN data file (exported from IDPS) pathway t_point_dff_filename = ''; %% FILLIN output file...
2953f2366acb859c07412fcc8718831dbe7b1b1eac1a67b8e0dc62e20a1014fa
MATLAB
5,961
211
function [vert, face] = read_ply(fn) % READ_PLY reads triangles, tetraheders or hexaheders from a Stanford *.ply file % % Use as % [vert, face, prop, face_prop] = read_ply(filename) % % Documentation is provided on % http://paulbourke.net/dataformats/ply/ % http://en.wikipedia.org/wiki/PLY_(file_format) % % See ...
91f1c592a9bac54bd321e0132784aa135800077527631480c998f00a7a304d8e
MATLAB
5,962
181
% DELCODE-SAME, Figure "FADE SAME Abitur" % _ % original paper: Soch*, Richter* et al., HBM, 2022 % Figure S4B: Analysis of FADE scores as a function of educational status % % DELCODE paper: Soch et al., medRxiv, 2023 % Figure S5: FADE and SAME scores by diagnostic group and educational status % % written by Joram ...
eedd4e6b3c78daf96e0becc4595d17735f9d2264a8a82ef54555e5a5ea999857
MATLAB
5,965
159
%% Sparse linear regression with EM on synthetic data % Similar to fig 8 from "Sparse Bayesian nonparametric regression", % Caron and Doucet, ICML08 % We do not include normalInverseGaussian % but we do include normalExpGaussian (see Griffin and Brown) % PMTKreallySlow % PMTKneedsStatsToolbox boxplot %% % This file i...
2fe33a11a40118f349f2b3a324f4a170d6e16581a714e3cd55d42735be960f66
MATLAB
5,968
171
% HYPOCT Build hyperoctree. % % A hyperoctree is a direct generalization of the octree in 3D to arbitrary % dimension, wherein a given node is bisected in up to all dimensions on % refining from one level to the next. This implementation constructs an % adaptive hyperoctree on approximately hypercube nodes...
a6bac14acbe9ad873735bd162efc18d07ad475a013d27f26a4de80b74d1ff518
MATLAB
5,970
159
function [UnitIDs,UnitLabels] = FindInterestingUnits(TaskLabel,varargin) %ISINTERESTINGUNIT Returns list of "interesting" units. [varargin,PThresh]=Utilities.ProcVarargin(varargin,'PThresh',.001); [varargin,mode]=Utilities.ProcVarargin(varargin,'mode','Anova'); datafile = fullfile(env.get('results'),'FaceScratc...
cc42e702c844f13e5ba69e46d2315c00d5cb61f7d3d95cb81acbbd38b5109750
MATLAB
5,970
103
% GEN_MASS_MATRIX_FD_CUDA Builds sparse matrix representation of time-invariant % diffusion transport equation within FEM mesh in 2D (triangles) or 3D % (tetrahedrons). Parallelized for multithreading with NVidia CUDA. Uses % all available power of the strongest NVidia GPU installed. This function % is limited ...
a48e65c9fc5801e46b3599933f0af526cd6fea1fa86ed3826ed44d712b7b1fdb
MATLAB
5,971
240
disp('Detecting assemblies...') %% Clustering [NCell,NRace] = size(SCE.Race); [IDX2,sCl,M,S] = kmeansopt(SCE.Race,100,'var'); % M = CovarM(SCE.Race); % IDX2 = kmedoids(M,NCl); NCl = max(IDX2); [~,x2] = sort(IDX2); MSort = M(x2,x2); %SCE.Race clusters R = cell(0); CellScore = zeros(NCell,NCl); CellScoreN = zeros(NCel...
01cefdcf7dc86e73a37a008456c7397fcbaa66e4884fcf7f7abab52246dccb24
MATLAB
5,973
135
function lan_master_gui_segm(LAN_var, mainfig, parent_) LAN = LAN_var; if nargin < 2 mainfig = figure; end figure(mainfig); radiogroup = uibuttongroup(parent_, 'units', 'norm', 'position', [0 0 1 1]); uicontrol(radiogroup, 'style', 'radiobutton', 'units', 'norm',... 'position', [.04 .86 .6 .05], 'string', 's...
186ae5553564d30b229948b51c7bff4eea60e72d18bc8af18d1ce47b47c05dfb
MATLAB
5,973
180
function meg_Fig6b_TE_byPrecue_mdlFit_2Hz_bars % function meg_Fig6b_TE_byPrecue_mdlFit_2Hz_bars % Plot 2 Hz model fit %% Load data % Model fit data filename = 'figData/ModelFit_SeparatePrecueT1T2_2Hz_session.mat'; % ITPC data load(filename) % CSV settings % csvDir = 'manuscriptFigures/figData'; % % If not loading...
2c836f476d0f824afce19eabf65ab730fbb96f42eb79028aef379cdd89d76b17
MATLAB
5,976
173
function [sig,locatoms]= atoms(N,coord,display); % ATOMS Linear combination of elementary Gaussian atoms. % [SIG,LOCATOMS] = ATOMS(N,COORD,DISPLAY) % generates a signal consisting in a linear combination of elementary % gaussian wave packets. The locations of the time-frequency centers % of the different atoms are e...