sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
4e58591746280dc7261e54adcf953ba478616f59b2f154ec44839301aafbd57e
MATLAB
3,549
99
function mono_res = bz_GetMonoSynapticallyConnected(basepath,varargin) %% Method for estimating likelihood of monosynaptic connectivity based off of relative spike timing % Based off of Stark and Abeles 2009 and verified for PYR -INT in English et al., 2017 % Assumes network synchrony is low frequency and that synapse...
1469837730167cf1fe3177577baa404541a3d0351d6fe4552cbd8645ababa33f
MATLAB
3,551
97
function [itk_fwd_field, itk_inv_field] = ea_synthmorph(target_image, source_image) % Wrapper to run SynthMorph and get ANTs-like transforms % % SynthMorph % fs_fwd_field = strrep(source_image, '.nii', '_fs_fwd_field.nii'); % Check Conda environment condaenv = ea_conda_env('SynthMorph'); ...
e3f8428326abc503c394ab5a40b19d2da0bbce17030e5641865ab9bbe2e21dfb
MATLAB
3,551
82
% std_readspec() - load spectrum measures for data channels or % for all components of a specified cluster. % Called by plotting functions % std_envtopo(), std_erpplot(), std_erspplot(), ... % Usage: % >> [STUDY, specdata, allfreqs, setinds, cinds] = ... % ...
c2976f7de91b5519634d5d0c8dfbfa25c8a8de3a5fc8c926bce8ae5465144849
MATLAB
3,552
76
function ClincFreq_CalClinWeiLocation(INDIR,OutWeiLocdir,SetUpPara,Para,VolLab,ClincWei) [V,D,namelist] = Dynamic_read_dir_NIFTI_sparse(INDIR); D(isnan(D)) = 0; D(isinf(D)) = 0; D = D>0; Dvol = sum(D)'; Dvole = sum(D,2); IgV = Para.IgP; indexs = find(Dvole>=(size(D,2)*IgV/100)); Dmasked = zeros(V.dim); Dmasked(indexs)...
64a78b7dc56b021f8906c4d053034fd8324b75ff158826a8aa6800ff45158774
MATLAB
3,554
128
function [ INT,IDX_new ] = bz_IDXtoINT( IDX ,varargin) %bz_IDXtoINT(IDX) Converts state indices to state on/offsets % %INPUT % IDX: structure with fields: IDX.statenames % (see buzcode wiki) IDX.states % IDX.timestamps % -or- % [len x 1] vector ...
9d426b1b618b6312e68dd58983c1bdfb2f601cc674bfa6c7e93d646a896a3905
MATLAB
3,554
95
function options = ea_ensure_b0_coreg(options) % EA_ENSURE_B0_COREG Ensure that a coregistration transform between B0 and T1 exists. % % This helper is intended to be called from the main pipeline (ea_autocoord) % before any Lead-Connectome structural steps run. It is read-only with % respect to options except for po...
b9aac7f91e14726ec58b4682c471e1d92a8480f049b6ac29db059b29200b9b00
MATLAB
3,554
116
function [fibers, idx] = ea_trk2ftr(trkFile, ref, saveFTR) % Convert trk to ftr (fibers format in Lead-DBS) % % ref can be: % 1 - Lead-DBS / MNI152 NLin 2009b Asym % 2 - Choose a reference NIfTI file % 3 - Interactively select ref type (1 or 2 above) % [string] - Path of a NIfTI file defini...
50a9c659f70afc2a64e52c818fb21af469ed1e3dba6ff8b17978ab88eac56021
MATLAB
3,555
108
function [] = fig2idtf(filename,... surface_vertices, faces, face_vertex_data,... line_vertices, line_edges, line_colors,... pointset_points, pointset_colors,... mesh_tag) %FIG2IDTF Save figure in IDTF format. % % usage % ...
4187add54027b56d9a51e75294f3e07c3d78fbaf4c6508306580ffb43411ffde
MATLAB
3,556
76
function ft_struct = Trinh_happe_detectbadchannels(ft_struct,baby,flatline,corrnoise,specrej) % rejects channels according to the HAPPILEE pipeline % baby (1 on, 0 off) --> changes channel locations according to MUSICOM WP4 % (needs adaption for Biosemi as the function needs 3d coordinates). This % can be achieve...
57fd4e3b0a6aab00c616060fbc2975a76805c9d742bdf1280a2b83fe53dd2056
MATLAB
3,556
64
%% PaCER - Precise and Convenient Electrode Reconstruction for Deep Brain Stimulation % % Andreas Husch % Centre Hospitalier de Luxembourg (CHL), Dept. of Neurosurgery / % University of Luxembourg - Luxembourg Centre for Systems Biomedicine (LCSB) % (c) 2016 - 2017 % mail@andreashusch.de, husch.andreas@chl.lu function...
34d57510568d57f558fcfe9881d9539be624f1e2a01df34022c9972d8ae5b435
MATLAB
3,560
91
% Runs a two-sample t-test for a set of signature responses, for each % condition. % Signatures, scaling, etc. are defined below. % created by @lukasvo76 from h2_group_differences_emosignatures.m, March 2021 %% USER OPTIONS % ------------------------------------------------------------------------- mysignature = {...
4de93494383cad717c67591497175fee19d97efd9933962af217e40480f3edf2
MATLAB
3,560
108
function [posAlongDir,deltaPosAlongDir,prefDir] = projectCoordOntoDir(... trackCoord,deltaCoord,centerCoord,prefDir) %PROJECTCOORDALONGDIR reduces coordinates into their 1D projection along a line % %SYNPOSIS [posAlongDir,deltaPosAlongDir,prefDir] = projectCoordOntoDir(... % trackCoord,deltaCoord,centerCoord,pre...
b3818c0f9e36e7442da1a182403aaaa60350ac87578655d32ee36eee09e988e7
MATLAB
3,560
117
% readlocsold() - Read electrode locations file in style of topoplot() or headplot(). % Output channel information is ordered by channel numbers. % % Usage: >> [nums labels th r x y] = readlocsold(locfile);% {default, polar 2-D} % >> [nums labels th r x y] = readlocsold(locfile,'polar'); % 2-D %...
f91cea3ceecd2e051883263da8f41763301946696a9d1ada32188f3c28a88d68
MATLAB
3,562
71
classdef CBIG_gwMRF_unit_test < matlab.unittest.TestCase % % Target project: % Schaefer2018_LocalGlobal % % Case design: % Schaefer2018_LocalGlobal already has unit test script, here % we call its unit test script and automatically % make judgement on whe...
5378a887bda213d782bbaeec38e3cf436e1f0307515b84d0c66cf733ed8fb36a
MATLAB
3,563
91
% [labels, start, stop] = Boris.Aggregated.load(filename) % Returns a list of events encoded with BORIS. % Output: % labels: 'behavior1', 'behavior2', ... % start: [start1, start2, ...]; % stop: [stop1, stop2, ...] % % epochs = Boris.Aggregated.load(filename) % Output: % {'behavior1', [start1, stop1, ...
61be3f66e0e73332175ecf9d0d96adf89e0d4eeaf9e0e9061bac7d8332b39ba6
MATLAB
3,565
95
function ea_cvshowvatdmri(resultfig,directory,handles,selectedparc,options) % get everything we need to know from handles: if isstruct(handles) % called from GUI vatmodality=get(handles.vatmodality,'String'); vatmodality=vatmodality{get(handles.vatmodality,'Value')}; vs=get(handles.vatseed,'String'); % don...
7d642fb06b0f2ef9a46a84ce79d9a68d4cfd2f703be7a7821ab233033ef30d31
MATLAB
3,565
118
function [U, S, V] = mySVD(X,ReducedDim) %mySVD Accelerated singular value decomposition. % [U,S,V] = mySVD(X) produces a diagonal matrix S, of the % dimension as the rank of X and with nonnegative diagonal elements in % decreasing order, and unitary matrices U and V so that % X = U*S*V'. % % [U,S,V] = m...
8c63d6f639a46f65997629f59f2d88c51298cef94b59b73c65f5aa1255e1c057
MATLAB
3,567
91
function result = plugin_install(zipfilelink, name, version, forceInstall); if nargin < 4, forceInstall = false; end; result = 1; % get plugin path % --------------- %version(find(version == '.')) = '_'; generalPluginPath = fullfile(fileparts(which('eeglab.m')), 'plugins'); newPluginPath ...
df9b07ca477ec5275cea3d5282c9aef0e40d2b99576948145b4dda91603ea482
MATLAB
3,570
104
close all;clear;clc fs = 40; pre = 20; post = 50; % % Select the folders to be analyzed FolderList = uipickfiles; %% Analysis for i = 1:size(FolderList,2) % Determine the current subfolder name selected_path = FolderList{i}; cd(selected_path); work_folder = selected_path(find(selected_path ...
0ff90b7d028e3c42d1daaf30481634735f6886791e2382766c4ed3373a502ea1
MATLAB
3,571
68
function CBIG_MMLDA_brain_behavior_zscore_to_doc(Z_brain, Z_behavior, rid, ind_out, plus_num, nfold, out_dir, out_name) % CBIG_MMLDA_brain_behavior_zscore_to_doc(Z_brain, Z_behavior, rid, ind_out, plus_num, nfold, out_dir, out_name) % % Convert brain behavior zscore to documents used to run MMLDA. % 1. Plus a number to...
b68021a4ae29af8a91907332896054e654cd12f6c64493399f19dfab9e0cb94c
MATLAB
3,571
76
function [maxDrift_estimate, cumulativeDrift_estimate, median_spikeDepth, timeBins, spikeDepths_inChannels] = maxDriftEstimate(pcFeatures, pcFeatureIdx, spikeTemplates, ... spikeTimes, channelPositions_z, thisUnit, param, timeChunks) % JF, Estimate the maximum drift for a particular unit % ------ % Inputs % ------ ...
17e01ff7a3a9350a386389aac03db23554084942270646601ded8f51c33a01cd
MATLAB
3,572
94
function out = LaBGAScore_pdm_report_image(d, label, varargin) % LaBGAScore_pdm_report_image c2a-style reporting for one thresholded brain map. % % Produces the overview montage, the labelled region table, and the % regioncenters montage that second-level GLM results get from c2a, for a map % that is ALREADY threshold...
b2ce3caef5e1c8cd52462fb45ef65c2b4ae35fb6c3980c5c24295f5e150bc904
MATLAB
3,572
156
% Philipp Berens % CircStat: A Matlab Toolbox for Circular Statistics % Submitted to Journal of Statistical Software % % Example 2 % An Application to Neuroscience % % % In this example, we assess the orientation tuning properties of three % neurons recorded from the primary visual cortex of awake macaques. th...
33d761718435bbc8113726626964add789d5d9daf6a0a284fe904d0733ea9713
MATLAB
3,573
73
function CBIG_ASDf_FC2doc_infFactorComp_wrapper(corrMat_ASD_path, corrMat_con_path, ref_path, sub_info_file, output_dir) % CBIG_ASDf_FC2doc_infFactorComp_wrapper(corrMat_ASD_path, corrMat_con_path, ref_path, sub_info_file, output_dir) % % Wrapper function to compute Z-normalized, discretized FC (Z-normalization % w.r.t...
837a8160b7b9fc4c81f0d7d5f004280acd60220245f31cc08895482068e47046
MATLAB
3,574
72
function [plx] = get_all_from_plx(fileName) plx = []; if (nargin == 0 | isempty(fileName)) [fname, pathname] = uigetfile('*.plx', 'Select a .plx file'); if isequal(fname,0) error 'No file was selected' return end fileName = fullfile(pathname, fname); end [plx.tscounts, plx.wfcounts,...
f93e635d3eaaed8712507ed4483136ff873d05f2c88b0ffdbf8c28ec028ffa1f
MATLAB
3,574
119
% logimagesc() - make an imagesc(0) plot with log y-axis values (ala semilogy()) % % Usage: >> [logfreqs,dataout] = logimagesc(times,freqs,data); % % Input: % times = vector of x-axis values % freqs = vector of y-axis values % data = matrix of size (freqs,times) % % Optional Input: % plot = ['on'|'off'] plot ...
9f62cac3dab9716b5164d2fa60ef84e05e0feee4b71db425ecdd59caae180335
MATLAB
3,577
95
function [trackCntOut] = getFsmTrackNum(qfsmPackPaths, frameRange) %GETFSMTRACKNUM: output number of speckle track per movie from MPM of QFSM given directory of movie where QFSM was performed % %SYNOPSIS: [trackCntOut] = getFsmTrackNum(qfsmPackPaths, frameRange) % %INPUT : qfsmPackPaths : (nx1 cell) locations to n acti...
d8ba41cad0370d300644e3aab9a05b3dbdcdb9a8514f0b3e505bbec0dc4d9411
MATLAB
3,577
136
function CBIG_pMFM_step2_generate_FCD_desikan() % This function is the wrapper to generate parcellated time serises and FCD % for Desikan parcellation % % There is no input for this function as it can automatically get the % output file from previous step. % There is no output for this function as it will generate the...
007061b421d1e7545343c429a50a15de08d893e51b5b2c8fa14cb9a8a907ce07
MATLAB
3,578
135
function out = computeFluctuations(par, scenario_fun, proc, k) % Compute stochastic fluctuations for: % - total NSC number S = Q + A % - active fraction f = A / (Q + A) scenario = scenario_fun(par); %% --- fixed time grid --- % Variance propagation requires the full time-dependent trajectory. dt = 0.05...
54499dca26fa92647a38bbb165d9f91ceb8a79d2acf02c2fb0e7e0f99ef61422
MATLAB
3,578
84
% When you load any ANALYZE or NIfTI file with 'load_nii.m', and view % it with 'view_nii.m', you may find that the image is L-R flipped. % This is because of the confusion of radiological and neurological % convention in the medical image before NIfTI format is adopted. You % can find more details from: % %...
529fa886157127e85ef5cd4296b0fd65af2801ad35c6affec72a9cdc24a2475f
MATLAB
3,580
92
function SOFAstart(flags) % SOFAstart % % SOFAstart adds all needed pathes and checks if we need the Matlab or Octave % version of the API % % SOFAstart(0) or SOFAstart('silent') will suppress any message during the start. % SOFAstart ('short') will show a short header only during the start. % SOFA A...
524ee16f6eaab148acc6f2c05e1917ae88d08782ff5ac851795662d68fed79e6
MATLAB
3,581
121
function plot_brain_mesh_iso2mesh(p, e, brain_nodes_idx, overlay_brain, plot_cfg, varargin) %PLOT_BRAIN_MESH_ISO2MESH Plot a brain mesh with optional nodewise overlay using iso2mesh. % % fnirspower.measpred.plot_brain_mesh_iso2mesh( ... % p, e, brain_nodes_idx, overlay_brain, plot_cfg) % % fnirspower.measp...
d89f9f73808dfebd1ee11b4c238a1c75cdacccd000b6461fa8f0552e4c5158dd
MATLAB
3,582
146
function [xmax,imax,xmin,imin] = extrema(x) %EXTREMA Gets the global extrema points from a time series. % [XMAX,IMAX,XMIN,IMIN] = EXTREMA(X) returns the global minima and maxima % points of the vector X ignoring NaN's, where % XMAX - maxima points in descending order % IMAX - indexes of the XMAX % XMIN ...
d8d537c71db2554f860b93e2e5363d9da1302c0c23800336743de4523f5098b6
MATLAB
3,582
106
function [d pred f]=astar_search(A,s,h,varargin) % ASTAR_SEARCH Perform a heuristically guided (A*) search on the graph. % % [d pred rank]=astar_search(A,s,h,optionsu) returns the distance map, % search tree and f-value of each node in an astar_search. % The search begins at vertex s. The heuristic h guides the searc...
eadd7fddb0bd5d35a9ed3cecec14b23710957c1c9db207377ec80e669e20dd82
MATLAB
3,582
96
function spikes = ThresholdSpikes(amplitudes,factor,varargin) %ThresholdSpikes - Post-hoc threshold correction for spike detection. % % USAGE % % spikes = ThresholdSpikes(amplitudes,factor,<options>) % % amplitudes [time, electrode group, cluster, amplitude] tuples % e.g. obtained using <a...
11e36eb2b15242ccb4d83b3dc3f5c98d9c31172610a73106eddace08957a00e8
MATLAB
3,583
94
function [vatlist,FilesExist] = ea_discfibers_getvats(obj) % Return list of VATs numPatient = length(obj.allpatients); vatlist = cell(numPatient*2,2); FilesExist = zeros(numPatient*2,2); % also check if mirrored fields exist modelLabel = ea_simModel2Label(obj.M.vatmodel); disp('Construct VAT list...') for sub=1:num...
5d27b3e3b075621baf68198fd1ee06e1249950c14e3a75c8e41e6604a217258f
MATLAB
3,587
73
function [dS,f]=mtdspectrumc(data,phi,params) % Multi-taper frequency derivative of the spectrum - continuous process % % Usage: % % [dS,f]=mtdspectrumc(data,phi,params) % Input: % Note that all times can be in arbitrary units. But the units have to be % consistent. So, if E is in secs, win, t have to be in secs, ...
d8a0bd6615da237c22e088c393886d471dad2ce79175476314081e9e750fc63d
MATLAB
3,588
81
function Y = filterzm(B, X) %FILTERZM Zero-phase 1-D digital filter (memory efficient). % Y = FILTERZ(B, X) filters the data in vector X with the FIR filter % given by the vector B to create the filtered data Y, shifting the % filter to give zero-phase delay. The process is equivalent to % convolution...
138351c87bb891a173e790556ff2c94e1c749fbaa2edd2d390ee4986a7685da9
MATLAB
3,589
100
% Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions % %========================================================================= % % Copyright (c) 2008 Thomas Yeo and Mert Sabuncu % All rights reserved. % %Redistribution and use in source and binary forms, with or without %modification, a...
ed68b53ae174d0e867518ddca852e8e97201f4c9606f750e7795d096f31fa8d5
MATLAB
3,589
113
% readegihdr() - read header information from EGI (versions 2,3,4,5,6,7) data file. % % Usage: % >> [head] = readegihdr(fid,forceversion) % % Input: % fid - file identifier of EGI datafile % forceversion - optional integer input to override automatic reading of version number. % % Output: % head - structure con...
fb10d200a13769f835b7c40b7d66dc9815a2b82f48ffdb570a563969fba035ec
MATLAB
3,589
89
classdef CondColocPt2Pt2PtProcess < ImageAnalysisProcess % A concreate class for measuring conditional colocalization between 3 images % Anthony Vega 09/2014 %Adapted by Jesus Vega-Lugo (May, 2019) to run conditional colocalization % % Copyright (C) 2021, Jaqaman Lab - UTSouthwestern % % This file is part...
c453e3b0188724bd5a62d94578c1205f6be528ae35605ff165a603f4f0c85a9a
MATLAB
3,590
94
% written by Yiyuan Han, Essex BCI-NE Lab, 05/03/2020 % It's just a modified version of multiClassPar for CFC % Multi-class classifiers for each participant based on the CFC as the % selected features %% Only remain the participants with complete data in all of 4 classes classes = ['O' 'H' 'W' 'S']; bands = [0....
129ae07aff893d30032e38a679a689e110bf1fbb40cb24c6241c7d632431e0b1
MATLAB
3,591
94
function fig = draw_surface_bluewhitered_gallery(surface_to_plot, data_to_plot, hemisphere, medial_wall, with_medial) % draw_surface_bluewhitered_gallery.m % % Draw multiple data on surface using blue-white-red colormap for % negative-zero-positive values % % Inputs: surface_to_plot : surface structure with fields % ...
1344254f46dd629680b9862182852cb7d887aa9fca48b10bb60ddb1859f486ac
MATLAB
3,591
118
function [line_resources] = populate_line_resource_str(line_vertices,... line_lines, line_colors, n_resources) % % See also FACE_VERTEX_DATA_EQUALS_NPOINTS, VERBATIM. % % File: populate_line_resource_str.m % Author: Ioannis Filippidis, jfilippidis@gmail.com % Date: 20...
e2c19d6106822ccc1f2fbd98d294919ed60d4c623e6625a1a953556f479927ac
MATLAB
3,591
117
function bz_LFPFromAbf(basePath,chanNums) %assumes you are in or pointed to a directory containing subdirectories for % various recording files from a single session % %INPUT % Assumes presence of the following files: % basePath/baseName.abf % where basePath is a folder of the form: % whateverPath/base...
a23312041a252f297fa4ac7ba634cb5898765659002276459aae141a5faffe98
MATLAB
3,593
78
% Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions % %========================================================================= % % Copyright (c) 2008 Thomas Yeo and Mert Sabuncu % All rights reserved. % %Redistribution and use in source and binary forms, with or without %modification, a...
0e72fba50fa1a85c9b5116790248a3ea8219c11a695d2101b168914fb8373e7b
MATLAB
3,594
93
function [Figs, Results] =... scatterSignificance(Results, Counts, CondNames, Delta_t, clID) %SCATTERSIGNIFICANCE takes the statistical results from the statTests and %plots them against each other (conditions) meanfr = cellfun(@(x) mean(x,2)/Delta_t, Counts, 'UniformOutput', false); mxfr = cellfun(@max, meanfr);...
0ede1a2294256490f6da65c80d3e41566acebe75fae5fa57684c2551fb860439
MATLAB
3,602
134
function [r,p] = ea_bendcorr(X,Y) % Computes the percentage bend correlation along with the bootstrap CI % % FORMAT: [r,t,p] = bendcorr(X,Y) % [r,t,p,hboot,CI,H,pH] = bendcorr(X,Y,fig_flag,beta) % % INPUTS: X and Y are 2 vectors or matrices. In the latter case, % correlations are computed c...
75145bd650b03413d4917f1533344b8972900463f97310eb6f0ee18f5c3e24fa
MATLAB
3,602
102
% eegdrawg() - subroutine used by eegplotgold() to plot data. % % Author: Colin Humphries, CNL, Salk Institute, La Jolla, 7/96 % Copyright (C) Colin Humphries, CNL, Salk Institute 7/96 from eegplot() % % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public...
8cb0e8d9506d50973f1793c5da0391d6df97b87ff7ce19dd794b40c1d9d94707
MATLAB
3,602
101
function [R, t, iter_err, reg_pointqueary] = ... ICP_point_regRTbalance(reg_points, reg_pointqueary, ops) % This is an implementation of the Iterative Closest Point (ICP) algorithm. % Arguments: pointcloud - 3 x n matrix of the x, y and z coordinates of data set 1 % pointqueary - 3 x m matrix of the x, y...
ddc9b504ab10d717a3b3b00376767d76d476c0d9a7034ff3a097e6d36c011a3e
MATLAB
3,605
128
function averageOIS3(fname,fps,ntr,noff,nper,nfa,zoomdn,basediff) % Usage ... averageOIS3(fname,fps,ntrials,offset,trialdur,desiredres,zoomdown,basediff) % this one does global division if (nargin<8), basediff=[]; end; if (nargin<7), zoomdn=[]; end; if isempty(basediff), do_norm=0; else, do_no...
b84beb89d44c4cbca63f02bfa2880388dd99af8c8d1e3a70cd817043bf422439
MATLAB
3,608
71
% sleepDanalyzer montage script. % chanList. A list of channel names and (optionally) channel coordinates. % This should be an EEGLAB chanlocs struct. Alternatively you can read in a % .txt file using the readlocs function (EEGLAB). If you wish to % differentiate channel types (e.g. EEG, EOG, etc.) make sure to use t...
94a41187e593fedae83644ee8787d7c7d38787168dbe2d7d1244c7234305188e
MATLAB
3,609
121
% getallmenuseeglab() - get all submenus of a window or a menu and return % a tree. The function will also look for callback. % % Usage: % >> [tree nb] = getallmenuseeglab( handler ); % % Inputs: % handler - handler of the window or of a menu % % Outputs: % tree - text output % nb ...
8090e46097cbe506b29a340178b17cded39db2c2a9272e583b655189ea102e4e
MATLAB
3,611
106
function unfreezeColors(h) % unfreezeColors Restore colors of a plot to original indexed color. (v2.3) % % Useful if you want to apply a new colormap to plots whose % colors were previously frozen with freezeColors. % % Usage: % unfreezeColors unfreezes all objects in current axis, % un...
eb12947dd3ab010662b9f6a700de9d8c5b90f277bdd651522134825712d42070
MATLAB
3,611
118
function [maxsize,clstat,sizes] = palm_clusterp(X,y,thr,opts,plm,fastpiv,M,psi,res,m,c,o) % Compute cluster pivotal statistics, for volume or surface % data (vertexwise or facewise). % % Usage: % [maxsize,clstat,sizes] = palm_clusterp(X,y,thr,opts,plm) % % Inputs: % - X : Statistical map. % - y : Modality index...
f1b0f5f884994b797911aaf692922bd0f9cb6793524f49f5fdccb66a8f6ef3f3
MATLAB
3,614
87
% Example replay and relationship between weighted corr. and % sequence likelihood for all candidates load('result_example_1_8.mat'); % 8th replay candidate in the 1st block load('result_w_Lseq2.mat'); % weighted correlation and L_seq for all candidates %% Figures % example replay candidate subplot(3,4,2);...
817e80280e314dc1d07b332aed8eb051c15e615718daa1a44d29c8ef3553967d
MATLAB
3,615
147
function [psgOUT, scoresOUT] = fun_subset_data(psgIN, scoresIN, ar, varargin) % Subset a continuous dataset in artifct free segments of either a % particular sleep stage or a defined set of epochs. % % Required inputs: % % psgIN: A danalyzer psg structure % % scoresIN: A danalyzer sleepstages struct or an array of sle...
798f832b8a930d2a7be823f8140fbca2af2831676e86953618309f2c7f8302ee
MATLAB
3,616
142
function [ CONDXY ] = ConditionalHist( X,Y,varargin) %[CONDXY] = ConditionalHist(X,Y) Calculates the conditional probabilty %of Y given X % %INPUT % X % Y % (options) % 'numXbins' (default: 50) % 'numYbins' (default: 50) % 'Xbounds' % 'Ybounds' % 'Xbinoverlap' (default: 1) % 'minX' (default: 25)...
3435b24cc5fd9febcaf027624ba269d0eda789db6705319af4ee0d07555790fd
MATLAB
3,617
105
%%controls across animals ControlAll=[]; allnames={ 'Tser4883_res_cfr4.mat' 'Tser5198_res_cfr3.mat' 'Tser5205_res_cfr3.mat' }; groupname='ControlAll'; all_rr1a_micronsC=[]; all_rr1aSEM_micronsC=[]; all_rr1a_percentC=[]; all_rr1aSEM_percentC=[]; all_rr2a_micronsC=[]; all_rr2aSEM_micronsC=[]; all_rr2a_percentC=[]; all...
054d51f0af5f0516695f5c36bd9a551fb5018e4215974469ae910b8fa17a1756
MATLAB
3,622
100
% Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions % %========================================================================= % % Copyright (c) 2008 Thomas Yeo and Mert Sabuncu % All rights reserved. % %Redistribution and use in source and binary forms, with or without %modification, a...
82698a33abf3fd989880e9826a79afd7ff0aee28bceb0dfa95ac433097fbb1c5
MATLAB
3,622
113
function [srcProj, detProj, link] = placeAndProjectOptodes(head, probeInfo, opts) %PLACEANDPROJECTOPTODES Adjust probe coords and project to scalp nodes. % % [srcProj, detProj, link] = fnirspower.fwdcomp.placeAndProjectOptodes(head, probeInfo, opts) % % Inputs % ------ % head : struct with fields % ...
dd34127b87d206eae1ac410678670dc837ff13baa969a896254a0c67b348a3a3
MATLAB
3,622
125
function [ IDX,timestamps ] = bz_INTtoIDX(INT,varargin) %[IDX] = bz_INTtoIDX(INT) Converts state on/offsets to vector of indices % %INPUT % INT: {nstates} cell array of [nintervals x 2] start and end times. % (optional) can be TSObject intervalSet % -or- % structure with f...
0ad68899af4f90f3c32d4eb288f5b67a79606d8f457df59e04a181f75d994213
MATLAB
3,623
106
function [passTrackLogic, numPassTrack, statPassTrack, lftPassTrack] = selTrackChecker(decompTrack, checkFr, minLft) %PASSTRACKCHECKER checks for decompound tracks that pass through pre-defined frame and satisfy minimum lifetime % %SYNOPSIS: [passTrack, passTrackId] = selTrackChecker(decompTrack, frameCheck, minLft) % ...
7917c4e6017aaff44d503f94670283f11acab44ff22ee48ca524fc239d4dd83e
MATLAB
3,623
88
function [maskDens, maskDensMat, maskDensMatCov] = plotSpkMaskDensity(actinPropPerTimeStructArr, subgroupArr, pixelSize) %PLOTSPKMASKDENSITY collect and plot speckle Mask Density % %SYNOPSIS: [maskDens, maskDensMat, maskDensMatCov] = plotSpkMaskDensity(actinPropPerTimeStructArr, subgroupArr, pixelSize) % %INPUT: actinP...
7ded6f376442b9dff995eaee369a9f83d2ef9b20f14c3dee4080aabe81d5ddbf
MATLAB
3,623
67
function Obj=SOFAconvertFHK2SOFA(miroObj) % OBJ=SOFAconvertFHK2SOFA(miroObj) converts the HRTFs described in miroObj % to SOFA. miroObj is the miro object saved at the Fach-Hochschule Köln % provided by Benjamin Bernschütz. % Reference to the source format: http://www.audiogroup.web.fh-koeln.de/ku100hrir.html % Re...
84451255ff6f73b4e68794dc967b8317682d61e433111329762d9898267eccd8
MATLAB
3,623
85
function [imgRGB, imgMask, xBounds, yBounds, smoothGrid, cmap] = makeMetricMap(metricVals, valPositions, gridRes, xLimits, yLimits, cmapInfo, sd) % [imgRGB, imgMask, xBounds, yBounds, smoothGrid, cmap] = % makeMetricMap(metricVals, valPositions, gridRes, xLimits, yLimits, cmapInfo, sd) % % Creates a gridded color im...
f460c687dca18e7e1c7f47e5a3347fab451651a34f1d67b582808abe4ecbf84f
MATLAB
3,623
118
function [L_l,R_l] = lindemannInh(L,R,fs,c_inh,dim) %LINDEMANNINH Signal pre-processing for Lindemann's cross-correlation % % [L_L,R_L] = IOSR.AUDITORY.LINDEMANNINH(L,R,FS) pre-processes left L and % right R signals for the cross-correlation function based on Lindemann's % precedence model [1,2]. A crucial param...
99d1bc1374b970c5dbe67e2b1cb17d86e3dc06840c0db490422ba258e708f073
MATLAB
3,626
99
% ==================================== %% Help % ==================================== % % CBIG_supp_fig1_fc_similarity % % This script replicates Supplementary Figure 1: the vertex-wise Pearson % correlation between the NIH-34 and HCP-40 group-average whole-brain % functional connectivity (FC) fingerprint maps. For eac...
53bc777179e1c464555bf09c87b29be0561b2b55a3b5f2443cc4e484c8d19eac
MATLAB
3,627
103
% % Copyright 2017-2023 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with % Sandia Corporation, the U.S. Government retains certain rights in this software. % % See LICENSE for full license details % % Basic example of how to use the CrossSim matrix interface directly from Matlab % This uses the C...
f6d0e2d9ac625d6f2cf18bee7f522fabea2aebc27a2b68724bacfecc82b45941
MATLAB
3,631
89
function X = gursoy_atun_layout(A,varargin) % GURSOY_ATUN_LAYOUT Layout a graph by uniformly distributing vertices % % Instead of trying to optimize an objective function of forces or springs % in the layout, the Gursoy-Atun layout distributes vertices uniformly % within a topology subject to keeping vertices nearby t...
1558d0243ab81b5c6e4fc635115f553553900d7bcc776f84f988a6af9f2bb85c
MATLAB
3,633
105
function [H, pValue, KSstatistic] = kstest_2s_2d(x1, x2, alpha) % kstest_2s_2d - FUNCTION Two-sample Two-dimensional Kolmogorov-Smirnov Test % % Usage:[H, pValue, KSstatistic] = kstest_2s_2d(x1, x2 <, alpha>) % % The paired-sample Kolmogorov-Smirnov test is a statistical test used to % determine whether two sets of dat...
7c1d9be2d9dc0db1c8ff347f5fd107f28d51f90463740bf57a9f90fbf041de15
MATLAB
3,633
73
%% Ordered probability matrix (Pairwise temporal ordering) % This section computes the ordered probability matrix % from spike trains across trials. % x2_nMat : number of times neuron i fires AFTER neuron j % x2_n0Mat : total comparable spike pairs (excluding ties) x2_nMat = zeros(n_ne); x2_n0Mat = zeros(n_ne); ...
0a3b933327f93b86ff66e8189144446d39ac2f4f78210328f5daad8a99bede0c
MATLAB
3,634
94
% dipfit_erpeeg - fit multiple component dipoles using DIPFIT % % Usage: % >> [ dipole model EEG] = dipfit_erpeeg(data, chanlocs, 'key', 'val', ...); % % Inputs: % data - input data [channel x point]. One dipole per point is % returned. % chanlocs - channel location structure (returned by ...
04a105c7ffb981ce322544c7dfa48c15ca9710fcc9586982b9a0ce164df5d5a3
MATLAB
3,637
94
function varargout = add(tree,uid,type,parameter) % XMLTREE/ADD Method (add childs to elements of an XML Tree) % FORMAT vararout = add(tree,uid,type,parameter) % % tree - XMLTree object % uid - array of uid's % type - 'element', 'chardata', 'cdata', 'pi' or 'comment' % parameter - property name (a char...
4da613c669ca8fefdefcb40a320ab8b06cff0c52b309460c7b14f5c93604fc70
MATLAB
3,637
123
classdef HBoxFlex < uix.HBoxFlex %uiextras.HBoxFlex A dynamically resizable horizontal layout % % obj = uiextras.HBoxFlex() creates a new dynamically resizable % horizontal box layout with all parameters set to defaults. The % output is a new layout object that can be used as the parent for ...
e9add03d73e226f970c938f589c1c7b1b19d54baabe8a4d34447c00a43c2e131
MATLAB
3,637
123
classdef VBoxFlex < uix.VBoxFlex %uiextras.VBoxFlex A dynamically resizable vertical layout % % obj = uiextras.VBoxFlex() creates a new dynamically resizable % vertical box layout with all parameters set to defaults. The output % is a new layout object that can be used as the parent for other...
fa159e4589e528772078292f0e599e31177a1876f75b377441d7e6dabd049423
MATLAB
3,638
93
function series = fgn_sim(n, H) % Generate Fractional Gaussian Noise (FGN) time series % inputs: % n (integer): Desired length of the series % H (real number): Hurst exponent for the output series (0 < H < 1) % % outputs: % series: Real-valued time series of length n with Hurst ...
2639073f623f657b9e0e91364ee1df8bbc375928c1a5246a3a05f16fbf9945de
MATLAB
3,641
113
% entropy_rej() - calculation of entropy of a 1D, 2D or 3D array and % rejection of odd last dimension values of the input data array % using the discrete entropy of the values in that dimension % (and using the probability distribution of all columns). % % Usage: % >> [entropy...
902ac59b8a8552fca548d7769c8ad95e32a137fefa2ca03c04bed71bf21f7795
MATLAB
3,641
113
function [cY,mY,ng] = motion_metrics(Y,bnd,batch_size,var_name) % computes several metrics for the quantitative assessment of the registration % INPUTS % Y: registered time series in a loaded or memory mapped array % bnd: number of pixels to be exluded to avoid NaN effects % [x_...
ac77fd51e094f0a2a1222204f104847c7dca4792f0b21cf689d1e37704fa1c05
MATLAB
3,642
111
% % simple flow from genotype to RC/non-RC % figure('Name','sankey demo1','Units','normalized','Position',[.05,.2,.5,.56]) % links={'WT','RC',29;'Mutant','RC',2;'WT','Non-RC', 78;'Mutant','Non-RC',30}; % SK=SSankey(links(:,1),links(:,2),links(:,3)); % SK.ColorList=[0.0, 0.7, 0.0; % 0.8, 0.0, 0.0; % 0.0, 0.0, 1....
f767dd600c79d94de2ee3a94d7d7415e9e60cead345fa068ce9cf6e0c8b713b2
MATLAB
3,642
119
function [y,yi,subim1loc,im1loc]=positionMask2d(mainParms,subParms,mainIm,subIm) % Usage ... y=positionMask2d(mainParms,subParms,mainIm,subIm) % % mainParms=[xSize,ySize,xFOV,yFOV,x0loc,y0loc] % subParms=[xSize,ySize,xFOV,yFOV,x0loc,y0loc] % % Ex. positionMask2d([],[],im1) if length(mainParms)<6, if length(mainParms...
c2fb7fe2ab6465ac5a97fe4d7409c1061650636d82b91ec5664ef7e2abfc21ba
MATLAB
3,643
123
function plywrite(filename,faces,verts,varargin) % plywrite(filename,faces,verts) % Will write a face vertex mesh data in ply format. % faces -> polygonal descriptions in terms of vertex indices % verts -> list of vertex coordinate triplets % faces and verts can be obtained by using the MATLAB isosurface function....
a228035f68c1fe7ef530a3c4a328479b6bde8be97aaf7b92423611f1de682b36
MATLAB
3,644
117
% interface program for batch program % % Author: Marco Reisert % PC 2010 function out = dti_tracking_global_ui(P) h = findobj(0,'tag','fiberGT_main'); if ~isempty(h) delete(h); end; if isfield(P,'temp') %% GT accum fiberGT_tool('loadFTR',P.filenameFTR{1}); ftr = fiberGT_tool('createEFTR',P.numi...
63cce6265b9fe0c8ae3d8eff433dfc7ed76ba3a14f25a1fc4e7f190fa90c4142
MATLAB
3,645
148
function [tuning_curve theta ang_hd mr u2] = PolarMap(self,variableName,root,varargin) % [tuning_curve theta ang_hd mr] = PolarMap(self,root,'x') % % Tuning of the user defined variable as a function of a polar variable. % % Inputs: % root - The CMBObject that we lie within (CMBHOME.Session) % % variableName - Whic...
d3d586d9b9507bef318c048b94c906f000c4eec74ff1c11948eb93629278b4a6
MATLAB
3,645
87
function ea_get_probab_axon_state_for_multisource(results_folder,damaged_as_activated) % Estimate probability of axon activation based on a sweep of parameters % special case for multisource probabilistic PAM % (e.g. fiber diameters). % By Butenko and Li, konstantinmgtu@gmail.com arguments results_folder ...
109a491cc6d6acc16b75ebf16d2c03daed2c6200428e6050bc73fb9e07fcffe2
MATLAB
3,648
142
% Script that carries out cross-correlation analyses shown in Figure 5: % NB apical area vs NC transcription levels and % NC apical area vs NC transcription levels close all clear all %% load data load("combined_data_for_correlationsNEW.mat") maxLagMinutes = 23; analysis_number = 3; % 1 is NB area vs SC Intensity ...
e99349e7b4eb5466d9f21fcacd616b6dde62f823d58a4f6ce19c3bc36fbbbb35
MATLAB
3,649
95
%% params nChTopo = eval(['nCh', topoArea]); coherencespctrm = eval(['coherencespctrm_topo', topoArea]); if strcmp(topoArea, 'AC') posIndex = 1; else posIndex = 2; end %% time-frequency figure; plotSize = mu.autoplotsize(nChTopo); for cIndex = 1:nChTopo mu.subplot(plotSize(1), plotSize(2), cIndex, "paddin...
82e90080beefd19259bfba68f0d984079a8ed58736aebee513725bb66db5612e
MATLAB
3,650
100
function ResampleBinary(inputName,outputName,nChannels,up,down) %ResampleBinary - Resample binary data file. % % Resample binary data file, e.g. create LFP file from raw data file. % % USAGE % % ResampleBinary(inputName,outputName,nChannels,up,down) % % inputName binary input file % outputName binar...
da2163c0a865a799155eaf0844dadb67aa7943014181b14d21ad8c39e97cafc8
MATLAB
3,650
154
function h=ellipse(ra,rb,ang,x0,y0,C,Nb) % Ellipse adds ellipses to the current plot % % ELLIPSE(ra,rb,ang,x0,y0) adds an ellipse with semimajor axis of ra, % a semiminor axis of radius rb, and an orientation of the semimajor % axis with an angle of ang (in radians) rotated counter-clockwise % from the x-axis. The el...
7a9331992cc2f4160bd6c2034ecdaf632e240a1a37040330b166d19e45dfe36d
MATLAB
3,651
69
function [S,f,R,Serr]=mtspectrumtrigpt(data,E,win,params,fscorr) % Multi-taper time-frequency spectrum - point process times % % Usage: % % [S,f,R,Serr]=mtspectrumtrigpt(data,E,win,params,fscorr) % Input: % data (structure array of one channel of spike times; % also accepts 1d column ve...
018bcd5a3bc9cc11f7614092dd39b0599357d288bf6bd624ab3fada7fb54bece
MATLAB
3,653
99
function ccfs = clustering_coefficients(A,varargin) % CLUSTERING_COEFFICIENTS Compute the clustering coefficients for vertices. % % ccfs = clustering_coefficients(A) returns the clustering coefficients for % all vertices in A. The clustering coefficient is the ratio of the number % of edges between a vertex's neighbor...
40d66efd09b5c90dd0cde2e8be02395a93938dc9b0a6ebf74d11e8f09041e36d
MATLAB
3,653
112
function clustered = CBIG_IndCBM_generate_MSHBM_params(lh_profile, rh_profile, lh_labels, rh_labels) % clustered = CBIG_IndCBM_generate_MSHBM_params(lh_profile, rh_profile, lh_labels, rh_labels) % % This function can generate parameters used in MSHBM algorithm for a given % group-level parcellation with average profil...
7da3581d63906effebc93b00c26b8e891c7be95e3d8a1479e071d016bae2dca9
MATLAB
3,653
94
function [trace_stamp, trace_num, ttlabel, tracetype] = pooltrace(handles) trace_stamp = []; trace_num = 0; tracetype = []; ttlabel = []; if handles.plotRawdff == 1 if ~isempty(handles.cfeature_dff) trace_stamp = cat(2, trace_stamp, handles.cfeature_dff); for i = 1:size(handles.cfeature_df...
e8905064f0c60766dba4542db96a2e430d3ce6b5537b37962efab9ad72396c10
MATLAB
3,654
104
function [chosenfluor,chosenROIs,chosentemps,chosenFrameRate,chosenIndex]=compare_tuning_old(headpath,savemode) %give the headpath (genotype) go to the extracted folder %bring up the different ROIs for each %let the user select which ROI they want to use as the one to compare for %THAT fly %take the dff for those - an...
94a340b317b1511171447f47a525439e96fb77c4a2c7d1bf68e77303462348ad
MATLAB
3,659
21
%% createColorImage (RGB) from colormap and indexed image % % Andreas Husch % Centre Hospitalier de Luxembourg, Dept. of Neurosurgery / % University of Luxembourg - Luxembourg Centre for Systems Biomedicine % 2009 - 2017 % mail@andreashusch.de, husch.andreas@chl.lu function image = createColorImage(rawImageData, myCol...
bbaba9439e27d315890bc65d62a9b47de5760e2e0082a2e1e3d29444d62a0718
MATLAB
3,659
123
%% clc clear all close all set(0,'defaultfigurecolor',[1 1 1]);% set figure background color % set parameters % input parameters % subjs = {'S01' 'S02' 'S03' 'S04' 'S05' 'S06' 'S07' 'S08' 'S09' 'S13' 'S15' 'S16' 'S17' 'S18' 'S19' 'S20' 'S21' 'S22' 'S32' 'S36' 'S37' 'S38' 'S39' 'S40' 'S41' 'S42' 'S43' 'S44' 'S45' 'S...
e25563b493e029204344f2880fde10e8a5a4493c0d8f246d4795e68f979b3e70
MATLAB
3,659
81
% std_renamestudyfiles() - rename files for design 1 if necessary. In design % 1, for backward compatibility, files could have % legacy names. For consistency these files now % need to be renamed. Note that the STUDY is % ...
a3bf9cd34a8e492dcd91ac84ce9ca719525adfe1dcef4c297956cf8e0bdcdbd9
MATLAB
3,660
73
function [dS,f]=mtdspectrumc(data,phi,params) % Multi-taper frequency derivative of the spectrum - continuous process % % Usage: % % [dS,f]=mtdspectrumc(data,phi,params) % Input: % Note that all times can be in arbitrary units. But the units have to be % consistent. So, if E is in secs, win, t have to be i...
139ff0a1ae1010b027cd9d58448176dea8293f9852b7ab6ed623235f3106c505
MATLAB
3,662
95
% Copyright(c) 2011 - 2018 Thermo Fisher Scientific - LSMS % % Permission is hereby granted, free of charge, to any person obtaining a copy % of this software and associated documentation files (the "Software"), to deal % in the Software without restriction, including without limitation the rights % to use, copy, modi...
226bc9837fe95caffcdeb554878ae2aa01a34f1ac8d06dce770cd0771a363297
MATLAB
3,662
93
function FV2=ea_smoothpatch(FV,mode,itt,lambda,sigma) % This function PATCHSMOOTH smooths a triangulated Mesh, with accurate % curvature flow smoothing, or laplacian smoothing with inverse vertice % distance based umbrella weights. % % FV2=smoothpatch(FV,mode,itt,lambda,sigma); % % Inputs, % FV : A struct con...