sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
55dad33c7664bad28d6c29b79ccf4791444804e9aad25d8c91124a55e9ed3a21
MATLAB
4,625
145
function [BCMatrix, BCRHS] = boundaryConditionRadial2D(BC) % It creates the matrix of coefficient based on the BC structureprovided % by the user. It also generates the right hand side vector of the linear % system of equations % % SYNOPSIS: % [BCMatrix, BCRHS] = boundaryConditionRadial2D(BC) % % PARAMETERS: % % % RE...
8f2ae875a06d5219b258c8376797f16ca9ac5f6145acf88832f0f373fee21a8e
MATLAB
4,627
125
function [select] = parameterselection(param, data) % PARAMETERSELECTION selects the parameters that are present as a volume in the data % add that have a dimension that is compatible with the specified dimensions of the % volume, i.e. either as a vector or as a 3D volume. % % Use as % [select] = parameterselection(...
ab76846abc0770b16face3c456eec9f623f5c6ddb55e43927a68e12eb651f3e2
MATLAB
4,628
147
function out = IN_AutoMutualInfo(y, timeDelay, estMethod, extraParam) % IN_AutoMutualInfo Time-series automutual information % % ---INPUTS: % % y: input time series (column vector) % % timeDelay: time lag for automutual information calculation % % estMethod: the estimation method used to compute the mutual informat...
3b7155212402e12584f64ddd969821f43751b01ad5f38121c25a8c602bfd0064
MATLAB
4,629
101
function task_footprint_GA(sii, PATH, cfg, fieldNames) % Add task description here % - sii: vector of subject IDs to be processed % - PATH: structure with all paths leading to diff processing steps % generated in naj_neurCorGait_paths % - cfg: structure with all processing variables generated in naj_neurCorGa...
8b8c435f2163b4fd4ac312aea1b6f387e6c86e32817e7dd4569893af5718f035
MATLAB
4,629
149
% Example function to demonstrate surface-based voxel selection. % % This function uses two surfaces (pial and white matter, from Freesurfer) % to define circular regions of approximately 50 voxels using a geodesic % distance measure. % % This function is aimed at the ''fingerdata' dataset % % NNO Feb 2011 %%%%%%%%%%...
6181ca94623e7a87955dfcd012c19c6d4315bacfd4e6489fab794d94aec224cf
MATLAB
4,632
109
function [event_times,calcium_duration,onset_delay] = align_behav_to_calcium(paq_path,event_table,event_times,tag_duration,varargin) event_fds = {}; data_type = []; pad_name = ''; Fs = 1; sub_session_length = Inf; for v = 1:numel(varargin) if strcmpi(varargin{v},'event_fds') event_fds = varargin{v+1}; ...
e64efc35e98094050b28ece9bb50fe665739a2c81d26ac67d14b0cd75703f7a0
MATLAB
4,634
145
% Bang et al (2020) Private-public mappings in human prefrontal cortex % % Reproduces Figure 4-figure supplement 2 % % "Private confidence" is computed by training multinomial regression on % data from prescan session and then applying weights to data from fMRI % session while setting context weights to zero % % Visual...
58f8bf5c4d309af1972953d265d28841ec5c880e755d9810a59f98279dde379b
MATLAB
4,635
130
function data = loadData_mat(dwifile,gradfile_dummy); data = []; if not(exist('dwifile')), [files path] = uigetfile({'*_HARDI.mat', 'All accepted filetypes';'*.*','All files'},'Select HARDI data to open'); if files==0, return; end; dwi...
eacd6f887e8b4bb80b50774e443d8609a8e1233d3955a54b729ddf25840d99ea
MATLAB
4,635
134
%function ch2roi_selFreq(params, groupInfo) % groups channels into defined ROIs (anatomic areas), averages & plots % based on the following criteria: % - selected anatomical areas (groups) % - selected freq. band % - significance (difference of conditions, from baseline (TO DO), or all) % settings (subjects, dire...
1ca17ca7b2db348d26bfb39f4d10bc2fb7114b90e7958eac70e7a8374258fa3a
MATLAB
4,636
92
function [S,f,varS,C,Serr]=mtspectrumsegc(data,win,params,segave) % Multi-taper segmented spectrum for a univariate continuous process % % Usage: % % [S,f,varS,C,Serr]=mtspectrumsegc(data,win,params,segave) % Input: % Note units have to be consistent. See chronux.m for more information. % data (single channel) -...
3cce70a8eb7fa0fc06c9d89b6b7b76b5f4c9962fe8c5d085b48a9c11fab02b99
MATLAB
4,638
108
function [varargout] = likWeibull(link, hyp, y, mu, s2, inf, i) % likWeibull - Weibull likelihood function for strictly positive data y. The % expression for the likelihood is % likWeibull(f) = g1*ka/mu * (g1*y/mu)^(ka-1) * exp(-(g1*y/mu)^ka) with % gj = gamma(1+j/ka), mean=mu and variance=mu^2*(g2/g1^2-1) where mu...
9842e3c9e135f3f04b3ffb3782cd29fc07187c46de953588bb2dcf57b9cef2e8
MATLAB
4,639
151
%% %%%%%%%%%%%%% Create views in ITK-SNAP % subj01. % anterior, right, inferior is the corner that matches 1mm and 1.8mm % % from center of first voxel (1,1,1) in 1mm, we achieve correspondence every +9 1mm slices or +5 1.8mm slices. (.,24,.) 186 - 162 = 24 162 is 9*18. 104 - 162/1.8 = 14 (.,.,73) for 1mm is good 1...
2468c5ec2664d4e21ce2b24011d68d4d37ec61e1e835d19a16690b77b7846450
MATLAB
4,640
115
disp('See http://www.gaussianprocess.org/gpml/code/matlab/doc/ for details.') disp('Wait 10s, then continue...'); pause(10) disp(' '); disp('clear all, close all') clear all, close all write_fig = 0; disp(' ') disp('n1 = 80; n2 = 40; % number of data points from each class') n1 = 80; n2 = 40; disp('...
27aa88375f044e3d7462b3624760f1fa7e59e0bb7a7c004538aab8b142509604
MATLAB
4,641
108
clc;clear;close all; %% DataManager = FileManager; dataset_name = 'Lightfield'; stack = 'Zhang2020'; segmentation_version = 'auto'; raw_data_folder = DataManager.fp_raw_data_folder(dataset_name, stack); mask_folder = DataManager.fp_mask_folder(dataset_name, stack, segmentation_version); graph_folder = fullfile(DataMana...
71bcbb2dd2e9be9dc33f89245a3dea29947e5311bcaa8d3b06e74d7b184a53f3
MATLAB
4,641
139
function plotNetMetNodeCartography(combinedData, ExpName, Params,HomeDir, figFolder, oneFigureHandle) % Plots network node cartography of individual recordings % Parameters % ---------- % combinedData : struct % structure with fields of the different groups (eg. genotypes: % combinedData.WT, combinedData.KO, .....
ddef6ddb22ac3b550d2cbde6b15ee14896a783d79068204c7f1efe0d1cfcda20
MATLAB
4,643
119
function [cfg] = expDesign(cfg) % % This function and its companions creates the sequence of blocks (static/motion) % and the events (the single directions) for MT+ and MT/MST localizers. % % The conditions are consecutive static and motion blocks (fixed in this order gives % better results than...
0a26258929eca79713c0c798f8f5c69cde7ec015f222b30afb6f04bfc6d31c04
MATLAB
4,645
160
%% %%%%% DERIVE CANONICAL PCS %% %%%%% [avg across stimuli, select good R2, aggregate across subjects, %% %%%%% unitlength normalize, cross-validate to decide 3, derive 3 from all data] % setup nsdsetup; % load the GLM SIMPLE results for all 8 subjects clear a1 a2; for p=1:size(sessmatrix,1) ppdir = ppdirs{sessma...
15247be125805e139b6155c7c549f3df0892e21cc172c3f8d75c734165aea888
MATLAB
4,647
123
function out = CO_CompareMinAMI(y, binMethod, numBins) % CO_CompareMinAMI Variability in first minimum of automutual information % % Finds the first minimum of the automutual information by various different % estimation methods, and sees how this varies over different coarse-grainings % of the time series. % % The fu...
cc5e2603674dfaa6bfc994c05d6d276da401ca75e24ce585faadc0caffb6c856
MATLAB
4,650
147
function out = FANSI_4sepia_v3( phase, magn, alpha, options ) % FANSI wildcard function. This may be used to call the included functions % globally, for a simplified use. % % Parameters: % phase: local field map data % magn: magnitude data % alpha: gradient L1 penalty, regularization weight % options (structure with o...
a8963292e4051190ff8d11cda280db8c771879606c83f07f4dbacbf2fd46ef96
MATLAB
4,651
114
% Script demo_realign % Shows realignment for n-dimensional data with different scenarios of 4D % subsets feeding into estimation, and parameters applied to other subsets, % e.g. % - standard 4D MrImageSpm realignment, with or without weighting of % particular voxels % - multi-echo data, 1st echo realigned, app...
747a60e63ea73e653b9998d497d44a729bdf83228857c4c774c5d3295f94f77a
MATLAB
4,652
130
function out = CP_WaveletVarChg(y, wName, level, maxnchpts, minDelay) % CP_WaveletVarChg Variance change points in a time series. % % Finds variance change points using functions from Matlab's Wavelet Toolbox, % including the primary function wvarchg, which estimates the change points in % the time series. % % ---I...
1b6048526da6133ebd2d5c75c7f007ba9b39813b6a0bc484ecda84231a610c6a
MATLAB
4,654
99
function [numPCs, not_converged, score, sd_score, latent, sd_latent] = parallelAnalysis(prefix, basedir, datafolder, resultsfolder, slices, spv, perm, maxiter, truncate) %PARALLELANALYSIS compares IAAFT generated surrogates to fMRI timeseries %data to determine a number of principal components in a region outside the...
45dee5a95a8e407d3096d41781f223733ecf5ad1b2c0d107003b679860202bb6
MATLAB
4,654
123
function SU = makeHeatmat(SU, S, behEvents, wndw, bins, varargin) % input % SU struct % S struct % behEvents struct % wndw = [-2,4] usually % bin = 0.05s usually % varargin = include raster or not if nargin<5 bins = 0.05; end %side LED on sideEvents = {S.Lled(:,1) S.Rled(:,1) S.l_opt(:,1) S.r_opt(:,1)}; %pull ti...
39f713f385523f0d66e9d870349e1c4106c189230cab7018a28a676863b696c3
MATLAB
4,656
144
%% Run an optimization on certain parameters with the 1-sided, systemic model % MJC 5/27/2021 clear all; %close all; clc; ! make clean -f Makefile ! make -f Makefile ! chmod +x sor06 %% Define the inflow % load('allparam_unweight1.mat'); % opt_values = x.*sc; % inflow_param = opt_values(:,1:12)'; Qdat = dlmread('DP...
0283b2ebfdf38fa0fd2edda184c3baee917f9dc8e7be811f7fd6432ca9d732df
MATLAB
4,660
129
function outputImage = kfilter(this, filterType, applicationDimensions, varargin) % Filters by multiplication of a specified window function in k-space % % Y = MrDataNd() % outputImage = Y.kfilter(filterType, applicationDimensions) % % This is a method of class MrDataNd. % % IN % filterType string of filter to b...
b6740b1f66bab790ddb5104fc06f23a3e1ff35ef502c0aa848b85a8e8ee38045
MATLAB
4,663
109
function [varargout] = likGamma(link, hyp, y, mu, s2, inf, i) % likGamma - Gamma likelihood function for strictly positive data y. The % expression for the likelihood is % likGamma(f) = al^al*y^(al-1)/gamma(al) * exp(-y*al/mu) / mu^al with % mean=mu and variance=mu^2/al where mu = g(f) is the Gamma intensity, f is...
1d90854ae4872eb23892a35a1fd5c7bebc809c02e6ba39e785a646f9b17f94e5
MATLAB
4,664
132
function [J,h,func_evals,f_0]=jacobiansimple(func,x,varargin) % SIMPLE JACOBIAN CALCULATION % % evaluates the jacobian of a function func at point x. It respects % bounds, can accept a baseline evaluation (e.g. f_0=func(x)), and % will provide it for further evaluations to speed up computations. % Fu...
bbdb019701c0b4e399736861f435248651a4c47fd4e03e547cb6018b1464beda
MATLAB
4,665
199
function [efs,F,cdfs,p,eps,dfs,b,y2,sig,mses,msss,partial_eta_squared,effectname]=repanova(d,D,fn,gg,alpha,display_results) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [efs,F,cdfs,p,eps,dfs,b,y2,sig,mses,msss,partial_eta_squared,effectname]=repanova(d,D,fn,gg,alpha); % R.Henson, 17/3/03; rik.henson@mrc-cbu...
306887dfda8ecebf1138e5599b26889dbe6ee6fd003d07fcb7af013a737f4379
MATLAB
4,666
119
function tests = tapas_physio_filter_cardiac_test() % Tests whether bandpass filter on PPU example data works as expected % % tests = tapas_physio_filter_cardiac_test() % % IN % % OUT % % EXAMPLE % tapas_physio_filter_cardiac_test % % See also % Author: Lars Kasper % Created: 2019-07-02 % Copyright (C) 2019 T...
b3bf05d29713bf7a4afabecf939c3142e5a36122eb4287f684690f93e8e9faf0
MATLAB
4,667
127
function step5RunRFX(maps, funcFWHM2Level) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % maps = 'beta'% 't_maps'; % funcFWHM = 0 % 2; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % addpath(fullfile(fileparts(mfilename('fullpath')), '..')); % initEnv(); opt = getOptionSearchlight(); i...
1859780247bec603e34062e35cc34bd9fe67762cd806b62f724916b3538945eb
MATLAB
4,668
143
function [g_val, err_gain, r_gain] = fit_gain_change(x0,y0,x1,y1,varargin) ip = inputParser(); addParameter(ip, 'interp_method', 'linear', @(x)validateattributes(x,{'char'},{'nonempty'})); addParameter(ip,'normalize_error',false, @(x)islogical(x)); addParameter(ip,'normalize_x', false, @(x)islogical(x)); addParameter(...
1340c2a382b18a9b6710a0231bd52d18987ea39d920abd6e96ae7a98e8e08318
MATLAB
4,669
128
function [header,tracks] = trk_read(filePath) %TRK_READ - Load TrackVis .trk files %TrackVis displays and saves .trk files in LPS orientation. After import, this %function attempts to reorient the fibers to match the orientation of the %original volume data. % % Syntax: [header,tracks] = trk_read(filePath) % % Inputs: ...
6c1bd5a735519ae314c746bd9b06f083f35290ea114369d72fb1166e50a4046e
MATLAB
4,671
122
%% AlignEvent % Align spike data on a specific event, compute Z-score, and save into <aligned> folder %% PARAMETERS TIMEWINDOW_LEFT = -2000; %(ms) TIMEWINDOW_RIGHT = +2000; %(ms) TIMEWINDOW_BIN = 50; %(ms) numBin = (TIMEWINDOW_RIGHT - TIMEWINDOW_LEFT)/TIMEWINDOW_BIN; % number of bins %% Select Unit data (.mat) path ...
91762a6d1fd1392d4e7469199c5568eeda0f80788ebb9172015ce4baa23b75c7
MATLAB
4,671
113
function [cpulse, verbose] = tapas_physio_get_cardiac_pulses_auto_matched(... c, t, thresh_min, minPulseDistanceSamples, verbose, ... methodPeakDetection) % Automated, iterative pulse detection from cardiac (ECG/OXY) data % (1) Creates a template of representative heartbeats automatically (as % deprecated *...
c818db133d9a1b3bf0463b63afe95c8b16e235161eb997ed23cf57bde4ce6c08
MATLAB
4,671
126
function [spectrum,f,s] = MTPointSpectrum(times,varargin) %MTPointSpectrum - Compute point process spectrum by multi-taper estimation. % % The spectrum is computed using the <a href="http://www.chronux.org">chronux</a> toolbox. % % USAGE % % [spectrum,f,s] = MTPointSpectrum(times,<options>) % % times ...
7c787c30288f6a3e26f5f300672da034993c78caf63019f8f4befaa45c9a0f72
MATLAB
4,672
137
function angdataw=angtimewarp(evLatency, newLatency, angdata) % ANGTIMEWARP - Given two event marker vectors, computes a % warping of the input angular time series so that its % evlatencies match newlatencies. Values of the warped % timeserie that falls between two frames...
182658322048afe1ba600254dfd11624926e57a85c922fd1cafe3a82eb539069
MATLAB
4,675
169
function [ regional_metrics , regional_labels] = nmri_regional_values( full_metrics, ref_surf, opt) %[ regional_metrics ] = nmri_regional_values( full_metrics, ref_surf, opt ) % Will resample a full brain e.g. SUMA surface (1 value/vertex) metric % into a regional metric (1 value / region) % the regional informat...
22e5820c44b8828677e4c81a2f55627427b4adf6f36b024789873a10cc5135c3
MATLAB
4,683
126
%% predicted clear; mypath = '/Users/bo/Documents/data_liujia_lab/analysis_liuP1_greeble'; sub_pool = {'01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20'}; % sub_pool = {'11', '12', '13', '14', '15', '16', '17', '18', '19', '20'}; cur_struct = MRIre...
470339e9ff6ac2cd59c30f0a6afc798746693421d2603f2c0cb0c7424e881e8b
MATLAB
4,683
114
function problem_critpt = criticalpointfinder(problem) % Creates a Manopt problem whose optima are the critical points of another. % % problem_critpt = criticalpointfinder(problem) % % Given a Manopt problem structure 'problem', this tool returns a new % problem structure, 'problem_critpt', such that the global optima ...
b717554765ace2392c3181759ed29ae3ae70e060336b4791dd56d5012681dd24
MATLAB
4,683
139
function [result] = fit_happy_model_responsibility(mtx,happyscore,constant) %assumes that each row of the cell array is a different subject rptfit = 5; %repeat N times jittering the betas tempf=fieldnames(mtx); for n=1:length(tempf), eval(sprintf('mtx.%s=double(mtx.%s);',tempf{n},tempf{n})); end; data = mtx; data.hap...
6f6a143a4ed7be7c92616407b47309a685a29dad4a314d7baab4d03a77cfa7f0
MATLAB
4,689
89
function osp_onQuant( ~, ~ ,gui) %% osp_onQuant % Callback function on quantify button click. % % % USAGE: % osp_onQuant( ~, ~ ,gui); % % INPUT: gui = gui class containing all handles and the MRSCont % % OUTPUT: Changes in gui parameters and MRSCont are written into the % gui ...
cd3addb6fd5f46dc116d147a727e2a6c5c7501864bbde9a4c0c568e3ff138291
MATLAB
4,689
185
function OUT = citation_mca(file) % OUT = citation_mca(file) % Citations are output from Endnote in APA 5th format % Save as MS-DOS text % example: 'citation_list1.txt' % % Multiple people with the same name, e.g., Zhang, are not counted % correctly! % read text file s = textread(file,'%s','delimiter',',\n'); % find ...
f3ddfdb494f2119ee054194d995108ef8fd7634f5b2acf7a05091cfa400698ce
MATLAB
4,689
120
function tapas_hgf_categorical_plotTraj(r) % Plots trajectories estimated by fitModel for the hgf_categorical perceptual model % Usage: est = tapas_fitModel(responses, inputs); tapas_hgf_plotTraj(est); % % -------------------------------------------------------------------------------------------------- % Copyright (C...
16840ebc7824e8a9db979045737ae9b62b7aa68cbd5f1277481e7dcdd37dd2c8
MATLAB
4,690
150
function allenMapPolyCentered(dorsalMaps, bregma, side, colorFill, scaleBar, hAx) % allenMapWithLabels(dorsalMaps [, side] [, colorFill] [, scaleBar]) % % Produce a dorsal-view Allen atlas map using polygons instead of an image % (as allenMapWithLabels.m does). % % Input "dorsalMaps" should be from allenDorsalMap.mat....
7b43317e2200bdaecd98b28f31476f1e9c5cc0a11db472ce8370f8bc0dd4cabc
MATLAB
4,691
125
function [peaks,majorpower]=fft_neuron(imageprofile,filename,timeinterval) %% to run: imageprofile=double(imageprofile); ll=length(imageprofile); cinfo=strrep(filename,'.tif','_output/'); [~,savename,~]=fileparts(filename); %colorofcurve = 'r'; %scrsz = get(0,'ScreenSize'); %figure('Position',[scrsz(3)*...
c84a86d7fbeb17f7289d435aa8953b964026d74cb179537f5a4640ccd3d20882
MATLAB
4,692
153
function s = mfileparse(mfile, mdirs, names, options) %MFILEPARSE Parsing of an M-file to obtain synopsis, help and references % S = MFILEPARSE(MFILE, MDIRS, NAMES, OPTIONS) parses the M-file MFILE looking % for synopsis (function), H1 line, subroutines and todo tags (if any). % It also fills in a boolean array indi...
ca1a85243b7750eac9c347bd65cb002cbe5f3024d26f2f2931e2066038931d29
MATLAB
4,692
138
function [result] = fit_happy_model_responsibility_redux(mtx,happyscore,constant) %assumes that each row of the cell array is a different subject rptfit = 5; %repeat N times jittering the betas tempf=fieldnames(mtx); for n=1:length(tempf), eval(sprintf('mtx.%s=double(mtx.%s);',tempf{n},tempf{n})); end; data = mtx; da...
56fee600ebf51c5ff412942edcabc293f2126b03b25f14350978c8137235df4f
MATLAB
4,694
142
%% %%%%%%%% Organize the data % manually organize dicom directories % quick check of directory sizes du -s ~/nsd/rawdata/*stru*/dicom/* %% %%%%%%%% Prepare some templates % get MNI152_T1_1mm templates cd /opt/local/fsl-5.0.7/fsl/data/standard rsync -av MNI152_T1_1mm* /home/stone/generic/Dropbox/nsddata/templates/ ...
7b718b88f0cc12eae1a494b7171981421cb36e1ab0bfdb65f4c0c2c2e519fb8b
MATLAB
4,694
96
%% This document shows how fsaverage-defined ROIs are converted to individual-subject %% surface ROIs, and then how those individual-subject surface ROIs are converted %% to the anat0pt8, func1mm, and func1pt8mm spaces. % First, we will take various ROIs defined on fsaverage and transfer these ROIs % via nearest-neig...
32db9fca7fc9371e6e78b9dd5c701f2953cbde1f9fffc6d270bcf6ff9bd5582c
MATLAB
4,695
155
binwidth = 10; % ms range = [2000 3000]; % ms for data = 1:2 if data == 1 load('dataOKT03901') else load('dataOKT04906') end [bb,aa] = butter(3,5/(TQsRate/2),'low'); fTQ = filtfilt(bb,aa,TQ); % dfTQ = diff(fTQ); % fdfTQ = filtfilt(bb,aa,dfTQ); ...
f3fe6837e1604b9f8389317ec73df288aa973d551cc7b15b26a58cf229bd44ec
MATLAB
4,695
110
%% TestBFRMatrixPhantom - Tier 2 synthetic-phantom background-field-removal method regression matrix % % Mirrors TestQSMMatrixPhantom.m: runs the one-stop SEPIA pipeline on the % synthetic phantom once per background-field-removal method in % methodBFRName (sepia_universal_variables.m) AND per matrix size (the % same 5...
d58e2ec0c4ea9a0677df3ed0341aff49f421f87c106cadae2bb63c5046057da7
MATLAB
4,697
180
function test94() % Test for fixedrankNewGHquotientfactory geometry (low rank completion) % % Test CG scheme % This file is part of Manopt: www.manopt.org. % Original author: Bamdev Mishra, Dec. 30, 2012. % Contributors: % Change log: clc; close all; % reset(RandStream.getDefaultStream); % randnfoo = rand...
ee47aebbaf9d4fc4bca09558458c615f72a181e4da936d19677255765c293899
MATLAB
4,697
142
function varargout=detectFreezeByHMM(basename,varargin) %% load([basename '.basicMetaData.mat']) fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName) load([basicMetaData.Basename '.olfactorySpec.lfp.mat']) load([basicMetaData.Basename '.acceleration.lfp.mat']) load([basicMetaData.B...
0c4f8af99f32c419b0d466c0791200554a62b2d84e05fefec10ecad1a796990d
MATLAB
4,699
148
function [T1, PD, R1] = MP2RAGE_dictionaryMatching(MP2RAGE, INV1,INV2,B1map,varargin) % function that computes T1 and PD maps using a dictionary matching % approach. % input variables are: % MP2RAGE is a structure that should have the following fields % MP2RAGE.TR % MP2RAGE.TIs, % MP2RAGE.NZslices, % ...
1971af6cd2b7f6682caebff1bb6d8eef83407adc4063bb83b17eaf2991418928
MATLAB
4,705
126
function brain = brainVolumes_load(params, file2load, struct_plotBrain) % loads 3D brain volume (MRI, CT, anatomic areas, ...) sepcified in file2load % interpolates if different vosel size is specified % returns brain = % SPM package MUST be included in Matlab path % (c) Jiri, Nov21, Jan17 % based on: getBrainData.m ...
794780e89139873138ec70ae1dd882731a668c3a35cf8f3f3f05c7c761230aec
MATLAB
4,707
175
%% markCropBox % video annotation GUI built on top of movieAnalyser classdef verifyFlyPositions < movieAnalyser properties all_objects full_images parent_dir x_scale y_scale original_file_names end % end properties methods function a = createGUI(a) createGUI@movieAnalyser(a); a.ui_handles.f...
03a449784a72663daa64a852b67ef62a02bebad1425ab802d74675d1e6dda55a
MATLAB
4,708
97
function filename = env_translatepath(filename) % Translates platform-independent directories into a system-specific directories. % SystemPath = env_translatepath(IndependentPath) % % BCILAB supports platform-independent paths for all its scripts and IO functions, which allows for % script portability from system to sy...
4461fbdf69579e2cef5787d6d1c48367fa90c0c5487967a437839f17e7bfef17
MATLAB
4,709
143
function [unsrtR,S,srtR] = palm_competitive(X,ord,mod) % Sort a set of values and return their competition % ranks, i.e., 1224, or the modified competition ranks, % i.e. 1334. This makes difference only when there are % ties in the data. The function returns the ranks in % their original order as well as sorted. % % U...
1adb4c0fc3462a7937d84fe14224cea50a6998ffdadec6776e0a9f6e28593138
MATLAB
4,710
126
% postprocessing for all ofc data (stratified and non-stratified) %location of analysis codebase codepath = '~/projects/constantinoplelab/Analysis/'; % add code paths addpath(genpath(codepath)) addpath(genpath(codepath + "david")) addpath(genpath(codepath + "maggie")) %for saving pds correctly so illustrator can mo...
6b5ff9f9983400e3f614912bbdb2131f822bcef80bc4b8883c2e8089c4bd5a2e
MATLAB
4,710
138
%Funciona bien LC2014. %Algoritmos intuitivos que funcionan para detectar los estados de una red %asumiendo que los picos de sincronia en diferentes tiempos no tienen una %variacion enorme, esto es que el numero de celulas totales involucradas en %los picos no varie de 4 a 100 por ejemplo. En dichos casos el S_index e...
2802d87a1d995125edde92b781f0b251ae51ee480873c9044a2461ef43a30186
MATLAB
4,712
142
function [result] = fit_happy_model_inequalityActPass(mtx,happyscore,constant) %assumes that each row of the cell array is a different subject rptfit = 5; %repeat N times jittering the betas tempf=fieldnames(mtx); for n=1:length(tempf), eval(sprintf('mtx.%s=double(mtx.%s);',tempf{n},tempf{n})); end; data = mtx; data....
a3d9c2f8f80230af7c3157202e9ec215b8a8ce6689062f3cfdb5b682796f8be0
MATLAB
4,713
104
function [deconvolved,t] = DeconvolvePETH(signal,events,varargin) %DeconvolvePETH - Compute a deconvolved version of PETH which removes the % smoothing effects of the events' autocorrelogram % % INPUTS % signal signal to find events for % events events for PETH % <options> option...
0305f706410831de0726602329489b7a1f60edd77562ec5e00d00e43129d0514
MATLAB
4,715
118
% ROBUST_KMEANS - an extension of Matlab KMEANS that removes outlier % components from all clusters. % This is a helper function called from POP_CLUST. % Copyright (C) 2006 UCSD % % This file is part of EEGLAB, see http://www.eeglab.org % for the documentation and details. % % Redistribution and use i...
b4649e1a19dc22ed83542e782304d98ae840b86e6d6ca540c084e87440e36b57
MATLAB
4,715
141
function M = symfixedrankYYcomplexfactory(n, k) % Manifold of n x n complex Hermitian pos. semidefinite matrices of rank k. % % function M = symfixedrankYYcomplexfactory(n, k) % % Manifold of n-by-n complex Hermitian positive semidefinite matrices of % fixed rank k. This follows the quotient geometry described % in S...
bcaea42ca516ef7584ce6bba355198386cf0a4ba537557fe3a58b5ed63c155c0
MATLAB
4,715
129
function [coeff,local] = CV(timestamps,varargin) %CV - Compute coefficient of variation for a point process. % % Three alternative measures can be computed: regular CV, CV in operational time % (Gestri and Petracchi, 1970; Nawrot et al., 2008) or CV2 (Holt et al., 2006). % % While the CV is typically computed for cons...
dfe633a721fa0a1d5143df5217418174558831152052c1ad580748a20ef4ebaa
MATLAB
4,715
154
function [t_aligned, t_21, v_21, t_9, v_9] = extract21PointsFromPeaks(loc, volt, fs, num_points, varargin) p = inputParser; addRequired(p, 'loc', @isvector); addRequired(p, 'volt', @isvector); addRequired(p, 'fs', @isscalar); addRequired(p, 'num_points', @isscalar); addParameter(p, '...
7a983b2586c97be6f05bc777bd6ed81959fee5e9c302cdad8583f59ab99df1e0
MATLAB
4,718
121
function plotEigenvaluePostHoc(data, behavior, toi, significantResults, outputFolder) uniqueAges = unique(behavior.Age); uniqueGroups = unique(behavior.Group); data = permute(data, [1 3 2 4]); % subjects × components × epochs × time [~, numComponents, numEpochs, ~] = size(data); colors = {[0 0 0], [1 0.5 0], ...
13b6dbb5e3e386f843b72f20b298d1536597b715748d06b5e478e1556a60028a
MATLAB
4,719
118
function [interpolated,discarded] = Interpolate(samples,timestamps,varargin) %Interpolate - Interpolate samples (positions, spikes, LFP, etc.) at given timestamps. % % Interpolate samples (positions, spikes, LFP, etc.) at given timestamps. As a special % case, a point process can also be 'interpolated' by changing eac...
a0ef677ca701277699cfaad2f13e77cf2feef3436308d8fd410736feec373a3c
MATLAB
4,722
124
function out = CO_Embed2_Basic(y, tau) % CO_Embed2_Basic Point density statistics in a 2-d embedding space. % % Computes a set of point-density statistics in a plot of y_i against y_{i-tau}. % % INPUTS: % y, the input time series. % % tau, the time lag (can be set to 'tau' to set the time lag the first zero % ...
17aeef410bd3984b09fffa88b23a86a665229f1948445a767f736e466c54c85a
MATLAB
4,723
126
function [tMin,fMin,tBreak1,tBreak2,tMinAll]=essential_distMinAnglePair_base(Q211,Q212) flagCheckFirstDer=true; flagUseNewton=true; %Note: requires flagCheckFirstDer=true tolMZero=1e-15; tMinAll=[]; [tBreak1,~,~,c1,m1,p1]=essential_distMinAnglePair_discontinuityDistance(Q211); [tBreak2,~,~,c2,m2,p2]=essential_dist...
94fe4477965b2fcef05639c910a9786c2acb579edeada642381e9e868a7d5b4e
MATLAB
4,724
126
function Test_fixedrankembeddedfactory() % Given partial observation of a low rank matrix, attempts to complete it. % % function low_rank_matrix_completion() % % This example demonstrates how to use the geometry factory for the % embedded submanifold of fixed-rank matrices, fixedrankembeddedfactory. % This geometry is ...
6a16ade0c3bc25feb546ab5b03922f84b42be56392cfad92694a74ae36422a53
MATLAB
4,726
95
%% create Roi which are non-overlapping % This script takes the Mt and Mst rois which are created using method2 % and removes the overlapping volume to create non-overlapping MT and Mst Rois % % Method2: % it is important to use these masks so that we identify the clusters which are not connected to other regions % h...
1171c0d86937209e042aa6303bc000ed7bf0c095beb3a443a5a9e34eb622fdd3
MATLAB
4,731
151
function Stat=clusterstat(S,partition,between) %function Stat=clusterstat(S,partition,[between]) % %PURPOSE % %To compute various intra- and extra-cluster statistics. % %INPUT % %[An argument in brackets is optional. If it isn't given or it's % an empty matrix/string, the function will use a default value.] % % S ...
3474d9db7c24f2485b51ab80a771db72af40aa4cf3ece7627b44c6621e6486ee
MATLAB
4,733
96
function [cpulse, verbose] = tapas_physio_get_cardiac_pulses(t, c, ... cpulse_detect_options, cardiac_modality, verbose) % extract heartbeat events from ECG or pulse oximetry time course % % cpulse = tapas_physio_get_cardiac_pulses(t, c, cpulse_detect_options, cardiac_modality, verbose); % % IN % t ...
0a4eef795568c12209e110b51bdc5cbaa9ecbe3d8806473764f017fb96dea1dd
MATLAB
4,734
158
function ir=icassoRindex(sR,L) %function ir=icassoRindex(sR,[L]) % %PURPOSE % %To return and/or plot a relative clustering validity index. %R-index is originally defined in Levine & Dormay (2001), %"Resampling method for unsupervised estimation of cluster %validity. Neural Computation 13(11)) and redescribed in %public...
562ea9b51479c048ce988e0adcfcb3cdf1f606dbb9a3b6e6bcbf7e5f16a22690
MATLAB
4,734
147
function coactPaper_tableS01() close all height=9.6; fontsize=6; fh=initFig('width',18.6,'height',height,'font','Arial','fontsize',fontsize); panel_01(7) drawnow() print(fh,sprintf('~/Dropbox/FearAnalyses/paper/figure/tableS01_%s.pdf',datestr(now,'yyyymmdd')),'-dpdf','-painters','-r300') end function panel_01(fs) o...
0fdb50685fe4ee173738e2646b5fbb6b62435a8017d9921ddbeca5e658e7fffe
MATLAB
4,739
132
%% Generate Figure 5d % Note: This model was trained and evaluated using raw (non-normalized) values % to preserve interpretability in millimeters %% clear; clc; set_participant_information addpath(morph_path) % Paths to change save_path = fullfile(morph_path, 'REVISION','Figure_4d'); file_path = fullfile(morph_pat...
3ae023c005338658b0532364c5b154b7c3a89729d6f823c19330a9aee0e2970a
MATLAB
4,739
122
% concatdata - concatenate data stored into a cell array into a single % array. only concatenate along the last dimension % Usage: % [dataarray len dims] = concatata(cellarraydata); % % Input: % cellarraydata - cell array containing data % % Output: % dataarray - single array containing all data %...
1e3b0132570665bad90f0d7bad92f98e2db99df77655d3ab016d129e53206a69
MATLAB
4,744
93
function data=rmlinesc(data,params,p,plt,f0) % removes significant sine waves from data (continuous data). % % Usage: data=rmlinesc(data,params,p,plt,f0) % % Inputs: % Note that units of Fs, fpass have to be consistent. % data (data in [N,C] i.e. time x channels/trials or a single vector) - required. % ...
71b145306aa645259078a64ec217d5d20d722049ac86a0f32779a734abf6b931
MATLAB
4,744
117
function currentMousePosition = tapas_uniqc_lineplot_callback(hObject, eventdata, Img, ... hAxLinePlot, fnConvertMousePosToSelection) % provides a callback function to plot the non-displayed dimension in a % figure display % % currentMousePosition = tapas_uniqc_lineplot_callback(hObject, eventdata, Img, ... % ...
de61d7841a57cf3a1a97134521716f6a35c87161db804d285721dbbcf3f7ae7e
MATLAB
4,744
141
function filtered = Filter(samples,varargin) %Filter - Filter samples. % % USAGE % % filtered = Filter(samples,<options>) % % samples <a href="matlab:help samples">samples</a> to filter % <options> optional list of property-value pairs (see table below) % % ====================================...
0fb7a8628fc2b7b11347ed78f4207e43381b26863245ddb08b13c74bf0528d9f
MATLAB
4,745
148
function fear_tripleActTrigWaveletNREM(basename,varargin) % basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115'; load([basename '.basicMetaData.mat']) fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName); load([basicMetaData.AnalysesName '-nremWaveletPow.mat']) param.l...
94d7dd05d93645b354a8ff642aca65d8e43e4d75b4fc07941a6ebf4ba596cbf1
MATLAB
4,747
108
% Script demo_set_geometry % Illustrates the different components that define an image geometry. % % demo_set_geometry % % % See also definition_of_geometry % % Author: Saskia Bollmann & Lars Kasper % Created: 2018-11-05 % Copyright (C) 2018 Institute for Biomedical Engineering % University of ...
af4a135db583ed2ea2eb539ee3b52e18cfa0367d938b74b44ffdaf15ac2181b2
MATLAB
4,747
118
% inherited from analysis_prf_maps.m % % this script just makes a bunch of maps. %% %%%%%%%% Prep special colormaps cmfecccmapA = cmfecccmap(4); % to green cmfecccmapB = cmfecccmap(4); % to green cmfecccmapC = cmfecccmap(7); % to cyan vals = linspace(0,12,257); vals = vals(1:256) + diff(vals(1:2))/2; whval = [0....
1ee0f5697582265582ef9b39da2df3f72477b8ad7945af596259cab07170d37a
MATLAB
4,750
155
function [unmixsource,umxcoeff,options]=umxICA(source,reference,varargin) % GOAL: Unmix the two signal using Blind Source Separation method. % % INPUT: % - source: source trace 'sce' to be unmixed from the reference trace 'ref'. % - reference: % - options (as input struct or variable arguments): % ...
06def1927e146eb3212145c7a1819a7959d8b5e66062805f8516fc9b74d00d26
MATLAB
4,751
156
%% script that loads data from effective connectivity (dDTF) from all subj % warning: harcoded paths, ... % (c) Jiri, Sep22 loadDataAgain = false; % set subjects params_default; params.paradigm.usedParadigm = 'switchEI'; params.paradigm.specificType = 'switchEI'; params.storage.dir_shareData = 'G'; [params.storage.p...
f02871213ad5c9220000735477a5e3112c8d981fae5f113b4e09fb6bfde27cd1
MATLAB
4,751
154
function run_permuchi2_examples %RUN_PERMUCHI2_EXAMPLES Run permutation Chi-square test examples. % Generates random multivariate categorical data for a sample X, % containing 20 variables. The first 10 variables contain a weak % association, while the remaining 10 variables are completely % independent. Each ...
9f4dba7b1020811fceec2c371ae6db515b5c37111a17138d5a6dd732dac43138
MATLAB
4,753
133
function DBAddVariable(v,eid,name,comments,parameters,mfiles) %DBAddVariable - Save variable in current database. % % Save variable and code used to compute it. % % USAGE % % DBAddVariable(v,eid,name,comments,parameters,mfiles) % % v variable % eid experiment ID (identifier string) % ...
124c9473c3dc81ea92c9aa447b066d676b69eeed6099a1d29c1d5f839d742c34
MATLAB
4,754
124
% EEGFILTFFT - (high|low|band)-pass filter data using inverse fft % (without using the Matlab signal processing toolbox) % Usage: % >> [smoothdata] = eegfiltfft(data,srate,locutoff,hicutoff); % >> [smoothdata] = eegfiltfft(data,srate,locutoff,hicutoff,epochframes,filtorder,revfilt); % % Inputs: % ...
32411126c4af0974233ab764083d0105b5eb12d0d99dc803e570be43c64279e0
MATLAB
4,755
141
function res = permutation_null_spin(img_data, geneset, expressions, gene_symbols) % PERMUTATION_NULL_BRAIN(...) performs permutation testing to examine % whether imaging profiles associate with gene expression profiles, based % on the null-brain model (where random genes were selected from % brain-expressed genes). %...
5a78d85fc3c08acd0a6c03077af1ea78a14e1b90df9a925b2c5b6ce26056fbc9
MATLAB
4,756
140
function [C_store]=NumericalSolver3D(M,ds2,dt,nt,Diff,S0,Q,kapa,tp,T,rate,f,alpha,sc,Mask,Cb, BC) %Extract source coordinates Sy=S0(1); Sx=S0(2); Sz=S0(3); Mx=M(2); My=M(1); Mz=M(3); dy2=ds2(1); dx2=ds2(2); dz2=ds2(3); ds=sqrt(ds2); sc_z=sc*(ds2(1))/(ds(...
afde10b4186f62323484961dacfd62a54ba586e79d331f34dfc47c3aac30b40b
MATLAB
4,756
144
function analyzebehavior_nsdsynthetic(datadir,expfile) nsdsetup; ppdir = regexprep(datadir,'rawdata','ppdata'); mkdirquiet(ppdir); %% BEHAVIORAL PERFORMANCE % find behavioral files files = matchfiles([datadir '/mat_files_from_scan/*nsdsynthetic*subj*run*.mat']) assert(length(files)==8); % HACK FOR FIXING DIFFERENT ...
aab76bb46ea233ce2a230a04740dc501f97a934b418b940e62ef9f608165d4de
MATLAB
4,758
81
function osp_onNii( ~, ~,gui) %% osp_onSave % Callback function on nii button click. Opens the external Nifti Viewer. % % % USAGE: % osp_onNii( ~, ~ ,gui); % % INPUT: gui = gui class containing all handles and the MRSCont % % OUTPUT: Changes in gui parameters and MRSCont are written into th...
fffc1f719e0ea7c75822999934b32dab91c28a848c752d37c53e5bcca8049b48
MATLAB
4,759
117
function varargout = halfViolin(data,varargin) %halfViolin - generate half violin plots for visualizing the distribution % of data across multiple columns. % halfViolin - Generate half violin plots for visualizing the distribution % of data across multiple columns. Each column of "data" should represent a % dif...
68856d9510eb9bf38d590f1632f215ac4debba3c04b0b85260ebfbb59ba2c63e
MATLAB
4,760
139
% JOINTPROB - rejection of odd columns of a data array using % joint probability of the values in that column (and % using the probability distribution of all columns). % % Usage: % >> [jp rej] = jointprob( signal ); % >> [jp rej] = jointprob( signal, threshold, jp, normalize, discret)...
70a8676021ce6ac2c619b933889d0dcb828e0bd150ee291547ed31d9d44080ba
MATLAB
4,760
160
% Define parameters inputSize = 2; hiddenSize = 100; outputSize = 1; numSequences = 20; numTestSequences = 20; sequenceLength = 1; numEpochs = 15000; supervised_rate = 0.01; topdown_rate = 0.001; % Generate XOR data for training [x1, x2, Y] = generate2bitparity(numSequences); inputs = [x1, x2]; X = z...
3f6366ded50b6bbfc81d024faa5804175b6bb291342d6e9da557fc8201d3012d
MATLAB
4,763
107
function [avgITIbyblock_opto, errITIbyblock_opto,... avgITIbyblock_nonopto, errITIbyblock_nonopto] =... CompareOptoITIbyBlock(optoafterdate, Aligned, S) %controlafterdate, varargin %input: ratlist (e.g. {'G060'}) %afterdate is the date after opto surgery for control sessions %G071: optoafte...
aabf552289ae08c36ec22c1dbcd693dfd05499ba3259c40d99ce4c63627b097d
MATLAB
4,764
185
function [cs,coh,nave]=data2cs_event(data,segleng,segshift,epleng,maxfreqbin,para); % usage: [cs,coh,nave]=data2cs_event(data,segleng,segshift,epleng,maxfreqbin,para) % % calculates cross-spectra from data for event-related measurement % input: % data: ndat times nchan matrix each colum is the time-series in one % ...
b55680ab2346eab16c3310bdb13bc16297a0129a633619b5d0e57f5697743c79
MATLAB
4,765
96
%{ preprocess.PrepareGalvo (imported) # basic information about resonant microscope scans, raster correction -> preprocess.Prepare --- nframes_requested : int # number of valumes (from header) nframes : int # frames recorded px_width ...
6d4b869e30b5d3b56551d43693c19b1662962ab6505d1f266c4387969e4ebfbb
MATLAB
4,766
135
% EEG_COUNTEPOCHS Count how many epochs there are of each type % % Usage: % >> eeg_countepochs(EEG); % % Inputs: % EEG - input dataset % epochmarker - ['type'|'eventtype'] indicates which part of the % EEG.epoch structure the different trial types are stored in. Depending % on what system the da...