sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
f30051bf88dbf82b19d56d1f671b16b669f28b37dae78f4b3cd00feccb387baf
MATLAB
10,470
277
function varargout = ResultsViewSetting(varargin) % RESULTSVIEWSETTING MATLAB code for ResultsViewSetting.fig % This GUIDE dialog returns atlas settings for Results View. % % Usage: % settings = ResultsViewSetting(oldSettings) % % Returned fields: % Enabled % VolumeSpaceCortexAtlas % VolumeSpaceSubcorticalAtlas...
53664c2882f8560e4fb27c5796369f9790b9a35bbc20751f3220440f80261a62
MATLAB
10,471
332
function ft_plot_matrix(varargin) % FT_PLOT_MATRIX visualizes a matrix as an image, similar to IMAGESC. % The position, width and height can be controlled to allow multiple % matrices (i.e. channels) to be plotted in a topographic arrangement. % % Use as % ft_plot_matrix(C, ...) % where C is a 2 dimensional MxN matr...
e3468e460290e9861e43304f5887f5f42b76c428451330a6e78edf3cbf8ae296
MATLAB
10,471
251
for q=1% Sheet number test_duration = 900; %total time in seconds [time]=xlsread('Test',q,'A:A'); %time values [F_value]=xlsread('Test',q,'B:B'); %F values [TTL]=xlsread('Test',q,'C:C'); %TTL pulse values F_DIF=[]; Pulse_points=find(TTL==5.00001);%Fiber photometry and video recording of the animal behavior was...
d3a4771d709fe49a15ec943c9f79740730bb50b5c32ff980f66c2090cda7a0a4
MATLAB
10,472
322
function [ CF ] = Cost_Function (xopt) NineMuscleMorphParaInitial = load('NineMuscleMorphParaInitial.mat'); NineMuscleMorphParaInitial = NineMuscleMorphParaInitial.NineMuscleMorphParaInitial; G = 6; % Muscle Group Number (G = 1 to 9) x0(1) = NineMuscleMorphParaInitial{G, 1}.MorphologicalParameters.OW.a1OW; x0(2) = N...
4e3453c9c9fadc5efc4ed20a10858871eb53ea3af81eaaec7c8b99a5ede26871
MATLAB
10,476
318
function meg_manuscriptFigs_TE_byPrecue_mdlFit_2Hz_pies % function meg_manuscriptFigs_TE_byPrecue_mdlFit_2Hz_pies.m % 2 Hz phase by attention, in fittedP structure %% Load data user = 'kantian'; % Model fit data filename = sprintf('/Users/%s/Dropbox/github/ta-meg-analysis-model/model_anticipatory/ITPCfit_separate1_...
b33207d90f62778383199f2a79ba25468165bb2e59d57a31ac75d2d4649b6e6a
MATLAB
10,478
267
function [event] = read_trigger(filename, varargin) % READ_TRIGGER extracts the events from a continuous trigger channel % This function is a helper function to read_event and can be used for all % dataformats that have one or multiple continuously sampled TTL channels % in the data. % % This is a helper function for ...
9ecae5822c28e54a60d8a6da503a64979764dce9ddd0c12902d2f6489646e658
MATLAB
10,487
262
%% This script analyzes PF map correlations for PFs calculated from subsets of trials % gridAnalysisPlaceFieldReliability.m % % myPlotSettings %% Set up and load data % Choose results to analyze decodeFileID = "mainPaperGrid"; % Select which decoding file result ID to analyze % Param set [2,3] for (mcn=1.25, cluster...
5d1dc345b87d62628a2b3603c4363e005bfdc27356d235d8cec2e5879fd35854
MATLAB
10,491
262
function Out=dpcaAnalysis(firingRatesAverage,firingRates,trialNum,time,varargin) % defaults dPCA_noReg=1; dPCA_Reg=1; % lambdas=1e-07 * 1.5.^[0:1:20];% allows less regularized % lambdas=1e-07 * 1.5.^[0:1:30]; % allows even more regularized lambdas=1e-07 * 1.5.^[0:1:25];% default % lambdas=1e-07 * 1.5.^[0:1:23];% defau...
d3e8523be9a287dea162ea4bf0e499bc39e57f8ca86782176026c587fa556673
MATLAB
10,494
257
function chanunit = ft_chanunit(input, desired) % FT_CHANUNIT is a helper function that tries to determine the physical % units of each channel. In case the type of channel is not detected, it % will return 'unknown' for that channel. % % Use as % unit = ft_chanunit(hdr) % or as % unit = ft_chanunit(hdr, desired) ...
c6269e5f28171e92a6e6f998557bc9b14aba3a84d6c4595cafcdf1b57d3e524d
MATLAB
10,496
312
% Author: Birgit Nierula % nierula@cbs.mpg.de function eeg_prepro_loop_calc_cca(subject, nerve, srmr_nr, ref_chan, plot_graphs) %% set variables subject_id = sprintf('sub-%03i', subject); save_path = [getenv('EEGDIR') subject_id '/']; cfg_path = getenv('CFGDIR'); % get condition info if nerve == 1 nerve_name = ...
ec1934ac5d3621407630bacacadb8561dbdca2c70a774cd7391011d484173cc4
MATLAB
10,497
253
function extract_replay_info_batch_randomised_dataset(folders) % % Extract information cross experiment shuffles % shuffles={'PRE spike_train_circular_shift','PRE place_field_circular_shift','POST place bin circular shift'... % ,'POST time bin permutation','PRE cell_id_shuffle'}; % % for n = 1:length(shuffles) % ...
09c3255eff4edcc3f7c184d663f82437adcd314c083432c95d8e0268cf2691e9
MATLAB
10,507
375
% 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> % Provided by the Herzenberg Lab at Stanford University % License: BSD 3 clause classdef TreeMa...
dd14c9ad5c9ddadbf72bb13377ec496592a3b51a4ba6702aa46ed0a4652c52a2
MATLAB
10,509
335
function ft_plot_matrix(varargin) % FT_PLOT_MATRIX visualizes a matrix as an image, similar to IMAGESC. % The position, width and height can be controlled to allow multiple % matrices (i.e. channels) to be plotted in a topographic arrangement. % % Use as % ft_plot_matrix(C, ...) % where C is a 2 dimensional MxN matr...
19a94c20e6f244cda53878527feef3cf4e6929af5a72d36b2101be1cdfec05f9
MATLAB
10,510
321
function [source] = ft_source2full(source) % FT_SOURCE2FULL recreates the grid locations outside the brain in the source % reconstruction, so that the source volume again describes the full grid. % This undoes the memory savings that can be achieved using FT_SOURCE2SPARSE % and makes it possible again to plot the so...
cf292e52a11acfc6fc6517c3e96ff5e5c645dfe3d3f3458ee4146904c7f8e37a
MATLAB
10,511
321
function [source] = ft_source2full(source) % FT_SOURCE2FULL recreates the grid locations outside the brain in the source % reconstruction, so that the source volume again describes the full grid. % This undoes the memory savings that can be achieved using FT_SOURCE2SPARSE % and makes it possible again to plot the so...
d142f9b51d5c22cf77f85820fad72998ce6da7323afda230b3086e639b90264f
MATLAB
10,511
505
% %emata(PET_dyn_path, t_PET_delta, out_path) % %Optional parameters % %emata(PET_dyn_path, t_PET_delta, out_path, 'MoCo', MOCO_flag) % MOCO_flag = 1 or 0 (default = 1) % %emata(PET_dyn_path, t_PET_delta, out_path, 'Patlak', PATLAK_flag) % PATLAK_flag = 1 or 0 (default = 1) % %emata(PET_dyn_path, t_PET_delta, out_path,...
f17e16739d56dccde67700b772b04616bcdd3bb78f77ec25bfd476d61757a039
MATLAB
10,517
300
function imgzoompan(hfig, varargin) % imgzoompan provides instant mouse zoom and pan % % function imgzoompan(hfig, varargin) % %% Purpose % This function provides instant mouse zoom (mouse wheel) and pan (mouse drag) capabilities % to figures, designed for displaying 2D images that require lots of drag & zoom. For mor...
20a6809ff9161433620b35629028545c4424e896f4d781e73bb04a61674a0759
MATLAB
10,524
204
function pyramid = chnsPyramid( I, varargin ) % Compute channel feature pyramid given an input image. % % While chnsCompute() computes channel features at a single scale, % chnsPyramid() calls chnsCompute() multiple times on different scale % images to create a scale-space pyramid of channel features. % % In its simple...
cbdd73cee3b12849bda4b7adb43dfbfbccd1175f6c24bb2424bf1e6b60baea81
MATLAB
10,533
222
function meg_Fig5b_TE_allTrials_mdlFit % Plot ITPC all trials with model fits (linear, and linear+periodic) % Fig5b %% Load data filename = 'figData/ModelFit_freeFreq_group.mat'; load(filename) %% Figure settings titleVis = 0; % if title vis off, then will plot for appropriate manuscript size showN = 1; % show n =...
b2822e2f9546bdd300c5c1418165c307a64d54f6abd84f0be4e3f3c1859f19b8
MATLAB
10,543
274
% This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful,...
c6f92cdb23e5f1e6b18865f0e23837d6fb8d7caa464016fbe959e52ae92dddba
MATLAB
10,546
258
function command = trackCodeGenBase(totrackinfo, varargin) % Generate the case command for tracking. Returned command uses WSL paths. This is a static method of DLBackEndClass. % Serial mode: % - movtrk is [nmov] array % - outtrk is [nmov] array % - trxtrk is unsupplied, or [nmov] array % - view is a *scalar* and *...
416658e271e7ecd3c817055e0908cc3d8eb2a4a50ff2132782acf2b8059d20e5
MATLAB
10,548
426
% Field Trip-related test scripts - Extracting bursts from FT data. % % See LICENSE.md for distribution information. % % % Includes. do_ft_init % % % Configuration. % Data reduction, for fast tests. use_one_band = false; %one_band_chosen = 1; % Theta. %one_band_chosen = 2; % Alpha. %one_band_chosen = 3; % B...
85ed85b83a093733f24f7c137a9aaca7dca544426faa6d1d46dee8618f704b65
MATLAB
10,548
309
% Author: Birgit Nierula % nierula@cbs.mpg.de function esg_prepro_loop8_cca(subject, nerve, srmr_nr, plot_graphs) %% set variables subject_id = sprintf('sub-%03i', subject); analysis_path = [getenv('ANADIR') subject_id '/esg/prepro/']; save_path = [getenv('ESGDIR') subject_id '/']; cfg_path = getenv('CFGDIR'); % ge...
10cffb8d1dacb315e4875ac2e38ef354a1f30d735f790757e287d5ed6723f126
MATLAB
10,554
288
%shortcut to save matlab workspace memory test_img_size(); %actual %[mini, full, lens, img_blur_fft, img_blur_cuda, img_blur_cuda_1GPU] = test_img_size(); %save('conv_data_8th.mat', 'mini', 'full') %if ~exist('conv_data.mat') %[mini, full, lens] = test_img_size(); %save('conv_data.mat', 'mini', 'full') %else...
24362d57dc2ff600fd246cba514c6b907bdea907d7e274ab1569ce65c2460710
MATLAB
10,564
262
function [output, Greg_tot] = dftregistration(buf1,buf2,buf2tot,usfac) % function [output Greg] = dftregistration(buf1ft,buf2ft,usfac); % Efficient subpixel image registration by crosscorrelation. This code % gives the same precision as the FFT upsampled cross correlation in a % small fraction of the computation time ...
8dfd236631f6848c9819432912eb6ce1e34f005cd438cdfe18cf2172aee1c0c8
MATLAB
10,570
165
function ChannelMap = LoadSubjectChannelMap(SubjectID) valid_subject_ids = {'BCI02', 'BCI03', 'CRS02', 'CRS07', 'CRS08'}; if strcmpi(SubjectID, 'all') ChannelMap = cell(size(valid_subject_ids)); for s = 1:length(valid_subject_ids) ChannelMap{s} = LoadSubjectChannelMap(valid_subject_i...
6dc4f3a032d86a3eb0481af411d281ef47be9842bbda0534199f2e907d0dea8b
MATLAB
10,578
258
function [acc, loss] = CBIG_KRR_innerloop_cv_allparams_LITE( test_fold, sub_fold, num_inner_folds, ... data_dir, y_resid_stem, with_bias, ker_param, lambda_set, threshold_set, metric ) % [acc, acc_concat] = CBIG_KRR_innerloop_cv_allparams_LITE( test_fold, num_inner_folds, ... % outdir, y_resid, ker_param, lamb...
4c779a34565cbf52237462704f53f8a2d764a454529bf8915819c490d557d2ce
MATLAB
10,585
282
function [model, loglikHist] = hmmFitEm(data, nstates, type, varargin) %% Fit an HMM model via EM % Interface is identical to hmmFit %% % This file is from pmtk3.googlecode.com if ~iscell(data) if isvector(data) % scalar time series data = rowvec(data); end data = {data}; end model.nstates = nstat...
27c5f4d86602793de3bb2ca33dbb10933b1133bfee110f763cabb3e4580c9019
MATLAB
10,589
228
%% Script to make struct array for ACR1 tracked data % This only works with speicific folder,subfolder arrangement as in subFolders = dir(pwd); realSubFolders = subFolders([subFolders.isdir]'); realSubFolders = realSubFolders(3:end); % Initialise video temporal parameters fps = 30; %frames per second trialDu...
e0e4ab93f040dc553d8bd660cf9f2179640a2c135141d097324e3ec231ef7390
MATLAB
10,595
260
%------------------------------------------------------------------------- % Author: Brandon S Coventry % Goal: To transform data from raster into Infotheory toolbox (Timme) form % Date: 01/10/2023 %-------------------------------------------------------------------------- %Data storage shape % n stimulus conditi...
05fb7aadd6f7147c8395ce81f6c4b7cedffe11b33ce15ce4e16ba2d061a9c079
MATLAB
10,602
247
function plotVelocityAnalysisFigs(DarkData) %% This script reproduces the bump velocity results in Figure 1 of Noorman et al 2024 % Concatonate each fly's data across trials [FlyData]=Combine_Data_Across_Trials(DarkData); % Make directory to save plots to PlotDir = 'velocityAnalysis_Figures/'; if ~isdir(Plo...
8859efee2bc1cd39da897986763785ea167b645af83d6b1777ac15a27394370b
MATLAB
10,608
303
% Set up format of simulation data to match mediation analysis medA = load(fullfile(saveLoc, 'for_plots_mediation_norm_to_se')); % sim_dat = load(fullfile(saveLoc, 'race_model_simulation')); % use race model with lower bound to simulate traces % [S,P] = simRace2DDM(t, varargin) numTr = 60000; t_sim = (0:...
e67abe38e270bcf7083aeec5129da2b69a0deebc15c954fdcf2b8ff4db61ee51
MATLAB
10,610
219
function NMJ_Region_Selector_Basic(BoutonSelectionDisplayImage, dilateSize, min_pixels, fudgeFactor,AllBoutonsRegion1) OS=computer; if strcmp(OS,'MACI64') dc='/'; else dc='\'; end pwd; currentFolder = pwd; [upperPath, deepestFolder] = fileparts(currentFolder); [ret, compN...
7a40fcab8e9aaf8b0da69a15420bbd17667264dce7f79893d6edf41fd8b8d05d
MATLAB
10,617
382
function CBH = cbfreeze(varargin) %CBFREEZE Freezes the colormap of a colorbar. % % SYNTAX: % cbfreeze % cbfreeze('off') % cbfreeze(H,...) % CBH = cbfreeze(...); % % INPUT: % H - Handles of colorbars to be freezed, or from figures to search % for them or from ...
beb92dfefadc956732035b5f2692274378720ee5556c656276fdeabb17205a06
MATLAB
10,618
197
%% Decription % This example simulates a collimated top hat beam of radius 300 µm % incident on skin, with some gel (water) on the top. This example is % constructed identically to that on the mcxyz website, except that photons % escape on all boundaries and the voxel grid is only 100x100x100: % https://omlc.org/softwa...
516317d32aece45fb98ab3f728f7f6c5f71a992295323de53b8d77885bcd80bd
MATLAB
10,630
392
function varargout = boundedline(varargin) %BOUNDEDLINE Plot a line with shaded error/confidence bounds % % [hl, hp] = boundedline(x, y, b) % [hl, hp] = boundedline(x, y, b, linespec) % [hl, hp] = boundedline(x1, y1, b1, linespec1, x2, y2, b2, linespec2) % [hl, hp] = boundedline(..., 'alpha') % [hl, hp] = boundedline(...
a72047ddd36cf5e11de5926fc5691465fb76bc732118da00f677f2a942475ee5
MATLAB
10,634
199
function [glob_avg1,glob_avg2,glob_avg3,glob_avg4,glob_avg5,glob_avg6,glob_avg7,glob_avg8] = assembly_trig_avg_pool (traces, pyr_id, int_id, si_img, TRace, RasterRace, CellCl, PCl, C0) windowSize = 200; %in frames x = -windowSize/2:1:windowSize/2; n_int_in_assembly = sum(sum(CellCl(:,int_id))); pyr_out_assemblies =...
51e23c3cc02b640036537cccf5d672e98f04363f2b1c54ee1e41b401aa71c9b9
MATLAB
10,639
276
function [dataout] = ft_denoise_dssp(cfg, datain) % FT_DENOISE_DSSP implements a dual signal subspace projection algorithm % to suppress interference outside a predefined source region of % interest. It is based on: Sekihara et al. J. Neural Eng. 2016 13(3), and % Sekihara et al. J. Neural Eng. 2018 15(3). % % Use as...
190f42845b6a4de28836090cdb303ff9790b2abca0ba8de9c801a1e04fede71a
MATLAB
10,659
299
% loadeeg_lan() - load a binary data file in Neuroscan .eeg file format. % % Usage: % >> signal = loadeeg(filename); % >> [signal, accept, typeeeg, rt, response, chan_names, pnts, ... % ntrials, srate, xmin, xmax] = loadeeg( filename, chanlist, ... % triallist, typerange, accepttype, rtrange, responsetype);...
3df639bc4a8742fb4f2c42df60d60eb3aac65d730b0faa00f2b0b720649a6a33
MATLAB
10,661
326
function [Regions,RgMeans] = lme_mass_RgGrow(SphSurf,Re,Theta,maskvtx,nst,prc) % [Regions,RgMeans] = lme_mass_RgGrow(SphSurf,Re,Theta,maskvtx,nst,prc) % % This function implements a region growing algorithm along the spherical % surface to find homogeneous regions comprising locations with similar % covariance compo...
67174383b30cb35ccdabe4a46e9d19c7cbdb7f13957ee87982ac05f5dc20b87a
MATLAB
10,661
227
function root = dtfit(X,y,varargin) % Fit a simple classification or regression tree. Rows of X represent % examples, columns are features. Target 'y' can be continuous or % catagorical, single or multivariate. Automatically infers type: % classification or regression. Features can be either binary or % continuous...
f4c23a82e934e044ba586206f565c9751524a5045b584721cc270179aeadde94
MATLAB
10,664
59
%Step 1 of CBIG Kong2019 Brain Parc Pipeline % %To run: 1. Open Matlab using salloc (ex: `salloc --mem-per-cpu 200G --time 2:00:00 --x11`) % 2. source your config file containing the $CBIG_CODE_DIR variable % -It might be helpful to `cd` to the $CBIG_CODE_DIR/stable_projects/brain_parcellation/Kong2019_MSHBM/step1.....
2929876f92e4ab82058c0a64437808d63860d3bbafebfd402b8dcde941846a22
MATLAB
10,666
204
function [DegreeCentrality_PositiveWeightedSumBrain, DegreeCentrality_PositiveBinarizedSumBrain, Header] = y_DegreeCentrality(AllVolume, rThreshold, OutputName, MaskData, IsNeedDetrend, Band, TR, TemporalMask, ScrubbingMethod, ScrubbingTiming, Header, CUTNUMBER) % [DegreeCentrality_PositiveWeightedSumBrain, DegreeCentr...
8bf78e2f4c27d50dd973fbc32afe4b047e49198af7a7e7f5ed635320790d1b74
MATLAB
10,666
219
% Plots correlation between RUN and SLEEP replay dynamics % INPUTS: % 'scoring': 'wcorr','spearman' - in the future will add 'linear' (default: 'wcorr') % 'control': 'fixed_rate','fixed_spike_count',' % global_remapped','rate_remapped','r...
478d9e23ee1de748e610f62ee21fe96a371573295623853c6c9b90fc13486815
MATLAB
10,676
375
function [xp,dxpdX,dxpdom,dxpdT,dxpdf,dxpdc,dxpdk,dxpdalpha] = project_points3(X,om,T,f,c,k,alpha) %[xp,dxpdX,dxpdom,dxpdT,dxpdf,dxpdc,dxpdk] = project_points3(X,om,T,f,c,k,alpha) % %Projects a 3D structure onto the image plane. %Same as project_points2, with the derivative with respect to the shape X (dxpdX) included...
f78e18249ab0a5f2818cf04ade1361acce52e2b214983065640f14f2142fc6ad
MATLAB
10,689
258
function chanunit = ft_chanunit(input, desired) % FT_CHANUNIT is a helper function that tries to determine the physical % units of each channel. In case the type of channel is not detected, it % will return 'unknown' for that channel. % % Use as % unit = ft_chanunit(hdr) % or as % unit = ft_chanunit(hdr, desired) ...
3dd28c58387754c7a88711582a0472b2409389c1b41d1d6ace075a33c955a441
MATLAB
10,692
287
function X = VBA_random (name, varargin) % // VBA toolbox ////////////////////////////////////////////////////////// % % X = VBA_random (name, p1, p2, ..., [N, M, ...]) % generate random numbers following the requested distribution % % If you the MATLAB statistics toolbox, this merely serve as an overload of % the ran...
08a10fb273c94edb15f82412fcc4ea309dfe50cec092f6c8e25d401532d0b8ab
MATLAB
10,694
283
function latextable(X,varargin) % LATEXTABLE produces a table for usage with LaTeX from a numeric array % latextable(X); % latextable(X,'PropertyName',PropertyValue,...) % % DESCRIPTION: % latextable(X) produces a gerneic table without headers and asks the % for a name and location for saving the file, X mu...
62b3a3efd6e802d92b088287f9a50ea36c0639ee064b6d903259bb8860672e41
MATLAB
10,694
227
function [StabilityBrain_LH, StabilityBrain_RH, GHeader_LH, GHeader_RH] = y_Stability_Surf_Window(WindowSize, WindowStep, WindowType, InFile_LH, InFile_RH, InFile_Volume, ROIDef, OutputName_LH, OutputName_RH, AMaskFilename_LH, AMaskFilename_RH, IsMultipleLabel, IsNeedDetrend, CUTNUMBER) % [StabilityBrain_LH, StabilityB...
3b5ad12bfd9a15661824b7965f18613e1966926124a953c71f5c90e87a6140f1
MATLAB
10,700
283
%% Plot cortical sources for NeVRo study % Project the spatial patterns from SSD, CSP, and SPoC into source space % by using eLORETA. % % Launch this script from top level of the NeVRo repository. % BEFORE RUNNING: % - Download the "New York Head" Leadfield from https://www.parralab.org/nyhead/ % - make sure the file...
469e2408f337af0465fe77407f148b98ccc29c782b05e3ce9ea173af6b024a33
MATLAB
10,700
362
loadParameters; %Load the pixel_idxs list filename_centroidsMOD = fullfile(params.punctaSubvolumeDir,sprintf('%s_centroids+pixels_demerged.mat',params.FILE_BASENAME)); load(filename_centroidsMOD) filename_output = fullfile(params.punctaSubvolumeDir,sprintf('%s_finalmatches.mat',params.FILE_BASENAME)); load(filename_...
fd5266cadd92185249a152ad4c68aaef8ac76ad494516d7c94a683648655b0f5
MATLAB
10,700
308
function [Results]=SUA_BayesModelTwoThree(AllTrialData,Phase,unit,timeWindow,opts) %%(AllTrialData,Phase,unit,timeWindow,opts) % unit=[1 50 1]; % % Phase='Go1'; % timeWindow=[.5 1]; % opts.BaselinePhase='CueTarget' model= 'FR~Condition'; LabelOrder={'Pinch' 'Press' 'Rub' 'Tap'}; cTrialData=Analyze....
4d42abfce413c6e0333bd2c2155742cfe809b616df2ddb44055c14d9dd7ea795
MATLAB
10,702
216
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
4ecc71414e5c35d6912d2a5ebac1f2233f190bed22b3c40f845a75c7a3e967b1
MATLAB
10,713
226
% motor_behavior_period_structures.m % Sarah West % 12/9/21 % Splits the all_periods structure into a structure where each possible % type of period is split into its own field. Is harder to read for humans, % but will be easier for using with established code. function [] = motor_behavior_period_structures(paramete...
17a939595fb89bb833aecc56b4b6a2609cbaed60936aafb8e0ffb4a030eab440
MATLAB
10,715
346
function lan_freq_event_plot(LAN_file,RT_file,freq) % <°LAN)<] % v.0.0.8 % ... en proceso!!! % % Marcelo Stockle % Pablo Billeke % 24.05.2013 % - Funciona para cualquier rango de frecuencias % - Enfasar condicional % 07.05.2013 % 09.04.2013 % 05.04.2013 % 02.04.2013 % 17.01.2013 % 16.01.2013 ...
4573b2cba8906909da67c64cc4c892575213a95e2c9a1e6606c9a88b77d302ec
MATLAB
10,721
475
%{ _ _ ___ _ __ __ _| |__ ___ ___ _ __| |_ / __| '__/ _` | '_ \/ __|/ _ \| '__| __| | (__| | | (_| | |_) \__ \ (_) | | | |_ \___|_| \__,_|_.__/|___/\___/|_| \__| # NNpredict **Syntax** ``` NNpredict(self, channel) ``` **D...
3dff550c2056dc5680d792d258eb62de0c0bd06637f5475ebe8c4f7de58ab48e
MATLAB
10,731
262
function acfSweeps % Parameter sweeps for ACF pedestrian detector. % % Running the parameter sweeps requires altering internal flags. % The sweeps are not well documented, use at your own discretion. % % Piotr's Computer Vision Matlab Toolbox Version 3.50 % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] % Li...
e92c0282b1e52ff7ba70d5e72de8583f36b8cd2002c31afa8cfbf028468fa405
MATLAB
10,733
388
function [LAN, latency ] = lan_latency(LAN, cfg ) % <*LAN)<] % v.0.0.6 % from latencia.m % Genera LAN.time para luego poder epoquira LAN.data continuo % cfg. source % 'RT' % 'event' % cfg. ref % code of event mark of epoch (references) % cfg.zero = 'stim' or 'resp' % take the stimuli or the respon...
d4fc891997bb231d0ed00d5169582668725f5a1ffb160902870eec606e61a97d
MATLAB
10,738
219
clear close all clc % addpath('/media/slohit/DATAPART1/Codes/CSCNN/NLR_codes/NLR_CS'); % addpath(genpath('/media/slohit/DATAPART1/Codes/CSCNN/D-AMP_Toolbox')); addpath(genpath('..\TV_AL3\TVAL3_beta2.4')); load experimentalData_GaussianMeasurements.mat % Load phi phi_0_10 = load('..\phi_suhas\phi_0_10_1089.mat'); phi_...
773058114c2404407b041aea5b86c8b70077add17eb761347bb1865704ef187c
MATLAB
10,740
304
%% Bicluster Demo %PMTKreallySlow %% % This file is from pmtk3.googlecode.com function [] = biclusterDemo() setSeed(0); nRow = 100; nCol = 30; dummyData = zeros(nRow, nCol); nLevels = 3; %% First a really simple example fprintf('First discover a bicluster in a really simple example -- binary data\n') dummyData(5:5:...
798fb716f6f12e9b0c44dd6ed7383baa67aa963dcfbfc08df56e5d9b497dc6bb
MATLAB
10,753
269
function Out=dpcaAnalysis(firingRatesAverage,firingRates,trialNum,time,varargin) % defaults dPCA_noReg=1; dPCA_Reg=1; % lambdas=1e-07 * 1.5.^[0:1:20];% allows less regularized % lambdas=1e-07 * 1.5.^[0:1:30]; % allows even more regularized lambdas=1e-07 * 1.5.^[0:1:25];% default % lambdas=1e-07 * 1.5.^[0:1:23];% defau...
b4e1328ea6fed95ebe4bcd90411be40ca360c81211ca092422a29b8ce1476e87
MATLAB
10,753
293
function [varargout]=gscatter3(x,y,z,g,clr,mrksle,mrksze,mrkfclr,leg,legloc) %------------------------------HELP START---------------------------------- % gscatter3 - 3D scatter plot by group % % Ussage: % gscatter3(x,y,z,g); % gscatter3(x,y,z,g,opt_param); % opt_param - optional parameters...
fbeb0d23fd9fe26bd69ffec95f825e45f8f7c74f752b5c71206d9825587d7d65
MATLAB
10,759
284
function meg_plotERFMax % finds max amp and max idx per target per condition per subject % averages and plots % April 2020 % mega group D load('/Users/kantian/Dropbox/Data/TA2/MEG/Group/mat/groupD.mat') load('/Users/kantian/Dropbox/github/ta-meg-analysis2/groupDataMat/TA2/D.mat') % load('/Users/kantian/Dropbox...
26525129587454884e87988f8ac6c800148f9353d26bab23ff4a5af57204f3ef
MATLAB
10,770
213
function [DegreeCentrality_PositiveWeightedSumBrain_AllWindow, DegreeCentrality_PositiveBinarizedSumBrain_AllWindow, Header] = y_DegreeCentrality_Window(WindowSize, WindowStep, WindowType, AllVolume, rThreshold, OutputName, MaskData, IsNeedDetrend, Band, TR, TemporalMask, ScrubbingMethod, ScrubbingTiming, Header, CUTNU...
80b6211cbe76c7753ad488c55cfa9ceb2937e82c7a554238077daafdf52885d1
MATLAB
10,771
246
%------------------------------------------------------------------------- % Author: Brandon S Coventry % Goal: To transform data from raster into Infotheory toolbox (Timme) form % Date: 01/10/2023 %-------------------------------------------------------------------------- %Data storage shape % n stimulus conditionsxre...
67d9b44cfb4131d8aab6c6be08fa2bf39f518a1d85b3160e2d9c54a48e4849b7
MATLAB
10,777
269
function hText = xticklabel_rotate(XTick,rot,varargin) %hText = xticklabel_rotate(XTick,rot,XTickLabel,varargin) Rotate XTickLabel % % Syntax: xticklabel_rotate % % Input: % {opt} XTick - vector array of XTick positions & values (numeric) % uses current XTick values o...
8b28ae3d74cc888fd94390b169563ff0e36bbcfb7d00567e0cb76be36788d867
MATLAB
10,790
330
%{ ## Run command locally: workspace = getenv('WORKSPACE'); datafolder = [workspace, '/data/cme/']; fn_timing = [workspace, '/data/cme/timing.csv']; output_dir = [workspace, '/results/cme/test']; stat_type = 'compute_degrees'; CHANGE_POINTS = 7; HAS_INSTRUCTIONS=1 deg_analysis_sbjs ## Run the with the following comma...
cd1fd20d36580f5734e1d8b7941cc48fb30b453af25874eaf133497880e20fbd
MATLAB
10,792
309
function [filt, B, A] = ft_preproc_lowpassfilter(dat,Fs,Flp,N,type,dir,instabilityfix,df,wintype,dev,plotfiltresp,usefftfilt) % FT_PREPROC_LOWPASSFILTER applies a low-pass filter to the data and thereby % removes all high frequency components in the data % % Use as % [filt] = ft_preproc_lowpassfilter(dat, Fsample, F...
32171d3ea5b74f98c11bce84fe17c00c6ca2a475d54ba800e3784575d3ee89df
MATLAB
10,799
290
% FindAtlasRegions.m % Sarah West % 4/1/22 % Uses center-of-mass and percent area to find the best atlas region for % each spatial source. function [parameters] = FindAtlasRegions(parameters) % If there's a mask for this mouse & the atlas hasn't been masked yet, % do that now. if isfield(parameters,...
6455d30b15fbe2d684ab31d9698813155c52af98410271909860be26ab88181a
MATLAB
10,801
304
function varargout = VBA_spm_select(varargin) % File selector % FORMAT [t,sts] = spm_select(n,typ,mesg,sel,wd,filt,frames) % n - number of files [Default: Inf] % A single value or a range. e.g. % 1 - select one file % Inf - select any number of files % [1 Inf] - selec...
74cf6adab2c1c4a45f9ff540c733ce7b594b1d44ee3f9bb89fd9ee54349c918d
MATLAB
10,807
391
function [labels,info]=isosplit2(X,opts) if (nargin<1) test_isosplit2; return; end; if (isstr(X))&&(strcmp(X,'test')) run_misc_tests; return; end; if (nargin<2) opts=struct; end; if (~isfield(opts,'return_iterations')) opts.return_iterations=0; end if (opts.return_iterations) info.iteration...
9c468b32ab021ffcbb7729b4243cba66621a7b1dc09254e81fcc6b3cbe8ad4a0
MATLAB
10,815
264
function draw_figure4D_S4D(p,encRes) % % This code is for drawing figure 4D and S4D % Before drawing, slope estimation is conducted. % %% settings compPairs = { {'category','dimension'} {'category','semantic'} {'category','vision'} }; load(p.roiInfPath,'roiInf'); p.roiDescrip = {roiInf.hcp360.roiDescri...
73025b4038f37695b102ae7d2fd539d91eb28ebc5a47c1921d94e6a3440075aa
MATLAB
10,820
305
function [filt, B, A] = ft_preproc_highpassfilter(dat,Fs,Fhp,N,type,dir,instabilityfix,df,wintype,dev,plotfiltresp,usefftfilt) % FT_PREPROC_HIGHPASSFILTER applies a high-pass filter to the data and thereby removes % the low frequency components in the data % % Use as % [filt] = ft_preproc_highpassfilter(dat, Fsample...
d55d494caaf4023231367b9ba6da6dbcc91899c813943632b2129dbb8b4b819b
MATLAB
10,821
337
% finputcheck() - check Matlab function {'key','value'} input argument pairs % % Usage: >> result = finputcheck( varargin, fieldlist ); % >> [result varargin] = finputcheck( varargin, fieldlist, ... % callingfunc, mode ); % Input: % varargin - Cell arra...
b8c3f87cd1fb8be2ad06de49493e01dae00983cba98d4f906e30c3d5dc711e5b
MATLAB
10,823
308
function [filt, B, A] = ft_preproc_lowpassfilter(dat,Fs,Flp,N,type,dir,instabilityfix,df,wintype,dev,plotfiltresp,usefftfilt) % FT_PREPROC_LOWPASSFILTER applies a low-pass filter to the data and thereby % removes all high frequency components in the data % % Use as % [filt] = ft_preproc_lowpassfilter(dat, Fsample, F...
74aefc13080da544a2da0bb6dc5a840a75f238cae9a0e90ab68bc07f979f9600
MATLAB
10,831
174
%% % ================= RESPONSE ANALYSIS ================= %% clear all; close all; clc; %% for s = 1:21 if s < 10 sub = strcat('P0',num2str(s)); else sub = strcat('P',num2str(s)); end if sub == "A09" || sub == "A15" runs = [1:5]; else r...
4b58b4a6ec31453e808ab8f1e091c41174de963a81243e6895039a10a799f33d
MATLAB
10,838
226
function meg_manuscriptFigs_TE_allTrials_mdlFit % Plot ITPC all trials with model fits (linear, and linear+periodic) %% Load data user = 'kantian'; % filename = % sprintf('/Users/%s/Dropbox/github/ta-meg-analysis-model/model_anticipatory/ModelFit_1_freeFreq_GroupTS_231102.mat',user); % only 1 permutation filename = ...
adf239833e987a6d0e0ee98e535f27fdedb88ac2656811b4928c029461ba4754
MATLAB
10,840
233
function data = chanscale_common(cfg, data) % CHANSCALE_COMMON applies a scaling to specific channel types % % Use as % data = chanscale_common(cfg, data) % where the configuration contains % cfg.parameter % % For specific channel groups you can use % cfg.eegscale = number, scaling to apply to the...
50354f39ab3056e57deec9917c6a786ab2bddf0a8e795198e1ee3e6c4421d942
MATLAB
10,851
304
function [filt, B, A] = ft_preproc_highpassfilter(dat,Fs,Fhp,N,type,dir,instabilityfix,df,wintype,dev,plotfiltresp,usefftfilt) % FT_PREPROC_HIGHPASSFILTER applies a high-pass filter to the data and thereby removes % the low frequency components in the data % % Use as % [filt] = ft_preproc_highpassfilter(dat, Fsample...
5a52af9b8541714f9589f118c999a9fd0b6adc7d879414def7bc93f357b7d3dd
MATLAB
10,853
283
function [Vo, Yo, Yc, Ya, Ymsk, Ym, Affine, YaROIname, YaROIid, RES, BB] = ... boney_segment_loadMRI(P, job, seg8t, tis, cls, bd) % loadMRI. Load MRI and segmentation maps with general size limit. % % [Vo,Yo,Yc,Ya,Ym, Affine, YaROIname, RES, BB] = ... % boney_segment_loadMRI(P, job, seg8t, tis, cls, bd) % % P ...
82151d967442155fb22068b8a03b30e824f8c9518f53da287d57ed672534f7e8
MATLAB
10,858
287
function ConvertKlusta2Neurosuite(shank,basepath,basename,numCores) % Converts .kwik/kwx files from Klusta into klusters-compatible % fet,res,clu,spk files. Works on a single shank of a recording, assumes a % 16bit .dat and an .xml file is present in "basepath" (home folder) and % that they are named basename.dat and...
461ff9197462f0ca512b044adc9677237e218a7404644aa7f35905eae022413c
MATLAB
10,860
237
function perform_clustering_analysis(p,encRes) % % - This code is written for performing clustering analysis % based on encoding accuracy % % called from emotion2020_analysis_BATCH % %% settings testSubjectTypes = {p.sbjID{:},'randctrl'}; nclust_all = [50,27,15]; % numbers of kmeans clustering nTopSampleProp = 5; %...
f24f7292350c350a9396b39a5f958f21f8d36bc630345ed2c5fc3c0c3ef36051
MATLAB
10,860
219
function Cfg = y_Organize_SegmentSubregions(Cfg,WorkingDir,SubjectListFile,IsSlurmOrganizeSurf) % function Cfg = y_Organize_SegmentSubregions(Cfg,WorkingDir,SubjectListFile,IsSlurmOrganizeSurf) % Organize results by Segment Subregions. % Input: % Cfg - the parameters for auto data processing. % WorkingDir -...
bbe69679c92aa54821dde87568ba8cb19ee71593d60d9fb8a42f6d54331e7f6a
MATLAB
10,865
232
%% Initial Setup % Put all needed paramters in a structure called "parameters", which you % can then easily feed into your functions. % Use correlations, Fisher transformed, mean removed within mice (mean % removed for at least the cases when you aren't using mice as response % variables). clear all; % Create th...
70064d837e385c6065e8b69b512518956eb8babbc4e5ae7689cdfb9162137cc5
MATLAB
10,876
233
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Thalamic spindles and Up states coordinate cortical and hippocampal % co-ripples in humans % % Dickey et al. 2024 % % Compute and compare probabilities of co-occurring hippocampo-cortical % ripples ("co-ripples") for the following conditi...
4b7a6eb276f2c4bff53f1e5557d6ae5e3b26f67b01aff05b3248485c49be192a
MATLAB
10,881
277
function [spike] = ft_datatype_spike(spike, varargin) % FT_DATATYPE_SPIKE describes the FieldTrip MATLAB structure for spike data % % Spike data is obtained using FT_READ_SPIKE to read files from a Plexon, % Neuralynx or other animal electrophysiology data acquisition system. It % is characterised as a sparse point-pr...
b328525c10d203ef3f511d81a2fcaf2b4b96acc9d6e4b086cce4606eb19b3027
MATLAB
10,881
214
% Theta bouts detection % Modified by JZ based on "Bicycle" analyses suite: https://github.com/bycycle-tools/bycycle % % Parameters settings % % cycleLength= 3; % least cycle numbers % amplitude = 0.3; % amplitude threshold, 0.3 % period = 0.5; % period threshold, 0.5 % mono = 0.6; ...
55b1020403657334818fd35b600f231222f09300f325580d826437d9f9d275bb
MATLAB
10,882
377
function [out] = VBA_spm_eeg_render(m,options) % Visualisation routine for the cortical surface % FORMAT [out] = spm_eeg_render(m,options) % % INPUT: % - m = MATLAB mesh (containing the fields .faces et .vertices) or GIFTI % format file. % - options = structure variable: % .texture = texture to be projected onto...
9c7058fc3d27f9482e65f885ebbf2095dd0a13715e46228574310a8ee8079fc7
MATLAB
10,882
346
%% ssta_vs_SDO % % Show the spike-triggered average, mean-split, and state-dependent % spike-triggered averages to demonstrate how averaging results in a % less-accurate prediction of future signal behavior. % % Uses the programatic methods %_______________________________________ % Copyright (C) 2023 Trevor S. Smit...
11e68fca2b0b15c2af1f318f755bfb3ffec7f032aa13bb926df9a9e3344eadbb
MATLAB
10,884
277
function [spike] = ft_datatype_spike(spike, varargin) % FT_DATATYPE_SPIKE describes the FieldTrip MATLAB structure for spike data % % Spike data is obtained using FT_READ_SPIKE to read files from a Plexon, % Neuralynx or other animal electrophysiology data acquisition system. It % is characterised as a sparse point-pr...
b4db66656ac7f83d109938503b65846306cd36006b142ed46c96a9065a064bee
MATLAB
10,897
313
% first, find the standard deviation of each trial (GAMMA BAND). Will discard certain % data. clear smooth_envelope* all_std if(single_column) the_length = 64; else the_length=128; end smooth_envelope = nan(the_length, length(LFPRawAll)); for chan = 1:the_length the_chan = chan smooth_envelope(the_cha...
627bea9b643b23d872022112d08638ec23febc34f6b4feb5a46a0eefd18308e0
MATLAB
10,901
343
clear; clc; doSaveFig= 0; doSaveGrandAvg= 0; if strcmp(getenv('COMPUTERNAME'), 'NB-VATS-LAB1') fig_dir= 'C:\Users\sap245\Google Drive\PostDoc\dAM_MultiSpecies\Figures\'; else fig_dir= 'G:\My Drive\PostDoc\dAM_MultiSpecies\Figures\'; end if ~isfolder(fig_dir) fig_dir = './saved_figures/'; if ~exist(f...
ea120d03f84f2893f5aa6c5fadac971759e665cdcaabd094b4897cb52f727764
MATLAB
10,901
259
function [data,varargout] = femdata_DCS(mesh,tau_DCS,varargin) % FEMDATA_DCS Calculates diffuse correlation spectroscopy (DCS) data % (electric field temporal autocorrelation function) for a given mesh at % a given correlation delay times. % % SYNTAX: % [DATA] = FEMDATA_DCS(MESH, TAU_DCS) % [DATA] = FEMDATA_DC...
70e3b96f9fbb6d37f79d37215f039f2f22c2b35401b4b4ff3197da414fb6b1ab
MATLAB
10,905
287
%% Classification using parametric discriminative models in pmtk3 % % We extend the parametric discriminative regression models discussed % <http://pmtk3.googlecode.com/svn/trunk/docs/tutorial/html/tutRegr.html % here> to the classification setting. %% Logistic regression: plugin method % Consider fitting a bin...
be9ee7a9ad4b2a1f4574185123f9b995c0aba60d886339360205bac1e8ac485d
MATLAB
10,937
286
classdef PointCloud < handle_light % Contains the point cloud that represents a detected surface % % property ROI specifies the coordinate system and range in which the % points are specified relative to the the raw data % % See also surfaceDetection.RegionOfInterest %--------------...
a599e0aeb6757afc4662d344ec1478ef20802be7eb0ac8b52d45de041abe645c
MATLAB
10,949
221
function [fx,indlev] = RecToMfunction(x,P,u,inF) % recursive evolution function for k-ToM's learning rule (2x2x2 game) % [fx,indlev] = RecToMfunction(x,P,u,inF) % Marie Devaine wrote this function in November 2015 (comments: JD). % A k-ToM agent with k>0 learns the unknown parameters (theta) of her % opponent's learnin...
61653684b5a051209dff19e4a8dd947a04fdd62cbbff14b6e7930839e6e29b91
MATLAB
10,951
393
function LAN = syn_hilbert_lan(LAN, freq, win_cycles) % V.1.9.86. fix % 27.11.2009 % PLI en prueba % % % % Calculate -> syncrony between electrodes througth hilbert transforms % example: % LAN = syn_hilbert_lan(LAN, 25, 6); % % parameters: % LAN % matrix 2d elec x time % ...
cc02ae8c5457b31822bb301b39e0ded75027b7989e51c088ef3fc5a5eb49cf27
MATLAB
10,952
307
function [spike] = ft_read_spike(filename, varargin) % FT_READ_SPIKE reads spike timestamps and waveforms from various data % formats. % % Use as % [spike] = ft_read_spike(filename, ...) % % Additional options should be specified in key-value pairs and can be % 'spikeformat' = string, described the fileformat (defa...
4b1dc2b78aef5425074ea84b9f470c01d5ec0ecc16b3ef4c56a0eac66f826918
MATLAB
10,956
353
%% GP kernel plots from David Duvenaud's thesis % Code from https://github.com/duvenaud/phd-thesis/tree/master/code % Modified by Kevin Murphy function gpKernelPlot(seed) % A script to make a series of plots demonstrating how structure can be % reflected in a kernel. % % This version updated to be more amenable to ti...
92ae9f7a15c248bf582bc2f6a3866afd956b47d267cbcaa75e23f978c7078a9d
MATLAB
10,964
320
function [A,fH,figNames] = meg_plotITPC(data,sessionDir,p,selectedChannels,selectedFreq) % MEG_PLOTITPC(data,sessionDir,p,selectedChannels,selectedFreq) % % INPUT % data % structure of condition cells containing % data matrix, time x channels x trials % sessionDir % eg: 'R0817_20171212' % selectedChannels % v...