sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
fc33f6b11b3583ae2c6271c35eb87c6430359569da2c020ea5a0e5c5cb4030ab
MATLAB
2,603
58
function subject_FD_parse(FD_movement_files,skip_seconds,epi_TR,brain_radius_in_mm) % FD parsing Nipype wrapper pulling in list of motion files % All variables (skips, TR, CurrentDirectory) set within Nipype % Iterates over range of values from 0.1 to maximum of 0.5 FD threshold % Outputs to .mat file % FD_movement_fil...
027661490fe9b2952249ca7f3e0fd803007df96c4b18fa1b9ba753436f7634e6
MATLAB
2,605
77
%% Set Up clear;clc;close all dbstop if error %files = dir('C:\Users\maxwellg\OneDrive\04 Work\01 Stanford - LSRP\CF Project\Data\D1_1995\**\**'); %files = dir('C:\Users\maxwellg\OneDrive\04 Work\01 Stanford - LSRP\CF Project\Data\D1_1995\da0208'); %files = dir('C:\Users\maxwellg\Documents\CF_Project\Data\D2_1995\da031...
53cd20ccb242b47576cc4a652645a4e096b6ff539b34587343be00349881a2df
MATLAB
2,606
80
function [hdr] = neuralynx_getheader(filename) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % SUBFUNCTION for reading the 16384 byte header from any Neuralynx file %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright (C) 2007, Robert Oostenve...
826f56abddc119f0bb82a38c8be266fa588e0d8cae29a2a894dbe864a2b48b62
MATLAB
2,606
106
% mglMonitorDims.m % % $Id$ % usage: mglMonitorDims(<monitor>) % by: justin gardner % date: 01/28/09 % purpose: A display showing monitor dimensions in degrees. % % If monitor is -1, then this just draws to an already open display, does not flush and returns immediately % ...
4aac576db54cfb5b1bf718f0bb4ad916595b9b9b05a315f3ad7f748cc13aa17f
MATLAB
2,607
70
%% corr the coupling R2 or P-value with transmitter maps %% para roi_num = 48; load('Edge_GLM_fun_str_dis_commu_DBM.mat') AR = cat(1,results(:).AR); AR_p = cat(1,results(:).AR_moran_p); load('neuro_trans_net.mat','TM_data','trans_name') TM_data = TM_data.JHU; p_fdr = 0.05; rand_time = 10000; results_trans = struct;...
a41a66ce5b55c4ed27e1fa4b379b1afe77734a772f5956054c4a0fcc0e8a9022
MATLAB
2,607
81
function [event] = read_nexstim_event(filename) % Use as % [event] = read_nexstim_event(filename) % Written by Vladimir Litvak based on the function nxeGetTriggers % provided by Nexstim % % Copyright (C) 2007, Vladimir Litvak % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for the ...
4537d82aa118397404b55120e63229ff13da13862287a58503fcbd93435adbab
MATLAB
2,609
94
function [t, Nu, Net] = RNNDynamics(Net, TimeSpan, NuExt, ODESolverOpts) % Parameter processing. if exist('NuExt','var') % External input. if ~isempty(NuExt) if size(Net.CParam.JExt,2) ~= size(NuExt,1) %JExt viene definito direttamente nel test error('Num. of rows in NuExt does not match the columns ...
d6b79706ddce783efafad2b93411437e41cc0e53c3288e3e411ac51521d835ac
MATLAB
2,610
93
% mglTestGamma.m % % $Id: mglTestGamma.m 600 2009-07-25 08:02:30Z justin $ % usage: mglTestGamma() % by: justin gardner % date: 06/30/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: % function retval = mglTestGamma(screenNumber) % check arguments i...
d4bddd11fdeedd5e023d8a352ddca7a8166e9caae172073cffccc8e27794a146
MATLAB
2,611
81
%% Start the main pipeline filenames = {'Mouse_1K','Mouse_2K','Mouse_3K','Mouse_4K',... 'Mouse_1M','Mouse_2M','Mouse_3M','Mouse_4M'}; load('EXTRACT/eval.mat') % radii = [4:8]; % SNRs = [3:4:23]; output_folder = ['./EXTRACT_CV/']; if ~exist(output_folder,'dir') mkdir(output_folder); end CV_times = zeros(length(...
02a2ef93fb3fa3e1dfc7f654fd98e116c37d4f974bab5cc20ee3816e463655b9
MATLAB
2,612
84
% filtFictrac_all.m % % Function that downsamples and filters FicTrac data of all user-selected % pData files. Runs by calling dsFiltFictrac(), which operates on a single % trial. % % Must have run selectDroppedFicTrac() on selected pData first. % % INPUTS: % none, but prompts user to select pData files to process ...
e6b5a489cf1f2d7a4bc8fb925ab8493ffbb09df8be517c3c0441cc561f23e2e0
MATLAB
2,612
80
function R=randmio_dir_connected(R, ITER) %RANDMIO_DIR_CONNECTED Random graph with preserved in/out degree distribution % % R = randmio_dir_connected(A,ITER); % % This function randomizes a directed network, while preserving the in- % and out-degree distributions. In weighted networks, the function % preserv...
aa3eced46b760826e0381863d789c8b52e602b640416b928916674e70b893ba0
MATLAB
2,618
89
% VL_DEMO_MSER_BASIC Demo: MSER: basic functionality pfx = fullfile(vl_root,'figures','demo') ; randn('state',0) ; rand('state',0) ; figure(1) ; clf ; % -------------------------------------------------------------------- % Load a figure % ----------------------...
048699844b6c22281d5dc236c2c9ecaa9d50db57e35acc4c2f89286a57765012
MATLAB
2,619
63
function [wij, seed, pattern, castor_map] = ... prepare_data_patient(pat_dir, get_SEEG, get_map) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % If you use this code, then please cite: % 1.- Ana P. Millan, et al. "Individualized epidemic spreading models % predict epilepsy surgery outcomes: a pse...
e73e97d719de07901249d37d9cc011612f804ba8b391a50f3f6c2f22313f031c
MATLAB
2,619
70
% getLegPhaseDiffs.m % % Function that takes in leg phase (computed in getLegPhaseFromSteps()) and % returns pairwise differences in phase between legs % Leg pairs: % R1-L1, R2-L2, R3-L3, R1-R2, R2-R3, R1-R3, L1-L2, L2-L3, L1-L3, L1-R2, % R2-L3, R1-L2, L2-R3 % Leg phase can be NaN so phase difference will be Na...
7b51103e6a2f2670c89e702a04d7b803630227613a5cbaa6361564cfc8b20f4f
MATLAB
2,620
81
whichParam = 'stepDirections'; whichPhase = 'stance'; disp('Select output files from saveLegStepParamCond_bouts()'); [outputFNames, outputPath] = uigetfile('*.mat', ... 'Select cond_bouts files', datDir, 'MultiSelect', 'on'); numCond = length(outputFNames); paramVals = {}; for i = 1:num...
5bcc8c7f85e7a868b2c701097b38369d66c35ba7306b15cc752def674085cb56
MATLAB
2,621
62
% mglMetalRepeatingBlts.m % % $Id$ % usage: [ackTime, drawTimes, frameTimes] = mglMetalRepeatingBlts(nFrames) % by: Benjamin heasly % date: 06/15/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Send one command that causes multiple texture blts. % ...
45c89862ca4912f14ca333f0f3357f6057d4215bd3215ce553f8cd426932cec8
MATLAB
2,622
82
% taskTemplateSaccade.m % % $Id: taskTemplate.m 217 2007-04-04 16:54:42Z justin $ % usage: taskTemplateSaccade % by: justin gardner % date: 04/27/2010 % copyright: (c) 2010 Justin Gardner (GPL see mgl/COPYING) % purpose: example program that demonstrates a simple saccade task % ...
8b10985b0cd219360999f4800ff1383b84f057feda73eb80119f3da80848d440
MATLAB
2,627
55
function y=getmondim(mnum) % y = getmondim(monitornumber) GET MONitor DIMensions. % "y" is the dimensions of the specified monitor represented as % [xstart,ystart,width,height] where values are in pixels. % (xstart,ystart) are the absolute coordinates of the lower left corner. % "monitornumber" is a number ass...
321e416d3e186432d36487eedc69966eab94788170f7fecdd141796bfe99f334
MATLAB
2,628
136
function b=my_cell2mat(a, cat_dim, e_count) if isempty(a) b=a; return; end cell_num=numel(a); if cell_num==1 b=a{1}; return; end if nargin<2 cat_dim=[]; end if nargin<3 e_count=[]; end if isempty(cat...
9862ae6c414b835a748621daa850de5006d3efcf23e2077eb9908dcc68cb3c69
MATLAB
2,630
94
% plotRawImgFicTracData.m % % Function to plot raw traces of imaging data (dF/F) for all ROIs and % FicTrac data (yaw angular velocity and forward velocity), each in its % own separate subplot % % INPUTS: % frameTimes - frame times of imaging data % bksSignal - background subtracted fluorescence signal for all ...
096ab8a3f3108cdb2404df235838e32c55c6cedc907050dc3afed1ec255f9250
MATLAB
2,632
119
% Author: Guosheng Lin (guosheng.lin@gmail.com) % perform segmentation prediction on user provided images. % specify the location of your images, e.g., using the following % folder which contains serveral example images: % ds_config.img_data_dir='../datasets/custom_data'; function demo_refinenet_test_example_ade()...
d6f8b0ba0248c83d28f701b1b92159401142d82461405193fb6fee730c3ff8b0
MATLAB
2,632
96
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function make_bfo90_PerAnimal_formatted_for_sigmastats(analysisSettings, analysisResults) % Not used %MIN_COMPARISONS = analysisSettings.BFO90_PER_CELL_MINIMUM_DATA; F = 'NormalBFO90'; T = analysisResults.(F); [SessionsToGroups] =...
26cd3e8f66afb174600826a91a85e6ee13322b079badf22658bbb74ddb74b69f
MATLAB
2,633
58
function [ signal, states, parameters, total_samples ] = load_bcidat( varargin ) %LOAD_BCIDAT Load BCI2000 data files into Matlab workspace variables. % % [ signal, states, parameters, total_samples ] = load_bcidat( 'filename1', 'filename2', ... ) % % loads signal, state, and parameter data from the files whose names...
cd97cd547ea44cfe24daa36fde3caf6a5d70fb431c5032168ea35cd0bd16fa5d
MATLAB
2,633
67
function plot_summary1(csInfo, z, titlez) %% Set up csInfo_good = csInfo(logical([csInfo.usable])); figure('Position', [2 42 958 1074]) Summary = tight_subplot(3,1,[.03 .03],[.03 .03],[.03 .03]); %% FIG A: Stim, and CSs axes(Summary(1)) histogram([csInfo.timeRel2Cycle_sec], linspace(0,z.cycleLen_sec, 51), 'FaceColor'...
263fab8fa2224f6edc203dab20444771b4c67778bafd21f39f0b4bcf27bfc0b4
MATLAB
2,634
66
function [metrics] = calculate_metrics_v2(mat,v,varargin) % This function calculates the graph metrics given a connectivity matrix and a given choice of metrics n_nodes=length(mat); len_mat=1./mat; % conection-length matrix d_mat= distance_wei(len_mat); % distance matrix randmat=random_matrix(mat); len_randmat=1./ra...
36969a87b379ea538c09b00664d69c66f4b4650db67b4f277b3825242291844e
MATLAB
2,635
82
classdef SoftLink < handle properties (Hidden, SetAccess = private) target = []; end properties (SetAccess = private) path = ''; end methods function obj = SoftLink(target) %SOFTLINK HDF5 soft link. % obj = SOFTLINK(path) make soft link ...
d2f6a006adb3aa2094afd038b3e6d66955c29eb23a914992307ff8b6162787de
MATLAB
2,635
89
function roi_averages(DATA,ROI,AddInfo) % % This Aedes plugin calculates and plots average time series from ROIs % if AddInfo.isDataMixed % Make data a 4D-matrix if it is loaded in aedes as a stack of 2D or 3D images DATA2{1}=DATA{1}; DATA2{1}.FTDATA = zeros([size(DATA{1}.FTDATA,1),... size(DATA{1}.FTDATA,2)...
91aea9de5a6255cb156c4cc3e8641e2e44853b10f7887f63432197d32b611032
MATLAB
2,636
69
function c = InvProbV2Cons(x,Imat_t,tn,ni,nh,no,at_C_in_t,at_H_in_t,at_O_in_t,fv_in_t,V,CAf_in_t,CBf_in_t,CDf_in_t,mol_W_in_t,delta,data) wh = reshape(x(1:ni*nh),[ni,nh]); wo = reshape(x(ni*nh+1:ni*nh+nh*no),[nh,no]); bh = (x(ni*nh+nh*no+1:ni*nh+nh*no+nh))'; bo = (x(ni*nh+nh*no+nh+1:ni*nh+nh*no+nh+no))'; y_r = r...
2eb3bfcb36a77317361da33fe1fef962f1ab39a205c5e4880c68498fe49d7199
MATLAB
2,637
93
function [Image] = scalebar(I,pxsz,unit) % writes a scalebar into the image % To be used with full size HRTEM images of Size 1024x1024 - 2048x2048 % Copyright (C) 2022 University of Duisburg-Essen % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU Ge...
36e2cca3dd68b68523288afc677bed6eb5d723e5da3848c9da97225e027e0b64
MATLAB
2,640
96
function orient_chosen = searchGaborOrientation(imagesCellTrain, param, plotta) %Output: %orient_chosen: vector of angles (in degrees) %init histAll = zeros(1, param.numBins); %parfor im_index = 1 : numel(imagesCellTrain) for im_index = 1 : numel(imagesCellTrain) %for im_index = 1 %select image img ...
33e75a27a7be0d0fcc674659d4fff0a1128aedd0217a4f103bac781a7713b407
MATLAB
2,641
79
% set up the paths isdone = ~isempty(which('ctrax_matlab_misc_check')) && ~isempty(which('ctrax_matlab_filehandling_check')); if isdone, return; end dirnamestry = {'.','../matlab','..','matlab','../Ctrax/matlab'}; % try last saved location rcfile = which('setuppath'); rcfile = strrep(rcfile,'setuppath.m','.setuppat...
be2661d60de32689da55c1c32aa653c8d91e117fb8ca8c8de20bebc41f890ef3
MATLAB
2,642
80
function corra = corrA(Var,LFP,Fs,elec) % compute corr LFP*Var. % var is the frames vector of tuning var. % LFP % globals; % CORRPAR.lags = [-500, 500]; %ms % CORRPAR.maxF = 100; %Hz. low-pass filtered up to maxF before xcorr Clags = floor(CORRPAR.lags*Fs/1000); % in samples %[c, lags] = xcorr(cell2mat(...
f4b60ac86e3f54769c83c10a35412afd6db9e29ad1b56ee974d6e4c897843877
MATLAB
2,642
77
%% All necessary topoplots % Load necessary data addpath Z:\MATLAB\fieldtrip-20210328 %Windows saveFolder = 'Z:\MATLAB\Perceptual_Load\FieldTrip\Results\group_level\'; ft_defaults %% Alpha load([saveFolder 'Alpha' filesep 'TFR_dt_all_subs_alpha_pow']) load([saveFolder 'Alpha' filesep 'comb_planar_labels_alpha']) loa...
8d2573880a431503ded2e177eab7979764b33cc5c9b2e4c4057efb6e000f23b7
MATLAB
2,643
86
clear file=dir('ACC*restable*.mat'); k=1; for jj=1:5 load(file(jj).name) gotrial=find(outcome(:,1)==1|outcome(:,1)==2);%GO trial gotrial(find(gotrial<6))=[];%form 6th trial gotrial(27:end,:)=[];%uniform trial number,total 26 trials Previoustrial=ones(length(gotrial),5); for ik=1:5 ...
deb34f5fabdc2220552ea90d4f32ea10107adfa63bc0a6d44535d991b88928f6
MATLAB
2,643
76
% preprocessLegVid.m % % Function for preprocessing raw voltage signals from the leg tracking % camera (strobe signal with falling edge as frame start). Extracts leg % video frame times. Checks that number of frames camera says it has % captured matches number of trigger pulses sent. % Returns these parameters as ...
adad97e67b2a0c8b541ac57635f0c576b7d0165f6e6d84500561227a63c2acea
MATLAB
2,645
64
% This is a one-off script. It was written to process the concatenated % CNFMe into the separate trial results close all clear all clc fclose('all'); %% config = mulana_json_read(fullfile('R:\chengs_task_2c\code\ucla_miniscope\NotUSed', 'pipeline_config.json')); experimentDescriptionSepFilename = 'T:\Minimice\feature...
12dca992ffc00b515b14b4530b1c1b3c7ec3c826ef8dc3513b7a77fef67032e3
MATLAB
2,646
76
%% runEyeCalibration % Run a mouse video eye tracking calibration session % % Hannah Payne % Raymond Lab, Stanford University 2013 % hpayne@alumni.stanford.edu % % NOTES % - To install cameras, enter: imaqhwinfo('winvideo') % If an error returns, click the link and install the OS Generic Video % Interface % - If two ca...
4fffe9c60025a02beb70cffd43a9e29d3f40ae638af8f70c9fee22b8c6b575c7
MATLAB
2,646
97
% mglClose.m % % $Id$ % program: mglClose.m % by: justin gardner % date: 04/03/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Shut down the mglMetal app % usage: mglClose() % function retval = mglClose() % check arguments if ~any(nargin ==...
7407237180beb3515701d76c8a81ba6262f5479a3f4ea22de1eb319c451dd10b
MATLAB
2,646
64
%% input: bits of dendrite line and synapse locations load('lineSegments.mat'); load('markerCoordinates.mat'); %% for each marker, calculate the distance in y from the line % For each synapse, make a vertical line synapseLines1=[markerCoordinates.vglut1X repmat(1,size(markerCoordinates.vglut1X,1),1) markerCo...
e95cf2a592bcd0821874fbf3016fe997b188ca67eb1cfbc5f42dda48c97963be
MATLAB
2,646
81
function [FR,spkPerTr,nPerTr] = getBoundedFR(Recordings,datadir,inds,rt_good,mt_good,boundSpec) %getBoundedFR.m 7/19/22 startevt = boundSpec.startevt; endevt = boundSpec.endevt; start_offset = boundSpec.startoffset; end_offset = boundSpec.endoffset; filterFRs = optCheck(boundSpec,'filterFRs',false,[true false]); min_s...
0f156b9d91689a5c25ea4fb8a8fc1aa1168972030a2ed42f0a57cee342d1c262
MATLAB
2,648
69
% parameter search in 2D space % clear; % close all; % clc; initime = clock; addpath('..\funcs'); %% changeable parameter settings Delta_e_start = 0; % cannot equal to 0 Delta_e_end = 0.5; % can equal to 0.5 Delta_e_steps = 200; Delta_i_start = 0; % cannot equal to 0 Delta_i_end = 0.05; % can equal to 0.05 Delta_i_s...
e1df5204653b59f8e9ceb46c84e83380c06605fd27304ca06c5ed52b170df156
MATLAB
2,648
69
% parameter search in 2D space % clear; % close all; % clc; initime = clock; addpath('..\funcs'); %% changeable parameter settings Delta_e_start = 0; % cannot equal to 0 Delta_e_end = 0.5; % can equal to 0.5 Delta_e_steps = 200; Delta_i_start = 0; % cannot equal to 0 Delta_i_end = 0.05; % can equal to 0.05 Delta_i_s...
072863d97fb896f81bc8e42c187c4ba4874cef5894ca77be94b894c4fd52bb53
MATLAB
2,651
73
function CBIG_ASDf_plotCorrWithBest(inputDir, k, r_final, corr, outputDir) % CBIG_ASDf_plotCorrWithBest(inputDir, k, r_final, corr, outputDir) % % This function plots the correlation between final estimate and other % solutions, sorted from highest to lowest likelihood. % % Input: % - inputDir: % Absolute...
65e8a0108565dbd6a788acdc5dba78b334814775c107186b5acd788b4738a9d0
MATLAB
2,651
84
function model = glmFracRidge(Y, X, fracAlpha) % Apply a general linear model (GLM) with fractional ridge regression % (minimizing the L2-norm) to data in Y using design matrix in X. This % function requires the toolbox fracridge: % https://github.com/nrdg/fracridge.git % % INPUTS % Y: TR by voxel matrix of fMRI ti...
7c0a60d9825c99d9f6eb69db10b3d144310f5a9cfdffa344633b9f824d4513cd
MATLAB
2,653
108
function asc = read_eyelink_asc(filename) % READ_EYELINK_ASC reads the header information, input triggers, messages % and all data points from an Eyelink *.asc file % % Use as % asc = read_eyelink_asc(filename) % Copyright (C) 2010, Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroima...
d52465cbaa04df9aa4a162d233346b5e263b34cdb5555870826f685fe1838381
MATLAB
2,653
84
function [datout, tim] = ft_preproc_resample(dat, Fold, Fnew, method) % FT_PREPROC_RESAMPLE resamples all channels in the data matrix % % Use as % dat = ft_preproc_resample(dat, Fold, Fnew, method) % where % dat = matrix with the input data (Nchans X Nsamples) % Fold = scalar, original sampling frequency in...
56dbba7285c900fed571ff6e09cc375c0ebc351d9218dff599585cb5f99e0045
MATLAB
2,654
69
% parameter search in 2D space % clear; % close all; % clc; initime = clock; addpath('..\funcs'); %% changeable parameter settings Delta_e_start = 0; % cannot equal to 0 Delta_e_end = 0.5; % can equal to 0.5 Delta_e_steps = 200; Delta_i_start = 0; % cannot equal to 0 Delta_i_end = 0.05; % can equal to 0.05 Delta_i_s...
6420f2be0f86fec48d13f393c6135a9382a056bbe04188e951eb1c7dae3a2039
MATLAB
2,654
108
function ok = makelcmraw(DATA,outdir,outname) % MAKELCMRAW - Write data in LCModel RAW file format % % % Synopsis: % % Description: % % Examples: % % See also: % % Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uku.fi> % % Department of Physics, Department of Neurobiology % University of Kuopio, FINL...
a7368806b4177099e957ea665123ef2a0fba778cea1600ebe176b6ddeede4d8c
MATLAB
2,654
59
function [v,w] = FindAllowedDeg(normals,device,targetpos) %UNTITLED2 法線ベクトルを受け、移動可能な角度v、wを二分探索する [v,w] = Grad2VW(normals); if device.qVMO({'x','y','z','u','v','w'},[targetpos,0,v,w]) == true && ... device.qVMO({'x','y','z','u','v','w'},EstimateINJCordinate([targetpos,0,v,w],[2,0,0])) == true && ... ...
b802b7d314ffe40a9c554e3ae3b256a712a9719b10727e83a72af4de796eadad
MATLAB
2,654
69
% parameter search in 2D space % clear; % close all; % clc; initime = clock; addpath('..\funcs'); %% changeable parameter settings Delta_e_start = 0; % cannot equal to 0 Delta_e_end = 0.5; % can equal to 0.5 Delta_e_steps = 200; Delta_i_start = 0; % cannot equal to 0 Delta_i_end = 0.05; % can equal to 0.05 Delta_i_s...
271a2bd4127690bb2bd1ddd277a6f226e9f1296756c30d3d6cdcd70654ccd003
MATLAB
2,656
103
%% clear all close all %% Create mean vectors (Symbols) M = 7; % #symbols N = 100; % dimension S = randn(N,M); alp = ('A':'Z')'; voc = alp(1:M); SAVE_FIGURES = false; %normalize vectors for k=1:M S(:,k) = S(:,k)/norm(S(:,k)); end %% Orthogonalizing [ST,~] = mgson(S); %% Adding different num. of trials on single...
4c36790e6ee6a6de1bf0518b3311e3fde7f6dc925b7d29f89aa9133430e4df85
MATLAB
2,656
80
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % This code makes Figure S13A (cellreg scores) close all clear all clc % Paths run('../load_figure_config.m') INPUT_FOLDER = CHENGS_TASK_2C_FIGURES_CONFIG.DATA_FOLDER; %'../figure_S13B/local_output'; OUTPUT_FOLDER = CHENGS_TASK_2C_...
8826ba8481e1ddf24c867631b34169a0095f7297a3ded90de4e604dc850c1cd8
MATLAB
2,657
53
function f = surfaceculfcn(x,target,BregmasOnPano) %SURFACECULFCN “_x‚̍À•W‚ðŽó‚¯Žæ‚Á‚ÄŠp“x‚ðÅ“K‰»‚·‚邱‚Ƃɂæ‚è—^‚¦‚ç‚ꂽ“_‚ÆFigureã‚Å—\‘ª‚³‚ê‚é“_‚Ì‹——£‚ðÅ¬‰»‚·‚éB % h = x(1) : ‰ñ“]޲‚ÌDP޲‚̍‚‚³ % theta = x(2) : X޲Žü‚è‚ÌŠp“x@idegj % u = x(3) : Y޲Žü‚è‚ÌŠp“x (deg) % standardp : Random sampling ‚É...
fa93545be988d49ab4d29d37257072301b4ddbf2126f129234ceaf4867e96a29
MATLAB
2,659
71
% % author: SK % % date: 28/03/2024 % % reference :"Neural effects of dopaminergic compounds revealed by multi-site electrophysiology in mice and interpretable machine-learning" clear all; close all; clc; %%Specify the path of chronux toolbox addpath(genpath('-----EEG_AnalysisMatlabToolBox\chronux_2_12')) %...
66f922df061492ee0735d01c063c95997fffd6eabad439bc2b536a7b6bf355d6
MATLAB
2,660
69
% parameter search in 2D space % clear; % close all; % clc; initime = clock; addpath('..\funcs'); %% changeable parameter settings Delta_e_start = 0; % cannot equal to 0 Delta_e_end = 0.5; % can equal to 0.5 Delta_e_steps = 200; Delta_i_start = 0; % cannot equal to 0 Delta_i_end = 0.05; % can equal to 0.05 Delta_i_s...
6d8764eb16cb49e27281adb6680cbd60edab5edd384d3f74be2bdfd087253f48
MATLAB
2,660
69
% parameter search in 2D space % clear; % close all; % clc; initime = clock; addpath('..\funcs'); %% changeable parameter settings Delta_e_start = 0; % cannot equal to 0 Delta_e_end = 0.5; % can equal to 0.5 Delta_e_steps = 200; Delta_i_start = 0; % cannot equal to 0 Delta_i_end = 0.05; % can equal to 0.05 Delta_i_s...
453d625fe76e9da5bfeb39b65fde7f2536d2c05eda675b0e95ced718b44125aa
MATLAB
2,661
59
classdef RepetitionsTable < types.hdmf_common.DynamicTable & types.untyped.GroupClass % REPETITIONSTABLE A table for grouping different sequential intracellular recordings together. With each SequentialRecording typically representing a particular type of stimulus, the RepetitionsTable table is typically used to group ...
908c2b77e602d89f64dacd8425a78c498819bc4e8b3c9a1def9fc2fd4aedf33f
MATLAB
2,661
105
function P = vl_click(N,varargin) ; % VL_CLICK Click a point % P=VL_CLICK() let the user click a point in the current figure and % returns its coordinates in P. P is a two dimensiona vectors where % P(1) is the point X-coordinate and P(2) the point Y-coordinate. The % user can abort the operation by pressing any k...
505bf87bc3651346f92b1e44fd17c5013c4c38eb8c9e3beadcc96bd6e7ab10d7
MATLAB
2,663
61
%% mff_valid.m % Matlab File % author Colin Davey % date 12/3/2013 % Copyright 2013 EGI. All rights reserved. % Support routine for MFF Matlab code. Not intended to be called directly. % % Tests whether a file is valid, and throws an exception if not. Gives an % informational warning if filename doesn't end in '...
07b75cc6b8a305cb32979ba8d892ba57504399dc44b96096e6313b422db4d749
MATLAB
2,667
114
function [modes,orders] = makeOrthonormalModes(inputs,maxOrder,plotvalidation) % takes in a (S by N) matrix of inputs (# sources/inputs and # datapoints), % and produces a ((maxOrder+1)^S by N) matrix of output modes that are % orthonormal to each other. Also lists the orders of each input in orders, % which is a (...
2b104480bebe18227917d70735963256efe1d3a43b278ab21adf49770fc68fde
MATLAB
2,669
62
function [data_reframed]=reframe(data, chan, reframe, rot_tra) % REFRAME % This function uses the translation vector, rotation angle and door % correction of ROTATION_TRANSLATION to reframe the input data into the new coordinate system % % Use as % [data_reframed] = reframe(data, chan, rot_tra); % % INPUT: % da...
f56b66cbff92383a08f181d2bb71a945627bb4f8b976434946558bbc9c9ccffc
MATLAB
2,669
119
% Author: Guosheng Lin (guosheng.lin@gmail.com) % perform segmentation prediction on user provided images. % specify the location of your images, e.g., using the following % folder which contains serveral example images: % ds_config.img_data_dir='../datasets/custom_data'; function demo_refinenet_test_example_voc()...
4761ee8cc8687132c9900673c46a4a8f447e9a8ffedb3336a4d7933b0b16a626
MATLAB
2,670
77
%% corr the duration and EDSS with altered edge, controling the cov in the edge %% para load('Edge_compare_tidy_DBM.mat') load('group_data_DBM.mat') MS_cov = data.cov{2}; MS_cov(:,1) = tiedrank(MS_cov(:,1)); MS_cov(:,2) = tiedrank(MS_cov(:,2)); NMO_cov = data.cov{3}; NMO_cov(:,1) = tiedrank(NMO_cov(:,1)); NMO_cov(:,2)...
0bf850df29f9683e9914f645f8150b69f17e26e49d8bad08be4eb8900260b5da
MATLAB
2,671
44
% The script "demo_UFARSA_simData.m" simulates a Poisson spike train and the corresponding fluorescence trace (i.e. % time-course). Simply run this script and see UFARSA's spiking activity reconstruction results for this trace. You can % change the simulation parameters below in block 1. To apply UFARSA to your r...
c311807dd092e237432d15841915758a1c60b3355adaaa163848dc18ccfa6dc7
MATLAB
2,671
71
% VL_HOMKERMAP Homogeneous kernel map % V = VL_HOMKERMAP(X, N) computes a 2*N+1 dimensional approximated % kernel map for the Chi2 kernel. X is an array of data points. Each % point is expanded into a vector of dimension 2*N+1 and saved to % the output V. The expanded feature vectors are stacked along the % f...
ea0c99acea35ea4a037d9cd706154ac7e38ecd361147162092f579ea9a18f131
MATLAB
2,671
71
%% read_mff_header.m % Matlab File % author Colin Davey % date 3/2/2012, 4/15/2014 % Copyright 2012, 2014 EGI. All rights reserved. % % Takes the path to the data and returns the header in the structure % described at http://fieldtrip.fcdonders.nl/reference/ft_read_header. % % filePath ? The path to the .mff fi...
50d129c7a84d4ed559d8f0d70896bdba3ba345e7062b60e68b0ace7db6f8e019
MATLAB
2,673
80
% decodeTelegraphedOutput.m % % Function that decodes gain, frequency, and mode telegraphed from Axopatch % 200B amplifier % % Adapted from Yvette's function of the same name % % INPUT: % telOut - raw output telegraphed from amplifier % chType - which channel type we're decoding ('gain', 'freq', 'mode') % % OUTPUT...
5d636b040b2d2479baa5169febf0c93dfa8e6fa807be5c9b7679533a7e61e076
MATLAB
2,674
106
% plotSpikesPhaseDelays.m % % Function to plot amplitude of modulation of spike timing by phase, across % temporal offsets % Fits 1 period sine curve to values for each delay, plots amplitude (2*a) % equation: a*sin(x+c) + d % Data from getSpikesStepPhase_cell() % % INPUTS: % datDir - directory with output files %...
ea5caf8e834d4c03ba96a200662d9ba6a321ed63b3ea53bc3b338573573e06f2
MATLAB
2,677
88
% mglTestRefresh.m % % $Id:$ % usage: mglTestRefresh() % by: justin gardner % date: 10/06/11 % purpose: Tests the refresh rate of the monitor. Note that with some video cards, notably % ATI Radeon HD 5xxx series, flushing the screen does not seem to wait for the vertical % ...
df114ffbd99ed61f1851e689df6dd34c38cd1e0266a22ee8e435c2a20c4cbd3c
MATLAB
2,680
85
function S=fixedResSamples(A,n,varargin) % fixedResSamples Compute ensemble using fixed resolution. % % Syntax %__________________________________________________________________________ % % S=fixedResSamples(A,n) % % S=exponentialSamples(__,Name,Value) % % % Description %___________________________________________...
d016cca521c84cb581bd21870810252de9fbd5a454c7331fc20fa7da830a306f
MATLAB
2,681
83
function mglEyelinkSetup(displayNumber, targetParams) % MGLEYELINKSETUP Enters the Eyelink setup mode. % % Syntax: % mglEyelinkSetup % mglEyelinkSetup(displayNumber) % mglEyelinkSetup(displayNumber, targetParams) % % Description: % Switch into the EyeLink setup mode (for camera setup, calibration, % validation, etc....
f5fb74fc43a794fcad1152dcb531d5a16551735bd171c9e770c02f26c4854501
MATLAB
2,681
82
function gradual_adaptation(fig4) %% gradual_adaptation plots % 1. The ratio between the predicted FR from the tuning curve for each touch number and the actual response to those touches. % 2. the intercept of the tuning curves from the tuning curves for each % touch number figure(fig4) av_unit=0; ff=dir('*.mat*');...
2ee0aba964ec4acab720514dc04b41e6c5744da7161ba65e505c568b3c8a9368
MATLAB
2,682
112
function [isUpdateAvailable,HeadRev,WorkingCopyRev,error_msg]=aedes_check_updates() % AEDES_CHECK_UPDATES - Check if Aedes updates are available % % Synopsis: % [isUpdateAvailable,HeadRev,WorkingCopyRev] = aedes_check_updates() % % Description: % Checks if there are updates available for Aedes. The % "isUpdateAvailab...
4f3b5b8217cf1586663913b743993d14c0a3fcfd05124da1bf3e3e8f930de2eb
MATLAB
2,682
29
% Sets Values to Defaults specified in Eventer % Basic app.TimeConstantsEditField1.Value = 0.5; % Time Constants: tau1 (rise) app.TimeConstantsEditField2.Value = 5; % Time Constants: tau2 (decay) % Detection app.ConfigurationDropDown.Value = 'VC'; % Configuration ...
6ea29d7798de216cbba7f281caefde2e24b79bc67217040122d0067c7c955430
MATLAB
2,682
94
% VL_DEMO_FRAME Demonstrates vl_plotframe and vl_frame2oell %% A standard frame is a unit circle centered at the origin with a % radius pointing in the positive Y direction. Since images use a % left-handed coordinate system (X axis pointing right, Y axis % pointing downwards), the radius will point downwards. A = e...
8c688548fa50e2857b3c2bac7d631ec59946d02e77b6dc5bcb58202721935d64
MATLAB
2,682
70
% [relSpikesC, relSpikesF] = plot_resp_byID(id, ... % img_or_pos, spiketable) % % plots simple raster plot of preferred stimulus only % % Mackay et al. 2024 (DOI:10.1038/s41467-024-52295-5) % License: MIT License (see LICENSE file for details) % ----------------------------------------------------------------------...
12e063e352f95234227dd7a96107a8f38b7759299872aee4f637122911dc9509
MATLAB
2,683
48
% Get header of the system information % [ Yokogawa MEG Reader toolbox for MATLAB ] % % brief: % This function retrieves information about data acquisition condition in the specified file. % % usage: % acq_cond = getYkgwHdrAcqCond(filepath) % % arguments: % filepath : file path % % return v...
83586d2f0eba25dd482cd73c85b4b0daa958585bb5fbb24d5668521217a3fd61
MATLAB
2,683
61
function st_prfResponse = getPRFStimResponse(stim, linearPRFFilters, params) % Function to generate neural pRF time course for given pRF and stimulus. % % INPUTs: % stim : (double/logical matrix) % stimulus xy (pixels) by time (ms) by run % linearPRFFilters : (double vector/matrix) li...
e20daaa965e5b9ece5fa953cde35d4f83cb3315863208c5d93e04f4a9f61355a
MATLAB
2,685
119
% Author: Guosheng Lin (guosheng.lin@gmail.com) % perform segmentation prediction on user provided images. % specify the location of your images, e.g., using the following % folder which contains serveral example images: % ds_config.img_data_dir='../datasets/custom_data'; function demo_refinenet_test_example_sunrg...
f007ebe4207e6d922ebce0203899709b21378bbb47593a0588e7bc3a88f7eee2
MATLAB
2,687
80
%% load IC to test for causality load('GC.mat') %% Parameters ntrials = 1; % number of trials nobs = 706; % number of observations per trial regmode = 'LWR'; % VAR model estimation regression mode ('OLS', 'LWR' or empty for default) icregmode = 'LWR'; % information criteria regression mode ('OLS', 'L...
53c725623f10d8971c6569d61353cdaa70b358ffdbcd843a47c808dc858f96a3
MATLAB
2,688
67
function status = fillSurveyParameters( obj, data ) % Extract and visualize LFPs from Survey test mode % % Syntax: % [ status ] = FILLSURVEYPARAMETERS( obj, data ) % % Input parameters: % * obj - parsing object % * data - data from json file % % Output parameters: % * status % % Example: % status = F...
9166eb7b1fe12d44d1b2b702e43da7a6e223753eb9fc82d4996966abe4d1a864
MATLAB
2,689
74
% plotPreAnal, plot pre analysis data globals; Nrows1=2; Ncols1=4; xfac=0.9; yfac=0.9; mysubplot_rel(Nrows1,Ncols1,1,1,xfac,yfac); [hh,hx]=hist(GVar1,20); plot(hx,hh); hold on; plot(hx,cumsum(hh)); plotVertLines(xBins,cumsum(hh),'--'); xlim([min(hx) max(hx)]); title(sprintf('%s',Sesname)); xlabel(sprintf...
2ca95683ae282ae3164fdfb868b95166499732cf03e188b785fe29a7296ee551
MATLAB
2,691
71
function fH = plotDiffPRFModelCVR2_bargraph(mnDiffR2Subj,roisToPlot,saveFigs, saveFigDir) % Set up figure params cmapModels = getColormapPRFModels(0); % Model colors barWidth = 0.75; xposBar = [1:length(roisToPlot)]; xposError = [-0.215,0,0.215]; % X position for errorbars modelDiffNames = {'CSS-LSS','CST-LSS','...
bc346d1763ccea447ffa2c6bec092f77835d9239bb6809b1e4f362814bc184fc
MATLAB
2,692
90
function tifwrite(imData,imFilename,imHeader,dataType) % writes a tif file with data, filename, header, and type %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Input parsing if nargin<4 dataType = class(imData); else imData = eval([dataType '(imData)']); end %%%%%%%%%%%%%%%%%%%%%%...
c2277eadaab4875955673624ad2a22bdc9171b439351a9d275397a0fffeb224c
MATLAB
2,692
81
%% SETUP clear;clc;%close all try [dataTable] = readtable('G:\My Drive\Expmt Data\Max\Climbing Fiber Project\ExperimentMetadata_C.xlsx'); expmtDataFolder = 'G:\My Drive\Expmt Data\Max\Climbing Fiber Project\Jennifer Data\Jennifer Data Reorganized'; catch [dataTable] = readtable('D:\My Drive\Expmt Data\Max\C...
e6ea1d84d161950dbc35ce94a6803120d13b68ccf61645f712874c9026e0ac68
MATLAB
2,692
79
function [P, E] = bemf4_surface_field_electric_subdiv(c, P, t, Area, mode, modeArg) %% Input parsing if(nargin < 4) error('Not enough input arguments'); end %Assign default mode if(nargin < 5) mode = 'gauss'; end %Assign default subdivision parameter if(nargin < 6) ...
884d235730312556e4fe5ae08f9e1b0dab5d63babf6d5236f8771745cc8e7e73
MATLAB
2,696
86
function [stimulus, response, segment, timezero] = read_brainvision_vmrk(filename); % READ_BRAINVISION_VMRK reads the markers and latencies % it returns the stimulus/response code and latency in ms. % % Use as % [stim, resp, segment, timezero] = read_brainvision_vmrk(filename) % % This function needs to read the he...
bbb51061b583f048e5c221ed2661c28a60144c9fc710417e70f9a183ca498261
MATLAB
2,698
71
function [xy, conf] = coordinate(color) %UNTITLED4 Summary of this function goes here % Detailed explanation goes here if length(color) == 87 answer = questdlg('Choose the used layout', ... 'Layout', '60MEA','4QMEA','4QMEA'); % Handle response switch answer case '60MEA' ...
9d18221f434dc7ac2990efa8ca4af96a336c8ad0377962d56eae896152d51cbd
MATLAB
2,700
118
% Author: Guosheng Lin (guosheng.lin@gmail.com) % perform segmentation prediction on user provided images. % specify the location of your images, e.g., using the following % folder which contains serveral example images: % ds_config.img_data_dir='../datasets/custom_data'; function demo_refinenet_test_example_citys...
35cc8cb08874bf42b600a89d543531c79aeefe964817e661ab0b9a06048c0441
MATLAB
2,701
105
% plotOptoIInjRawEphysTraces.m % % Simple script for plotting ephys scaled voltage traces during optogenetic % stimulation or current injection % One row for voltage, one row for stimulation % Option to downsample from acquisition rate for reduced size vectors % % For supplementary figure of 2024 DNa02/DNg13 paper %...
65cd08269ce7878c579713602347d66aea1b01959767e8d8421f9fb51c3f24ff
MATLAB
2,701
89
function [x, f] = beadsFast_UFARSA(y, fc, lam0) %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This code provides a fast version of the BEADS method, by adapting its original % MATLAB implementation written by Laurent Duval (doi: 10.1016/j.chemolab.2014.09.014): % https://de.mathwo...
d7a7e017a84da6cc886b8c6e87c3158bc6d8e0106657cb8860015db3592046a0
MATLAB
2,701
84
function gui_cg() % % This function is needed by FASTICAG % This file just removes the global variables % that are used in FASTICAG from the memory % @(#)$Id: gui_cg.m 8776 2013-11-14 09:04:48Z roboos $ clear global c_FastICA_appr_strD; clear global c_FastICA_appr_strV; clear global c_FastICA_dMod_strD; clear global...
664a68d93884b0224e0f5b0782147bbdc976771cb823bb47e490e2db5a7b3e8f
MATLAB
2,703
63
% mglMetalGetWindowFrameInDisplay.m % % usage: [displayNumber, rect, results] = mglMetalGetWindowFrameInDisplay(socketInfo) % by: Benjamin Heasly % date: 03/11/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Returns current mgl displayNumber and window fr...
78a2f544709ea70a5447a16eebacccd584e8e4e87ec24b5eba83bb70e865d4db
MATLAB
2,703
81
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [C] = get_cellreg_table(cellRegFolder) % We need to load the cellreg results, and map them back into sessions % tables [cellToIndexMap, cellScores] = load_cellreg_results(cellRegFolder); files = dir(fullfile...
d26bf9c0c62db7305e1b9cf1406404f3eb75a0d4938ea5ab5a641ea1a13355fe
MATLAB
2,704
76
%% Plot probes disp(fullfile(SaveDir,MiceOpt{midx},thisdate,thisprobe,[num2str(SN) '_HistoEphysAlignment.mat'])) Depth2AreaPer = load(fullfile(SaveDir,MiceOpt{midx},thisdate,thisprobe,[num2str(SN) '_HistoEphysAlignment.mat'])); Depth2AreaPer=Depth2AreaPer.Depth2Area; probePoints = cell2mat(Depth2AreaPer.Coordinates)....
91e2de44b3efdc902c3d6b922754bb68296f7f68f1349123d65926bb282219bc
MATLAB
2,707
77
ListAnimals = 'IMPORTED_EXPERIMENTAL_LIST.XLS'; proc_dir = 'PATH_TO_PROCESSED_DATA_FOLDER'; %%%%This is the directory where your pre-processed data is saved number_probes = 1; for anim = 1:size(ListAnimals,1) exps=[];no_exps=[]; exps = eval(ListAnimals{anim,5}); procExpNames...
c106a257bc6f7e9c39729efe530e175c059ddff67b2b28120f4abdaf03cb3ff3
MATLAB
2,707
94
function [r_alpha,t_alpha,p_alpha,v,vv,vvv] = MC_corrpval(n,p,method,alphav,pairs,D) % function to compute the alpha quantile estimate of the distribution of % minimal p-values under the null of correlations in a n*p matrix with null % covariance but variance D (I by default) % % FORMAT p_alpha = MC_corrpval(n,p,metho...
7dcfb5370ba5f27ff02e4a8739aa002f0a3eca4028ea6e611bbfddc021650589
MATLAB
2,708
68
% mglMetalRepeatingQuads.m % % $Id$ % usage: [ackTime, drawTimes, frameTimes] = mglMetalRepeatingQuads(nFrames, nQuads, randomSeed) % by: Benjamin heasly % date: 06/17/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Send one command that causes mul...
bf491e66f29ba78b3c2265b302ec9abd40378bc872318317af81a836fdb4cce8
MATLAB
2,708
101
function save_roi_as_mask(DATA,ROI,AddInfo) % Aedes plugin for saving ROI masks % This function is a part of Aedes - A graphical tool for analyzing % medical images % % Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uku.fi> % % Department of Physics, Department of Neurobiology % University of Kuopio, FI...
edceec47cf4e1dec04a1968939b4d596d31d4ea538565a00d68ca9e8b15f653c
MATLAB
2,708
96
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % Requires the MapsData table MapsData = analysisInput.MapsData; NORMALIZE_MAPS = true; digTypesToCompare = {'Corr', 'Geo'}; clc T = MapsData; animalSessionCellNames = unique(T.animalSessionCellName); nCells = length(animalSessionC...