sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
774832a18139a77f8262d6d8c26da894fb1bc57770ff614714f8c8dcc599c95a
MATLAB
7,426
280
function h=grPlot(V,E,kind,vkind,ekind,sa) % Function h=grPlot(V,E,kind,vkind,ekind,sa) % draw the plot of the graph (digraph). % Input parameters: % V(n,2) or (n,3) - the coordinates of vertexes % (1st column - x, 2nd - y) and, maybe, 3rd - the weights; % n - number of vertexes. % If V(n,2), we ...
1292c4291bd7c1aecf0c5c39d4302e25f1fe9186e6371443eccd868323c2541a
MATLAB
7,430
244
function [C,h,Ph,F,Fa,Fc,Eh,Ch,hE,hC,Q] = spm_reml_sc(YY,X,Q,N,hE,hC,V) % ReML estimation of covariance components from y*y' - proper components % FORMAT [C,h,Ph,F,Fa,Fc,Eh,Ch,hE,hC,Q] = spm_reml_sc(YY,X,Q,N,[hE,hC,V]) % % YY - (m x m) sample covariance matrix Y*Y' {Y = (m x N) data matrix} % X - (m x p) design mat...
6fa78269f041ced1cf71b8f13591eac13571497171f71d66b8b4fcdaa4d913a6
MATLAB
7,432
271
% df_example1.m % parallel-beam image reconstruction: % comparing direct Fourier (DF) reconstruction vs FBP. % Copyright 2005-8-10, Jeff Fessler, University of Michigan if ~isvar('sino'), printm 'simulate data' down = 4; % slightly larger than 80cm fov sg = sino_geom('par', 'nb', 1500, 'na', 700, 'dr', 0.55, ... ...
b30fc2f5174943462ddecd60e7c43fe76f3ca493bb816d09f1b40ad54e36c083
MATLAB
7,432
154
function Compute_Avalanches_MEG_Destrieux(path_file_MI, path_file_Rest, subject_IDs, db_path, labels_Destrieux, freq_band_def, z_thresh, fs, min_size_aval) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Compute Avalanches x dataset - 20 subj. - Sess. 4 - MEG - Desikan-Killiany % A...
b342833ebea31d7c254b6e7d71d20104e813613b293a34250c0b6f8e974aae7e
MATLAB
7,440
154
function Compute_Avalanches_EEG_Destrieux(path_file_MI, path_file_Rest, subject_IDs, db_path, labels_Destrieux, freq_band_def, z_thresh, fs, min_size_aval) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Compute Avalanches x dataset - 20 subj. - Sess. 4 - EEG - Desikan-Killiany % A...
e093f2757059fd3f888dcc7791f713ba66f6e26ffc4db86c3923a3b8e7f4431b
MATLAB
7,440
186
%% This script is written to perform statistical analysis on information %% reconstructed using the gpr reconstruction approach applied on time- %% continous data. % This script is a merge between a script by Joram Soch to estimate % balanced accuracy from gpr based reconstructions and a script by Gi-Yeul % Bae to co...
4121e4609f833f7a22c3043f4d6600caae44228319fbbea0c305f85bd6b785d2
MATLAB
7,449
245
function supplFigS6(analDir,rrmDir,tsDir,figDir) % function supplFig6(analDir,rrmDir,tsDir,figDir) % % plot supplFig6: PSTHs across sessions separately for M1 and M2, Movement % index across all units. % save figure as *fig and pdf % % input: % analDir path to directory of results for model-free analysis % r...
4454c71b6cd857ee5d466cadc5c97b447982b7971919827c6f1c6ef7b44dd10c
MATLAB
7,457
190
function [fig, cPnl] = openCPanelFig(clientList, subPanels) % function [fig, cPnl] = openCPanelFig(clientList, subPanels) % % Opens a figure with clientPanels. Each clientPanel can monitor (control) % remote (local) paradigms. Closing the figure also cleans up all the % connections made by the clientPanels. % % Clie...
1679ee2b306f58ea95700308ea6d253054c16036c3ecf945a907f641e3bbd61d
MATLAB
7,471
201
function str = spm_file(str,varargin) % Character array (or cell array of strings) handling facility % FORMAT str = spm_file(str,option) % str - character array, or cell array of strings % option - string of requested item - one among: % {'path', 'cpath', 'fpath', 'basename', 'ext', 'filename', ...
a63a9aeca32c22599aea08477c3a150cf7ed0421184c850e56d1a1ff7612f7e9
MATLAB
7,473
268
function [block] = spm_vb_init_block(Y,block) % Initialise Variational Bayes for GLM-AR models % FORMAT [block] = spm_vb_init_block(Y,block) % % Y - [T x N] time series with T time points, N voxels % block - data structure (see spm_vb_glmar) %_______________________________________________________________________...
0b5b410dcd8279b8a71effe256a51f9b6936b6efe0b910f1e282b433a26cdc6a
MATLAB
7,474
309
%% % FINAL parameters based on the GLM fitting to NEST data in script % defaults % (seconds) % p(1) - delay of response (relative to onset) 6 % p(2) - delay of undershoot (relative to onset) 16 % ...
a2d404edd6475ceccef730a19e33673ca4e07b0cf23242be8950c54213491e72
MATLAB
7,475
163
function [labels, names, colors, line_styles, markers] = fn_condition_label_styles(grp_id) %% Converts the name of a set of conditions into labels, plotting colors/styles % Mostly for Target Time, but also some Oddball conditions % INPUTS: % grp_id [str] - label for group of conditions to select % 'Dif': {'Ez...
8e083726920e7cc64bfa9386595d58100ce64ca75f05734f1c42586a5a458a6b
MATLAB
7,481
192
% epoch() - Extract epochs time locked to specified events from continuous EEG data. % % Usage: % >> epocheddata = epoch( data, events, timelim); % >> [epocheddata, newtime, indices, rerefevent, rereflatencies ] = ... % epoch( data, events, timelim, 'key1', value1, ... ); % % Inputs: % data ...
ddbcaf6720662624499493821da4ee8829b164f2dae9d009b6eb03988a18998c
MATLAB
7,483
186
function [cp_horz, p_horz, cp_vert, p_vert, cp_combined, p_combined, countingmatrix_custom] = cross_validate_multicoder(data, labels, varargin) % cross_validate_multicoder Perform cross-validated decoding using model % of your choice. Uses `multicoder` architecture % ...
a1fd7a97a6d5f640270b8621c01972ab4c69d124b07a13136a0eef1c0d4d57f1
MATLAB
7,498
163
function [ ev_ho_x, ev_ho_y, lawn_limit_line] = geteventhorizon_freehand(background, outer_boundary_mask, lawn_limit_line, pixpermm, th) %GETEVENTHORIZON_ROUGH.M this function takes in the background image (not %blurred) and extracts the convex hull -- the limits of the lawn boundary, %not taking into consideration all...
06f43a8abbb3594ade001e1f5c8e709b74e9017bb7667764a40d79710e01f4bd
MATLAB
7,506
138
function linker_features = fun_graph_get_linker_features(linker_str_array, vessel_graph) % fun_graph_get_linker_features computes features for fake linker % classifier from linker_str % Input: % linker_str_array: structure array computed by fun_graph_connect_gap_p2p % Output: % linker_features: linker features % ...
ec737c9b809c09c57b6227ea2d156f764eb3d1fb2bcabf0059b1244ce6334659
MATLAB
7,506
328
% Gcone_test.m % test the Gcone object % Copyright 2008-1-1, Jeff Fessler, University of Michigan printm 'todo: check user_source_zs vs hct2 with file_source_z' pn = jf_protected_names; f.sf1 = {'sf1', ... 'sf1,p:ts,b:st', 'sf1,p:st,b:st', ... 'sf1,p:ts,b:ts', 'sf1,p:st,b:ts'}; f.sf2 = {'sf2', ... 'sf2,p:ts,b:st'...
01ecec305f3faf5326e1ae1f812928f030cabdaa6e7eb189008eccd589fa9f42
MATLAB
7,507
196
function [bhv] = SBJ03_behav_parse(SBJ, block_ix, proc_id, plot_it, save_it) % % SBJ [str] -- uniquely identifies the subject, e.g., 'IR54' % block [int] -- index of which block of data should be analyzed % proc_id [str] -- name of the processing pipeline (to get resample rate) % plot_it [0/1] -- optional. plot_it...
408970f1ffad0878776c5a90ccc6d597a24a1bb38ba86baf68a7f67c9a88767e
MATLAB
7,507
146
function total = keyBuffer(duration,varargin) % This buffer stores behavioral responses over a period of time specified % in duration. In addition, it terminates if a specified number of responses % on "good keys", "neutral keys" or "bad keys" is reached. % To use this feature specify at least the position of the good,...
9b4e4298c5215fec2a27bc190f17b7bc6d70288c24f01c9e045d75ea5022dd1a
MATLAB
7,507
220
function EEG = c_EEG_epoch(varargin) p = inputParser(); p.addRequired('EEG',@isstruct); p.addParameter('timeBeforeEvent',0,@isscalar); % in s p.addParameter('timeAfterEvent',0,@isscalar); % in s p.addParameter('timespan',[],@(x) isempty(x) || (isvector(x) && length(x)==2) || (ischar(x) && strcmpi(x,'auto'))); % in s p...
efb48eeecd2ebe33abce92d35be0e16f6d1b1792ec9c874eb03d6628bf64f513
MATLAB
7,529
179
% plot cluster determined group bar plots clear all;close all;clc fn_ext = '_cue_responseive_yes' baseline = [ '_cond_spec_prestim' fn_ext] lock = 'onset' % onset % response exp_type = 'tuning_correct'% 'encoding' 'tuning_correct' ref = 'LM' plot_4_conds = '' addpath('/mnt/yassamri/iEEG/sandra/an...
33f5308c9de734811dcfcaf4425be8e3673c1b609409b073ab35b40e89a6c35d
MATLAB
7,538
163
function [negLogLik prWord_log] = hills2015_model_decay_softmax_hybrid_concat2_wordECDF(best_params, obs); % SOFTMAX local search model (allows saliencies <= 0) % % _vers2 does not explicitly model a 'general' saliency with % semantic_weighting [0, 1] to arbitrate semantic vs lexical similarity. % Instead it directly f...
55e897efdef795427851f1a658f95be6a5b075a8ad130ff05d29570b4490dbac
MATLAB
7,540
192
function [rm,tbl,A,C,D] = simple_mixed_anova(datamat, varargin) % tbl = simple_mixed_anova(datamat, between_factors, within_factor_names, % between_factor_names) % % Repeated-measures or mixed ANOVA with any number of factors. % % Function built on top of existing MATLAB functions in an attempt to % simplify user inp...
41557bfb904418210e4af1c9becb8a9c1d1d5944513e0f2a26e2488588419cef
MATLAB
7,544
154
% TIME SHUFFLE % Disrupts temporal/phase domain. Random shuffle of the phases of the average theta cycle (columns). Keep relationship between spike % probability and position intact, but disrupts relationship between phase and position. % INPUT - % num_shuffles: integer function [time_bin_shuffles,time_shuffle]...
7b5e61e9f38484b2b433ca78ebf8e2c8cc4e6fd902531b61cc3e70421d8c0352
MATLAB
7,544
230
function[prm] = pbups_psych_gamma(data, varargin) p = inputParser; addParameter(p,'h_ind', []); addParameter(p,'pR_ind', []); addParameter(p,'trial_back', +1); % +1 means 1 trial after the conditioned trial addParameter(p, 'xreg','gamma'); % gamma/ Delta addParameter(p, 'binwd_delta', 2); % binwidth for deltaclicks ...
96febb410269ce1cc399300f049760d51032490b57c982c690665b9129f4e7ff
MATLAB
7,545
290
function Answer = c_inputdlg(varargin) if nargin == 0, testfn(); return; end; persistent pathModified; if isempty(pathModified) mfilepath=fileparts(which(mfilename)); addpath(fullfile(mfilepath,'./ThirdParty/findjobj')); addpath(fullfile(mfilepath,'./GUI')); pathModified = true; end p = inputParser(); p.addRequir...
b40ce89d92ed1c0221da8bd7afb951c840bbed1fff1d6c1c8f1fa262a887df42
MATLAB
7,546
222
function co_stitch(target, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; % yx=-4; result=targ...
024b3d10a5e4be187eb4a45da87335fb02efad849250f894cba0e1295774d5a4
MATLAB
7,553
166
% Proportion of significant replay events function proportion_of_sig_events(computer) % Load name of data folders if strcmp(computer,'GPU') sessions = data_folders_GPU; session_names = fieldnames(sessions); elseif isempty(computer) %normal computer sessions = data_folders; session_names = fieldnames(s...
a350d946432b7028c8df36258daf0299889f8edffb3fe082d0e8e148a9e38e39
MATLAB
7,553
222
function co_stitch(target, datapath,disp,mosaic,pxlsize,islice,pattern,sys) %% stitch the fitting result using the coordinates from AIP stitch %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); % displacement parameters % xx=92; % xy=-4; % yy=97; % yx=-4; result=targ...
7fd48a018dbbc4ec74123f2d8c16c210022f3f8ac0bff7451e99daaba1d9d87f
MATLAB
7,554
201
function model = spm_mvb(X,Y,X0,U,V,nG,sG) % Bayesian optimisation of a multivariate linear model with a greedy search % FORMAT model = spm_mvb(X,Y,X0,U,V,nG,sG) % % X - contrast or target vector % Y - date feature matrix % X0 - confounds % U - patterns % V - observation noise covariance % nG ...
db3b43d0d48eab0c1c50521adadd2d9776eb971cadbe7701b3a8eda5babc3230
MATLAB
7,567
206
function out = bIO(pinNr, status) % This function handles the IO communication of the IO pins on the % Raspberry Pi 2 and 3. % bIO(inputNumber) returns the status of the selected input % bIO(outputNumber, status) sets the selected output to either 1 or 2 % % The hardware provides 5 inputs and 6 outputs. That number is ...
faf022e92c7aae6176cf5e87dbb685ecc60f6a9c9e40051be7050bea69fba4f2
MATLAB
7,573
159
function [PlaceCells,Tinfo,infoScoreThresh] = permutingSpike_speed(neuron,behav,thresh,deltaTall,occThresh,nboot,binsize,Stype,Method) % This function aims to identify place cells by shuffling neuron % spikes over a course of random time shift. Get a distribution of shuffled % information scores and make 95% of the dis...
46b851ea3171b91955f7b429100f8958238ff2860390ed28ea71bdd1f61a2ab2
MATLAB
7,575
185
function cameracontrol(cameras, varargin) % Record up to 8 ip cameras with matlab % More cameras is easily possible with copy/paste % Argument cameras is a cell array with every ip as a string in a single % cell and can be predefined or put in as an argument % Preview is 1 or 0 if the matlab preview window should be op...
238e3dc5cb10f3a132080313aab4a5c203569522e94c9daf2ecc64442687b287
MATLAB
7,590
276
%requires SPM to be installed and in the path clear all rng shuffle for ttt = 1:5 switch ttt case 1 trials = 25; case 2 trials = 50; case 3 trials = 100; case 4 trials = 200; case 5 trials = 400; end runs = 5000; trials1 = trials*7; ts = zeros(runs, trials1); ts_est = ...
23a4d916e7dc47183bf7aafd93af526be753b42fcfd2a2e64eff099f158dac2c
MATLAB
7,608
329
function M = qpwls_precon(type, sys, C, mask, varargin) %function M = qpwls_precon(type, sys, C, mask, varargin) %| %| build a preconditioner for QPWLS problems: %| approximations to inv([A'WA + C'C]) %| %| usage: %| M = qpwls_precon('circ0', {T}, C, mask); %| M = qpwls_precon('circ0', {A, W}, C, mask); %| %| in %| ty...
4527e17b66b2aaa974cdfcc374b79ef0d98aaa41dd28f2a0b877b24963d6c669
MATLAB
7,611
205
function db_out = SBJ00b_view_preclean(SBJ,block_ix,keep_db_out,varargin) %% View SBJ00_preclean output with channels colored by type % INPUTS: % SBJ [str] - name of patient % block_ix [int] - which block to plot % keep_db_out [0/1] - return the output of ft_databrowser to save epochs % varargin: % bad_ep...
f30b5fa0ca96fca03d68bc98d0f2839f651b4dbed4a3266777f4bb729e5a18d1
MATLAB
7,611
189
classdef AbstractFW < handle % AbstractFW Base class for Frank-Wolfe algorithms. Handles outer loop % and convergence checks. % % For example, the run() loop can handle some callbacks at a given % interval. properties algoName obj dualityGap opts ...
29dd7d517493fe3ff40943e8f5813ba29bac39ddddc2e3b0d0f8e8e1497d556f
MATLAB
7,613
183
function bHand = createButton(text, varargin) % Creates a button (framed text) on the stimulus window. % % Draws the given text with a frame around it and returns the bounding box % as a handle. Use getButtonClick (or the Psychtoolbox function GetMouse) to % check whether the user clicked inside the button. % % Usage: ...
c688c0fee018a2285019732e3cfe3411b0100da1051bbf2699d72804ffd0a6e3
MATLAB
7,615
164
% TIME SHUFFLE % Disrupts temporal domain. % INPUT - % num_shuffles: integer % thresholded_decoded_thetaSeq_option: 1 if using theta sequences that have passed the position threshold (not happening neither at the % start or end of track) function time_shuffle = average_theta_sequences_timebins_shuffle(n...
d2ebc160faa961450ff8bfab9202caf52bd13bd27edf276b4c2db8a123782065
MATLAB
7,629
223
function [result] = bfopen(id, varargin) % Open microscopy images using Bio-Formats. % % SYNOPSIS r = bfopen(id) % r = bfopen(id, x, y, w, h) % % Input % r - the reader object (e.g. the output bfGetReader) % % x - (Optional) A scalar giving the x-origin of the tile. % Default: 1 % % y - (Optional) ...
2e237320452e009d4e7023c8cff4fd19df763adadf8fb71415b07954185acbd1
MATLAB
7,634
216
function Mus_stitch(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys,ds,stitch) %% define grid pattern % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); result=target; id=islice; xx=disp(1); xy=disp(2); yy=disp(3); yx=disp(4); % mosaic parameters numX=mosaic(1); numY=mosaic...
bf85400242a5480f2d02677f94382d143eefce72e49c2c2bcdac4a995cfa83d1
MATLAB
7,641
219
function MIP_stitch(target, P2path,datapath,disp,mosaic,pxlsize,islice,pattern,sys,stitch, aip_threshold) %% stitch the retardance using the coordinates from AIP stitch % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); id=islice; filepath=strcat(datapath,'mip/vol',num2str(islice),'/'); cd(...
c5b22100954599a2d90266be29c5df569e2dfec53380c13dbfa324d5ac790192
MATLAB
7,641
194
function vdm = FieldMap_Run(job) % Auxillary file for running FieldMap jobs % FORMAT vdm = FieldMap_Run(job) % % job - FieldMap job structure containing various elements: % Common to all jobs: % defaults - cell array containing name string of the defaults file % options - structure containing the...
83285e9299aa6ef4e58dbba505b6d01cd589a5c3f626954f00d6f67d5d08cca7
MATLAB
7,643
192
function [tbl,rm] = simple_mixed_anova(datamat, varargin) % tbl = simple_mixed_anova(datamat, between_factors, within_factor_names, % between_factor_names) % % Repeated-measures or mixed ANOVA with any number of factors. % % Function built on top of existing MATLAB functions in an attempt to % simplify user inputs an...
ecf2579ca9223900f407d345f26a464e3bb2118cbd2c3ead6a368a33cc4a3c97
MATLAB
7,643
138
function linker_features = fun_graph_get_linker_features(linker_str_array, vessel_graph) % fun_graph_get_linker_features computes features for fake linker % classifier from linker_str % Input: % linker_str_array: structure array computed by fun_graph_connect_gap_p2p % Output: % linker_features: linker featu...
6f56b14f3cbaa9a4b2025796e2bdb000c032ba2dcf8dc1951cb1dee73c4ea698
MATLAB
7,651
178
classdef LoopyModelCollection properties %Properties & Definitions models; x_train; x_test; computed_true_logZ;%archaic hidden_model;%arhaic end methods function self = LoopyModelCollection(models,params) self.models = models; ...
17ecea06557df5adf98a9e7ef84d2253237fd890b0b112c4301327a95aaf151f
MATLAB
7,652
238
function [RCM,BMC,BMA] = spm_dcm_bmr(P,field) % Bayesian model reduction (under Laplace approximation) % FORMAT [RCM,BMC,BMA] = spm_dcm_bmr(P,[field]) % % P - {Nsub x Nmodel} cell array of DCM filenames or model structures % of Nsub subjects, where each model is reduced independently % % field - paramete...
b527a3c58301b7bc22b761434451892b41ec1735430326794c52289ea3621e47
MATLAB
7,660
255
clc;clear;close all rng(1,'twister'); % computing PSTHs clear all_units=0; rootpath='..\dataset\Mice\result\total_clusterArea_paper_results_kernel_0\_clustering\'; postfix=''; if(all_units) postfix=[postfix,'_allUnits']; end matPath=[rootpath,'_dpca\']; load([rootpath,'clusteringFeature',postfix]) %as described...
ade752de32ffe669e533498316b2afc0b8e3333f1c66965c10777dcf8f3baec8
MATLAB
7,661
171
function Figure_8A_S7C_plot % % Written by Ayaka Matsumoto, October 2023 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Output: Figures 8A and S7C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
49f399f74a4bcc9596827d876d3e549ba2e29d0437e6faa90bebfd2f1aac20ed
MATLAB
7,668
121
% COMPARISON SHUFFLE TO REAL DATA HISTOGRAM OF PVALS % MH 2020 % Compare population vector analysis distributions versus shuffles. % INPUT: % remap: 'global' or 'rate' for different types of remapping function protocol = compare_shuffle_PV_corr_pvalues(remap) if strcmp(remap,'global') load('X:\BendorLab\Drob...
9af371ed31d22a3906628e7e95caf75d56d72f996a2d425015c4cbafdfe3b773
MATLAB
7,668
248
function [Dice]=ribbon_adf(subject, th_pval) % For each subject "subject": % Computes the Dice coefficients measuring the overlap of the % Cortical Ribbon volume computed % 1- from the subcortical labeling % 2- as the space between the white and the pial surface % % Uses the pvalues, tr...
9427b4be1b272db991266bb7438c1fe1ed26e605d591472df264b1883ce24dba
MATLAB
7,676
165
% GIBBS_SAMPLER receives parameters of a Markov Random Field in the % Ising Model and through stochastic methods samples the variables and % determines the marginals of each random variable. % % Usage % sampler = gibbs_sampler(node_potentials, edge_potentials, (optional) burn_in, (optional) gap) % % Input % node_p...
6df5522434e54440f159fe74ccb4496d9c9ca9e7abe6e09fcf695dd63c72cd1f
MATLAB
7,677
222
clc;clear;close all; root='..\'; addpath(genpath([root,'NeuralCorrelateEvidenceAcc'])) addpath(genpath([rootpath,'npy-matlab-master\'])) addpath(genpath([rootpath,'steinmetz-et-al-2019-master\'])) %% datapath='..\dataset\Mice\'; rootpath=[datapath,'9598406\spikeAndBehavioralData\']; outpath=[datapath,'result\']; regCl...
73ac4c409502e89b0ccdb9c3bf36b113a5e093b3a09da288fd97ab1290b47159
MATLAB
7,678
177
function [significantVarWei,significantVarMax,pValWei,pValMax] = distances_both_tasks_weighted_cluster_perm_stats(subjects,category,if_save,numPermutations,method) %DISTANCES_BOTH_TASKS_WEIGHTED_CLUSTER_PERM_STATS Perform weighted cluster permutation stats to calculate the %significance of the timepoints in the distanc...
cd7dbfbd8e3392a2130d2df4561a5daaefe2683f57f7e9d66797833b2caba48c
MATLAB
7,682
246
function [wmap, wconv] = mri_field_map_reg(yik, etime, varargin) %function [wmap, wconv] = mri_field_map_reg(yik, etime, varargin) %| %| MRI field map estimation using regularization and optimization transfer, %| based on a multiple image model: %| y_ik = mag_i * phase_ik * decay_ik + noise_ik %| phase_ik = exp(1i * w...
4627541a87c470445e00ec0eb6c135106fef5c98be2dbd2351e29de8e8fd9835
MATLAB
7,692
146
% THETA SEQUENCES QUANTIFICATION: SPIKE TRAIN CORRELATION % MH, 2020 % From Feng et al (2015,J Neuro). For each theta sequence, calculate Pearson's linear correlation coefficient between spike timing and place cell peak % firing positions for spikes emitted during 45-315 degrees of individual theta cycle (referenced to...
99a0955c884fa7266888b639c3da157849210cc0ff81271d7e708ff26b12bc6d
MATLAB
7,696
151
function modelParameters = setDefaultModelParameters(data,BW,model,environment) % function setDefaultModelParameters(data,BW,model,environment) % Function that sets the default model parameter values. % % Input: % - data: timetable which contains the data to be used by the tool; % - BW: the patient's body weight; %...
3effaba8c7e9679c42d8d04d51d28267865ca759c383260ad55ecd1dfed70ca1
MATLAB
7,697
176
% plot cluster determined group bar plots clear all;close all;clc reg = 'NC' fn_ext = '_cue_responseiveyes' baseline = [ '_cond_spec_prestim' fn_ext] lock = 'onset' % onset % response exp_type = 'tuning_correct'% 'encoding' 'tuning_correct' ref = 'LM' plot_4_conds = '' addpath('/mnt/yas...
3049a3171bdb4da7f44b1ec5d199cf23ff0c8678e5f7da2ef67e76369277d1a7
MATLAB
7,706
142
function [ratemapt_LRm, frLRm, countLRm, timeLRm] = match_smooth_trim_ratemap(neuronIndivLR, behavIndivLR, thresh, condition) % This function performs multiple steps for ratemap analysis % 1. downsample data to match bahavior coverages across left and right cpp % experment chambers or across different sessions; % 2. ca...
1d6e1f5c79ed312e74921fbc508f717cbcaa7092c88a973dd4d52a33df0866bb
MATLAB
7,709
224
%% Check which root directory if exist('/home/knight/hoycw/','dir');root_dir='/home/knight/hoycw/';ft_dir=[root_dir 'Apps/fieldtrip/']; else root_dir='/Volumes/hoycw_clust/';ft_dir='/Users/colinhoy/Code/Apps/fieldtrip/';end %% Set Up Directories addpath([root_dir 'PRJ_Error/scripts/']); addpath([root_dir 'PRJ_Error/sc...
1d5d6ed3ad031593ca0f7e96b650bf0763b06680d50b62c7b9acf96c531af3f2
MATLAB
7,714
175
function lf = fun_graph_get_link_w_1_ep_features(link_cc, vessel_image, vessel_mask_dt) % fun_graph_get_link_w_1_ep_features computes the features derived from the % position and orientation of endpoints and their nearest neighbor % Input: % ep_sub: N-by-3 numerical array, where N is the number of endpoint and 3 % ...
5e81624a5e18952c405adc1f3b91ee46b6ca927450d4031c8c71f66cdf13620d
MATLAB
7,714
314
function xrs = xray_read_spectra(stype, varargin) %|function xrs = xray_read_spectra(stype, [options]) %| %| Read X-ray spectra data and initialize a structure that describes "M" %| piecewise constant polyenergetic X-ray spectra, where M=2 for dual-kVp case. %| %| in %| stype char which spectrum model: %| 'mono,6...
75756d04f9065b3ed6718877648b1a20a47ab7c7992e7b81fb03b45e9e87ec1d
MATLAB
7,720
198
function [S Rex] = rho_s(Sim) % comments here % last change: 2014/04/03 by PS P = Sim; xZspec = Sim.xZspec; w_ref = 2*pi*P.FREQ; w1 = P.B1*gamma_2pi; da = (xZspec-P.dwA)*w_ref; theta = atan(w1./da); S.theta = theta; S.Reff_sincos = -P.R1A*cos(theta).^2 -(P.R2A)*...
0c05ee8ea1b9d00386377f09f7e9d4f16ca385548b82763525c049330d6e0790
MATLAB
7,727
287
% Notes % ----- % This code runs five time, for each of these conditions listed by H_flag H_flag = 5; if (H_flag == 1) H2 = Hb; elseif (H_flag == 2) H2 = Hr; elseif (H_flag == 3) H2 = Hrg; elseif (H_flag == 4) H2 = Hgb; elseif (H_flag == 5) H2 = Hgb; end % Image of orange on a tree and he...
403f5a19944d7fa0669a0c2cc5d541aea6c8a15d88b49b90caa346ed5e60b621
MATLAB
7,730
218
%subjectList = [ 16, 18:21, 24, 26, 27, 28, 29, 31, 32, 33, 34, 35, 39, 40, 41, 42, 43, 47, 50, 51, 52, 54, 55, 57, 58]; subjectList = [ 16, 18:21, 24, 26, 27, 28, 29, 31, 33, 34, 35, 42, 43, 47, 50, 51, 52, 54, 55, 57, 58]; %subjectList = [ 19,21,24,26,27,31,33,35,39,40,41,47,50,55]; subjectList = [62:64,66,68,70]; % ...
9a3d336d5c8184e020bc9ba08652de6b9d69c17eaf7a5dca12eb90b7735e068f
MATLAB
7,733
203
function [all_plv, all_iplv] = channelwise_plv(data_1, data_2, foi, nseed, Niterations, ... fsample, padding, time2use, method) % ######################################################################### % ---- INPUT ---- % % 1. data_1 = seed data % 2. data_2 = data that is used to compute PLV to ...
8ba453bbc2c121eb36ded072335aa75826e4d1eaa7457b7caf1323f8dddbbc89
MATLAB
7,746
283
function proj = cylinder_proj(cg, params, varargin) %function proj = cylinder_proj(cg, params, [options]) %| %| Compute set of 2d line-integral projection views of (elliptical) cylinder(s). %| Works for these 3D geometries: %| parallel beam %| flat-detector cone-beam %| arc-detector cone-beam (3rd generation CT) %| to...
d2068a39fd4bcbf879dbdd7a13b2dbb9b540ebf8ecb1fa6602203cdfcc7cf915
MATLAB
7,746
213
% PLOT AVERAGE PHASE PRECESSION SCORES PER PROTOCOL % MH 2020 % Loads phase precession scores per track and session ('extracted_phase_precession_absolute_location.mat'). % First plot - calculates the mean phase precession scor per track and protocol (1,2,3,4,8,16 laps and re-exposures). Plots as a line plot with error...
ce88baee466ae8ffb69d4ad4f152f3e9406e21dfdd972cd96ddd4bbc3e8106d5
MATLAB
7,754
141
%% NATSORTFILES Examples % The function <https://www.mathworks.com/matlabcentral/fileexchange/47434 % |NATSORTFILES|> sorts filenames or filepaths in an array |A| (cell/string/struct) % taking into account number values within the text. This is known as % _natural order_ or _alphanumeric order_. Note that MATLAB's ...
7a7a4ac1a75fcb0186894cc7e1f86b0f37d4411c229fb163977befbb6d313ec0
MATLAB
7,756
193
%% Prepare Matlab clear clc addpath(genpath('S:\Libraries\hcsforge\LCSBMatlabLibrary')) %% Document script %SavePathMainDirectory = 'S:\HCS_Platform\Data\SilviaBolognin\HumanSamples\LAMNB1\'; SavePathMainDirectory = 'S:\HCS_Platform\Data\IsabelRosety\Confocal\GBA_LAMP1_MAP2\20211209_488LAMP1_568GCase_647MAP2'; Analys...
3c93c87328501b105224b9ddb3a1322557c7d8019c82ca456ee47003f0c3a430
MATLAB
7,763
187
function control_plots_phase_precession(track) % Sanity check plots at different time points of theta phase precession extraction code % Uses output from main code 'phase_precession_absolute_location', which is a structure called TPP load('extracted_phase_precession_absolute_location.mat') load('extracted_position.ma...
e3d972a549b1f4d29b8aafb61cd8b1edee09bad7d1a41cae1a2a5948b772b803
MATLAB
7,782
191
function Optical_fitting_6692_fix_rayleigh(co, cross, s_seg, z_seg, datapath) % Fitting scattering and retardance of brain tissue % co: volume data for co pol % cross: volume data for cross pol % s_seg: slice number % Z_seg: tile number % datapath: datapath for original data cd(datapath); opts = optimset('Disp...
c18af246b84c3dfb12a21ae76228627b218c20ed6f3088465871dcedb18f5b26
MATLAB
7,791
281
function makeMapMovie(obj,iterSequence, RGCidx, SCidx, resolution, frameRate) if(~exist('iterSequence') | isempty(iterSequence)) % Load the iter sequence of the current object. iterSequence = obj.loadIterSequence(); end if(~exist('RGCidx')) RGCidx = []; end if(~exist('SCidx')) SCidx = [...
6d28b3a555f4bac7d1dec6f009b009e49ee851cf4ee7e3afe7c05412f707b3a6
MATLAB
7,794
261
function varargout = roipoly_adv(varargin) global CERRADO; %MODIFY VERSION OF ROIPOLY TO BE USED WITH ROI % %ROIPOLY Select polygonal region of interest. % Use ROIPOLY to select a polygonal region of interest within an % image. ROIPOLY returns a binary image that you can use as a mask for % masked filt...
a9ec507061722fc12bb7f480b4f95fc62b32f478a2552f4abf12dd83c6afa216
MATLAB
7,795
226
function ob = fatrix2(varargin) %function ob = fatrix2('odim', odim, 'mask', mask, 'arg', arg, [options]) %| %| Construct fatrix2 object, a matrix generalization for representing %| any linear operator. The 'f' might stand for 'fake' or 'function-based' %| or 'fancy' or maybe a last name? %| The caller can provide a ...
aaf66d46c1d0c8211fcef65fc84aba7ac4e58a642b45e1dead1d2b89140e2312
MATLAB
7,800
215
function Mosaic(datapath,disp,mosaic,pxlsize,islice,pattern,sys) %%% ---------------------- %%% % function version of mosaicing & blending % input: displacement parameters: four elements array [xx xy yy yx] % mosaic parameters: four elemetns array [number of x tile, number of y tile, % ...
458c02fcaead7f54bda59416cb7e83b5880dbda3c31b1a2cefc0e3a51c4ec60b
MATLAB
7,805
256
%% Computes sequence score by calculating the probability and asking for it to be larger than 3 ensembles %Without significance clear all close all rec_data_path = 'C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath='C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; save_data_path = 'C:\Users\xscogno\MATLAB...
ceefb4370c09daa45a546dd0c8e3497f1812c60d425af9dae1ea5c77674a317f
MATLAB
7,815
186
function results = validate_CAP_A1(dbDir, records, outCsv) % VALIDATE_CAP_A1 Benchmark YOUR rule-based CAP A1 detector against the % expert annotations of the PhysioNet CAP Sleep Database (capslpdb v1.0.0). % % Addresses Reviewer 1, Comment 1 (and the Editor note): reports sensitivity, % specificity, PPV, F1, and Cohe...
a453ec558056309f5727046125ec9cddebbf134287a3bb724504d1289b402a3f
MATLAB
7,823
246
function [V,h,Ph,F,Fa,Fc] = spm_reml(YY,X,Q,N,t,hE,hP) % ReML estimation of [improper] covariance components from y*y' % FORMAT [C,h,Ph,F,Fa,Fc] = spm_reml(YY,X,Q,N,t,hE,hP) % % YY - (m x m) sample covariance matrix Y*Y' {Y = (m x N) data matrix} % X - (m x p) design matrix % Q - {1 x q} covariance components % %...
01e9faab6990d2801df114383019bdfec12f9111974f1eb3fb2cfa962c2cad88
MATLAB
7,824
114
% Common functions of the IPEM Toolbox % % IPEMToolbox\Common % ------------------------------------------------------------------------------ % % General: % IPEMAdaptLevel - Adapt RMS level of signal to specified dB level % IPEMBellShape - Generate bell-shaped curve % I...
59106d0f3b5abf71a902048522b10f9874cb694435771dba11fef2a871c283f6
MATLAB
7,826
221
function res = tnueeg_spm_eeg_artefact_eyeblinks_for_correction(S) %TNUEEG_SPM_EEG_ARTEFACT_EYEBLINKS_FOR_CORRECTION Modified SPM function: %Detects eyeblinks in SPM continuous data file % S - input structure % fields of S: % S.D - M/EEG object % S.chanind - vector of i...
17f6d90b86c06d2ab38605a70cb1f686ff29353be750846a0c872d93e2f75ce8
MATLAB
7,829
248
function [handles] = spm_uitab(hparent,labels,callbacks,tag,active,height,tab_height) % Create tabs in a figure % FORMAT [handles] = spm_uitab(hparent,labels,callbacks,tag,active,height,tab_height) % This function creates tabs in the SPM graphics window. % These tabs may be associated with different sets of axes and ui...
69cf665de4eb66b7f396994bc3c3d70c84ee7257337bd9e0a7bed21b05cccb13
MATLAB
7,830
244
% eopn3_closedloop_openfield_pooled_graphs % Pool the GFP and eopn3 data together inot one graph, by loading the workspace of the Pooled GFP and Pooled eOPN3 animals %% close all; clear variables; clc; set(0,'defaultfigurecolor',[1 1 1]) %% filedirectory = uigetdir('select folder'); %select the overall fold...
9a908067d60238543007d0c48bce237f7feeb01e4a4c7394661e24f6a82e3549
MATLAB
7,836
298
function [sino, pos, ang] = rect_sino(sg, rects, varargin) %function [sino, pos, ang] = rect_sino(sg, rects, [options]) %| %| Create sinogram projection of one or more rectangles. %| Works for both parallel-beam geometry and for fan-beam geometry. %| %| in %| sg sinogram geometry object from sino_geom() %| rects [ne...
10b1508a5ed48e7648534b7825aa5de5f2977fc406ebee5958704881df5a288c
MATLAB
7,839
346
function ob = Cdiffs(isize, varargin) %function C1 = Cdiffs(isize, [options]) %| %| Construct C1 object that can compute C1 * x and the adjoint C1' * d %| for a "finite differences" matrix C for roughness penalty regularization. %| This "stacks up" multiple Cdiff1() objects, e.g., akin to using vertcat(), %| for possi...
30e873119b73852ae40c86a40355fd257d6322ebe7f89e42f6461990ba050159
MATLAB
7,840
278
function [dr,dl]=cc_cut_adf(subject, name,th_pval) % For each subject "subject": % Computes the Dice coefficients measuring the overlap % of the WM volume in right and left hemispheres to check % if the corpus_callosum is correctly located. % % Uses .lta transform and p values % % % cc_cut_afd.m % % O...
35c94e5da8e8ac165b5e2d4935e8a61c778348458b079c8d5aa6ad03e0a7a8f1
MATLAB
7,860
230
function [fly2] = PostHocAnalysis(fly,sArena,vertices,badFlies,regions) addpath('C:\Nicholas Data\Image Processing New Rig\Util') f = 30; cF = sArena.cF; for k = 1:regions if any(k == badFlies) || ~isfield(fly{k},'Center') fly{k} = []; else ang = fly{k}.ang; xTmp = fly{k}.Cent...
66165845230ae2c9cb7ef8f8822568a60a156f98efe18c9e0175bb4e5afd2aa7
MATLAB
7,866
211
%% Run scripts for SfN 2019 abstract if exist('/home/knight/hoycw/','dir');root_dir='/home/knight/hoycw/';ft_dir=[root_dir 'Apps/fieldtrip/']; else root_dir='/Volumes/hoycw_clust/'; ft_dir='/Users/colinhoy/Code/Apps/fieldtrip/';end %% addpath([root_dir 'PRJ_Error/scripts/']); addpath(genpath([root_dir 'PRJ_Error/scrip...
073a34003cd59c3588cb650606260a63cd258f0b2c51e224aaa55ca72dd2bac3
MATLAB
7,871
237
function [fields,fstats,config] = graphPEAK(ratemap,varargin) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ################################################################# %% DESCRIPTION %graphPEAK Measure properties of image regions. % fields = graphPEAK(ratemap) counts the number of f...
3e379b0f89e3f6994a901d08d4692870d4d1520b1f026ccf982d3aef78291425
MATLAB
7,880
232
function[]=co_cross_stitch(id,datapath, depth, thickness) % add path of functions addpath('/projectnb/npbssmic/s/Matlab_code/fitting_code'); addpath('/projectnb/npbssmic/s/Matlab_code/PostProcessing'); addpath('/projectnb/npbssmic/s/Matlab_code/PSOCT_code'); addpath('/projectnb/npbssmic/s/Matlab_code/ThorOCT_code'); ad...
6c13476ba51f7393f138d520f1372b817a932774095ebf86c78986d5c98f4486
MATLAB
7,880
303
function ob = Gblur(mask, varargin) %function ob = Gblur(mask, options) %| %| Construct Gblur object for image restoration. %| %| See Gblur_test.m for example usage. %| %| in %| mask size(image) logical array of object support. %| %| options %| 'chat' verbose printing of debug messages %| 'psf' point spread function...
5de414e0c558f1d8cf7d25e90b76452e8491bdb4df26fd7d1009b75618143615
MATLAB
7,883
158
function [hout] = plotAdded_modified(varargin) %plotAdded Added variable plot % plotAdded(LM,CNUM) produces an added variable plot for the term that % multiples coefficient number CNUM in the LinearModel LM. An added % variable plot illustrates the incremental ef...
c9343c56d52847c312b360368d1e5c3467ac8f907380bfe264ccc26fbdf5eeb8
MATLAB
7,885
192
function buffer = shuffleVectorRestricted(in, constrains, maxRep) % This function randomizes a given vector using several constraints. % The number of constraints is not limited, but should not exceed a % reasonable level, otherwise randomisation is not possible and an error % occurs. Constraints have to be defined as ...
3e092e2f1d2c1ab61c37f1a7e17ab36ff839258fd8ba745578a1301b1d3a6628
MATLAB
7,887
286
function nvr_writewavefile(Fs,nbits,wavefile,wavefile2) %WAVWRITE Write Microsoft WAVE (".wav") sound file. % WAVWRITE(Y,FS,NBITS,WAVEFILE) writes data Y to a Windows WAVE % file specified by the file name WAVEFILE, with a sample rate % of FS Hz and with NBITS number of bits. NBITS must be 8 or 16. % Ster...
7d2b2e1572e6f9cf1e54df5752ef26ccab8be09cf08fa6ee7dedd11cfde673c0
MATLAB
7,888
175
function lf = fun_graph_get_link_w_1_ep_features(link_cc, vessel_image, vessel_mask_dt) % fun_graph_get_link_w_1_ep_features computes the features derived from the % position and orientation of endpoints and their nearest neighbor % Input: % ep_sub: N-by-3 numerical array, where N is the number of endpoint and 3...
2299c5ecce6522386aa8c09e49ba1dbe4771da33aecfe8782868a7f57ac0343d
MATLAB
7,890
285
function [smap, sinit] = ir_mri_sensemap_admm(ykj, varargin) %function [smap, sinit] = ir_mri_sensemap_admm(ykj, [options]) %| %| Regularized estimation of sensitivity maps for parallel MRI %| using augmented Lagrangian methods with variable splitting. %| See M.J. Allison et al., IEEE TMI, 32(3), 556-564, Mar. 2013. %...
b3d107d50fe245bf816b7442251413eaadaf38d7116725cb6f995741fe7449a9
MATLAB
7,907
206
%aim to calculate the latency of the response, find the time and CI, and %the bootstrap % close all; clearvars; addpath ('/data/local/u0114568/ephysio/test'); cn1={'sp','color', 'con', 'incon', 'att', 'congruency','fac','int'}; % condition names length=8 cn={ [cn1{5}],[cn1{7}]}; condnames='Att-Faci-Int'; % note the ...
cc9dff280bdddff943408d8f08b16608cc7b94d870f77daac35e35cddf0b9996
MATLAB
7,907
205
%% Prep environment & load the data w/ pruned segments % Data.Graph.edges is a [N, 2] matrix, where each row contains the % indices that the edge connects. % Data.Graph.nodes is a [N, 3] matrix, where each row contains the [x,y,z] % coordinates of the node. % Data.Graph.nB is a 1D array containing the number of bifruca...
2371b3f85b101ea70cd3901f1bd5b12a442c1f396dfa190dad25f563384355a5
MATLAB
7,908
220
function Ret_stitch(target, P2path, datapath,disp,mosaic,pxlsize,islice,pattern,sys,stitch, aip_threshold) %% stitch the retardance using the coordinates from AIP stitch % add subfunctions for the script addpath('/projectnb/npbssmic/s/Matlab_code'); id=islice; filepath=strcat(datapath,'retardance/vol',num2str(islice),'...
1e6ddcae1b17b004710902d7b8b30778d4da919cd2ab599509ace907c663eee4
MATLAB
7,913
196
%% Manually scoring the participants trajectory % In order to the model to fit the data the participant had to demonstrate % a clear intention of completing the triangle. % This did not happen all of the time and therefore we had to exclude some % data. Also we noticed by looking at the tracking data that participants ...