sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
f7ed4c774d7a28c9d86c361da7686b828d40576a82bf9d12141439fcac1a9bd5
MATLAB
4,887
140
function P1 = fun_my_head_motion_missalignment_estimation(pth, selind,.... DWIname_pre,... bvals, bvecs,... mask) % pth - path where images are s...
b0425706c6cf068a5046a5522dc493792cf7ac14ab2a77bdc4626b4ce0fa87ca
MATLAB
4,895
125
function changeTextSettings(textSize, textSpacing) % Change the text size and the line spacing of the presentation window. % % Both settings are global and stay in effect until this function is called % again or the window is closed. initWindow sets the defaults: % textSize = 46 (35 with Psychtoolbox older tha...
31604964c83f03a45fccd50269e1c216039ac74c7f1e2af1f00b338c7c999771
MATLAB
4,906
98
function SBJ11c_HFA_conn_peak_stats(proc_id, an_id, model_id, conn_id, swap_Xcorr) 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/'])...
82350a582bc78bc192d1acd8d7a9852bb578484deda58825188219358bbae2a0
MATLAB
4,913
123
function fr = calculateBaselineFR(spikeData, stimInfo, baselineDur, dt, sortedSpikes) blankingInterval = .002; % (sec) duration of the stimulation pulse + blanking period prePTA = -0.005; if sortedSpikes unitIds = spikeData.unitIds; else unitIds = 0; end % Stim Train Information numTrains = stimInfo.train.nu...
9e6104dc826565f99596d86f4239105168fb69c7f17896285e79663baa0d8139
MATLAB
4,921
167
function [prv ] = surf_registration_adf(subject, th_pval) %% Tests the overall surface based registration %% % % % surf_registration_afd.m % % Original Author: Laurence Wastiaux % CVS Revision Info: % $Author: nicks $ % $Date: 2007/01/10 22:55:10 $ % $Revision: 1.2 $ % % Copyright (C) 2002-2007, % The Gener...
df85a09f86993af3288bc098d810197d7f240b0a606ea02d74de9ce57dde0b15
MATLAB
4,921
147
function yhat=fun_IterPoissonBM3D(z) % Iterative Poisson denoising algorithm based on variance stabilization and AWGN denoising (v1.00) % % INPUT: z Poisson noisy image z ~ P(y) % OUTPUT: yhat denoised image, estimate of y % % % L. Azzari and A. Foi, "Variance Stabilization for Noisy+Estimate % Combination in I...
a34bb1f9dcd8b1bf277b16d96b475b4e61c58e4ae0cf3a0cf2f6b9ffad6bdcbc
MATLAB
4,923
114
%{ createPluginFigure - shared parameter pop-up builder for onset/offset detection plugins. DO NOT EDIT. Every onset/offset detection plugin calls this. It builds the numeric parameter pop-up, auto-prepends a "Start Time (ms)" field, and loads/saves the calling plugin's settings file. Inputs: app, existFig, appCust...
fd7b971fb9db8686479f1c3bf134d7327e3e5ae4c0b4c1f5d7f03e90dff979d8
MATLAB
4,923
111
% id=str2num(id); folder='/projectnb2/npbssmic/ns/Ann_PTSD1/Ann_PTSD1_1/'; datapath=strcat(folder,'dist_corrected/'); % add subfunctions for the script. Change directory if not running on BU SCC addpath('/projectnb/npbssmic/s/Matlab_code/fitting_code'); addpath('/projectnb/npbssmic/s/Matlab_code/PostProcessing'); add...
8be4b4e24eb96a06af6c58560c71a6c9a1e705aea7fa9488ad333d2eb0d8f73d
MATLAB
4,924
129
function [negloglikelihood] = Estimate_beta_k_g3_m3_sigma_nu(beta, k, g3, m3, sigma, nu, Input, config) % Zilong Ji, UCL, 2022, zilong.ji@ucl.ac.uk % Find the likelihood with parameters specified in the model function name % Args (in common between all estimates functions): % beta: decay factor for the mental distance ...
4182ef93fdb9e126e906a02e8e1edb6e6004d381c6523e160c2eb4960836e577
MATLAB
4,925
241
%% T2-D example %simulate a simple image where each voxel has an associated spectrum dim = [10 10 10]; %load a placenta gradechoinv file gradechoinv = load('inspect/examples/placenta_gradechoinv.txt'); % %want this in ms % gradechoinv(:,5) = 10^3 * gradechoinv(:,5); nmeas = size(gradechoinv,1); %associated ...
f6d917d4cd72a9f1fa558e09c7937f91b2eb14ddd5cd86cabd8b3f3cbfcbbe9e
MATLAB
4,925
130
% The following script can be used to perform the behavioral analyses % described in the manuscript. More precisely, the script will go through % the experimental data and extract the trial-by-trial stimulus motion % direction and the corresponding reported direction of motion for each % coherence level and each subj...
846d1cfdc29deae64f1f1a9a9d25460b888ff3506af9cd3920eeb70b60be202d
MATLAB
4,926
132
clc;clear;close all; root='..\'; addpath(genpath([root,'NeuralCorrelateEvidenceAcc'])) addpath(genpath([rootpath,'steinmetz-et-al-2019-master\'])) addpath(genpath([rootpath,'npy-matlab-master\'])) %% ------------------------------------------------------------------------ subdir='total_clusterArea_paper'; rootpath='.....
45d48caff298f81b0163d830422f29ecfd95267e1e992b3d0af382ea8468c6b4
MATLAB
4,928
165
function h_group = impolygon(h_parent, x, y) n = length(x); if length(y) ~= n, error('x and y must be the same length'); end; if ~ishandle(h_parent) error('Images:impolygon:invalidHandle', ... 'HPARENT must be a valid graphics handle.'); end if strcmp(get(h_parent, 'type'), 'axes') h_axes = h_parent; else ...
c16bad7192ad50ae817789392dda97148a3985362f7edeb8caf4500b1d5e6351
MATLAB
4,929
130
function [negloglikelihood] = Estimate_alpha_k_g2_g3_m3_sigma_nu(alphap, k, g2, g3, m3, sigma, nu, Input, config) % Zilong Ji, UCL, 2022, zilong.ji@ucl.ac.uk % leaky integration with distance (added because one of the reviewers asked) % Find the likelihood with parameters specified in the model function name % Args (in...
91a57d295daa1ea076a0fe14f136e4b4736ee0ca7d96392114a8548918ce77d7
MATLAB
4,931
180
% cone_beam_ct_example.m % Illustrate cone-beam X-ray CT image reconstruction via FDK and iterative. % Uses a tiny system size because cone-beam projection can be slow. % Copyright 2005-1-21, Jeff Fessler, University of Michigan %% First run the FDK example. It generates the true image xtrue % and noiseless projectio...
dd3db2bafd6cc7e0b1dc241caf5934b792cbf48618eafa8c701e3c09011ce3c5
MATLAB
4,931
153
function A = catstruct(varargin) % CATSTRUCT Concatenate or merge structures with different fieldnames % X = CATSTRUCT(S1,S2,S3,...) merges the structures S1, S2, S3 ... % into one new structure X. X contains all fields present in the various % structures. An example: % % A.name = 'Me' ; % B.income = 99...
da5a1e0bbbb4dbf85f45d7ccf9ac110f24c94d41d559c1de1cd917aec9ae0e39
MATLAB
4,932
121
function model = step_neurons(model, params, i) %% inputs V = model.V_line(:, i); U = model.U_line(:, 1); G = model.G(:, i); G2 = model.G2(:, i); AG = model.AG(:, i); eSP_expand_line = model.eSP_expand_line(:, i); t_Iapp_met = model.T_Iapp_met(i); array_Iapp = model.Iapp; Isyn =...
f22950afc4e3d1cc4d8eb69e4f7554e51fd1e0959d9e393da783f2456f605e5c
MATLAB
4,933
119
% Check the Time and Distance cells for a given Phase Precession slope PVal or CorrCoef % PPSummary provides the mean values of the slope and R2 for a given pValue (<=) % Then count the cells, for each type and experiment type, complying to the given mean slope criteria function CheckPhasePrecessionPop Condit...
293a577c53486e0fedcc81516521fb9e9059c442297ec48b886795a47fe92589
MATLAB
4,936
110
function create_data_directory() % create_data_directory Set up desired data folder organization % This function will create the expected file directory organization % Types of folders to create folder_names = {'doppler', 'sulcus', 'output', 'simulated', 'aligned'}; %% Iterate over folder types and create folder if n...
c294995eba3ed2584a1a13518a9923f911dc7655c66f72656d50bac12348d805
MATLAB
4,938
129
function [negloglikelihood] = Estimate_beta_k_g2_g3_m3_sigma_nu(beta, k, g2, g3, m3, sigma, nu, Input, config) % Zilong Ji, UCL, 2022, zilong.ji@ucl.ac.uk % Find the likelihood with parameters specified in the model function name % Args (in common between all estimates functions): % beta: decay factor for the mental di...
7ac0677ba34ad0a9092883685f8c2bc33844ae47e57feb689bd641b953c8377c
MATLAB
4,939
144
%% Thomas_Yang_et al, 2023 @Nuo Li lab %% Fig. 3b # of selective SC neurons contra vs ipsi clear all close all addpath('../func/'); load Figure_3_b_sc_data sig_selective(isnan(sig_selective))=1; sig_selective = sig_selective<0.01;%sig_selective<(0.05/size(sig_selective,1)/3); % <----------- This p valu...
8c18aa8e9ca9a51e92cae3776d15f088ef70a00c35a3aac1106fff0a4c99222c
MATLAB
4,939
129
function EEG = c_TMSEEG_handleBurstEvents(varargin) p = inputParser(); p.addRequired('EEG', @isstruct); p.addParameter('pulseEvent', '', @ischar); p.addParameter('pulseEvents', {}, @iscellstr); % can specify multiple pulse event types to be treated as the same p.addParameter('method', 'error', @ischar); p.addParameter...
26980f668c8138098838ce0208d6b6be8b80f8d7875f1bc00df5bc22283850dc
MATLAB
4,941
194
function values = c_convertValuesFromUnitToUnit(values,fromUnit,toUnit) % c_convertValuesFromUnitToUnit - Convert values between units (e.g. mm to m) % Can handle {km,m,cm,mm,um,pm,miles,feet}, {kV,V,mV,uV,pV,dBmV,dBuV}, or arbitrary relative scales % % Syntax: % convertedValues = c_convertValuesFromUnitToUnit(values...
309d7fc4ae6bbdb726c4628f8cfdccb002a58d589c80cb8b3d8cd1249d8abaf4
MATLAB
4,941
171
function ll = llbmm(nn,pA,pI,lambda,M) % ll = llbmm(nn,pA,pI,lambda,<M>) % % Computes the log-likelihood of data (nn) given a binomial mixture % model with parameters pA, pI, and lambda. % % nn is the histogram over all voxels of the number of times % that a given a given number of positives was detected. The % number ...
bc09add890e83fdf1abf55d6e7be1488ab7f7c1bc679f6a83b1fb45a5b84aeeb
MATLAB
4,941
184
function [] = violinPlotsStats(data,opts) % violinPlotsStats significant box of violins :) % % Inputs: % data: A matrix of data. Each row is an observation. each column is a % variable. % opts: a structure of options with potential fields: % yl: y-limit (e.g. [ymin ymax]) % sigLevel: significan...
b8016f452f51c8b80763ba81d77eb5df4dbd05283092b8f80c3d7df1d2386819
MATLAB
4,944
187
classdef c_GUI_ColorIndicator < c_GUI_handle % c_GUI_ColorIndicator - simple GUI class to draw a color indicator with an optional label properties Units Position Callback end properties(Dependent) Label Color end properties(SetAccess=protected) Parent; end properties(Access=protected) gcont ...
a0bfd8cc8c88a8d67759ef97db92d22de523f1a86c87743892d473eb214534d7
MATLAB
4,946
100
function outResult = IPEMProcessAuditoryModel (varargin) % Usage: % IPEMProcessAuditoryModel(inInputFileName,inInputFilePath,... % inOutputFileName,inOutputFilePath,... % inSampleFrequency,inNumOfChannels,... % inFirstFreq,inFreqDis...
a2825ef427c6884d678961362829f842b5854b98d0ede71ca9c7b11cade7b829
MATLAB
4,946
140
[filename,pathname] = uigetfile({'*.mat;*.tiff;*.tif'},'Please select the Segmentation Data'); h = waitbar(0,'Please wait... loading the data'); [~,~,ext] = fileparts(filename); if strcmp(ext,'.mat') temp = load([pathname filename]); fn = fieldnames(temp); angio = temp.(fn{1}); elseif strcmp(ext,'...
06a9bae87315b3f0f1d9ddd329d3db3fc3c2b3b8b1fda0e6372744cc5a1e110f
MATLAB
4,949
89
%% Run this files to compute the network-human main effect and interactions for all for the VISION experiments %% Must specify the paths to the required network data mat files. function [] = run_anova_stats_matlab_network_human_results(EXP_NUM) rng(517) addpath('../matlab_statistics_functions') NUM_BOOTSTRAPS = 1000...
18032a94e65bc26e7327e84918bc1521a278677887fbce4f2f2a191784a47b13
MATLAB
4,950
147
function [GroupIntegrationKernels, SubjectIntegrationKernels, SignificantTimePoints] = calculate_integration_kernels_for_signal_periods(all_responses,SubjectList,nS, mean_stim_streams, stim_streams, trigger_streams,lags) ExpParameters = 0; %% loop through subjects and find button presses for subject = 1 : nS subj...
5a2f676f91200fed50beb2680ff7b061b3bdfef133af998b14ef58f8668f2ca9
MATLAB
4,950
97
function shuffle_type= shuffle_scoring(shuffled_struct,analysis_type,event_type) % new function to score shuffles post hoc. allows rerunning of scores % without having to redo the actual shuffles. % will overwrite shuffled_tracks if exists parameters= list_of_parameters; if isempty(shuffled_struct) load('Bayesian...
2cf6ef26d9f0c04051d33b61eea9b9d2fb330cea209fb476ff2e52cac07520aa
MATLAB
4,951
197
pause(0.1) [~,ccl] = find(sum(left_fr,1)); [~,ccr] = find(sum(right_fr,1)); len_cc = min([length(ccl) length(ccr)]); MM = movmean(correct_mat,[100 1]); % figure;plot(MM) % ylim([0 1]) pause(0.1) NNL = movmean(choice_mat(:,ccl),[100 1],2); NNR = movmean(choice_mat(:,ccr),[100 1],2); figure; subplot(2,2,1) plot(NNL...
f3ed1e46a465f7712be1b9a33191e82be471e178c57014fdc532d7ad806c894a
MATLAB
4,951
155
function img = feldkamp_par(interpRect,rectGrid,cg, ig, proj, varargin) %|function img = feldkamp_par(cg, ig, proj, varargin) %| %| %| Modified by G. Handy; feldkamp can be rewritten to accommodate changes %| %| in %| interpRect set to 1 if you want to use %| interpolation/extrapolation %|...
31700e3afe67a99b19ff50e16635f30faa31756c8ac69c89931be7a83f60ecd3
MATLAB
4,952
190
% Gtomo3_test.m % Test the Gtomo3 object % f3d_mex('chat', int32(2)) % for debugging if ~isvar('A1'), printm 'setup Gtomo3_test' f.chat = 0; f.option = {}; f.test = '2z'; % todo: na is not last dimension f.test = '3l'; % todo: diag tests below fail f.test = '3s'; f3d_mex('free:all') % start with a blank slate ...
182292ec4c7024e8e067bba0f9f8952d3830a8a0b16124a8db69e595ac6ad037
MATLAB
4,955
134
%% Reliability analysis of source reconstructed data % % Vinding, M. C., & Oostenveld, R. (2022). Sharing individualised template MRI data for MEG source reconstruction: A solution for open data while keeping subject confidentiality. NeuroImage, 119165. https://doi.org/10.1016/j.neuroimage.2022.119165 % % Compare the ...
aa2b9d393134c40bc9be72361e44c4a9f64a7115d62c8bc7f66b8b7b168c584b
MATLAB
4,955
132
clear clc addpath /mridata2/mri_group/xilin_data/misac/mouse_atlas/ addpath /mridata2/mri_group/xilin_data/nifit_code_matlab/ N = 10; M = 8; T = 40; blue_am = 10; uv_am = 6; blue = blue_am*randn(N, M, T); uv = uv_am*randn(N,M,T); blue_off = repmat( rand(N,M)*10+5, 1,1,T); uv_off = repmat( rand(N,M)*10+5, 1,1,T); ...
5d3b6289b19213bd716f586cfdec8b76d64291cdf90f903b86bd6761c6a70e06
MATLAB
4,962
123
function [expNewSeq_out, expStates_out, estTR, estE, actualratio_out] = getHMMStates3(track,binSize,onfood,ratio_cutoff,trans,emis,x_offset,train) %function [estTR estE] = getHMMStates(finalTracks,binSize, trans,emis) %does R/D classification on the entire track regardless of whether it was %in or out of the lawn. fin...
f009881e0e4e1f21d99197d7a9d504f033c75a67fd2b0b75222085aa242c883a
MATLAB
4,962
108
function pseudotrials_SVM_artificial_vs_natural_decoding_PDM(subject,task) %PSEUDOTRIALS_SVM_ARTIFICIAL_VS_NATURAL_DECODING_PDM_FULL_EXPERIMENT Perform category decoding (artificial vs natural) using the SVM classifier. % %Input: subject ID, task (1=categorization, 2=fixation) % %Output: NxNxP vector of accuracies i...
cd94f82283a9f786aecf528c6c3215dc20f57a4e753900c8241ecfe0dc5a920e
MATLAB
4,963
143
function [pE,C,x,pC] = spm_dcm_fmri_priors(A,B,C,D,options) % Returns the priors for a two-state DCM for fMRI. % FORMAT:[pE,pC,x,vC] = spm_dcm_fmri_priors(A,B,C,D,options) % % options.two_state: (0 or 1) one or two states per region % options.stochastic: (0 or 1) exogenous or endogenous fluctuations % options.pr...
268f61f242bf0a68af197f89e87374a99d4252a3d753ac60b7e52a3fd92ff05e
MATLAB
4,965
160
%{ Run this file to compile the mex files if you need to (or if the binaries work for your computer, then you can skip this) This file also contains two simple test problems Stephen Becker, Feb 14, 2012 srbecker@alumni.caltech.edu Updated May 3, 2012 adding the f2c version for Windows userss Updated ...
71b821cb2e00fafcc660c1d2e5cc55b86a6b236ee127a379bc6dbe8aed69e507
MATLAB
4,965
142
function [M Rex S] = ANALYTIC_SIM(Sim) % comments here % last change: 2014/04/03 by PS Sim.td = calc_td(Sim.tp,Sim.DC); % td is always calculated form the duty-cycle and tp xZspec = Sim.xZspec; [S Rex] = rho_s(Sim); R1rho = S.Rho_full(:); theta = S.theta(:); Rex=Rex(:); ...
f64a7f6502e7c30aecd56498c250400b808fc6c84a8099d160963e2808214338
MATLAB
4,967
117
%% Client panel: watching an experiment from the office % The client panel shows on your office computer how an animal is doing in % a running session: the camera image of the box, what is on the screen in % the box, how many trials are done and how many of them were correct. % % <<clientPanelExample.jpg>> % % The pane...
3e4acf0196e1faa15e40116eb09c02e0ec58776350c9c108aba33c5c9e2190c1
MATLAB
4,968
182
% ir_ct_roi_split1.m % "frequency split" approach to ROI recon of Lin Fu et al. from Fully 3D 2015. % Low frequency part of ROI sinogram comes from reprojecting FBP ROI image, % whereas high frequency part comes from original sinogram. % ROI reconstructed using PWLS-OS-LALM % 2015-06-17 Jeff Fessler, University of Mich...
105eefca7528c1e39a128608316f6bb55d8e5e8609ddce59fbac0ea1e3972896
MATLAB
4,970
223
function [xc,good,bad,type] = cornerfinder(xt,I,wintx,winty,wx2,wy2); %[xc] = cornerfinder(xt,I); % %Finds the sub-pixel corners on the image I with initial guess xt %xt and xc are 2xN matrices. The first component is the x coordinate %(horizontal) and the second component is the y coordinate (vertical) % %Based on H...
4f1f3b02e3e1eb33fd8afc0ea969046ce5a1924c1cc0aa0c0c9f9082c9af87e6
MATLAB
4,970
158
datapath = strcat('C:\Users\jryang\Desktop\Vibratome_data\1002\Axial\30.38opt\'); cd(datapath); load max.mat; depth0=mip; datapath = strcat('C:\Users\jryang\Desktop\Vibratome_data\1002\Axial\30.305\'); cd(datapath); load max.mat; depth1=mip; datapath = strcat('C:\Users\jryang\Desktop\Vibratome_data\1002\Axia...
247a88dfe2a25cfc0b17582f9eca5d9b3df1e91b7ef874bda60b3d7e73603957
MATLAB
4,971
246
function y = ir_conv(x, psf, varargin) %function y = ir_conv(x, psf, varargin) %| %| ND convolution of signal x with psf. %| This generalizes convn(x, psf, 'same') by supporting and adjoint %| and by allowing periodic boundary conditions. %| For the usual case of an odd-sized psf, the 'center' of the psf is [0,0] %| s...
57aa8275dd8d974c0d7f21a3aba86ee77e34c4661867996787fc0997beb85aa5
MATLAB
4,971
157
function create_GLM_figures % PLOT INTER SLEEP GLM cd 'X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 2\Raw_replay_analysis\figures\GLM' bar_ind = openfig('GLM_INTER_explained_deviance_individual.fig'); bar_diff = openfig('GLM_INTER_explained_deviance_difference.fig' ); prob_ind = openfig('GLM_INTER_pr...
231ec5d4e905a1dc8d05b013705613d5e99acfef443ee9445b49b6dce62f1b25
MATLAB
4,973
142
function out = getMousePos(waitTime) % Wait for a mouse click on the stimulus window and return its position. % % Calling getMousePos without arguments blocks execution until a click is % done. A call with the optional argument waitTime exits after a click or % after the given time, whichever comes first. Pressing ESC ...
01ee5c377b2d0349afe49602c9da746e4c9b7bf59f32e842bc3917af69b2ddcb
MATLAB
4,977
160
%% Analyzing Neural Time Series Data % Matlab code for Chapter 2 % Mike X Cohen % % This code accompanies the book, titled "Analyzing Neural Time Series Data" % (MIT Press). Using the code without following the book may lead to confusion, % incorrect data analyses, and misinterpretations of results. % Mike X Cohen ...
f9d1237b08cddd93c49db3c7573dd9001cb023398b25b637f0582ce988d37418
MATLAB
4,981
190
function [grad, out, com] = ir_hct_rgrad(x, varargin) %|function [grad, out, com] = ir_hct_rgrad(x, varargin) %| %| compute 3D regularizer gradient using hct binary %| for UM testing only %| %| in %| x in xyz order %| option %| (many - see below) %| %| Notes: because hct2 uses 'zxy' order, it is essential to use Reg1...
5134bf9a25cb0b93437220ee2dca2e339123e1e2157c226ca9f3a6d44e0131b2
MATLAB
4,986
160
function [P] = spm_dcm_fit(P,use_parfor) % Bayesian inversion of DCMs using Variational Laplace % FORMAT [DCM] = spm_dcm_fit(P) % % P - {N x M} DCM structure array (or filenames) from N subjects % use_parfor - if true, will attempt to run in parallel (default: false) % NB: all DCMs are loaded in...
a7d95850f0f03a771d16698668b8f372fe324f56a0c3f26e11ba5b6753d238ac
MATLAB
4,986
206
% LICENSE % % _This file is Copyright 2018 by the Image Processing and Analysis Group (BioImage Suite Team). Dept. of Radiology & Biomedical Imaging, Yale School of Medicine._ % % BioImage Suite Web is licensed under the Apache License, Version 2.0 (the "License"); % % - you may not use this software except in compl...
38e799164a172a85abdcb80ef1fdec6d0a0c3fdc8e673ce17379580e36b5d5a0
MATLAB
4,987
142
% read angiogram and segmentation [filename,pathname] = uigetfile({'*.mat;*.tiff;*.tif'},'Please select the Angiogram Data'); h = waitbar(0,'Please wait... loading the data'); [~,~,ext] = fileparts(filename); if strcmp(ext,'.mat') temp = load([pathname filename]); fn = fieldnames(temp); angio = temp.(fn{1...
411f5aade25412ed2a27df325c589135c48a7ea4a8411649dd8b397a38453534
MATLAB
4,990
161
function DCM = spm_dcm_fmri_csd_data(DCM) % Get cross-spectral density data-features using a VAR model % FORMAT DCM = spm_dcm_fmri_csd_data(DCM) % DCM - DCM structure or fMRI % % sets % % DCM.Y.pst - Peristimulus Time [ms] sampled % DCM.Y.dt - sampling in seconds [s] (down-sampled) % DCM.Y.csd ...
d837fe6a75c78356a59e4569a993b6bcb305efd9db13be3a32829ede182033b1
MATLAB
4,993
199
function ft = bspline_1d_interp(fn, ti, varargin) %function ft = bspline_1d_interp(fn, ti, varargin) %| %| given f[n], the "unit spaced" samples of a continuous signal f(t), %| perform b-spline interpolation at sample locations t_i using the model: %| f(t) = \sum_{k=0}^{N-1} coef_k b(t - k) %| where the coefficients a...
9fcbc43d40eea37216642a3bc075319c8838938bafaed5e0feebc3867a2edb15
MATLAB
4,996
170
function [wt scale180] = fbp_fan_short_wt(sg, varargin) %function [wt scale180] = fbp_fan_short_wt(sg, [options]) %| %| Sinogram weighting for fan-beam short scan, aka 'Parker weighting' %| %| in %| sg strum sino_geom (sg.orbit_start is ignored) %| or ct_geom %| %| option %| 'type' 'parker' from parker:82:oss (Med...
260adb572efac92959d98b77a6ca5530b6c6f47e48ff281843624d47da391b5d
MATLAB
4,998
187
function s = c_toString(c,varargin) % c_toString Convert various data types to a string % Handles reasonable printing of scalars, vectors, matrices, cells, etc. % % Examples: % c_toString(rand(2,3)) % c_toString(rand(2,3),'doPreferMultiline',true) % c_saySingleMultiline('%s',c_toString(rand(2,3),'doPreferMultiline',tru...
4741e09f63045a217a9f2f5576187daa8a94a2817311ad123841d62a01d3208c
MATLAB
5,000
146
%Extract LabChart Block Data %Inputs: LabChart data %Outputs: Number of channels, number of blocks, Block data, sample rate for all blocks (assumed to be the same between all blocks) function [numChannels,numBlocks,Block,AllSampleRate]=ExtractLB_BlockData(labChart_Data) %Extract base data %Channel Titles ChannelTitle...
90fc3bceb9966c3e97b589c80bf78c67c0f55435d212aa7433e11bc630ce80d0
MATLAB
5,002
77
fig7.fig = figure('Name', 'Figure 7: Stimulation Effects on Decoding'); set(fig7.fig, 'Units', 'centimeters', 'Position', [40 10 8.8 3], 'NumberTitle', 'off'); fig7.failureRate = axes('Position', [.1 .15 .375 .8]); annotation('textbox', [0, 0.9, .1, .1], 'String', 'a', 'FitBoxToText', 'on', 'LineStyle', 'none', 'Rotati...
943be6fcf5951a0aea3d6c730798c22a1d51a09c8196e022a5849941fe9f51de
MATLAB
5,007
123
function [OFC_chan_idx,fro_chan_idx,temp_chan_idx,insula_chan_idx,cingulate_chan_idx,ACC_chan_idx,EC_chan_idx,... CA3_chan_idx,CA1_chan_idx,HC_chan_idx,MTL_chan_idx] = get_elecs_clean(subj) if strcmp('39', subj) OFC_chan_idx = [1:2, 58:59]; fro_chan_idx = [16:19, 25:26, 28, 64, 66, 70:74]; ...
3fdd64997307d93c7ff3a1e87dd70225b63379612ea1c9979109a12151911873
MATLAB
5,010
125
function findAttractorDynamicsbySession(cells,save_figs,folderName) % folderName = "wt_cell_gainchange_only"; close all; seshes = unique(cellfun(@num2str,cells.metadata(:,1),'uni',0)); % slopeMatrix = nan(numel(seshes),4); pearson_rhoMatrix = nan(numel(seshes),12); for i = 1:numel(seshes) seshIndx = ismember...
0990621c36fa0761a246f17df256acfdf11802b067a73707abdab22507f63fb9
MATLAB
5,011
153
% Simulate a feedforward network (without recurrent connections) of Poisson spiking neurons % Wen-Hao Zhang, July 1, 2021 % University of Chicago %% Parameters of the model parsHawkesNet; parsMdl.tauIsynDecay = 2; parsMdl.dt = 0.1; % Unit: ms parsMdl.bSample_ufwd = 0; parsMdl.jxe = 1e-2; parsMdl.ratiojie = 5; par...
f1f540377412d8c4937883d131c4e1041320718c3ef72c8a0986a6f8577b9f59
MATLAB
5,013
174
% Example script to reproduce the spectral plots shown in the paper % % Combining Magnetoencephalography with Telemetric Streaming of Intracranial % Recordings and Deep Brain Stimulation – a Feasibility Study % By M. Fahimi Hnazaee, M. Sure, G. O'Neill, G. Leogrande, A. Schnitzler, E. Florin, V. Litvak % Vladim...
8d9d88d2ac917013a04be9b23d81f8230edf6c9667279fb5da989ee9f7ecc79a
MATLAB
5,014
123
function create_place_field_stability_figure % PLACE FIELD STABILITY - CENTRE OF MASS & DECODING ERROR cd 'X:\BendorLab\Drobo\Lab Members\Marta\Analysis\HIPP\Chapter 1\Decoding_error\figures\Decoding error within exposure' DecErr_lastlaps = openfig('Median decoding error per lap using last laps from same exposure_all...
f2f7cc2e8f9ad7955e809e86611e5a5bdd9aacb49c4b6bd786404488f0e377b8
MATLAB
5,014
157
function[prm] = plot_conditioned_psychometrics(data, ax_postcorr, ax_posterr, varargin) % data.pokedR, data.gamma, data.hits % axes for post corr, post err % trans is unfortunately, whether or not to plot in transparency true/false p = inputParser; addParameter(p,'xreg', 'gamma'); addParameter(p,'plot_data', []); add...
f5f3254dea20c0333bc087a928d291644e3bae8d82c9a4e40b706f9d9a3ec02b
MATLAB
5,015
174
% Example script to reproduce the spectral plots shown in the paper % % Combining Magnetoencephalography with Telemetric Streaming of Intracranial % Recordings and Deep Brain Stimulation – a Feasibility Study % By M. Fahimi Hnazaee, M. Sure, G. O'Neill, G. Leogrande, A. Schnitzler, E. Florin, V. Litvak % Vladim...
0df9b45b9619aab6054c91f33a38f4724ad5b9ee506d94cf1b445c25044a6404
MATLAB
5,017
168
% output: %1. data :notch filtered LFP data for elecs of interest %2. trial_data :epoched data based on photodiode clear all; close all; clc subj = '84' addpath(genpath('/media/SSanDra/Pattern_Separation/analysis_pipeline_final/')) % FT folder ft_defaults script_path = '/media/SSanDra/Pattern_Separation/analysis_pipe...
6bd47a805d050b04f762cb3b327cda8a713e960f5b435cbc2cf47dc261d07e13
MATLAB
5,020
162
function [components,cliques,CC] = k_clique(k,M) % k-clique algorithm for detecting overlapping communities in a network % as defined in the paper "Uncovering the overlapping % community structure of complex networks in nature and society" - % G. Palla, I. Derényi, I. Farkas, and T. Vicsek - Nature 435, 814–818 (200...
aa8c0923910048bd5bb24f14986dff5808e6b04c2ec35b6bd3b3f862d31b091f
MATLAB
5,026
137
function result = punishment(wTime, varargin) % Use this function for punishment if a task wasn't successfully finished. % During punishment the answers of the animal are recorded and available % in the output variable. % This function uses three options for punishment implicitly (all are % defined in myHardwareSetup/ ...
e3eaf10d1ce3dcd1df532a0be4eb108257e1a24b7975be215a778611e44bc0fa
MATLAB
5,026
128
function Prepare_TestData_HR_LR_Noise() clear all; close all; clc path_original = './OriginalTestData'; %dataset = {'Set5', 'Set14', 'B100', 'Urban100', 'Manga109'}; %dataset = {'720P', '1080P', '4K'}; % dataset = {'720P'}; ext = {'*.jpg', '*.png', '*.bmp', '*.tif'}; degradation = 'Gray_Noise'; % Noise, Blur, JPEG,...
f65b2f407c5f5a7789bb3cf4165f340390438b4357f8fbdf0cb621aff13ef0df
MATLAB
5,029
149
function [fNum,stateFigure,kinFigure] = plotKNNKinematicsSTD(f_orcoAll,state2Cons,tim2Cons,plotType,colortype,fNum) % loop through each genotype k=ones(1,numel(state2Cons)); nGen_per_page = 3; nPage_all_gen = ceil(numel(f_orcoAll)./nGen_per_page); fNum_byState = fNum:nPage_all_gen:numel(state2Cons).*nPage_all_gen; nGe...
d7c63283479d0974945bcba7c41ea5b98419f27d59e3765ad52fe13a4b976d9c
MATLAB
5,030
179
% 1062 rows, 1599 columns in 'Orange_on_the_tree.jpg' photo Nrow2 = 900; Ncol2 = 1500; dh = 77; OR = imread('../../results/Figure_8/Orange_on_the_tree.jpg'); OR = double(OR(1+dh:Nrow2+dh,1:Ncol2,:))/255; % Make hexagons template N_hs = 30; Bn = make_numbered_hexagons(N_hs,Nrow2,Ncol2); N_hex = max(Bn(:)); % Calcula...
a07fb782efe5a224849a34f21933afa7e75bc721ccfd83a735e3e07b75630280
MATLAB
5,032
142
function [big_table, waves] = get_big_table() dbeh_path='C:\Users\xscogno\MATLAB\Flavio2\Waves\Tracking data\'; rec_data_path = 'C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_spikes='C:\Users\xscogno\MATLAB\Flavio2\Preprocessed_data\'; dpath_sorting='C:\Users\xscogno\MATLAB\Flavio2\Waves\Sorting\'; dpath=...
0e4603c8887139a10da3bb4ac7f4a21fa3ee7388834bda3098961f1a990225de
MATLAB
5,033
156
classdef Clusters < handle % AUTHORSHIP % Primary Developer: Stephen Meehan <swmeehan@stanford.edu> % Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com> % Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu> % Copyright (c) 2022 The Board of Trustees of the Leland Stanford Junior...
2289605b0cdd674e65d596cbfdc0aa65de721141a37240268e52eb00867f9bd6
MATLAB
5,037
103
%% IR68 Processing Variables [root_dir, app_dir] = fn_get_root_dir(); ft_dir = [app_dir 'fieldtrip/']; if isempty(strfind(path,'fieldtrip')); addpath(ft_dir); ft_defaults; end %-------------------------------------- % Basics %-------------------------------------- SBJ_vars.SBJ = 'IR68'; SBJ_vars.raw_file = {'...
ca91476058986da6f887efdc425fe4f12c568aaad050c100afde915d55379ea8
MATLAB
5,043
254
function f = mri_brainweb_params(label, varargin) %function f = mri_brainweb_params(label, varargin) %| %| Tissue parameters for BrainWeb synthetic brain images: %| 1.5T values from BrainWeb database: %| http://mouldy.bic.mni.mcgill.ca/brainweb/tissue_mr_parameters.txt %| 3.0T T1, T2 values taken from literature when ...
efc1b848c5d2ea26aa3ac1ff409b7c0b17a0a395810c4da9bcb6e81f5d834345
MATLAB
5,045
145
function [fNum,stateFigure,kinFigure] = plotKNNKinematics2... (f_orcoAll,state2Cons,tim2Cons,plotType,colortype,fNum) % loop through each genotype k=ones(1,numel(state2Cons)); nGen_per_page = 3; nPage_all_gen = ceil(numel(f_orcoAll)./nGen_per_page); fNum_byState = fNum:nPage_all_gen:numel(state2Cons).*nPage...
147b2c586c4aecac5d51e301b77c49618a52199bb400543b909b0aca93b5edbe
MATLAB
5,047
270
% Gblock_test.m % Test the Gblock object in all of its versions. % This also tests several system objects: % Gsparse, Gtomo2_dscmex, and Gtomo2_wtmex % % Copyright 2002-2-19, Jeff Fessler, University of Michigan % image and sparse matrix if ~isvar('A0'), printm 'setup Gblock_test' ig = image_geom('nx', 20, 'ny', 22, ...
1df4f0a9b6c1fdaccaf8b787d9b008785df854931e0ecbe98d39898a99ad9410
MATLAB
5,053
134
function [f_orco_all] = GenerateEmpiricalFlies(genAll,meta) % GenerateEmpiricalFlies Generates a fly object, then calculate the KNN % space, baseline and boundary conditions, and crossing turn rate/ % kinematic filters % % Inputs: genAll = cell array of genotype labels to create fly objects for % ...
f6e557b3041429c7e4e5e6340f8f8e9c98fee2bc899b2a989373d440d5fd396a
MATLAB
5,057
127
function compare_program_metrics_bias_variance(tbl) metrics_cell = {'Vessel_Length_Density','Vessel_Area_Fraction','Mean_Diameter','Num_BranchPoints'}; metrics_abbrev_cell = {'VLD','VAF','Diam','BP'}; error_from_gt_tbl = normalize_matched_table(tbl,'Program','Manual','Image_Name',... metrics_cell,@(x,gt) x-gt); ...
ef59d92dfdc409594b7f36c24bb0997d504e33805d6f546ed5874acf31635ec0
MATLAB
5,065
192
% Simulation for time segmentation code. % for mri object, must use mexfile mvmult.c % to mex, simply type: mex mvmult.c at command prompt % % This file will form the mri structures and compare iterative % reconstruction times for field-corrected imaging % % Brad Sutton, University of Michigan % June 2002 % % Code cont...
1d059cdc2a5054e06f3d357b5486fbd05f7262cfacb7d08013fce1c590176ef6
MATLAB
5,067
155
function run_format_settings(figure_handle,varargin)%axis_handle %varargin - settings that are not for the main figure % match_ax, match_Xax, match_Yax: match limits of multiple axes. Can choose both, or only X or Y % ...any other type of figure that doesn't run with the main settings %%%% Load settings form = forma...
55fb4c249982c79a215b6d13399eac37f369bd56a696e4a9d4a1a166ececa30d
MATLAB
5,067
144
function out = spm_shoot_scalmom(job) % Generate ``scalar momenta'' for use as features in pattern recognition % FORMAT out = spm_shoot_scalmom(job) % % See: % Singh, Nikhil, P. Fletcher, J. Preston, Linh Ha, Richard King, % J. Marron, Michael Wiener, and Sarang Joshi. "Multivariate % statistical analysis of deformatio...
4647fc2b9cb943321b4f06825fdedca9074c379cb4fb77dd674147746c6dd9fe
MATLAB
5,069
215
% Code by David Sterratt % % Normally SCcol and RGCcol are not specified by the user function fig = plotGradients2D(obj, invertSCephrinA, forwardOnly, markIsl2) silentFlag = 1; if (exist('forwardOnly') && ~forwardOnly) forwardOnly = false; else forwardOnly = true; end if (exist('markIsl2') && mar...
8ac48d82616996a640b41d27fd7a8245653781978a599fed948a85f6bba6c57b
MATLAB
5,071
119
function ieegHGAll = extractHGDataWithROI(Subject,options) % extractHGDataWithROI - Extracts high-gamma (HG) band data with region of interest (ROI) selection % % Usage: % ieegHGAll = extractHGDataWithROI(Subject, options) % % Inputs: % - Subject: struct % subject output of populated task % - options: struct,...
912ae09c9ba65aa53eecf55dcbe5bf1f68a3c7d9fe906b1b77836e715e2421de
MATLAB
5,071
138
function [paramsBest, params, sqerr] = piecewiseFit(X,y,c, slope2) % Fits data with a series of lines joined at hinges % % [paramsBest, params, sqerr] = piecewiseFit(X,y,c) % % Inputs: % % X - Vector of x measurements % y - Vector of y measurements % c - Seedpoints for cutpoint or hinge parameters. There...
0b86a4667c1fff8c9aeb63610aa30dcd911109829f5fbf72c471e34ce6b4b7d0
MATLAB
5,075
125
function [expNewSeq_out, expStates_out, estTR, estE, actualratio_out] = getHMMStatesConcatenatedTracks(speed,angspeed,binSize,onfood,ratio_cutoff,trans,emis,x_offset,train) %function [estTR estE] = getHMMStates(finalTracks,binSize, trans,emis) %does R/D classification on the entire track regardless of whether it was %i...
226e742d5d18c387f1fe1fa8725cc1c995bd94ee8f24bc0b8954378611616b7e
MATLAB
5,075
111
folder0={'/projectnb2/npbssmic/ns/Ann_PTSD1/Ann_PTSD1_1/','/projectnb2/npbssmic/ns/Ann_PTSD1/Ann_PTSD1_2/','/projectnb2/npbssmic/ns/Ann_PTSD1/Ann_PTSD1_3/'}; id=str2num(id); folder='/projectnb2/npbssmic/ns/Ann_PTSD1/Ann_PTSD1_2/'; datapath=strcat(folder,'dist_corrected/'); % add subfunctions for the script. Change dir...
48517da99d699e7d43c60cbd5e5fdce4ccbabf2035ddd8c6b372b07c669fdf73
MATLAB
5,075
111
folder0={'/projectnb2/npbssmic/ns/Ann_PTSD1/Ann_PTSD1_1/','/projectnb2/npbssmic/ns/Ann_PTSD1/Ann_PTSD1_2/','/projectnb2/npbssmic/ns/Ann_PTSD1/Ann_PTSD1_3/'}; id=str2num(id); folder='/projectnb2/npbssmic/ns/Ann_PTSD1/Ann_PTSD1_3/'; datapath=strcat(folder,'dist_corrected/'); % add subfunctions for the script. Change dir...
933599061a12826148be7795d71c45e62a1f11ddf9f10bfddc7e6d65d84899a8
MATLAB
5,075
105
function input_graph = fun_graph_split_node_DT_guided(input_graph, vessel_mask_dt, vessel_skl, node_label_list) % fun_graph_split_node_DT_guided deletes the node of degree 4, pairs the % remaining 4 and connect pairs by linear regression and shortest path % searching. % Input: % input_graph: structure generated by ...
9dd03886e1130b593d97e36aaebbd02d3b228cdcd080208e2743586a0180c61a
MATLAB
5,075
146
function P1 = fun_my_head_motion_correction_v1(pth, selind, DWIname_pre, ... bvals, bvecs, mask, ... DWIname_orig) % pth - path where images are saved % selind - index of volumes where motion did not occour (FSL index + 1) % DWIn...
35b93431463cb69952f3cd52a5ecd7fa71e5a1021d7da8fd39bf6d9e0b05febf
MATLAB
5,081
200
% % % Alessandra Griffa % University of Geneva % Ecole polytechnique federale de Lausanne EPFL | MIPLab % Jun 2021 % function [k1,k2,k3,k4,k5] = colorsurf_2hemi_5perspectives_macaqueRM82(qinfo, CM, llist, my_lighting, nview) % Initialize figures handles k1 = NaN; k2 = NaN; k3 = NaN; k4 = NaN; k5 = NaN; % FACEs and...
b0bf27e4e506835e30a5a390efce60e3d1cb864755a70dbed6c403a32448ff5a
MATLAB
5,081
88
% BATCH ANALYSIS FOR REPLAY CONTROL FOR 1 LAP TRACK % MH_2020 % For 1 lap session, this code takes each lap from T1, calculate it's place fields and compares it to T2 1 LAP (e.g. ratemaps Lap 5 T1 vs Lap1 T2). % Then it used these new place fields to decode replay events, and runs the same shuffle analysis as for norma...
51e15bf43043a2c089fd889efee70bb375618f0563f5bb871f0e1946e678150a
MATLAB
5,082
108
% DECODING ERROR COMPARISON BETWEEN PROTOCOLS function plot_compare_thetaseq_decodingError(bayesian_control) PP = plotting_parameters; sessions = data_folders; session_names = fieldnames(sessions); if ~isempty(bayesian_control) path1 = '\Bayesian controls\Only first exposure'; path2 = '\Bayesian controls\Onl...
293c64b5db5507a7056b82f41ac5dd1dc3896f66b72f70053fab20c87d9d9517
MATLAB
5,086
227
function ob = Gtomo2_wtmex(arg1, varargin) %function ob = Gtomo2_wtmex(sg, ig, options) %function ob = Gtomo2_wtmex(file, options) %function ob = Gtomo2_wtmex(arg_pairs, options) % % Generate a tomographic system model based on aspire's wtfmex() routine. % % in % sg strum sino_geom() % ig strum image_geom() % % opti...
1dd7b00a1266ad9a3efd8be482946bbc9e2beba9392e70ede0cac95a5765d874
MATLAB
5,087
191
function ndf2swc(input_file, output_file, scale_factor) [input_filepath, input_name, input_ext] = fileparts(input_file); % Check if output file is specified if (nargin<2) if(isempty(input_filepath)) output_file = strcat(input_name,'.swc'); else output_file = strcat(input_filepath,'/',input_nam...
04c1e8901b7b4145e0ca57525d6d4498687e7c2e477122a80d04e958b1c4b177
MATLAB
5,089
134
function bootstrap_partialcorr_eeg_rnn_rt(conditions) %BOOTSTRAP_PARTIALCORR_EEG_RNN_RT Calculate the peak latencies and confidence intervals %for the partial correlations of EEG-RT and RNN-RT. % %Input: conditions ('artificial','natural' or 'both') % %Output: peak latency and confidence interval % % %% Add paths addp...
87bfa5d6e7cdd07d429b70a6c36965f32346a766cdaa183bc4a6f2feaa4ca2d9
MATLAB
5,091
110
%% NuCLear %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % NuCLear neural network cell type classification algorithm % Version: 4.1 % ...
9a65e55d7c68bff1bba9f299d7ab7142890690bfd18239dec0e1e27a09d24f37
MATLAB
5,094
140
function Statistical_IndividualAnalysis_PLV_BH(PLV_MI, PLV_Baseline, subject_ID, fig_path, db_path, numperm, nb_ROIs_DK, p_thresh, freqband) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Perform individual-level statistical analysis - PLV % Authors: MCC % Date: 26/10/2022 %%%...
cdea2e8617e9b482334c13b98e145e38fdb9722db716fc220c610f093b3aed39
MATLAB
5,106
100
%Z-score delay all cells close all; clear; load('U:\rg-yoshida\Yoshida_lab_shared_folder\Shared Data\Antonio\In vivo data\Babak\preliminary analysis\Space_bin\Space_bin_filt30Kalman.mat') load('U:\rg-yoshida\Yoshida_lab_shared_folder\Shared Data\Antonio\In vivo data\Babak\preliminary analysis\Space_bin\Spatial_...