sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a67f96e86e8a0e6342b7f309462ed7f08f99cf01d70e2023852b28c93a98bbbb
MATLAB
9,062
212
% tCFS_prepE1_data %this script concats group effects for b-CFS and re-CFS, and exports in %JASP friendly format. % reorient load. job=[]; job.concatGFX= 1; % job.plotPFX=1; % job.plotGFX=0; %% set up some directories. % homedir = 'C:\Users\mdav0285\OneDrive - The University of Sydney (Staff)\Desktop...
5d68444e3ab90ae0a2c261373d8d8961c3508f29440afcdc40978dc26ada5cd2
MATLAB
9,063
189
function [W0, R] = null_model_dir_sign(W,bin_swaps,wei_freq) %NULL_MODEL_DIR_SIGN Directed random graphs with preserved weight, % degree and strength distributions %null_model_und_sign % null_model_sign % W0 = null_model_dir_sign(W); % W0 = null_model_dir_sign(W,bin_swaps); % W0 ...
b9e1a8d25602bb0f403d90d23a72d7958548c449af3e242c37b9534aa0333e2e
MATLAB
9,068
252
%% load dataset % load('dataset_201.mat', 'df'); % load data of 201 brain regions load('dataset_53.mat', 'df'); % or load data of 53 brain regions % load('dataset_64.mat', 'df'); % or load data of 64 brain regions load('onto.mat', 'onto'); ivol = cat(1, df.Volume{:}); % get volume of each...
99d149ed733987def56607202bef7efb88036b9248573e9c8f2a8157a6822e43
MATLAB
9,069
337
function [errs warns] = generic_unit_classifier(class_args) % Generic classification train/test unit test % % [ERRS WARNS] = GENERIC_TEST_CLASSIFIER(type) % % Calls the classification train/test functions specified % in CLASS_ARGS on a variety of synthetic and real % data. This script is intended to be called from % w...
2736321429872afc7d4e1b3c4346838b29ef5c68ea8606b7db89de068c4e9ccb
MATLAB
9,077
268
function T = poly_to_tensor(r, gamma) % T = POLY_TO_TENSOR(R, GAMMA) % % Construct orientation tensors in up to four dimensions from quadratic % polynomial expansion coefficients. The algorithm is described in chapter % 5 of Gunnar Farnebäck's thesis "Polynomial Expansion for Orientation and % Motion Estimation". % % R...
8e78247a70d2812dcffce945827288d39e09ab0dc4c3209520af9cc41d8b0486
MATLAB
9,112
197
function [mapsShuf] = voronoiFieldShuffle(map_unsm,map_pos,nRnd,cellID,trID) % Randomise data by voronoi-segmenting rate map and randomly rearranging segments. % % [mapsShuf] = voronoiFieldShuffle(map_unsm, map_pos, n_shuffle) % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Map/field segmenta...
a1bcc22a8aa4c796d757266fa3098fc39cb34b91b665ae5514ca3a4672bc744f
MATLAB
9,150
186
% function [data,scaleparams] = decoding_scale_data(cfg,data,scaleparams,residuals) % % Function to perform data scaling on training or on test data. There are % two ways in which scaling can be performed: Using the data itself to % estimate scaling, or using external data (e.g. a covariance matrix from % residual...
95f62565e6c79465066a3307c04028433e8c8f3a9dcc42edc5c68389095c1e69
MATLAB
9,173
318
%% MONPangle % Lloyd Russell 2018 % Calculate how to align optical axis of microscope opbjective to be % perpendicular to the tilted sample plane. Calculates the pitch and yaw % values for use with the Bruker orbital nosepiece given the recorded tilt % of window which is measured by recording the Z depth when thr...
fb54a733adeedc46ca50cdc65d683e31ab160775ac0cf916c962528e3af0c7e5
MATLAB
9,174
203
% Plot voltage and spike times for sim figure in hco 2.0 article run("../initOAT"); % read in voltages stel_nR = NeuronReader('/mnt/StorageDrive/General/comp_neuro/gmu/research/simulation/hco_2/sim_fig/results/n_MEC_LII_Stellate.dat'); bask_nR = NeuronReader('/mnt/StorageDrive/General/comp_neuro/gmu/research/simulatio...
1d456f19c5b839479e2e88e6c0af45161825ca2278b9e6eb3ff86251f035b535
MATLAB
9,183
190
% Figure 5 %creating quadrent lines to help deliniate regions of the plot x_lineatzero = [-40:0.5:40]; y_xlineatzero = zeros(1,length(x_lineatzero)); y_lineatzero = [-40:0.5:40]; x_ylineatzero = zeros(1,length(y_lineatzero)); x_linezeros = [-40:0.5:40]; y_apone = ones(1,length(x_linezeros)); %Need...
a95b50d8251e9dc272fe21c1bd108651ca3fe783418d3710fde37e11788872db
MATLAB
9,193
195
%% Plot burst-highlighted raw data for axons in tunnels clear clc % stim_dir="D:\Brewer lab data\HFS\No Stim\23-Nov-2021_B\"; % no stim % stim_dir="D:\Brewer lab data\HFS\Theta Stim\10-May-2022_A\"; % 5hfs % stim_dir="D:\Brewer lab data\HFS\HFS Stim\24-Nov-2021_A\"; %40 HFS % testing % stim_dir="D:\Brewer lab data\H...
a6661ed942a66a5f44d02ccff0641c8fb98389636c97909bc3b172f0e565fdd6
MATLAB
9,206
255
% mv_classify_timextime unit test % rng(42) tol = 10e-10; mf = mfilename; %% Create a dataset where classes can be perfectly discriminated for only some time points [two-class] nsamples = 100; ntime = 300; nfeatures = 10; nclasses = 2; prop = []; scale = 0.0001; do_plot = 0; can_discriminate = 50:100; cannot_discrimi...
07cc3b9bc53bd867cd79836407cd0ae7b5703d93e6d3e68902799ed7f877c3f1
MATLAB
9,218
282
function bhvr_plot(p) % function bhvr_plot(bhvr, p) % % Plot behavioral data and analyses. Creates the following plots: % 1. Response distribution and vMMM fit % 2. Response bias % 3. Behavioral precision (estimated kappa of the vMMM) for each group % 4. Other estimated parameters for each group % 5. Individual vMMM f...
fdd51f7da18ed2d5d758e71212cc606114730952f1a9c1de179a7a15f9d8447f
MATLAB
9,219
129
%Gets list of clinical channel labels, and corresponding montage channel %numbers in some cases. Additionally, has mechanism to proofcheck that have %correct channels labels in various files. % %fnames: structure that may contain: %*root_dir %*subjectID %*task %*ses %2024/02/25 function varargout=fetch_channels(fnames...
1c1966a9a58b203eb23c6da4594bd0a758e366097a3d24562618ec2e69518235
MATLAB
9,222
398
clc; clear all; close all folder='/archive/bioinformatics/Danuser_lab/Fiolka/Manuscripts/POPSIM/CodeToShare/ExampleData/' %% cross-correlation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% time=[1]; % time...
a98ba44d32acc7ec4ebfb53121cdde44a5efc8595722525cc9e2f5f2c9824f09
MATLAB
9,239
255
function h = mv_plot_2D(varargin) %Plots 2D results, e.g. a time x time generalisation. Plots the results as %a color matrix. If a 3D matrix is given several subplots are created. % %%Usage: Two possible usages, either giving additional parameters in a cfg % struct (with cfg.key1 = value1) or directly giving the ...
242b9cffefc2ade32e5b11daca6604490dabd25fb55dd0e6880960ae4be48232
MATLAB
9,282
264
function Experiment = run_vwm_training(Experiment) Subject = Experiment.Subject; Display = Experiment.Display; %% Instructions and example trial % Timing and trial parameters itiExample = 2.5; trialCueExample = 0.5; stimExample = 2; maskExample = 2; cueExample = 2; delayExample = 6; respExample = 3; probeExample = ...
bc5fec8cefe192c558aae954ee9fb1210463f29b36ec765a68c40463850daf6f
MATLAB
9,302
342
function [y, S, F, ydata,alphaK,timeOurs,converge,LF] = SIMLR(X, c, k, ifimpute,normalize) %%% if nargin==2 k=10; ifimpute = 0; normalize = 0; end if nargin==3 ifimpute = 0; normalize = 0; end if nargin==4 normalize = 0; end if ifimpute X = X'; [I,J] = find(X==0); Xmean = mean(X...
2344362162e5019c7bfc628c595813872ff94e701dc93238d05524103ca03309
MATLAB
9,303
344
function setGuiFonts(inp1, inp2) ns = getNamespace(); if isempty(ns) return; end if strcmp(ns, 'AtlasViewerGUI') if nargin == 0 setGuiFonts_AtlasViewerGUI(); elseif nargin == 1 setGuiFonts_AtlasViewerGUI(inp1); elseif nargin == 2 setGuiFonts_AtlasViewerGUI(inp1, inp2); end el...
3cd02877d6c92b10a504296bd9403c7232a2550bfe12dd04262cd3bb8528db3f
MATLAB
9,307
272
%This script calibrates optical path correction. %Be sure to scan a flat surface using scanTarget function %% Inputs %experimentPath = s3SubjectPath('2019-11-30 Imaging Flat Surface On Motorized Stage','',true); experimentPath = s3SubjectPath('2020-01-24 Imaging Flat Surface On Optic Table','',true); json = aw...
9a3bb08b178a51abc44e2e9be643454d1dfa0c14b0c5bde69a3723a2fa1d6ca0
MATLAB
9,311
232
function [update] = ... polynomial_expansion_registration3d(moving, fixed, varargin) % POLYNOMIAL_EXPANSION_REGISTRATION3D Estimates a displacement field using polynomial expansion % % INPUT ARGUMENTS % moving - Moving image % fixed - Fixed image % % OPTIONAL INPUT ARGUMENTS % 'signalModel' ...
9a6cba8f36c519f507f3e57b0fe58983a85c8ce165d8e8b58742f001d76c602a
MATLAB
9,336
244
% function design = make_design_boot_cv(cfg,n_boot,balance_test,n_train) % % Function to generate design matrix for classification using bootstrapping % in the decoding toolbox. This design is helpful if it is not clear how % to separate training and test data (e.g. which pair should be left out) % or if there is u...
c8223d142e7de65e60145f32815e89fe20a79a74a26860c8f253c25c7d11f92e
MATLAB
9,336
368
function Duszkiewicz2024_Figure_IsomapWake % This script reporoduces panels from: % Figure 7, Extended Data Figure 10 % Dependencies: %TODO: script dependencies, links to external functions % Copyright (C) 2023 by Adrian Duszkiewicz and Adrien Peyrache % % This program is free software; you can redistribute it and...
1419bdb40d686fd182c3cc90a8a11df58d279078832559592f8e50a796073e1e
MATLAB
9,343
345
function [center,radius] = minboundsphere(xyz) % minboundsphere: Compute the minimum radius enclosing sphere of a set of (x,y,z) triplets % usage: [center,radius] = minboundsphere(xyz) % % arguments: (input) % xyz - nx3 array of (x,y,z) triples, describing points in R^3 % as rows of this array. % % % arguments:...
d6fb45e0d326526dccd6817fdf8836ff09c05084500a95622745c6f36eda681d
MATLAB
9,370
289
% STATUS: inactive % % SYNTAX: % grpBarChartROINames_04(sbjGrp,numClasses,rejChnOp,saveOp) % % DESCRIPTION: % Plot decoding performance (accuracies) of each channel as bar chart. % % RESTRICTION: % None. % % INPUTS: % sbjGrp - int: group of subjects. Encoding as follow: % 1 - high-performance group % 2 ...
e64c04e2f1969666edf9fd60f0a76a8f8e439e01759def6a6fa95daa9ff60b60
MATLAB
9,377
283
% function design = make_design_xclass_cv(cfg) % % % Function to generate design matrix for cross classification using the % decoding toolbox. This function uses leave-one-run-out crossvalidation, % but keeps training and test data separate. In that way, % crossclassification is done with independent runs. % % IN % c...
856981d8798be27e0357de7d970cfcc7e50482ec144350e45104a50433a785a4
MATLAB
9,389
248
% Classifier unit test % % Classifier: lda rng(42) tol = 10e-5; mf = mfilename; % Random data nfeatures = 100; X = randn(1000, nfeatures); clabel = randi(2, size(X,1),1); %% check "scale" parameter: if scale = 1, training data should be scaled such that mean(class1)=1 and mean(class2)=-1 % Get classifier params par...
110de19d6f2233bfba7ef38e49ab12cb984a33dbc96419e46ba4415f35859d0f
MATLAB
9,406
296
% tCFS_prepE3_data %this script concats group effects for b-CFS and re-CFS, and exports in %JASP friendly format. % reorient load. job=[]; job.concatGFX= 1; % job.plotPFX=1; % job.plotGFX=0; % adding data for average contrProfile per speed (review figure) %% set up some directories. %PC % homedir...
461507240bfbf811d1437a292422b249f97dc33ca532c3607099fe68430d1a08
MATLAB
9,408
300
function [err, v, Info, Com] = Read_1D (fname, p1) % % [err,M, Info, Com] = Read_1D (fname, [opt]) % or % [err,M] = Read_1D (fname,[opt]) % or % M = Read_1D (fname, [opt]) %Purpose: % Reads an AFNI 1D file into M % % The file is to contain an ASCII table % of numbers. All rows must have the same number ...
c0219b9de9904a93bc89a396c33273476d416ecef7ae3403d2fe4b3c12b5f675
MATLAB
9,411
231
% STATUS: active. % % SYNTAX: % preprocessFNIRS06_BVar(sbjNum,rawDataFN,movieList) % % DESCRIPTION: % Perform GLM on entire set. No splitting into training/test set. % % RESTRICTION: % Only for sbj 08 and 10. % % INPUTS: % sbjNum - subject ID. 2-digits string. Ex: '08'. % rawDataFN - 1xN cell array of nirs data rec...
71c523c4bfe5016860bf4b97e8495c7edab2bb79e2361eedcea0d375eecd0f18
MATLAB
9,427
256
clear; close all; clc; % modification from @GenerateExpectedGC6fResponsetoNoise in noise folder % and from @TestSpatialDecorrelation_position_NatMov in NaturalSceneVideo % folder %% FolderPath = '\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\NaturalSceneVideo\Preprocessed\Blue\'; nClip = 11; %% positio...
0a1a8c86cac17353842103dc086fe22dd0385759bce90af3da27cff647bf307d
MATLAB
9,455
240
% references: https://www.mathworks.com/matlabcentral/answers/180778-plotting-a-3d-gaussian-function-using-surf % https://www.mathworks.com/help/symbolic/rotation-matrix-and-transformation-matrix.html % https://www.mathworks.com/matlabcentral/answers/430093-rotation-about-a-point % run options sample_matrix = 0; write...
b1fe88d04cb6eece50feefa1e2db7261789f626dd8883b4030bb28383f18e3ef
MATLAB
9,468
240
% references: https://www.mathworks.com/matlabcentral/answers/180778-plotting-a-3d-gaussian-function-using-surf % https://www.mathworks.com/help/symbolic/rotation-matrix-and-transformation-matrix.html % https://www.mathworks.com/matlabcentral/answers/430093-rotation-about-a-point % run options sample_matrix = 0; write...
c8581be8d83cb529984098b4a4b70b3bd4934804897fce9ec06f622c3249076f
MATLAB
9,472
306
% PrairieLinkRawDataStream % ======================== % Convert and save raw data on-line % Lloyd Russell 2016. Optimised on 2017-03-10. Added 'GUI' on 2017-04-11 % Henry Dalgleish 2018 implemented online motion correction (using Suite2P functions) % % To do: % ------ % * Fix first run bug - very first time run...
b6ffed675ab8255ae516bfc8f064d3fd17f7db4fa6417e6b50ed41204483be03
MATLAB
9,505
380
function demnlab(action); %DEMNLAB A front-end Graphical User Interface to the demos % % Description % This function will start a user interface allowing the user to select % different demonstration functions to view. The demos are divided into % 4 groups, with the demo being executed by selecting the desired % option ...
d5c07a89d5e1f6b138f894c872965ae0820092c4bf042084bb2583845e6a0ceb
MATLAB
9,510
270
function [adj_list_pat_idx scratch adj_list_mask_idx adj_neighb_counts] = adj_sphere(mask,varargin) % Creates adjacency list using spherical neighbourhoods % % [ADJ_LIST_PAT_IDX SCRATCH ADJ_LIST_MASK_IDX ADJ_NEIGHB_COUNTS] = ADJ_SPHERE(MASK, ...) % % Create an adjacency list using a spherical neighbourhood % function....
be1e1587aab4e058684a404f0f98575c70843a0df81d585a119efc87f50ff173
MATLAB
9,515
204
%% Manuscript Information % % Authors: Tadamoto Isogai, et al. % Title: Direct Arp2/3-vinculin binding is required for pseudopod extension, % but only on compliant substrates and in 3D % % Abstract: A critical step in cell morphogenesis is the extension of actin-dense pseudopods, % controlled by actin-bindin...
9ffa19a2a4de976e972f3afb70fbade2f81d4a1e8d95cd76b114eec1bcc40586
MATLAB
9,530
225
function trialStruct = runTrial_OLD(taskStruct, dispStruct, trialStruct) % randomize higher/lower buttons across left/right presentation buttonChoiceOrder = randperm(2); if buttonChoiceOrder(1) == taskStruct.HIGH buttonChoiceL = dispStruct.imgGuess_Higher; buttonChoiceR = dispStruct.imgGues...
b57bf5c0cd23670685db3e557e0aea3c678fdfaec97f278ac803d59ff73a6383
MATLAB
9,531
240
% references: https://www.mathworks.com/matlabcentral/answers/180778-plotting-a-3d-gaussian-function-using-surf % https://www.mathworks.com/help/symbolic/rotation-matrix-and-transformation-matrix.html % https://www.mathworks.com/matlabcentral/answers/430093-rotation-about-a-point % run options sample_matrix = 0; write...
6375aa896923a49a1c1e426317d16b5c87404ab85a97a986e8ed994de1cc4beb
MATLAB
9,539
240
% references: https://www.mathworks.com/matlabcentral/answers/180778-plotting-a-3d-gaussian-function-using-surf % https://www.mathworks.com/help/symbolic/rotation-matrix-and-transformation-matrix.html % https://www.mathworks.com/matlabcentral/answers/430093-rotation-about-a-point % run options sample_matrix = 0; write...
1574b9049b23a7f7b15604bbd5835bbcadecf6ca7ddfb9504a3c3d8a065a8cba
MATLAB
9,554
240
% references: https://www.mathworks.com/matlabcentral/answers/180778-plotting-a-3d-gaussian-function-using-surf % https://www.mathworks.com/help/symbolic/rotation-matrix-and-transformation-matrix.html % https://www.mathworks.com/matlabcentral/answers/430093-rotation-about-a-point % run options sample_matrix = 0; write...
00f736ee5cbe0d7459978a4ef7f6cc6a283a8a78b281a6033683cb3a61c302ee
MATLAB
9,560
386
function Duszkiewicz2024_Figure_IsomapREM % This script reporoduces panels from: % Figure 7, Extended Data Figure 10 % Dependencies: %TODO: script dependencies, links to external functions % Copyright (C) 2023 by Adrian Duszkiewicz and Adrien Peyrache % % This program is free software; you can redistribute it and/...
ca77ed1294643b4e67a384e3ea580a584f4395ed6627bf6e6e02ef713af652ab
MATLAB
9,591
343
%% Init if(isempty(which('MovieData'))) addpath(genpath('~/repo/utsw-ssh/')); else disp('Code is already loaded'); end clc; clear; close all %% Detect objectes on two projections angle data_source = '/archive/bioinformatics/Danuser_lab/Fiolka/MicroscopeDevelopment/OPM/projection/MV3fixed/GEMS/201002/Cell10...
6c5cb157459adea166fb917a140707815a8e82b2d188a39076987e243bfeb768
MATLAB
9,644
295
%% Figure 7 of van den Berg*, Wong* et al, 2024, iScience addpath('.\functions\'); salColor = [.7,.7,0]; baseColor = [0,0,0]; [data,pairTable] = DRC_load_data; %% allBaseSTRF = cat(3,data.STRF{pairTable.basePairSel}); allBasePRF = cat(3,data.PRF{pairTable.basePairSel}); allBaseCGF = cat(3,data.CGF{pairTable.basePa...
900357cefa028665a8267acf50ac1df75cfa2fd8242212ceb89a897ccc649d55
MATLAB
9,681
249
% create high-resolution trajectory and firing plot close all; if run_on_hopper==1 curr_dir=pwd; %curr_dir=replace(curr_dir,"gc_can_1",strcat(fdr_prefix,int2str(local_run))); cd /home/nsutton2/git/OAT_CS4/ initOAT cd(curr_dir) addpath /home/nsutton2/git/CMBHOME_github/ elseif use_hopper_data==...
7a5819f30eab35576e7bc23638964025920cf29361c80681c9b1b0a545e10ed6
MATLAB
9,686
270
% function [results, cfg] = decoding_example_afni(decoding_type,labelname1,labelname2,beta_loc,output_dir,radius,cfg) % % We don't recommend using this for editing! Use decoding_template instead. % % This is a general function for two class classification with AFNI, using % a linear SVM as implemented in the libsvm sof...
96c12d867bf43a92c8c9d94da1a725ffd2942dcb2df61f7df892fae467ed4317
MATLAB
9,687
228
% split into single and multi groups. % new. Use trials from dcNew var % Use different method of concatenating to validate the code in % calcCumSumUpdateDCNew.m % work for all sbj 08-16 function calcSlopeValue(sbjNum,numClasses,saveOp) % channels pruned stored in mlActAuto var processedDataDir = ['C:\Users\mn0mn\Docum...
1fc452e96a789c1e9b88f5561f4d03196dc9af1ada3f2d50d8de9e7804654c0f
MATLAB
9,689
263
function TrackFigureMoviesWithTracks(fileParams, trackFigureMovieParams) %% File Parameters secBtwFrames = fileParams.secBtwFrames; pxPerMicron = fileParams.pxPerMicron; exportFolder = fileParams.exportFolder; thetaInDegrees = fileParams.thetaInDegrees; thetaInRadians = fileParams.thetaInRadians; %% Input Parameters n...
0c8744bfbbfaf6a17f49725628ac81559b09c8400f6544e5f835e08a3d2a2b4c
MATLAB
9,708
249
% For figure 7b in Draft 3 % Use sbj 12 and 19 as example function grpPlotPerf_Fig7b(sbjList,numClasses,saveOp,rejTrOp) fs = 50; %timePt = (0:0.25*fs:5*fs)+2*fs; timePt = (-2*fs:0.25*fs:5*fs); performanceLDALedoitHbTMean = zeros(length(sbjList),length(timePt)); performanceLDALedoitHbTCI = zeros(length(sbjList),length(...
7a977807239a19db7dd77217c0c52e19d9a307a00173444c763d356587ceca1e
MATLAB
9,716
211
function [interferogram, dimensions, apodization,prof] = yOCTLoadInterfFromFile(varargin) %%This function loads an interferogram data from file and preforms initial %interferogram preprocessing % %USAGE: % [interferogram, dimensions, apodization] = % yOCTLoadInterfFromFile(inputDataFolder,'param1',value1,'...
9c6a86eba21833e688eb5cf13507e89bde484171e07761bb4270316f9d502f9b
MATLAB
9,726
272
% Run after @GenerateExpectedGC6fResponseNoise % Get the filename for the batch loop clear; close all; clc; ChopClipL = 60; UpSamplingFz = 100; Txcorr = [-95 -5]; radius = 40; % Addnoise = 0.002; %% load comparison grids Topic = 'Ai148_Grm6Cre'; Day = '110318'; Cell = 1; Exp = 5; FolderPath = '\\storage1.r...
0ccc2191683fe61669b1b05de4ff47aed993b744b8463a50615921f28de7c9e5
MATLAB
9,732
355
% This script re-creates Figure S4 from van den Berg*, Wong*, Houtak, % Williamson, Borst (2024) iScience datapaths; load([DRCPath,filesep,'M30_S04_DRC.mat'],'Stm') % stimulus matrix load([DRCPath,filesep,'M30_S04_DRC_SpkT.mat'],'SpkT') % Trial-aligned spike times load([DRCPath,filesep,'M30_DRC_PSTH.mat'],'PSTH') % PS...
b54a3a683feb9e6e4211cfc5e35050254e9e37ab5f552aa028d101d97904f816
MATLAB
9,732
248
%% Create Graphs with strength of connections varying with time representing slopes of AFR between nodes clear clc close all %Loading prerequisites % load("D:\Brewer lab data\HFS\Temporal Analysis\No Stim\dataInfo.mat") % load("D:\Brewer lab data\HFS\Temporal Analysis\No Stim\full_idx_allregion_unit_matched_stim.mat") ...
cdd4ada4b89d69e5afdf8edda56b478d62a85957aa4ef0aa9a8c1de59461cd41
MATLAB
9,733
240
% references: https://www.mathworks.com/matlabcentral/answers/180778-plotting-a-3d-gaussian-function-using-surf % https://www.mathworks.com/help/symbolic/rotation-matrix-and-transformation-matrix.html % https://www.mathworks.com/matlabcentral/answers/430093-rotation-about-a-point % run options sample_matrix = 0; write...
414ce45f14f5b3c8a0c976865c47ea18508f26fd3e9c20ac32e28c5753e7cfdd
MATLAB
9,755
217
classdef Stimset < Sharedmethods %Stimset object % A stimset object is a group of acquisition sweeps in an NWBfile that were acquired by the same protocol/stimset % % --------------------------------------------------------------------------------------------------------------------- % Author:...
af26e386a35231aa8660f283971e70e5f65955c5f205ee2fbb41a162e88db096
MATLAB
9,775
411
function setpaths(options) % % USAGE: % % setpaths % setpaths(1) % setpaths(0) % currdir = pwd; try warning('off','MATLAB:rmpath:DirNotFound'); appname = 'DataTreeClass'; % Parse arguments addremove = 1; if ~exist('options','var') options = ''; elseif isnumeric(opt...
bcfcc85ddbcadba2e49f7646e185e670567196a93050de4cbe487888394e04c5
MATLAB
9,820
220
function stackConfig = scGenerateStackConfig(varargin) % This function generates stack config structure based on the inputs below. %PARAMETERS: % 'appendToSC' - stack config structure that you would like to append % data to. % 'sampleID' - the sample identification eg. 'LA-01' % Information specific for...
f0313bd220913d22353bf0333845fc2b9fc0bbd783886068389ce718de06e853
MATLAB
9,829
237
% run CircleAnalysis_BipolarCellTerminal.m options.IsPCA = 1; options.IsDebug = 0; options.EstimationType = 'DoG'; %[Params, ~, Costv] = estimateCenterSurround(ROIFeatures, options); options.EstimationType = 'Amp'; [SimpleCSRio, Curves] = estimateCenterSurround(ROIFeatures, options); options.EstimationType...
661cfb7e3087f00d6a69ac4373b1f12cc9ed8ea962edad5885f7fb6e45767a24
MATLAB
9,830
309
% von Mises Mixture Model for Random Dot Motion % _ % This script performs a vMMM analysis for data from the RDM experiment. % % Author: Joram Soch, BCCN Berlin % E-Mail: joram.soch@bccn-berlin.de % % First edit: 07/08/2018, 15:10 (V1) % Last edit: 07/04/2020, 16:50 (V5) clear close all % specify bias bias = 'mo...
1d570929e6e554caa8862865cad7b91e3d03402a634a87d6491a689ac55dce7a
MATLAB
9,837
275
% mv_classify_across_time unit test % rng(42) tol = 10e-10; mf = mfilename; %% Create a dataset where classes can be perfectly discriminated for only some time points [two-class] % nsamples = 100; ntime = 300; nfeatures = 10; nclasses = 2; prop = []; scale = 0.0001; do_plot = 0; can_discriminate = 50:100; % Genera...
2e43672e463cb52158f07f99a4cf35bebde784e814e252af697c2a41fca566af
MATLAB
9,848
327
function [r_est, m_est, k_est, MLL] = ME_vMMM_ML(y, mu, kr, m) % _ % Maximum Likelihood Estimation for a von Mises Mixture Model % FORMAT [r_est, m_est, k_est, MLL] = ME_vMMM_ML(y, mu, kr, m) % % y - an N x 1 vector of angles (domain: -pi <= y_i <= +pi) % mu - a 1 x K vector of means (default: mu_1 = 0, mu_2...
bb28966fc79f35f2a23c684afdcfef142b0797042813db77f20a42478acfa7fb
MATLAB
9,860
159
% Nav-Math Experiment: First level analysis %Check the brain activation at subject level using MNI space %% SET UP THE ENVIRONMENT clc clear restoredefaultpath SPMPath = '/Applications/spm12'; addpath(SPMPath); spm('defaults', 'fMRI'); spm_jobman('initcfg'); pmDataPath='/Users/federica/data/GridMagination/3Iso/Scr...
f1b9f715ee6cf7f74dd801d0e8fcfb919857d0e7a25d07cff94b4ab01450de49
MATLAB
9,867
270
clear;close all;clc; %% IsMakeVideo = 0; if IsMakeVideo FolderPath = '\\storage1.ris.wustl.edu\kerschensteinerd\Active\Emily\NaturalSceneVideo\Preprocessed\Blue\'; nClip = 11; MovieSize = nan(nClip, 3); SharedVar = nan(nClip, 1); clear RFctr_L RFctr_NL for i = 1:nClip ...
bc040c3f3afc43e698d1bce90df626c26dced2eb16773d07ea332aaa96b4dd19
MATLAB
9,885
343
function [F0,Fn,Zn,F] = EPGX_GRE_BM(theta,phi,TR,T1x,T2x,f,ka,varargin) % [F0,Fn,Zn,F] = EPGX_GRE_BM(theta,phi,TR,T1x,T2x,f,ka,varargin) % % EPG-X for Bloch McConnell coupled systems w/ gradient echo sequences % % arguments: % theta: vector of flip angles (rad) - length = #pulses % ...
9c85e6b6bfc69e15a1e9a288a1421be0249b2cce0b88be4087621c81382ea35d
MATLAB
9,887
284
% figure 5A: example of RISE method % last update: October 26 2022 % Amirhossein Farzmahdi clear close all clc % fixed random seed for regenerating same result seed = 42; rng(seed) % add path addpath(genpath('functions')) images_dir = 'mat_files/'; result_dir = 'results/'; % loading data load(images_dir+"5000_masks...
ed3cc5254c210eb6cb83b4ecf8219725f57d4420f852486635c26943a4813572
MATLAB
9,904
105
function [G,h] = build_G_h_quadratic3d(A,delta_b,transformationModel) % BUILD_G_H_QUADRATIC3D Builds the equation system G*p = h % % % INPUT ARGUMENTS % b1 - b = [b1 b2]' % b2 - b = [b1 b2]' % deltaC - c_fixed - c_moving % transformationModel - Transformation mode...
ea95184f763293cd621f775ed0002a422a0fd7be13249b300e685c494883f9f6
MATLAB
9,923
362
function demtrain(action); %DEMTRAIN Demonstrate training of MLP network. % % Description % DEMTRAIN brings up a simple GUI to show the training of an MLP % network on classification and regression problems. The user should % load in a dataset (which should be in Netlab format: see DATREAD), % select the output activ...
10796690c48024d6110526afda13efa616c614b9525ba60d663fa06484255e94
MATLAB
9,931
274
%========================================================================== % This script preprocesses the behavioral data. % % Lukas Kunz, 2023 %========================================================================== % start clear; clc; close all; % paths paths = []; paths.beh = 'G:\My Drive\Manuscripts\2...
02d536447c25bea99d97f5c185d88e8f772135ed63131ee5edb22cf797fc05dd
MATLAB
9,932
362
function demtrain2(action); %DEMTRAIN Demonstrate training of MLP network. % % Description % DEMTRAIN brings up a simple GUI to show the training of an MLP % network on classification and regression problems. The user should % load in a dataset (which should be in Netlab format: see DATREAD), % select the output acti...
6dc835c60c5f545de76dba9781d4d8aeea30b2c12fa2f778921bcc787d5ffc76
MATLAB
9,958
349
function selection = MenuBox(msg, bttns, relativePos, textLineWidth, options) % % SYNTAX: % % selection = MenuBox(msg, bttns) % selection = MenuBox(msg, bttns, relativePos) % selection = MenuBox(msg, bttns, relativePos, textLineWidth) % selection = MenuBox(msg, bttns, relativePos, textLineWidth, options) % % E...
c838f8c3b889dc353ec7a960a068b779b5f75d167fe24f802d3bb1946fd4d704
MATLAB
9,973
233
function output_variable=neuron_reconstruction(wholestack,to_be_added,source_variable,outputpath) % wholestack: the recorded stacked % to_be_added: the neurons to be added % source_variable: neurons already tracked % outputpath: outputfolder figure id_added(size(to_be_added,1),1)=0; for i=1:size(to_be_added,1)...
de3b784ca2a780ba2917830245a968894d7c2a330217b188ce6c6fa91f3f0e34
MATLAB
9,991
288
function batch_SurpriseMinimization % in order to replicate the results from Wurm, Ernst, Steinhauser (2023), % download the preprocessed EEG data and regression results via figshare % (https://figshare.com/articles/dataset/2023_Wurm_SurpriseMinimization/23055974). % Unzip and change dir_data accordingly. % This sc...
f16192496ad87f43cc4829027023fe01b0ad2818cc90de79b57f033908df57f0
MATLAB
10,016
166
%% Extended Data Fig. 5a: heat maps of post-stim AQuA events color-coded by onset latency after uncaging % All events from the entire FOV 0-120s following uncaging will be % plotted, along with the uncaging site (drawn in AQuA as landmark 1) % % Written for multiple conditions, excluding ramping cells and % cho...
7a2675161ea8ac29766193c6ce0b48778e798e774d538b0d2be3a62f0195dbab
MATLAB
10,033
295
function [v, cout] = velocity_from_tensors(T, model, kernelsize, sigma, cin) % [V, COUT] = VELOCITY_FROM_TENSORS(T, MODEL, KERNELSIZE, SIGMA, CIN) % % Compute a velocity field from a tensor field, using the algorithm % described in section 6.5 of Gunnar Farnebäck's thesis "Polynomial % Expansion for Orientation and Mot...
79830249636282d430180dc372d04d9cda4e15efc55b6ef227b72b8c8e03dc58
MATLAB
10,061
294
function [out1,out2,out3] = ginput(arg1) %GINPUT Graphical input from mouse. % [X,Y] = GINPUT(N) gets N points from the current axes and returns % the X- and Y-coordinates in length N vectors X and Y. The cursor % can be positioned using a mouse. Data points are entered by pressing % a mouse button or any key...
d8fc89f806253fc412404276a1436ecbf39d8a0801c9f155204c51eadd1cb2ab
MATLAB
10,067
175
function AssertOpenGL % AssertOpenGL % % Break and issue an eror message if the installed Psychtoolbox is not % based on OpenGL or Screen() is not working properly. % To date there are four versions of the Psychtoolbox, each based on a % different graphics library: % % OS9: Psychtoolbox-2, based on Apple's QuickDraw. ...
4f8378189a74ddd6c46b516733cc35847b4c77590baa1e9648c99108df2a3b6f
MATLAB
10,094
366
%% Figure 8 supplementaries %% Load behavior results BeDAT = load('Data/20220828_Behavior_signedOri'); BeDAT.Behavior = fitBehaviorGau(BeDAT.Behavior); %% Original Paramters sParmStim.FGCtrs = 24; % % sParmStim.FGOrt = 0; % deg sParmStim.FGSF = 4; % cyc/deg sParmStim.FGSize = 0.84; % deg sParmStim.FGSigma = sPa...
588d974431b9dc1af741e1b8f15d8ceb4a850665662ea260786789cb6963d185
MATLAB
10,095
317
function [mds] = plot_mds(subj,patname,regsname,varargin) % Plots a multi-dimensional scaling of a pattern % % [mds] = PLOT_MDS(SUBJ,PATNAME,REGSNAME,VARARGIN) % % This is designed to help you visualise the patterns of your data. it % does an MDS (see 'cmdscale') on the PATSNAME data, returning a % matrix with all of...
a4d54b57bab51e1c23d2d5ae9332b95b39542bcdeaf97a9eeb68ef71cc05c930
MATLAB
10,108
428
%% Load data binsize = 0.2; % bin size for population vectors, needs to be large thSmooth = 2; % smoothing factor of population vectors iso = 1; % set to 1 if need to re-run Isomap load(fullfile('Data','SpikeData')); load(fullfile('Data','BehavEpochs')); [~, foldername, ~] = fileparts(pwd); load(fullfile('Sleep',[...
a9312a7c9899a52f19d963ec24bfab2e6f377de6b8b348b9f58f63b1f0d21c9c
MATLAB
10,127
312
function [subj new_regsname] = convolve_regressors_afni(subj,old_regsname,runsname,varargin) % Convolves regressors with HRF % % [SUBJ NEW_REGSNAME] = CONVOLVE_REGRESSORS_AFNI(SUBJ,REGSNAME,RUNSNAME,...) % % Takes a set of regressors and convolves each condition % with a gamma haemodynamic response function using AFNI...
3fd954b315b3524b5ec68d47c528a9efe36c207d9effb94435a73815d4b2c779
MATLAB
10,153
97
%Fetches analyzed data from subjects. %NEED TO PROOFCHECK %2024/02/26 function subject=fetch_subject_data(root_dir,subjectIDs,varargin) subject=struct(); %initialize structure in which will store values for sub_nber=1:length(subjectIDs) %for each subject subject(sub_nber).subjectID=subjectIDs{sub_...
7c07dd51fac4738286f67a75454fbf93d82011f4fb14e80cc1fc9f66d4fd2786
MATLAB
10,156
200
% Extract single HRF from dcNew variable, the output of GLM fitting function % save to mat file. % For experiment 08 and 10 function createSingleTrialHRF_Updated_DiffBasis(sbjNum,movieList,opAllBasis) %saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment' num2str(s...
6bb2f823040785d16765ae257d929e10da3ddd1a6a140d56a09abafe36539f78
MATLAB
10,194
330
clear all; supPath = 'C:\noga\TD complex spike analysis\Data\albert\saccade_8_dir_75and25'; load ('C:\noga\TD complex spike analysis\task_info'); req_params.grade = 7; req_params.cell_type = 'PC ss'; req_params.task = 'saccade_8_dir_75and25'; req_params.ID = 4000:5000; req_params.num_trials = 50; req_params.remove_que...
6dba5dcb88650b5d95ea4041910b260efa45214596d414899b2dbb237e1992bc
MATLAB
10,198
284
% split into single and multi groups. % new. Use trials from dcNew var function plotPerformanceCumsum(sbjNum,numClasses,behScore) % channels pruned stored in mlActAuto var saveDir = ['C:\Users\mn0mn\Documents\ResearchProjects\spatailAttentionProject\ProcessedDatafNIRS\Experiment' num2str(sbjNum)]; saveDir2 = ['C:\User...
e24bd5e0fb4cffd4fdb932c7df6dd224a6deff8fde58da94ff8f7f2494bdcfed
MATLAB
10,200
334
clear all; supPath = 'C:\noga\TD complex spike analysis\Data\albert\pursuit_8_dir_75and25'; load ('C:\noga\TD complex spike analysis\task_info'); req_params.grade = 7; req_params.cell_type = 'PC ss'; req_params.task = 'pursuit_8_dir_75and25'; req_params.ID = 4000:5000; req_params.num_trials = 50; req_params.remove_que...
235c4ab49119b74a10611f2df2935e176ec7e12384f397aed1106277c5d135e8
MATLAB
10,203
254
function t_point = out_of_sample(point, mapping) %TRANSFORM_SAMPLE_EST Performs out-of-sample extension of new datapoints % % t_points = out_of_sample(points, mapping) % % Performs out-of-sample extension of the new datapoints in points. The % information necessary for the out-of-sample extension is contained in % ...
2870b9d946b0c079d59f3a4c32d8e11a74e1d6067761898a85e248a3d226c0d0
MATLAB
10,234
245
function h = mv_plot_result(result, varargin) %Provides a simple visual representation of the results obtained with the %functions mv_classify_across_time, mv_classify_timextime, mv_classify, %and mv_regress. % %The type of plot depends on which of these functions was used and on the %dimensionality of the data. % %U...
7f4e32153a5b4eda6b01b9dfda0543df020433885298f2078871c4ae5d572e22
MATLAB
10,255
275
function cf = train_svm(param,X,clabel) % Trains a support vector machine (SVM). % % Note: It is recommended to demean (X = demean(X,'constant')) or z-score % (X = zscore(X)) the data first to speed up the optimization. % % Usage: % cf = train_svm(param,X,clabel) % %Parameters: % X - [samples x features]...
f12354f8d83f479c41a00bd1094a611651365721249aea591f1d043f209900d9
MATLAB
10,276
234
% function output = decoding_transform_results(method,decoding_out,chancelevel,cfg,data) % % This function calculates a lot of different result measures defined by % METHOD. % % FURTHER METHODS: Type % >> transres_ % and hit tab key % % e.g., it also calls external transres_XX functions that implement othe...
9d1d836486c99bab2b61b0bd3ddede70c8ed5410e6148aef8747770398748be4
MATLAB
10,295
328
function [hs, hc, contour] = triplot(pnt, tri, val, mode, levels) % TRIPLOT make 2D or 3D plot of triangulated surface and interpolated values % The surface can be displayed with linear interpolated values or with % linear interpolated contours of a potential distribution. % % Use as % triplot(pnt, tri, value) % t...
951ec13b8804c96983385fdd28960feae7996aaaad242fee3a0982cc89c5d8f8
MATLAB
10,302
207
%% Initialization for initialization=1 addpath('C:\Users\enric\OneDrive\Documents\SeeElegans\Functions') % initial parameters global xy_pixel_size; global z_pixel_size % parameters to be chosen global thresholds; global sizes; global zsizes; global sigmas; global time_processing % vis...
c373ea3aee0c52262d0aceaee21f2c8408e2329107a90c5ba11415d30eff9d4c
MATLAB
10,302
129
function SetGuiProcLevel(handles, iGroup, iSubj, iSess, iRun, procLevelSelect) global maingui % Function implements rules for which currElem are chosen in responce to % various combinations of listboxGroupTree and proc-level radiobuttons % selections % Set new GUI proc level state based on current GUI selections of l...
ee4bac05addee15c39328daa9ff6ec8aa781d7fab5ad32fd1ddaf942054303b5
MATLAB
10,318
266
% This script is a demo showing some simple searchlight decoding on % simple simulated 3d toy data. % The toy data are matlab matrices and no real fMRI or EEG data. % % If the dimensions of the data are 15 15 9, "TDT" will be decoded from the % data. % % Otherwise, we use randn data for all voxels in 3d volume...
cf62dd9196f5181294e97e57c2396edadeedd8e6e74cf281337782a0227ce175
MATLAB
10,357
317
% references: https://www.mathworks.com/matlabcentral/answers/180778-plotting-a-3d-gaussian-function-using-surf % https://www.mathworks.com/help/symbolic/rotation-matrix-and-transformation-matrix.html % https://www.mathworks.com/matlabcentral/answers/430093-rotation-about-a-point % run options sample_matrix = 0; write...
e357f486cfc497ea88a3b71af4dbb3210d54401b1c3a7b8002d5bd7033fa1194
MATLAB
10,360
289
function [net] = AccuSleep_train(fileList, SR, epochLen, epochs, imageLocation) % AccuSleep_train Train a network for classifying brain states % Zeke Barger, 081120 % % Arguments: % fileList - a cell array with three columns. Each entry is the path to a % file of training data (as a string). The first ...
01de736599097e7378150be08079f2f2a30521833a507952153b9a5db18ba8cf
MATLAB
10,367
370
function handles = configSettingsGUI(varargin) handles = []; % Parse args [filenames, nParamsPerCol, lastpos, options] = ParseArgs(varargin); InitializeGuiStruct(filenames, options); hf = CreateGui(); ResetGui(hf); ResizeGui(hf, nParamsPerCol, lastpos); hBttnSave = DrawBttns(hf); DrawConfigParams(hf, hBttnSave); hand...
fd9dd20f484cd78361a7c732d566b53ea8283d4f7abc163893281eecf92f9fef
MATLAB
10,386
411
%% CLEAN clear;close all;clc; %clean old residues params.extract_databases = 0; params.extract_pivot_table = 0; params.export_png=1; params.export_fig=1; params.export_txt=1; params.export_mat=1; params.data_type = 'dff'; params.PEATS_binsize_ms = 60000; %en ms params.PEATS_x_tickfreq = .5; %1/10 %% FILTERING S...
2ca5601c57ca5f22811b094e24ec683608b6473a74825d0b5f773521a42ff4f2
MATLAB
10,401
304
function [scratch] = train_bp(trainpats,traintargs,in_args,cv_args) % Creates a backpropagation neural network and trains it. % % [SCRATCH] = TRAIN_BP(TRAINPATS,TRAINTARGS,IN_ARGS,CV_ARGS) % % You need to call TEST_BP afterwards to assess how well this % generalizes to the test data. % % See the distpat manual and the...
413043fcae7aa38d534e635c9c4a1427ddb97924ff12af4734ea8abd9fac1da6
MATLAB
10,413
280
% function mask_name = decoding_create_maskfile(cfg,data_location) % % This function will create a mask file to be used for the data provided, % named mask.nii, mask.img, mask+orig.BRIK, mask+acpc.BRIK, mask+tlrc.BRIK % (depending on the software used), in the location of data_location or - % when it is not a director...
1c7d96859835fc491d2fd123a1a8ce6e4076b41abd57cda01bb406dc20581457
MATLAB
10,436
275
% STATUS: analysis. For internal report. % % SYNTAX: % plotAll_PSD_Welch(sbjNum) % % DESCRIPTION: % plot estimate of power-spectral density for each channel. If axes are % highlighted in red, it means this channel is rejected (didn't meet the % SNR threshold). % % RESTRICTION: % Only for sbj 12 and afterward. % ...