sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
f631ed8a56684a77b4d6e7bc4ace47766372bae7192fb98ab412de18a937bb6c
MATLAB
1,860
59
% fromTrkGetpDataName.m % % Function that takes in .trk file name and returns the pData file name for % the same experiment % Assumes standard naming convention for experiments, either 2P imaging or % ephys: date_fly_fov/cell_trial % % INPUTS: % trkFilename - name of .trk file % pDataFilepath - path to pData fold...
507ef08cb499ddc0fc6d3f5dd669eb3d41c9b1c5d13662d09eb7c74306c00781
MATLAB
1,861
64
% appendDateLegVidFiles.m % % Function that goes through all the video files in a date folder and % appends the date in front of the video file names % % INPUTS: % none, but prompts user to select date folder through gui % % OUTPUTS: % none, but renames the video files % % CREATED: 3/24/22 - HHY % % UPDATED: % ...
5a69e128dfa3d30add9e49b19d4e18de6208d373bf9cbbca15da3c2558a82a4e
MATLAB
1,861
76
%tableS5_HR_diffs_highFR_synthetic.m %% clear all; close all; clc; warning('on','all') scriptdirs = {pwd; '..\..\plot'; '..\..\analyze'; '..\..\helper_functions'}; addpath(scriptdirs{:}) datadir = pwd; ssfile = 'subsample1000_highFR_stdRP.mat'; sspath = fullfile(datadir,ssfile); %% tabledir = datadir; tablefil...
4f7149a85942c74658899f833afd3d5f80ecbc29292c90c3cab3f0d59a992818
MATLAB
1,862
57
function [csInfo, z] = t2t_csNOcs(csInfo, z, window) z.csWindow_good = window; z.csWindow_bad = [0 window(1)]; z.csWindow_bad2 = window; %% Find Good Cycles/Trials for i = 1:length(csInfo) currentCycle = csInfo(i).cycleNum; if ~csInfo(i).usable continue end % CONDITION 1: Good Spike...
7141a216394be1a57a9c6b8401b3fc4c106f5b7f337e1f17db1b6e243d190d61
MATLAB
1,864
59
function y = gammaPDF(t,tau,n) % Gamma function - used for impulse response calculations and HIRF % % y = gammaPDF(t,tau,n) % % The gamma is essentially the convolution of n exponentials with time % constant of tau. The peak of the function is near tau * n % % See formula various places, but Boynton et al. is a good ...
7aae63db091b5f70d4a1538658fcaf3779cc56029f491761876eadbb2e6b9612
MATLAB
1,864
52
function clean_data = get_clean_data(stg,prf,roi) % gets data extracted for a desired ROI and whitens and detrends the % data. % % CLEAN_DATA = GET_CLEAN_DATA(STG,PRF,ROI)gets data extracted % for a desired ROI, returns whitened and detrended data % CLEAN_DATA (NImages-by-1 cell), and saves the cleaned data in t...
391ed22188455b2519ce32f5dc3fdfb9ca6e8fc49e3b9a519fbc5e132f208035
MATLAB
1,866
47
classdef MotionCorrection < types.core.NWBDataInterface & types.untyped.GroupClass % MOTIONCORRECTION An image stack where all frames are shifted (registered) to a common coordinate system, to account for movement and drift between frames. Note: each frame at each point in time is assumed to be 2-D (has only x & y dime...
c841a8256de3dd4c6c81454863c087ba419bfa08c38a8dd8977d7807b0e44af1
MATLAB
1,866
51
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
54efdbc120f4ae5ca9dd9c10b2c5d5dec07c5b7cddb972a7d751fed8b9bde664
MATLAB
1,867
65
classdef ScratchData < types.core.NWBData & types.untyped.DatasetClass % SCRATCHDATA Any one-off datasets % OPTIONAL PROPERTIES properties notes; % (char) Any notes the user has about the dataset being stored end methods function obj = ScratchData(varargin) % SCRATCHDATA Constructor for ScratchData ...
f3ae6e9a10c2c75b5d7f16e794d191d88af7ac500ffe1b9f29837070f66c19be
MATLAB
1,868
58
function [probe] = characterizeProbe(probe) %CHARACTERIZEPROBE Derives characterization metrics of a probe % This function takes in design parameters and assembly processes to % produce quantitative metrics that characterize the probe. The number of % characterizations depends on the number of inputted parameters...
d4a1b59f72a9c16745bc7cc72d1b3e743f120f72c9aeb5c5445a9acdd703c595
MATLAB
1,869
63
function allFliesCorr = getMeanCorrContParamEphys_fly(datDir, xRange, isCirc) % prompt user to select getCorrelationEphysContParam() files [corrEphysFNames, corrEphysPath] = uigetfile('*.mat', ... 'Select output file', datDir, 'MultiSelect', 'on'); % if only 1 file selected, not cell array...
4d152e7d138752efd2bda90ff0f8543ead0097e2cf268b4768e0d1fa1691ff2e
MATLAB
1,870
60
function main() if ~isdeployed disp('adding paths'); addpath(genpath('/N/u/brlife/git/jsonlab')) addpath(genpath('/N/u/brlife/git/mba')) addpath(genpath('/N/u/hayashis/git/vistasoft')) addpath(genpath('/N/u/brlife/git/wma_tools')) end config = loadjson('config.json'); centroidSD=config.centroidSD...
b816a3bf6ae87431fb6d68951029203a5cde971b49b13b118080564383692474
MATLAB
1,870
59
% sortLegStepsByIInj_allGUI.m % % Function that categorizes all leg steps by whether they're during a % current injection bout (and by injection amplitude) or not. % Calls sortLegStepsByIInj() but operates on multiple pData files, selected % through GUI % % INPUTS: % amps - vector of all current injection amplitude...
1875566f19de4fa7e1037d9eff9b17156edf39affc30cb64c4b78fcdf8c92f4f
MATLAB
1,871
51
function [xMax_px, yMax_px] = ml_sim_nlx_nvt_save(timestamps_ms, x_cm, y_cm, arena_width_cm, arena_height_cm, video_width_px, video_height_px, outputFilename) % FieldSelectionFlags(1): Timestamps % FieldSelectionFlags(2): Extracted X % ...
259f2a63f018ed9f20eaae3d445fdaf83b0f652faf87599f39af1101ae28dc6b
MATLAB
1,872
48
% This script creates the mesh (both CAD surface mesh and a computational % wire grid) for a ring with 1 A of total current % The output is saved in the binary file coil.mat and includes: % strcoil.Pwire(:, 3) - set of nodes for all wires % strcoil.Ewire(:, 2) - set of edges or current dipoles for all wi...
adb6488a3c6e4e4cb80b080ee21706d0dd47f94202ac5034c698c617f00e789c
MATLAB
1,872
48
% This script creates the mesh (both CAD surface mesh and a computational % wire grid) for a ring with 1 A of total current % The output is saved in the binary file coil.mat and includes: % strcoil.Pwire(:, 3) - set of nodes for all wires % strcoil.Ewire(:, 2) - set of edges or current dipoles for all wi...
ccf70d205bbd91cee6aa44b7e57ff1c75cd3c8e4f9838ebe35d3a4e90a3a453d
MATLAB
1,872
69
% mglGetHostName.m % % usage: mglGetHostName() % by: justin gardner % date: 07/18/09 % purpose: Gets the name of the computer that we are running on % function hostname = mglGetHostName() retval = ''; % check arguments if ~any(nargin == [0]) help mglGetHostName return end % check global to s...
6b2f075ee8e2fb2fd4c7db83262fe406c2ba4141ed41fcab18b3e32b936006ac
MATLAB
1,873
54
%% Average time in the center per 90 minutes function TimePercent_CenterZone_90min = time_in_the_center_90min_OF(structure) % Load: Time_StartAnalyse=structure.Time_StartAnalyse ; Frame_Start=structure.Frame_Start; Frames_Vec=structure.Frames_Vec; xi=structure.xi; yi=structure.yi; result=structure.result; Ti...
af4fc7d3eb039a0889cc92f2ac5437b9801546c237b452d4fba3ce7657a320b3
MATLAB
1,874
54
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: Greg P. Smith Web: www.ced.co.uk email: greg@ced.co.uk This file is part of CEDS64ML, an SON MATLAB interface. CEDS64ML is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License...
383ae0e3a434b08acca6e2ef4b3da9172daad59a7e4ddd442e9f16403af01b07
MATLAB
1,875
65
function vl_noprefix % VL_NOPREFIX Create a prefix-less version of VLFeat commands % VL_NOPREFIX() creats prefix-less stubs for VLFeat functions % (e.g. SIFT for VL_SIFT). This function is seldom used as the stubs % are included in the VLFeat binary distribution anyways. Moreover, % on UNIX platforms, the stub...
8419254c99adac273754f0b8c1e655822cd332333d91558b3f3179aca76770a3
MATLAB
1,875
29
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 % Simple way to make the scripts run for individuals since the data will % not be stored in the git repository and we need other repos. % All configuration variables are part of this structure. CHENGS_TASK_2C_FIGURES_CONFIG = []; ...
d730eb299c96d77f55c29a85cf44087b4cf86169d70c26fa766f42121286efe0
MATLAB
1,875
66
function [ status, text ] = open_batch_files( obj ) % Select files to open. % % Syntax: % OPEN_BATCH( obj ); % % Input parameters: % * obj - object containg data % % Output parameters: % status % text % % Example: % OPEN_BATCH( ); % % Available at: https://github.com/NCN-Lab/DBScope % For referencing, plea...
d23fd42162f613de210a91d070d8343ba7986d01661d178bed2420a9f26357e3
MATLAB
1,877
80
function [proj,Acc,AccS] = GML_ProbRewards(N,M,sigma,N_TrialsL,N_TrialsT,noiseL,noiseT) 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 Nois...
a43abb64e91c11a9f6b2bd6abb8c407d33a44ab8ad3988f394a8bda2461a66ba
MATLAB
1,879
52
% getFlyMetadata.m % % Function that prompts user to enter metadata about the experimental fly % and returns it in a single struct. Also, saves identifying info about % fly (date and fly number). % Metadata: % genotype - as string, fly genotype % manipulation - as string, anything done to fly (e.g. starvation, % ...
ba4ca7c55c14dd8308f8c10adac5d9ac43d80f41ad6319ea6770bf28df270f67
MATLAB
1,879
42
function c = ForwProbV1Cons(x,ynn_v,tv,no,at_C_in_v,at_H_in_v,at_O_in_v,fv_in_v,V,CAf_in_v,CBf_in_v,CDf_in_v,mol_W_in_v) ynn_v_r = x(1:tv*no); ynn_v_r = reshape(ynn_v_r,size(ynn_v)); ynn1_v_p = ynn_v_r'; ncA = 5; ncB = 5; ncC = 5; ncD = 10; nhA = 6; nhB = 8; nhC = 10; nhD = 12; nhW = 2; noA = 0; noB = 1; no...
d7945aca62fe4b8c9d88260602831b5f239f8c09a6bba501dc9b8cc1e44221df
MATLAB
1,879
52
function [eyevelH_offset, eyevelH_rel_phase, eyevelH_amp, eyevelH_rel_gain] = VOR_SineFit_Single(freq, sampleRate, eyeVel, headVel, drumVel) %% define vector of time ndatapoints = length(headVel); % number of datapoints in segment time = ((1:ndatapoints)-1)/sampleRate; %% Set up variables for fitting data using a l...
de56ef625c1999c376d414d793eb079a76384a220d39271a06b26c6ca293c84c
MATLAB
1,879
48
% PRV is the combination of both firing rate "r" and menbrane potential "v" clear; close all; initime = clock; addpath('funcs'); % get the change of PRV in parameter space Delta_e_start = 0.125; % cannot equal to 0 Delta_e_end = 0.4; % can equal to 0.5 Delta_i_start = 0.0125; % cannot equal to 0 Delta_i_end = 0.029; %...
0622a276ef0db9e8bf8e5edcfbf137c7c83d82dd416f66cea74c3403205a24eb
MATLAB
1,880
54
function [pos,pdf] = pseudoRandSample3D(sz, nsamps, width, weight, pdf) % [pos,pdf] = pseudoRandSample3D(sz, nsamps, width, weight, pdf) % % Function to sample pseudo randomly within a 3D array, with partial % exclusion of previously sampled locations. The inputs are: % % - sz - Size of input matrix % - nsa...
9b6abde9e02ca0b062cd90b059be81c3b62ca5786bd7a31ad253b5d47c7984ba
MATLAB
1,880
49
function [s2p_median ,s2p_centroids,Fall] = s2p_masks(mouse,date,servernum) % This code is adapted to only return the centroids % % FINDINTENSITIES_ALL_S2P_MASK uses suite2p mask outputs. Returns intensities for each red selected cell % across pockels and wavelenths; also returns the locations of the red; red % cell i...
c31aeea101765de16d4270d8a896726d8bf99f1b104543112ac1adcb0a5544e1
MATLAB
1,880
55
function [thinning_iteration, dilation_size] = find_worm_radius(Image, best_threshold) % get the worm radius by looking at how many iterations it takes for % thinning to converge BW = im2bw(Image, best_threshold); BW = bwmorph(BW, 'fill'); % last_thinned_image = false(size(Image)); % thinni...
8ba6d4898e7a835ae14d815b6671d8829847c698d323da6c01403dcb809294ca
MATLAB
1,881
79
%tableS3_HR_diffs_pbase_vary_synthetic.m %% clear all; close all; clc; warning('on','all') scriptdirs = {pwd; '..\..\plot'; '..\..\analyze'; '..\..\helper_functions'}; addpath(scriptdirs{:}) datadir = pwd; ssfile = 'subsample1000_pbase_vary.mat'; sspath = fullfile(datadir,ssfile); %% paths tabledir = datadir; tab...
fdaf1066f1304a7b4db8e7f1d190242de4385e8162f0ff0de867d70661d804f1
MATLAB
1,882
48
% Author: Zachary Chiang, Buenrostro Lab, Harvard University % Uses a previous color correction transformation matrix to speed up % current color correction between IGS cycles(see also: color_correct_initial.m) function[corr_channel pre_corr max_corr] = color_correct_heuristic(stackA, stackB, channel, tform) % cr...
0775d151d76099fb223a095b0a948d1c75084a6147a76e9e315a142a13143577
MATLAB
1,883
49
function dataRuns = alignAndConcatenateMultipleExperiments(tSeriesRun1_in,tSeriesRun2_in, coords1,coords2) % Function to reorder voxels of fMRI time series coming from separate data % collection sessions for the same experiment. The slice prescriptions will % vary across session. Thus in order to average or combine dat...
017873cd3456300af15ff27b688555a654956c8f958e0c6978022794d221e4ce
MATLAB
1,884
40
function Binc = bemf3_inc_field_magnetic(strcoil, Points, I0, mu0) % Computes magnetic field from the coil via the FMM % in terms of the pseudo electric potential % % Copyright SNM 2017-2020 % Compute dipole positions, directions, and moments M = size(strcoil.Ewire, 1); N = size(Points, 1); ...
373caf0e34334d0b1e476973ae550e587af6f1ff040f0198447515c2b7704ca8
MATLAB
1,884
64
clear; clc; close all; initime = clock; addpath('..\funcs'); % get the change of PET in parameter space Delta_e_start = 0.22; % larger than Delta_e_end = 0.42; % equal or smaller than Delta_i_start = 0.034; % larger than Delta_i_end = 0.034; % equal or smaller than Delta_steps = 100; Iattn = 0.02; time = 4000; strt_...
593e2d31dbb9d189afe984c658f4479ad5cc7fc727830d25393faa9c959a2bc7
MATLAB
1,884
50
function [] = plotSpatialMultiplexingGroups(probe, groups) %PLOTSPATIALMULTIPLEXINGGROUPS Spatially plot spatial multiplexing groups % Plots circles of radius sdrange(2) over sources of a particular group. % groups can be either a single integer specifying the group number, or a % vector of group numbers. When mu...
4b81e3079c24b6a8940d615919315941b2bd369548aa7b56de60e77258527d92
MATLAB
1,885
66
function helper_bfo_save_data(outputFolder, perCell, rotDeg, group) numAngles = 360/rotDeg; numCells = length(perCell); avg_prob = zeros(1, numAngles); avg_corr = 0; num_prob = 0; num_corr = 0; prob = []; corr = []; for iCell = 1:numCells % Only include the non-nan data...
ee6663ba19164ca70ffb49c5855a8f0a6024bea75e4ceacd4eb07d951a5bf4c0
MATLAB
1,885
80
function results = vl_test_imdisttf(varargin) % VL_TEST_DISTTF vl_test_init ; function test_basic() for conv = {@single, @double} conv = conv{1} ; I = conv([0 0 0 ; 0 -2 0 ; 0 0 0]) ; D = vl_imdisttf(I); assert(isequal(D, conv(- [0 1 0 ; 1 2 1 ; 0 1 0]))) ; I(2,2) = -3 ; [D,map] = vl_imdisttf(I) ; asse...
3e96f6b0b235b3da7b1d41c6cf6274e0c124697350a6d1e22827d8b3ca014848
MATLAB
1,886
53
function status = fillIndefiniteParameters( obj, data ) % Extract LFPs from Indefinite Streaming mode % % Syntax: % FILLSURVEYPARAMETERS( obj, data ); % % Input parameters: % * obj - object containg data % * data - data from json file(s) % % Output parameters: % * status % % Example: % status = FILLI...
62622b7e95922c30a31a15776da6ed6700861ff1a3a8ba21cc8c5870500e106f
MATLAB
1,886
66
%% Generate a table of optimal parameters and F1 for 1 photon clear % dir_video = 'E:\1photon-small\added_refined_masks'; % dir_output_info='data_TUnCaT'; % num_Exp = 9; % dir_output_info='data_TENASPIS_original'; % dir_output_info='data_TENASPIS'; % num_Exp = 8; % dir_output_info='data_simulation'; dir_output_info='da...
6bde972344fb70dd22a8238185a0b3ba02dd95f0ff47ca80fbad1c1b1b46fa0a
MATLAB
1,886
62
function [varargout] = funname(varargin) % WRITE_CTF_SHM writes metainformation and data as a packet to shared memory. % This function can be used for real-time processing of data while it is % being acquired. % % Use as % write_ctf_shm(msgType, msgId, sampleNumber, numSamples, numChannels, data); % % See also READ_...
24ebb743391b58541adcb1885680afec5b9eecfb3e7937c90a2254aafaf5d374
MATLAB
1,887
69
function [sfAll, sbAll]=TDLM_EEG_core( cfg,Prob_state) % TDLM_EEG_core performs TDLM analysis for EEG data. % This function calculates sequenceness for given state probability % using provided forward and backward transition matrices. maxLag = length(cfg.lgncy); %% load state probability [1,2,3,4] X = Prob_state; ns...
3bf545d549d60ea91e202d8fc49c53eee638069ca9249eb20d6ffaf21d5d5420
MATLAB
1,887
57
% determineStepStartEndInd.m % % Function that takes in zero crossing indicies (from findVelZeroXing()) % and returns the indicies of the start and end of each corresponding half % step % % INPUTS: % zeroXing - struct from findVelZeroXing() % legInd - indicies of leg tracked pts % % OUTPUTS: % stepInd - struct ...
4994e4af6ebc077c4e59bbe16d4d4dcc07da53fddf0d6a35439d3fea469757ab
MATLAB
1,887
54
% getStepFwdLogical.m % % Function that takes in legSteps struct, a specific leg, and sample times % and returns a logical for whether the leg was moving as in forward % walking (swing brings the the leg more anterior) or backwards walking % (swing brings the leg more posterior). True for forward. % % INPUTS: % le...
57098a9fbc9e01335a62394a4ad092f5896be0df62dc8dc1c3f35feca0fa4e1a
MATLAB
1,887
63
function [yData,signalData,signalIdx,signalAmps] = ... file_embeddingSubSampling(projectionFile,parameters) %file_embeddingSubSampling finds the potential training set contributions %from a single file (called by runEmbeddingSubSampling.m) % % Input variables: % % projectionFile -> file to be a...
7ab8a061c7478abc432eb1c959e690871ff85cb137dc7687b41db1d65447531d
MATLAB
1,887
56
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: Tim Bergel Web: www.ced.co.uk email: tim@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the terms o...
aa808a3388d69813e133f8cb04dbf529de4689aed689b69b7260270a70177cf6
MATLAB
1,887
56
function dat = ft_preproc_medianfilter(dat, order) % FT_PREPROC_MEDIANFILTER applies a median filter, which smooths the data with % a boxcar-like kernel except that it keeps steps in the data. This % function requires the MATLAB Signal Processing toolbox. % % Use as % [dat] = ft_preproc_medianfilter(dat, order) % wh...
c749c60720bf7ea1bbbc679ca5600592c2ba40c7e2b5d89c30f8da961a1a5be8
MATLAB
1,887
41
% Plot various measures of variation in the data subplotfigure = figure(); % 1) Variance between each cycle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% varFig = subplot(4, 1, 1); plot(nanvar(segMat_405_Control, 0, 1), 'b'); hold on plot(nanvar(segMat_472_GCaMP, 0, 1), 'color', lightGreen); plot(nanvar(segMat_Diff, 0, 1)...
56342ceaf2bee636ae7d3c6b29bfce0f41ff0ee84f573a0fd32895f088a95e36
MATLAB
1,888
68
% runVisStim.m % % Function to run visual stimulus for specified duration (or until key % press). User selects pattern and mode (closed loop X, Y, both; open % loop). % Does not acquire any data. Meant to play between calls of runEphysExpt() % to acclimate fly to closed loop on a ball % % INPUTS: % none, but promp...
830703322ae42cb693a7188d804fe865d9baaa7d57882063361d0ad1ac01128f
MATLAB
1,888
49
% permutationTest %save('amapVarDist1.mat','amapVarDist1','SesList','amapVarCenters'); BootStrap = 1000; load('amapVarDist1.mat'); [SS,LL] = size(amapVarDist1); figure(1); for iSes = 1:SS, xx = amapVarCenters; if length(find(xx<0))>0 && length(find(xx>0)>0), xx1 = find(xx<0); xx2 =...
5bdf90a11c0f5378465258b3f156833caac11b70d53425da1002805ee1569712
MATLAB
1,889
55
clear; tbl_dir = pwd; tbl_name = fullfile(tbl_dir,'S1_Data.csv'); T = readtable(tbl_name); groupStr = unique(T.groupStr); setStr = {'Load 1','Load 2','Load 4'}; %% myColors = jet(2);% https://www.mathworks.com/matlabcentral/fileexchange/68546-crameri-perceptually-uniform-scientific-colormaps mksize = 5; figure('Name',...
7ee0c2c8514e88bfd0cc33ee2703f7aa86472827ae9268196b9485bf0cde9aab
MATLAB
1,890
54
function LFP_Info= PLX2LFPInfo(PLX_filename) %% Get LFP_Info from PLX file %% Input full path of PLX file %% Output: %% LFP_Info.LFP = All_LFP; %% LFP_Info.ch_name = All_LFP_Names; %% LFP_Info.fs = All_LFP_freq; %% Copyright WB 2023/02/07 [n, freqs] = plx_adchan_freqs(PLX_filename); [n,na...
92a5b9799738acdfbae1f10c0db5438844aae7d5184b7d11f43e5ee23928e0d9
MATLAB
1,891
49
function params = setSeachParams(x,params) % Function to set starting parameters for fine search fit optimization % Note that we assume the same time constant for sustained and transient % IRF channels of CST pRF model. % % INPUTS % x : (vector) starting pRF parameter % 1. x0 (deg0 % ...
56d011ac78cdd0976086ab5560e3f8d6b2b995169cfafbb7d5d500f5e70ea0b9
MATLAB
1,892
49
function filename = fetch_url(filename) % FETCH_URL checks the filename and downloads the file to a local copy in % case it is specified as an Universal Resource Locator. It returns the % name of the temporary file on the local filesystem. % % Use as % filename = fetch_url(filename) % % In case the filename does not...
e811692e90987acb4a4def91b417ec60e6e45228c3c0bb13af9c52bcfa44cc70
MATLAB
1,892
61
% getNTArrays.m % % Function to generate digraph arrays for neurons' neurotransmitter % (info for both nodes and edges) % % INPUTS: % ntFolder - full path to folder of neurotransmitter txt files % s - array of source nodes for digraph % names - array of node names for digraph % % OUTPUTS: % ntEdges - neurotra...
2573b1dd06e4bb979288521ed4d730ccfcac34410d77868cb9a505d3257f802a
MATLAB
1,893
70
function hist = vl_aibcuthist(map, x, varargin) % VL_AIBCUTHIST Compute a histogram by using an AIB compressed alphabet % HIST = VL_AIBCUTHIST(MAP, X) computes the histogram of the data X % using the compressed alphabet specified by a cut MAP of the AIB % tree (as returned by VL_AIBCUT()). Each element of HIST count...
3524b76a7132c96fc3330990ad86571ff3a69a6a063a1001dc27f90b80b15974
MATLAB
1,893
57
function [innermost, inside] = find_innermost_boundary(bnd) % FIND_INNERMOST_BOUNDARY locates innermost compartment of a BEM model % by looking at the containment of the triangular meshes describing % the surface boundaries % % [innermost] = find_innermost_boundary(bnd) % % with the boundaries described by a struct a...
b3f37f89be86ee3d2fbbef4b1360f4493edba313b100f416f1b34f605f52a170
MATLAB
1,893
44
function [ns_RESULT, nsSegmentSourceInfo] = ns_GetSegmentSourceInfo(hFile, EntityID, SourceID); %ns_GetSegmentSourceInfo Retrieves information about the sources that % generated the segment data % % Usage: % [ns_RESULT, nsSegmentSourceInfo] = % ns_GetSegmentSourceInfo(hFile, EntityID, Source...
e8998aca8bc09691358890abd98330967c0da176e458eaf3221c8854ca32b4a5
MATLAB
1,894
65
function t1_inversion_recovery(DATA,ROI,AddInfo) % This Aedes plugin calculates T1 inversion recovery maps % 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...
bfd2dd7cc6276024febe5d719238da6641e04875be2efbcba0e2c9637ab2d690
MATLAB
1,895
88
function [done,msg] = aedes_cellwrite(incell,filename,varargin) % AEDES_CELLWRITE - Write cell array to a text file % % % Synopsis: % [done,msg] = aedes_cellwrite(incell,filename,varargin) % % Description: % % Examples: % % See also: % AEDES % This function is a part of Aedes - A graphical tool for a...
64f2a0a77aa21a7b8e5609435a522c3bc7002b4e20cace08f8e52533a8b58a6a
MATLAB
1,896
63
function [n, npw, ts, wave] = plx_waves(filename, channel, unit) % plx_waves(filename, channel, unit): read waveform data from a .plx or .pl2 file % % [n, npw, ts, wave] = plx_waves(filename, channel, unit) % % INPUT: % filename - if empty string, will use File Open dialog % channel - 1-based channel number ...
daf30310da8c5e3de793705e6cf6315175b2dae65d00227ea15c53ed3a4537af
MATLAB
1,897
73
% mglFillRect - draw filled rectangle(s) on the screen % % $Id$ % usage: results = mglFillRect(x, y, size, color, antialiasing) % by: Benjamin Heasly % date: 03-17--2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % inputs: x,y - vectors of x and y coordinate...
195b8de4a0ddd1055c0be7ee6d2e6638488d692e549f2330267faf08872ddbfc
MATLAB
1,899
62
% load marked spikes from data % % conf: name of configuration ('eeg-fmri-geneva' or 'eeg-fmri-marseille') % group: name of group ('lTLE' or 'rTLE') % isVerbose: boolean print Spikes per minute (true/false) % % 2022-08-22 Jonathan Wirsich function spkPerMin = getSpikesPerMinute(conf, group, isVerbose) [confs, conf...
49891e50227c4b32b086995bddf3ebdcf06fe71817e7352968f1b824a75d2979
MATLAB
1,900
79
function OUT = permutation_corr_brbeh(x,b,nperm,type) % permute the behavioral scores if size(b,2)>1 b = b'; end N = size(x,1); if nargin < 3 nperm = 10000; end if nargin < 4 type = 'pearson'; end % generate permutations P = zeros(nperm+1,N,'int8'); for p = 1:(nperm+1) if p == 1 ...
5f75f78c1c8bcd2fc340070561429aad31b419363681323c5e932c1317b1dc04
MATLAB
1,900
51
function unfold_motion_censoring_mask(path_to_list,path_to_functional) %% Use this function to unfold masks to calculate connectotyping via // code %% path to functional % path_to_functional='C:\Users\oscar\OneDrive\matlab_code\GUI_environments\README\output_GUI_env\standard\Functional'; % path_to_list ='C:\...
49b109ce27212869315a38432c3c98c4ec2a1ed4b89a0c82196b8afd98d75a8c
MATLAB
1,901
63
function c = SolveDynMCNNCons(x,Imat_t,dsr_t,tn,ni,nh,no,at_C_in_t,F_out_t,V_ins_t,delta,data_dyn) whd = reshape(x(1:ni*nh),[ni,nh]); wod = reshape(x(ni*nh+1:ni*nh+nh*no),[nh,no]); wfd = reshape(x(ni*nh+nh*no+1:ni*nh+nh*no+no*nh),[no,nh]); bhd = (x(ni*nh+nh*no+no*nh+1:ni*nh+nh*no+no*nh+nh))'; bod = (x(ni*nh+nh*n...
770650432a210800e41b5e279e653584e89fc9d7c4ee57a1713d1ee1c8275d0f
MATLAB
1,901
52
%% detects surface, starting from a provided start location function [surff]= surfaceDetectionAnterion_v02(complexSignal,startAnt,startLat) col='rygbck'; sign2=log(flipud(medfilt2(abs(complexSignal),[7 7]))); [Gmag,Gdir] = imgradient(sign2); Gmag(isinf(Gmag)==1)=0;Gmag(isnan(Gmag)==1)=0; Gmag=Gmag(1:end-22,:); Gdir=G...
75d13c7efe0ce08133c6ba28b683d391e20f23fbb2a35b7f84bb2216ecb75c9c
MATLAB
1,902
49
%{ Copyright (C) Cambridge Electronic Design Limited 2014 Author: James Thompson Web: www.ced.co.uk email: james@ced.co.uk, softhelp@ced.co.uk This file is part of CEDS64ML, a MATLAB interface to the SON64 library. CEDS64ML is free software: you can redistribute it and/or modify it under the t...
4dc2105cf0cd584d3d211a5f30f7f441aaf24826214d08cf2d370a92a3eed31f
MATLAB
1,903
49
function results = vl_test_homkermap(varargin) % VL_TEST_HOMKERMAP vl_test_init ; function check_ker(ker, n, window, period) args = {n, ker, 'window', window} ; if nargin > 3 args = {args{:}, 'period', period} ; end x = [-1 -.5 0 .5 1] ; y = linspace(0,2,100) ; for conv = {@single, @double} x = feval(conv{1}, x) ;...
4f7bbdfa09ea17675c7c08f3b85b2b6bd97fc9a3f1922e1872c3e12404d0e512
MATLAB
1,903
48
% mglSocketDataWaiting: Check if data is available to read on a socket. % % $Id$ % usage: isDataWaiting = mglSocketDataWaiting(s) % by: justin gardner and ben heasly % date: 12/26/2019 % copyright: (c) 2021 Justin Gardner (GPL see mgl/COPYING) % purpose: Checks if bytes are available to re...
5edd234dcb3a9ad3b4a61aa7fdc5fadcf8a38e1c73713bab610f043f727c02e2
MATLAB
1,903
63
function vl_demo_print(varargin) % VL_DEMO_PRINT % VL_DEMO_PRINT(NAME) prints the current figure to the documentation % directory with the specified filename, assuming that the global % variable VL_DEMO_PRINT is defined and non-empty when MATLAB is % started (our using SETENV() from MATLAB). Otherwise the funct...
79be222262e82bb5ee70679b1acaf772295a2bf4052d52159bc52d75182daf31
MATLAB
1,904
68
function bool = checkfields(s,varargin) % % bool = checkfields(s,varargin) % %Author: Wandell %Purpose: % We often need to check for a nest sequence of fields within a structure. % We have been doing this with a series of nested or grouped isfield statements. % This got annoying, so I wrote this routine as a repl...
814d52d9c6721f53434968757efe8e91586ea8039e4584a588a90da8f6a9e4bf
MATLAB
1,904
65
function [probe] = getAdjMatrix(probe, add_module) %GETADJMATRIX Calculate the module/node pairs of directional graph % Detailed explanation goes here add_module = 0; if (isfield(probe, 'denseflag')) if (probe.denseflag) add_module = 1; end end s=0; t=0; if ((isfield(probe.module, 'shape')==false...
9e364cc3273bf641018e3ccbf4988bcfceef58b8bc48205251f2359bfcea5eda
MATLAB
1,904
51
function [ lfp_montage ] = extractLFPMontage( obj, data ) % Extracts LFPs Montage data. % % Syntax: % [ lfp_montage ] = EXTRACTLFPMONTAGE( obj, data ); % % Input parameters: % * obj - object containg survey data % * data - structure containing montage % % Output parameters: % * lfp_montage - new structure c...
d6d9d0a7ea70220f334eb18d06967b2d0df76690f22947fc8c27ee9b704dff8c
MATLAB
1,904
59
% Function File: [yf, tf, n, HTF, Fs] = lpf (y, t, HTF) % % Low-pass filter y-values at the given half-transmission frequency % (HTF, in Hz) using a binomial filter. % % The filter order (n) for a given HTF is calculated from the following % equation: % % n = 1 / log2 ((cos (pi * (2 * HT...
ee14f4e9fc3ca1e4baa8a7ed50a6b2fde072819e43dcbf722fa336ae5b959a4b
MATLAB
1,905
77
%tableS2_FA_diffs_primary_synthetic.m %% clear all; close all; clc; warning('on','all') scriptdirs = {pwd; '..\..\plot'; '..\..\analyze'; '..\..\helper_functions'}; addpath(scriptdirs{:}) datadir = pwd; ssfile = 'subsample1000_stdFR_stdRP.mat'; sspath = fullfile(datadir,ssfile); %% tabledir = datadir; tablefil...
13ae45a181926058467e98743705750831cf99605a3107f90da0e31b38af47a4
MATLAB
1,906
79
function corrmap = fmri_corr(data,seed) corrmap = []; if ischar(data) data=aedes_data_read(data); data = data.FTDATA; elseif isstruct(data) data=data.FTDATA; end % Get mean time-series from seed ROIs seed_struct = l_Roi2seed(data,seed); % Calculate Pearson correlation coefficients ------------- data_sz = one...
84170549a971e36d02a172b6a92736e3ffee888c453fd59bacd78a754ebad186
MATLAB
1,906
77
%tableS6_FA_diffs_highFR_synthetic.m %% clear all; close all; clc; warning('on','all') scriptdirs = {pwd; '..\..\plot'; '..\..\analyze'; '..\..\helper_functions'}; addpath(scriptdirs{:}) datadir = pwd; ssfile = 'subsample1000_highFR_stdRP.mat'; sspath = fullfile(datadir,ssfile); %% tabledir = datadir; tablefil...
1d21988f2e02f8d49583b179469225008a6f90e5bef5e97123645225c41aef5b
MATLAB
1,907
50
% Check the validity of the t-files because of the issue with 32 vs 64 bit' close all clear all clc pipe = MLTetrodePipeline_v2('pipeline_config.json') for iSession = 1:pipe.experiment.numSessions session = pipe.experiment.session{iSession}; fprintf('Processing session ( %s )\n', session.name); % Loa...
d9845b699fe163e21c1dfd97ad1f7f93b60d4ae379b77779e657d7a988d7764a
MATLAB
1,907
56
clear; close all; clc; initime = clock; addpath('funcs'); Delta_E = 0.3; Delta_I = 0.03; Iattn = 0.02; allTime = 5000; steps = 101; lateral_start = 0.09; lateral_end = 0.18; strt_prd = 300000; end_prd = allTime/0.01; % container PETAsheet = zeros(steps,16,16,5); PETOsheet = zeros(steps,16,16,5); finalRsheet = zeros...
97461a7d3789da42f1b1fde95c525869f22b5938e1b4b6a68d732ff79df03c70
MATLAB
1,908
45
function [subjectName, isTestMode, distanceFromScreen] = runInput() % Initialize output variables subjectName = ''; isTestMode = false; distanceFromScreen = 0; % Create a figure for the input dialog fig = figure('Position', [100, 100, 350, 180], 'MenuBar', 'none', 'Name', 'Experiment Setup', 'N...
f20d3b9c9b2a6c5d824a44ec1672326fca1bea4f47315b70ae82455050b17683
MATLAB
1,908
64
function ft_flush_event(filename, varargin) % FT_FLUSH_EVENT removes all events from the event queue % % Use as % ft_flush_event(filename, ...) % % See also FT_FLUSH_HEADER, FT_FLUSH_DATA % Copyright (C) 2007-2010 Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % fo...
fa2a4c96d47cedaa5cd5bcf61bece86980edecf737b87d82be5df2348c82e9e6
MATLAB
1,908
52
classdef IntracellularElectrodesTable < types.hdmf_common.DynamicTable & types.untyped.GroupClass % INTRACELLULARELECTRODESTABLE Table for storing intracellular electrode related metadata. % REQUIRED PROPERTIES properties electrode; % REQUIRED (VectorData) Column for storing the reference to the intracellular ele...
a8954d57be8f6f56f5eb3c95e0a2f7e4663a4079b8c3cd5b52c5737824c8ef0b
MATLAB
1,909
54
function Nsmap1 = nmap(y,y2); % updates global Nsmap - Ns of al bins of y-y2 combinations % y2 is for y-axis, y for x-axis globals; DEBUG = GDEBUG; Nframesy = length(y); Nsmap1=zeros(yNbins,xNbins); % count the number of x-y (y-y2) appearances in the data % SEE IF CAN REPLACE BY 2D HIST for ii=1:Nframesy, ...
bc9584db9525bd5f79d67f5e13925134ab1892093bff2247f163db29c6c551ba
MATLAB
1,910
81
function [pc,p,cc] = pcorr(X) % PCORR - Calculate partial correlation coefficients % % % Synopsis: % % % Description: % % Examples: % % % See also: % % This function is a part of Aedes - A graphical tool for analyzing % medical images % % Copyright (C) 2011 Juha-Pekka Niskanen <Ju...
be858f756cd789cb22efc7213399c7ac1367b6e0f1e7bdba7e4e23d44b1ae5b0
MATLAB
1,910
60
clear all; close all; % Make a function for below input would be mat files, maybe filename? and output is the h5 % file % load binarized. mat load('Binarized_event_detection_final.mat'); % load plex.mat % [A,b]=uigetfile('*plex.mat','multiselect','off'); % load(A); matFiles = dir('*.mat') ; matFiles_name = {matFil...
deb819b381966a2fe09783a195cf7796e0a4ca941a61cd55ab276af7cde9acd6
MATLAB
1,910
46
function[header]=SONGetBlockHeaders(fid,chan) % SONGETBLOCKHEADERS returns a matrix containing the SON data block headers % in file 'fid' for channel 'chan'. % The returned header in memory contains, for each disk block, % a column with rows 1-5 representing: % Offset to start of block in file % ...
a7609ec1f503441e7a0518fae1ece344d71eced04ad568e1c467a32a50d0e509
MATLAB
1,911
70
function [MATreordered,MATindices,MATcost] = reorderMAT(MAT,H,cost); %REORDERMAT Reorder matrix for visualization % % [MATreordered,MATindices,MATcost] = reorderMAT(MAT,H,cost); % % This function reorders the connectivity matrix in order to place more % edges closer to the diagonal – this often helps in d...
b64fb18e2b7af0cfa41a06d7d37be89913b66ae7d11b2f801b1eea6160ea23d7
MATLAB
1,912
42
clear; %%%%%%%%%%%%%%%%%%%%%%%%% SETTING PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%% number_CASE_DEL=12721; number_CASE_DUP=4441; number_CONTROL_DEL=11924; number_CONTROL_DUP=5015; number_case=number_CASE_DUP; %specify this parameter with deletion of duplication values number_control=number_CONTROL_DUP; %specify this ...
8b3f3110a8764f844a1f7c013ebcfea795bb8f1c51e71123b4a48c6a07db8c05
MATLAB
1,913
66
function R=randmio_und(R, ITER) %RANDMIO_UND Random graph with preserved degree distribution % % R = randmio_und(A,ITER); % % This function randomizes an undirected network, while preserving the % degree distribution. The function does not preserve the strength % distribution in weighted networks. % % I...
e897d6165494d46cf7b398cb321d954ddacce286ae46337b0e388bb6e44e6631
MATLAB
1,913
67
function hdr = mayo2nifti1(ohdr,mat) % Convert from an ANALYZE to a NIFTI-1 header % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % % $Id: mayo2nifti1.m 8776 2013-11-14 09:04:48Z roboos $ if isfield(ohdr,'magic'), hdr = ohdr; ...
21558b877c271955fd296623adc5041749a5898a5c0fc5ad87e905335b8ca834
MATLAB
1,914
83
clear all close all M = readmatrix('cd_data.xlsx'); [B,I] = sort(M); I = I'; trial_num = B(:,1)'; cue_DA = M(I(1,:),2)'; rew_DA = M(I(1,:),3)'; total_DA=cue_DA+rew_DA; avg_cue_DA = movmean(cue_DA,10); avg_rew_DA = movmean(rew_DA,10); avg_rewcue_DA = movmean(total_DA,10); figure; subplot(1,3,1) sca...
519fefc42a79bd1adf3523a60d47a820fcd6826095fb7bde844a88a014e8e905
MATLAB
1,914
33
function [mean_of_binary_data,errhigh,errlow] = bootstrap_mean_and_ci(nboot,alpha,binary_data) %%%% this function will enable us to find the mean and error bars (95% CI using bootstrap) ci_cutoff = round([nboot*alpha/2 nboot*(1-alpha/2)]'); bootstrap_data = bootstrp(nboot,@mean,binary_data); s...
88fb429372762fd5c37924b4e279da53c905332b3a0e295451d01e05ca07657e
MATLAB
1,914
75
% GLM root = '/'; savedir = 'savedir/'; group = {'MUSICIANS/', 'NONMUSICIANS/'}; no_of_runs = 10000; % Load RMS data load('rms2.mat'); X = zscore(rms); % Loop over group directories for k = 1:numel(group) cd([root group{k}]); dirls = dir('*mus*'); for s = 1:length(dirls) disp(['subject ', num2str(...
5cd6cb5a68e64e76bd5052fa51e63d80cc477b7119b0e45ab06cdf83dd8d7133
MATLAB
1,915
55
%% Generate a table of optimal parameters and F1 for 1 photon clear % dir_output_info='data_TUnCaT'; % num_Exp = 9; % dir_output_info='data_TENASPIS_original'; % dir_output_info='data_TENASPIS'; % num_Exp = 8; dir_output_info='data_simulation'; num_Exp = 10; % dir_output_info='data_CNMFE\blood_vessel_10Hz'; % num_Exp =...
ba5f8d777536a0921cf0e450f2cd1d79a2ea8e71377d2e1cafe7e7f1755a983b
MATLAB
1,915
48
% This script creates the mesh (both CAD surface mesh and a computational % wire grid) for a straight conductor with 1 A of total current % The output is saved in the binary file coil.mat and includes: % strcoil.Pwire(:, 3) - set of nodes for all wires % strcoil.Ewire(:, 2) - set of edges or current dipo...
c1f0ddc8655e927943aea0c801a077068774cbd767dbd90b143fefe60ac293e0
MATLAB
1,916
52
function raw_motion = extract_MoCo(dicomdir) %% This script parses the movement information from MoCo series % NOTICE: The raw motion output will be in the native ordering format % (y,x,z,y_rot,x_rot,z_rot) %dicomdir = '/group_shares/FAIR_ADHD/CYA/sorted/ADHD-HumanYouth-OHSU/11778-1/20150211-SIEMENS_TrioTim-Nagel_K_S...
cf95d4fb4993564ade93c86d0d376d079a19d10cf4ec1d4123226ff362fb3789
MATLAB
1,916
75
function [CIJ] = makeevenCIJ(N,K,sz_cl) %MAKEEVENCIJ Synthetic modular small-world network % % CIJ = makeevenCIJ(N,K,sz_cl); % % This function generates a random, directed network with a specified % number of fully connected modules linked together by evenly distributed % remaining random connections. ...
e378eface169300e57e4c09b194621195397fc597173696fa18d1b974e8c994a
MATLAB
1,916
55
% clear; addpath(genpath('.')) addpath(genpath(fullfile('..','ANE'))) %% dir_video=fullfile('..','data','data_TENASPIS','added_refined_masks'); list_Exp_ID={'Mouse_1K', 'Mouse_2K', 'Mouse_3K', 'Mouse_4K', ... 'Mouse_1M', 'Mouse_2M', 'Mouse_3M', 'Mouse_4M'}; num_Exp = length(list_Exp_ID); eid = 1; Exp_ID = ...
e4a8afcfd258fc808c98007b698b7632dde1cdb1311eab79164ad5176b5e0f58
MATLAB
1,916
69
function R=latmio_dir(R,ITER) %LATMIO_DIR Lattice with preserved in/out degree distribution % % L = latmio_dir(A,ITER); % % This function "latticizes" a directed network, while preserving the in- % and out-degree distributions. In weighted networks, the function % preserves the out-strength but not the in-s...