sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
56cc38a59a1cc26384ffe91d861b7ecf3f949b2f76e8a90e07b0f4586d59971d
MATLAB
1,561
50
close all clear all clc % The freezeframe videos don't seem to record the frame rate at which they % were recorded so set this to what it should be. frameRate_hz = 15; % Select a folder that contains the video msg1 = 'Select the folder containing the FreezeFrame-formatted videos'; fprintf('%s\n\n', msg1); inputFolder...
e3b2873688973b3eade70fcf11f3b8c0c9668be69a649370bf66b762c6da4b0e
MATLAB
1,561
42
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [R] = compute_group_average_rate_differences_within_across_for_table(RateMatricesAveraged) numGroups = size(RateMatricesAveraged,1); R = []; k = 1; for iGroup = 1:numGroups groupId = RateMatrices...
c9b93ec15dc08c4373f6a3a3907af3f14b946d6e32c1b87f5c7d96000d135d23
MATLAB
1,562
67
function save_overlay_as_roi(DATA,ROI,AddInfo) if ~isfield(AddInfo,'ImageOverlay') errordlg('Image Overlay not defined.','Error','modal') return end % Get Threshold and clim clim = round(((AddInfo.ImageOverlayClim-AddInfo.ImOverlayMin)*256)./... (AddInfo.ImOverlayMax-AddInfo.ImOverlayMin)); if clim(1)==clim(2) if...
c078886a4fa55fe3d543c4b72afd6e41523571d9424b03a6e3139d2cdca05c3b
MATLAB
1,563
33
% readDigPort.m % % $Id$ % usage: readDigPort(<portNum>) % by: justin gardner % date: 09/21/06 % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % purpose: read the National Instruments board digital input. % portNum defaults to 1, to read from Dev1/port1. % ...
2955ba39d26dd4cffe4c68bc67a52456ca8233019efb3339c4e92362fc97eded
MATLAB
1,564
56
function [nrm] = normals(pnt, tri, opt); % NORMALS compute the surface normals of a triangular mesh % for each triangle or for each vertex % % [nrm] = normals(pnt, tri, opt) % where opt is either 'vertex' or 'triangle' % Copyright (C) 2002-2007, Robert Oostenveld if nargin<3 opt='vertex'; elseif (opt(1)=='v' | opt...
8ff1e93b1f8d3ce2089ab353e93ce99455955867efec9c389fcd12e96ef45863
MATLAB
1,564
54
function posH = calceyeangle_APP(frameData_cam1, frameData_cam2, theta) %% Angle between two cameras in degree 5/22 DONT CHANGE if ~exist('theta','var') theta = 39.8; end %% Horizontal d1 = [frameData_cam1.pupil_x] - [frameData_cam1.cr1_x]; d2 = - [frameData_cam2.pupil_x] + [frameData_cam2.cr2_x]; posH = atand(...
f265b03f3eea992e8d4f314ddd0f14c2a0d4b5eb684e2ac3ce82a47472f2633c
MATLAB
1,564
33
function wdm_params = check_wdm_params(wdm_params) % widefield imaging parameters % last update: 9/18/2021. YZ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Run the checks if isempty(wdm_params) % Make sure that tpm_params is a struc...
2d2ad6d7fe2632348e8b5f6eaa6d33ea72669021110be98e2ee0cd37241d6afa
MATLAB
1,565
38
function [asymmetry,abs_asymmetry,sign_sym] = fcn_get_asymmetry(B) %FCN_GET_ASYMMETRY returns weight/sign asymmetries % % [asymmetry,abs_asymmetry,sign_sym] = fcn_get_asymmetry(B) takes as % input the matrix of regression coefficients and returns, as output, two % matrices whose elements correspond to differe...
c6cb385af06e7e65a9d7b71df63c086102b1f0d05de7398fa112fc0bcb32e872
MATLAB
1,566
46
function [f F]=motif3struct_bin(A) %MOTIF3STRUCT_BIN Frequency of structural class-3 motifs % % [f F] = motif3struct_bin(A); % % Structural motifs are patterns of local connectivity. Motif frequency % is the frequency of occurrence of motifs around a node. % % Input: A, binary directed connectio...
ffa50537da93594d3279974352b8d847c899f33155458222ecccaac7ec429ae8
MATLAB
1,566
47
%{ 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...
152340e848d486032d576aee23aaf499d8615a650fd86e85858b60719aa056cd
MATLAB
1,567
41
function [folders, folder_tags, folder_count] = catalog_tags(folder_name) % Look through experimental folders recursively and sort out what the % experimental tags are folders = {}; folder_count = 0; folder_tags = cell(0,0); start_path = ''; if nargin < 1 folder_name = uigetdir(s...
e39cc4e7ac6600d78f6c8963fc09bc954eac5682f939f156579fdb217e21f292
MATLAB
1,567
47
function dm = compileSparseDesignMatrix(dspec, trialIndices) % Compile information from experiment according to given DesignSpec expt = dspec.expt; subIdxs = buildGLM.getGroupIndicesFromDesignSpec(dspec); totalT = sum(ceil([expt.trial(trialIndices).duration]/expt.binSize)); growingX = sparse([], [], [], 0, dspec.edi...
4380455d3e023bdbbbd43ce9b9e6fdedaad6257ea2f23019288241e0617a6b6f
MATLAB
1,568
69
% % Plot the rating evolution, i.e. the mean rating of each item in % function of number of ratings. Plot only the fast stuff. % % PARAMETERS % $network % % INPUT FILES % dat/data.$network.mat % % OUTPUT FILES % plot/rating_evolution.[c].$network.eps % network = getenv('network'); bins = 10; font_size = 22; line...
68715f3d7992cc2be25845887d53855c3a7fb20c48082c097f60911156e1e0d7
MATLAB
1,568
63
function [Head]=SONFileHeader(fid) % SONFILEHEADER reads the file header for a SON file % % HEADER=SONFILEHEADER(FID) % % Used internally by the library. % See CED documentation of SON system for details. % % 24/6/05 Fix filecomment - now 5x1 not 5x5 % % Malcolm Lidierth 03/02 % Updated 06/05 ML % Copyrigh...
75de304d64f4c0988d1e0bfa36827ed20dd3b110f97df173fa1c64f057117faa
MATLAB
1,568
32
function [regular_timestamps_s, regular_ax, regular_ay, regular_az, regular_totalAcceleration, imuFs] = ml_inscopix_imu_compute_total_acceleration_planar( imuData ) imuFs = 50; % Sampling rate of the IMU in Hz numSamples = length(imuData.IMU_Time_s); timestamps_s = imuData.IMU_Time_s; % Find the v...
7759b47cca709183dc49b42d7a3c3b12af1e39ecd0d93dc6c774ec8c52124146
MATLAB
1,568
47
classdef PupilTracking < types.core.NWBDataInterface & types.untyped.GroupClass % PUPILTRACKING Eye-tracking data, representing pupil size. % REQUIRED PROPERTIES properties timeseries; % REQUIRED (TimeSeries) TimeSeries object containing time series data on pupil size. end methods function obj = PupilTrackin...
b7a852862cca701464c12ad12fb093129e9bb227703f47c96dade662b034f827
MATLAB
1,568
38
% Demo for showing how to use plot_fig_subcortex % Author: Xinyu Wu and Guoyuan Yang, BIT. % dependecy: FreeSurfer MRIread functions. % File must be MNI152 2mm voxel space with size of 109*91*91. demo_file = fullfile('demo_file', 'HCP_group_principle_functional_gradient.nii.gz'); % Output file path % We recommend ge...
c53c40e990da0fbc2e300f46bf74bcfda55303d012b2bb819ec543239323088e
MATLAB
1,568
59
% Author: Guosheng Lin (guosheng.lin@gmail.com) % this is a simpler demo file for testing on your own images. function demo_test_simple_voc() rng('shuffle'); addpath('./my_utils'); dir_matConvNet='../libs/matconvnet/matlab'; run(fullfile(dir_matConvNet, 'vl_setupnn.m')); run_config=[]; run_config.use_gpu=true; %...
a9e9dac968451d6db65a1ea616a1b0cdbf20937ccaf93d5c02f1c878ea590ae0
MATLAB
1,569
65
clear all; close all; load('Alon_Modep'); %% ctrlLength = length(xDataCtrl.v); modepMatV = NaN(length(xData.v),2); modepMatDo2 = NaN(length(xData.do2),2); modepMatV(:,1) = xData.v; modepMatV(1:ctrlLength,2) = xDataCtrl.v; modepMatDo2(:,1) = xData.do2; modepMatDo2(1:ctrlLength,2) = xDataCtrl.do2; %% figure; st = su...
11ffecfa67ccd633ae0a15ebb1f9540d94ff65b9ac0b1fa9c162674ed5672dcf
MATLAB
1,570
54
function R = Rmatrix_ang(rl, ap, fh, inv_flag, order) % R = Rmatrix_ang(rl, ap, fh, inv_flag) %% Header % Purpose: % make the rotation matrix according to the angulation parameter % Assuming Tang = Tang = Trl*Tap*Tfh; % if inv_flag == 1 % making the inverse rotation matrix i.e. Tang_inv = % Tfh_inv...
caa1b72ec21e1cb86fec470e03b811bdbbc4fac02dc425c628babca8ff4e5ac8
MATLAB
1,570
80
function J=vl_xyz2lab(I,il) % VL_XYZ2LAB Convert XYZ color space to LAB % J = VL_XYZ2LAB(I) converts the image from XYZ format to LAB format. % % VL_XYZ2LAB(I,IL) uses one of the illuminants A, B, C, E, D50, D55, % D65, D75, D93. The default illuminatn is E. % % See also: VL_XYZ2LUV(), VL_HELP(). % Copyright ...
01b1913173e9cd08ca2d18af3074020271da01405877721945e212202abc252f
MATLAB
1,571
41
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [MeanTable, ErrorTable] = bfotable_compute_group_averages(BFOTable, SessionsToGroups) % This should work with any BFO90 or BFO180 table uniquePairs = unique_groups_sessions_to_groups(SessionsToGroups); group...
264caecb4138f8e1609b488c2599fb6e15a703c58a9043d9a1eb84222ad34e85
MATLAB
1,571
51
function [Fx,Fy] = vl_imgrad(F,varargin) ; % VL_IMGRAD Image gradient % [Fx,Fy] = VL_GRAD(F) returns the finite differencies gradient of the % image F. The function uses central differencies and for all but % the boundaries pixels, for which it uses forward/backward % differencies as appropriate. % % VL_GRAD...
ed490be4ccf132275e613e73f61d6bd3ff3877594e690616a01df48e668d4964
MATLAB
1,571
47
classdef Position < types.core.NWBDataInterface & types.untyped.GroupClass % POSITION Position data, whether along the x, x/y or x/y/z axis. % REQUIRED PROPERTIES properties spatialseries; % REQUIRED (SpatialSeries) SpatialSeries object containing position data. end methods function obj = Position(varargin) ...
44b3e990852f83c6b7aaed174168061970915ed41e90794b4007ed1ef5e7c74e
MATLAB
1,572
43
% THIS SCRIPT IS ONLY INTENDED FOR USE BY THE PACKAGE MAINTAINER % Run GNU Octave from a Bash terminal in a unix-based OS with pandoc installed. % Octave needs to have the following packages installed: % - generate_html % - statistics % - statistics-resampling % (The documentation was generated with GNU Octave inst...
2b873785801f973edcebd250520dd9a5f6a6f014f108fcfb9199061bd27200f1
MATLAB
1,573
75
function ds_info=my_gen_ds_info_voc(ds_config) ds_dir=fullfile('../datasets', 'voc2012_trainval'); train_idx_file=fullfile(ds_dir, 'ImageSets/Segmentation/train.txt'); fid=fopen(train_idx_file); train_file_names=textscan(fid, '%s'); train_file_names=train_file_names{1}; fclose(fid); val_idx_file=fullfile(ds_di...
c0808757280df4e68b5587e2feeacb546c2771d7144097d847873002110dfd8c
MATLAB
1,573
49
%function for getting IR zones for anophles vidoes function [Params] = getzones(Params) Zones = {}; for foldNumber = 1:length(Params.Folders) cd(Params.Folders{foldNumber}) vidName = Params.vidNames{foldNumber}{1} vid = VideoReader(vidName) zFrame = readFrame(vid); ...
1614c55a1bfde9f288a9f7e880fc23a4b0199984168182f65264a1b005982f0c
MATLAB
1,574
47
%{ 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...
b89b79f22e16464b7fa8302dd43d5e1f29ebdbb72d344927a660e7ecda17bd31
MATLAB
1,575
44
% mglMetalSetWindowFrameInDisplay.m % % usage: results = mglMetalSetWindowFrameInDisplay(displayNumber, rect, socketInfo) % by: Benjamin Heasly % date: 03/11/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Set the mgl window's displayNumber and frame rect...
bf76ca57532171d1ceb8451ecaf8acd288f52af6a0c989d31291b286760ed70a
MATLAB
1,575
61
function h = uimagesc(varargin) %UIMAGESC Display scaled image with uneven axis. % UIMAGESC(...) is the same as UIMAGE(...) except the data is scaled % to use the full colormap. See UIMAGE for details. % % Note: UIMAGESC is based on Matlab's original IMAGESC, Revision 5.11.4.5. % UIMAGESC simply calls UIMAGE w...
664c7632543eb68b143cc60a558537000d45c4c653fb746e28ac76ec77d20305
MATLAB
1,576
62
function surfstatcontrastbatch( Data, Model, Surf, Contrast, FilePrefix) slm_lin = SurfStatLinMod(Data, Model, Surf); % contrast slm_con = SurfStatT( slm_lin, eval( Contrast(1) ) ); [ pval, ~, clus, clusid ] = SurfStatP(slm_con); qval = SurfStatQ(slm_con); % contrast, another side invslm_con = SurfStatT( slm_li...
167015d8ad10bb2f5502085bd6e839bc9b1cba4fad7f5921b7956852109f60f5
MATLAB
1,577
75
function ds_info=my_gen_ds_info_sal(ds_config) ds_dir=fullfile('/home/lab/lei', 'sal_trainval'); train_idx_file=fullfile(ds_dir, 'ImageSets/Main/saliency_train.txt'); fid=fopen(train_idx_file); train_file_names=textscan(fid, '%s %s'); train_file_names = train_file_names{1}; fclose(fid); val_idx_file=fullfile(d...
332221a57a6e1fae4bab83e96bfa033c57320d30529598d7f5f9669d5b16acc9
MATLAB
1,577
55
function imsegs = processSuperpixelImage(segimage, getInfo) % imsegs = processSuperpixelImage(fn) % Creates the imsegs structure from a segmentation image im = double(segimage); imsegs.imname = 'empty'; imsegs.imsize = size(im); imsegs.imsize = imsegs.imsize(1:2); if size(segimage, 3) > 1. im = im(:, :, 1...
33bf9f5f83076f12e89a07092a302c463dbb6d37dd4431b867ab55345a54e45d
MATLAB
1,577
43
%{ 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...
7b72c78b738ec7c06143a134cd9c184f390b5b708a22b5fc19a9e97d6354ca77
MATLAB
1,577
68
% mglCameraLoadData.m % % usage: mglCameraLoadData(filename) % by: justin gardner % date: 10/29/19 % purpose: Fucntion to load data file that is stored by mglCameraThread('save'); % function retval = mglCameraLoadData(filename) % default return argument retval = []; % check arguments if ~any(nar...
bf8e45619856e908b1b8d6300a65d25a0e86831fb1144427f019b57bef470ed6
MATLAB
1,577
65
% generate_oscil_ex.m % to generate the two oscillation examples % with same simulation parameters % as were used for figures 2-3 %% clear all; close all; clc; %% add fn paths if not added yet % assumes script run within local directory scriptdirs = { '../../analyze'; '../../figures'; '../../helper_functions'; '../../s...
371e02dc7008662d523840fd57e2fb910511db4781c8309a96fc27ea629118bf
MATLAB
1,578
43
function TR_RecordPlot(Experiment, plotH, Type, IDs) if Experiment.NumGrps>0 width = 0.2; plotH.NextPlot = 'replacechildren'; plotH.Visible = 1; Xstr = cell(Experiment.NumGrps); maxScore = 0; Data = cell(Experiment.NumGrps); for g=1:Experiment.NumGrps Group = Experiment.Groups(g).Gr...
041fa3d1c6b55b88e0204ece56073db30e9b4cb8c41c26daaa6cde7778b4786c
MATLAB
1,579
40
function [DM, xd] = ft_preproc_online_downsample_apply(DM, x) % function [DM, xd] = ft_preproc_online_downsample_apply(DM, x) % % Passes signal x (channels times samples) through the downsampler. % Returns updated downsample model (numSkip!) and downsampled signal. % Copyright (C) 2010, Stefan Klanke % % This file is...
43619cb07613a4e431d2b641937771c0c16a7d7d5192154b9fd6aa5fbfb80c05
MATLAB
1,579
45
function [lambda,efficiency,ecc,radius,diameter] = charpath(D) %CHARPATH Characteristic path length, global efficiency and related statistics % % lambda = charpath(D); % [lambda,efficiency] = charpath(D); % [lambda,ecc,radius,diameter] = charpath(D); % % The characteristic path length is the average shor...
51e91c9eb26731a76dea59c4288d744ae61d85db59d678193257316cc1c71df1
MATLAB
1,579
63
function [phandle, chandle,flat_coords] = ternary_scatter3(wlimits, name_E, E, name_F, F, ZData, Cbar, varargin) %ternary_surf Plot surface on axes defined by handle. % % %% Process inputs % Check input count if ( nargin < 5 ) error('Too few Inputs') end % If user does not spe...
7b7391b62035fb8332ea331f3c2aacb6df403b5513169b6a1be4bd7863393534
MATLAB
1,579
73
%% Type help for help help Edf2Mat %% Example 1 for how to use the Edf Converter %% Converting the EDF File and saving it as a Matlab File edf0 = Edf2Mat('eyedata.edf'); %% The edf Variable now holds all information % lets display it: disp(edf0); %% And how about just plot it? plot(edf0); %% Of course you can als...
8b041abab57edd68c8ed45c731db143ec044f1f37a8f124aacb42d82427062c9
MATLAB
1,580
43
function NS_RecordPlot(Experiment, plotH, Type, IDs) if Experiment.NumGrps>0 width = 0.2; plotH.NextPlot = 'replacechildren'; plotH.Visible = 1; Xstr = cell(Experiment.NumGrps); maxScore = 0; Data = cell(Experiment.NumGrps); for g=1:Experiment.NumGrps Group = Experiment.Groups(g).Gr...
934b5b8549798c212c1e037251a0c6f15af74afc89b04f5232c72be0ed231738
MATLAB
1,580
48
function object_task_consecutive_trials_init(referenceFolder) projectType = 'object_task_consecutive_trials'; instanceFolder = uigetdir(pwd, 'Select project instance folder'); if ~exist(instanceFolder, 'dir') fprintf('Creating instance folder (%s) ... ', instanceFolder); mkdir(instanceFolder); fprintf('do...
969518cd642704325a4ef67c79f5ebff4947c490ab6e6187a880da409794f617
MATLAB
1,580
61
% mglDefaultScreenParams.m % % $Id:$ % usage: mglDefaultScreenParams() % by: justin gardner % date: 04/26/10 % purpose: Get a default screen parameters % % screenParams = mglDefaultScreenParams % function screenParams = mglDefaultScreenParams(screenParams) % get host/display name if nargi...
4e1479203496a1d18f81e41639ce7064977f5bb959c768624f2824c86641d7b8
MATLAB
1,581
45
function [chnsReg,chnsSim] = edgesChns( I, opts ) % Compute features for structured edge detection. % % For an introductory tutorial please see edgesDemo.m. % % USAGE % [chnsReg,chnsSim] = edgesChns( I, opts ) % % INPUTS % I - [h x w x 3] color input image % opts - structured edge model options % % OU...
f8f7cb818c4313e0e066b7df7ff004f3e1f0c7fe492c5c1827c34ecda6e4c091
MATLAB
1,582
34
% writeDigPort.m % % $Id$ % usage: retval = writeDigPort(portNum,val); % by: justin gardner % date: 09/21/06 % purpose: write an ouput to the National Instruments board % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % portNum defaults to 2, to write from Dev1/port2....
8e403b7264c07a3e2bcdfa58923deb9dae2bf27a445de31d12ab4f8cb42fb573
MATLAB
1,583
59
% Function f_FFT.m % % Description: % This function computes the FFT of a signal or matrix of signals. % % Inputs: % pm_ColInMat: input signal or signals (data in columns) % ps_SampleFreq: data sample frequency % ps_ZeroMean: set to 1 if the frequency=0 must contain the signal average % (default: 1) % ps_TwoSides: se...
bfaa930926e612ddd797ee28867d459461a10af43ae3b8b9830339de042c7947
MATLAB
1,584
47
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [C] = tetrodes_compute_fraction_occupied(ratemaps, useSmoothed) C = []; k = 1; numAnimals = length(ratemaps.data); for iAnimal = 1:numAnimals d1 = ratemaps.data(iAnimal); animalName = d1.anima...
0bebdff291ac9cbc4d4b35c539c533996ac0222bd696f8a5287e48243d9012ca
MATLAB
1,585
56
function vl_demo_kdtree % VL_DEMO_KDTREE % Demonstrates the construction of a kd-tree for uniformly % distributed 2-D data and data distributed on a circle. Both the % median and mean threshold selection methods are illustrated. randn('state',0) ; rand('state',0) ; % uniform 2D points Q = single(rand(2,...
260ed6c8fff4d00fb1edc483ffe9f85f6f328de25f21fc6de6edc737ec8a489e
MATLAB
1,585
34
function y = Sparse_L_ij(num_columns,npp,N,num_VTA,l5_rec,l23_rec,l5_l23,l23_l5,l23_l23_cross,l5_l5_cross,l_23_l_VTA,l_VTA_l_VTA,noise) %instantiation of weight matrix L_ij1 = zeros(N,N); rho = .3;%.0675; rho_2 = .1; for i = 1:num_columns j = (i-1)*npp*2; if i < num_columns L_ij1(j+npp+1:j+(2*np...
97b9e7f8d47d72a019010c9292335e4065de94c225296e6a869f0f1fe44dbe61
MATLAB
1,585
59
function [pvalue] = nbstrp_paired(data,groupID,nItr,method) %This function is to combine the hierarchical bootstrapping (for %resampling) and shuffling "resampled" paired data. two-sided test. % input % data - paired data. nx2, where n is number of observations. % groupID - give the same number for observations from t...
4262f0cec5c15000ee9501cb306a6acc71f34e2b82ff508be7e5b112382d5922
MATLAB
1,586
41
%{ 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...
6919016c8bc7650c891ca140c5e84f85b085dda12e93437bdaba1a46bce4e423
MATLAB
1,586
41
SC=init_system(SC); %% hadamard masks M = OPT_S.M; rads = OPT_S.rads; [HAD_S.had_mat,HAD_S.row_i,HAD_S.col_j] = hadamard_matrix(M,rads); [HAD_S.XM,HAD_S.YM]=meshgrid(linspace(-SC.mask_rad_laser,SC.mask_rad_laser,M)); [HAD_S.XM_int,HAD_S.YM_int]=meshgrid(linspace(-(SC.mask_rad_laser-0.1),(SC.mask_rad_laser-0.1),M)); HAD...
c444d40c0d990c3a16384905b597735c4097de1d912c150b262c79ec5c1852de
MATLAB
1,586
39
% mglGetGammaTable.m % % $Id$ % usage: mglGetGammaTable(fullTable) % by: justin gardner % date: 05/27/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: returns what the gamma table is set to. % % t = mglGetGammaTable % % If the ...
d6ec310dec910fde75efa9adacb038e54ae00e2a5772dcf87ea5fa1ecdc56676
MATLAB
1,586
51
function [data] = ml_singleunits_load_ucla_cnmfe( scopeH5Filename, neuronH5Filename, activityName ) % This function loads the cnmfe data into the single unit structure. if ~isfile(scopeH5Filename) error('File (%s) does not exist.', scopeH5Filename); end if ~isfile(neuronH5Filename) ...
667395a94ee0c718d8b45a60c2b263de5c78b94c15b0b7fd95bac82ca1c96349
MATLAB
1,587
29
function [ text ] = getLeadConfig( obj ) % Display information about lead settings. % % Syntax: % GETLEADCONFIG( obj ); % % Input parameters: % * obj - object containg survey data % % Example: % GETLEADCONFIG( ); % % Available at: https://github.com/NCN-Lab/DBScope % For referencing, please use: Andreia M. Olive...
bed07fc3d31229e744f798b9dfce72646e1ef8d13f8c6e1005695956d45599d1
MATLAB
1,587
39
function fH = makeFigure2_exampleV1Data(ds, fLMM, lmmResults, projectDir,subjnr, saveFigs, saveFigDir) % Function to reproduce main manuscript figure 2: % panel a: V1 time series for each stimulus condition % panel b: V1 SEQ vs SIM amplitude voxel scatter plot for each stimulus condition % % From the paper: % Title:...
e962b2b3c3828e952e9cc1bbd50e5277d29e98e8f79e5a91a2398fd619565a74
MATLAB
1,587
76
function [md, fq] = logbinning(X,a, type) %logarithmic binning %From "Complexity and Criticality" -- Christensen and Moloney, 2005 %X is the data to be binned %a > 1 is the binning factor - bins are made from [a^i a^(i+1)]. %type = disc for discrete avalanches, cont for continous. %note discrete %avalanches n...
447e4570c743e0c6856d0bfc4b68c3c78c7f847d5184027ef02fa88ffc6c9047
MATLAB
1,588
56
function [R2_other_dir,SIstd,SIall]=R2_other(score,idx_dir,idx_duration,ndim,normalised_t) %% R2_other calculates the coefficient of determination between trajectories %% of different directions % % INPUTS % % score: Projection of the neural activity into the subspace. Rows are % samples, columns are neurons % ...
915b9127384b2827634b1a75ab4676d82c5d2905b52c0e5a288aa15e3b83ac30
MATLAB
1,588
51
% testradiipupil % Test pupil radius parameters for initial search function [pupilStart1,pupilStart2] = testradiipupil(img1, img2, radiiPupil,dbgon) %% Reserved parameters alphaFRST = 0.5; % Sensitivity to radial symmetry fracRemove = .15; %% Camera 1 % Take the radial transform imgRadialPupil = Radial_Sym_...
fc5d2e7cd7bf90732dd140dff303abe1655a11f9550b41028c802dce28c2a991
MATLAB
1,588
65
function [phandle, chandle] = ternary_surf(wlimits, name_E, E, name_F, F, ZData, Cbar, varargin) %ternary_surf Plot surface on axes defined by handle. % % %% Process inputs % Check input count if ( nargin < 5 ) error('Too few Inputs') end % If user does not specify ZData, plot...
1d80d7933fb33cb1b35d9c24f548a49d838364829824cb9126d27a327d83a343
MATLAB
1,589
39
% Marc Normandin, Muzzio Lab, Psychological & Brain Sciences, University of Iowa, 2024 function [h] = plot_cell_rate_difference_matrix_by_context(rateMatrix, rateMatrixTrialIds, rateMatrixContextIds) if size(rateMatrix,1) ~= size(rateMatrix,2) error('Rate matrix must be square.'); end rateMatr...
546c556ef82b70757a89fe642b68c68e2fb6e6e59f0a3270e22ca4a6037be411
MATLAB
1,589
38
function [spike_times_ms] = ml_cai_estimate_spikes(timestamps_ms, trace_raw) cci = ml_cai_estimate_spikes_indices(trace_raw); if ~isempty(cci) spike_times_ms = timestamps_ms(cci); else spike_times_ms = []; end end function [spike_times_ms] = ml_cai_estimate_spikes_using_mlspike(ti...
028ba3f8c7a0a3fab056b6bdb8deffa400c9b6256c007eba7d1f065fcc03f559
MATLAB
1,590
40
function [h] = ml_sim_nlx_nvt_header(video_width, video_height) % This code simulates a header that is needed when saving similated data to % a Neuralynx NVT file. % The function should be passed in the timestamps and then we determine % the open and closed information based on those. Hopefully this wo...
22f537785bd7b3f4c48fa88bccee0466549b0a1db1933166f3d3efeeb0f1bb5d
MATLAB
1,590
83
% % Draw overlay of degree distributions over time. % % PARAMETERS % $NETWORK % $RANDOMIZE '1' to randomize order of edges % % INPUT % dat/split.$NETWORK.mat % % OUTPUT % plot/time_degree.$NETWORK.eps % consts = konect_consts(); network = getenv('NETWORK'); randomize = getenv('RANDOMIZE'); randomize = strcmp(...
80f6653e9e982a8631f98ab51e98c1e134d8c74e74c4e24c4363c74578c00d4c
MATLAB
1,590
34
function [plp, rp , art_thresh_analog, art_thresh_elec, art_dist, nstd, fs, cancelFlag]= uigetRTSDinfo() % % by Mauro Gandolfo (28 Ottobre 2006) % by VP, March 2010 mfactor=1000; cancelFlag = 0; fs = []; plp = []; rp = []; art_thresh_analog = []; art_thresh_elec = []; art_dist = []; nstd = []; PopupPrompt = {'Stan...
b9b375eb4e7479c0b92a66b6cd937a60cc3619abc77ebd049c99c3b540307117
MATLAB
1,591
55
function [zPlane,param]=section2zPlane(section,param) % Convert a section vector [physical_section,optical_section] to a z-plane index % % function [zPlane,param]=section2zPlane(section,param) % % % Purpose % Convert a section vector [physical_section,optical_section] to a z-plane index. % A z-plane index is a scalar d...
2fc256499bf92c81e9b58f044c05aff0bdefd3c01aecb3cd2f21abe155114028
MATLAB
1,593
86
<<<<<<< HEAD function [zeroFMR, zeroFNMR, iZFMR, iZFNMR] = computeZeroFMRFNMRindex(FMR, FNMR) % zeroFMR = min(FNMR(find(FMR == 0))); % zeroFNMR = min(FMR(find(FNMR == 0))); % % % correction on indexes % if isempty(zeroFMR) % zeroFMR = 1; % end % if isempty(zeroFNMR) % zeroFNMR = 0; % end zeroFMR = []; zero...
b64bdcd099ac8d7b0f695175f8faedea1a90c6c79d18c01910ddf73277f57001
MATLAB
1,594
38
function [minimum_solution, optimal_solution] = ... simulated_annealing(handle_neighbourhood, handle_loss,... initial_connection_indices, data_SA) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % If you use this code, then please cite: % 1.- Ana P. Millan, et al. "Individualized epidemic spreading ...
b69653328795a6ac416adba57addb29955961cfe13a68f8c5759caf7bd359ed7
MATLAB
1,594
54
function t1_3_parameter_fit(DATA,ROI,AddInfo) % This Aedes plugin calculates T1 three parameter fit 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 %...
4772b32974c92b55ddd22ded733cf3d1a4893e7acd9df553043456c9d4685461
MATLAB
1,595
57
function [pnt, tri] = read_off(fn); % READ_OFF reads vertices and triangles from a OFF format triangulation file % % [pnt, tri] = read_off(filename) % % See also READ_TRI, READ_BND % Copyright (C) 1998, Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for the documen...
66a1013194b1a54126a80ac10b586d4ef83baa8b696798df2cfbf57aab0d73d4
MATLAB
1,595
53
function [ts] = timestamp_plexon(tsl, tsh) % TIMESTAMP_PLEXON merge the low and high part of the timestamps % into a single uint64 value % Copyright (C) 2007, Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for the documentation and details. % % FieldTrip is free...
8254af94885d6a4866a15336c85b096fd797a5dbe2136aadde452ba4f00e666c
MATLAB
1,596
43
classdef SelectUploadableTest < matlab.unittest.TestCase % Tests for webupload.allowedNames and webupload.selectUploadable. Each test builds % its own folder of empty files. properties Dir end methods (TestMethodSetup) function makeDir(tc) fixture = tc.applyFixture(matl...
99373ae9ed012fdf674fc7c2ece5a73d69fa615c4df813078898e407d3fa86f1
MATLAB
1,596
43
function peTrans = getPET(v,g) %pathway energy transmission (over some duration) % Detailed explanation goes here % Connectivity p_base = [0.1184, 0.1552, 0.0846, 0.0629, 0.0323, 0.0000, 0.0076, 0.0000; 0.1008, 0.1371, 0.0363, 0.0515, 0.0755, 0.0000, 0.0042, 0.0000; 0.0077, 0.0059, 0.0519,...
b5e023765febae0135cbcf716efd60af9248518b92fddb1dca11103e11259b4d
MATLAB
1,596
49
%% LOAD if ismac load('/Volumes/runyan2/Christian/Processed Data/shuffled_classifier_final.mat') load('/Volumes/runyan2/Christian/Processed Data/sp_spm_final.mat') else load('Y:\Christian\Processed Data\shuffled_classifier_final.mat') load('Y:\Christian\Processed Data\sp_spm_final.mat') end %% Combine ...
d8913d773f1434a1900e82aa76f66b0c18d9079da2973a6164bb7b659d5a1884
MATLAB
1,596
48
%{ 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...
29a90733ba68edaadd807b12adf2a512e440ea8473e989db621d2d6e3fa39565
MATLAB
1,597
38
function [probe] = getBrainSensitivity(probe) %GETBRAINSENSITIVITY Returns Brain Sensitivity for each channel % Calculates Brain Sensitivity for each channel in % probe.results.lschannels, since this function can only be executed if % sdrange is defined. It ignores short separation channels since by % definitio...
3c4ebcdd0c7293fee1851819e01f75f6c09d3e34f57b1360e16b95526f4bf4c4
MATLAB
1,597
38
function [e_surf,x] = EstimateSurface(standard,template,nonlcon) %ESTIMATESURFACE Œv‘ª“_ standard‚ð“ü—Í‚µA„’肳‚ꂽ•\–Ê e_surf‚ðo—Í‚·‚é % Ú×à–¾‚ð‚±‚±‚É‹Lq fun = @(x)distculfcn(x,standard,template); options = optimoptions(@fmincon,'Algorithm','active-set','PlotFcn','optimplotfval','UseParallel',true,'MaxFun...
0b63d42d43f7257d4bcf24001b30c912de5992c8850d6db9664889412ba5abb0
MATLAB
1,598
54
function t1_saturation_recovery(DATA,ROI,AddInfo) % This Aedes plugin calculates T1 saturation 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 Neurobiolo...
a120d2eeed5f4b59129777dfdd25e82339025b3fde8ccdcf059746529f878ccf
MATLAB
1,598
76
function [code, name, rgbv] = read_fscolorlut(fname) % [code name rgb] = read_fscolorlut(fname) % % Reads a freesurfer color lookup table. By default % reads $FREESURFER_HOME/FreeSurferColorLUT.txt. % % % read_fscolorlut.m % % Original Author: Doug Greve % CVS Revision Info: % $Author: nicks $ % $Date: 2011/03/...
04558ef9bb0d6b589c871766db7d2fac2b51e97d7bcaacc598cda89ad30a6d2b
MATLAB
1,599
47
function [v, vind] = ml_core_max_pixel_rotated_pixel_cross_correlation_90deg(T1, T2, varargin) p = inputParser; p.CaseSensitive = false; checkmatrix = @(x) isnumeric(x) && size(x,1) == size(x,2); addRequired(p, 'T1', checkmatrix); addRequired(p, 'T2', checkmatrix); % By default use all of ...
6903ac6d21a2652608ae3c0aca5dbdc764dce7679cd4edf07d783ddf9d3bff6f
MATLAB
1,599
53
function [el, lab] = read_elec(fn); % READ_ELEC reads "la/mu" electrode parameters from a MBF electrode file % which are used to position them on a triangulated surface % % [el, lab] = read_elec(filename) % % where el = [tri, la, mu] % and lab contains the electrode labels (if present) % % See also READ_TRI, TRANSFER_...
c13ee7d79c57b454e1246fd21947655a585fd7c8e4f74c4cc48448909a1f9f4e
MATLAB
1,599
59
% endScreen.m % % $Id$ % usage: myscreen = endScreen(myscreen) % by: justin gardner % date: 12/21/04 % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % % purpose: close screen and clean up - for mgl % function myscreen = endScreen(myscreen) if nargin == 0 disp(sprintf('(endScr...
dc32468496c5c3b93bbfc7413399dd92d731fff33334149fbe714c6b35c4e2df
MATLAB
1,599
44
function PC = getPC(v,g) %GETPC replacement of PET, try to redefine the pathway current % getPC(v(1:16,strt_prd:end_prd,1:5), g(1:16,1:16,strt_prd:end_prd,1:5)); % Connectivity p_base = [0.1184, 0.1552, 0.0846, 0.0629, 0.0323, 0.0000, 0.0076, 0.0000; 0.1008, 0.1371, 0.0363, 0.0515, 0.0755, 0.0000, 0.0042, ...
df3139e0a3b83cb3f0506ca3eff842b68f808e94d6fbc92ae8851be41a15de6b
MATLAB
1,599
44
function [smoothed_pos_t_s, smoothed_pos_x_cm, smoothed_pos_y_cm, smoothed_speed_cm_s] = ml_alg_posspeed_estimate_2d_sharifi(pos_t_s, pos_x_cm, pos_y_cm, T_s, dmax_cm, maxSpeed_cm_s) % Compute the unsmoothed velocity dt = diff(pos_t_s); dx = diff(pos_x_cm); velraw_x = dx ./ dt; dy = diff(pos_y_cm);...
fdf25bbbb5fe5226d84674c9a5d6c522114315bf6a21477432089f2e45f43976
MATLAB
1,599
41
function [Coil_repos] = position_coils(Coil_init) strcoil_All = []; Coil_All = []; coilaxis = [0 0 1]; theta = 0; for ij =1:Coil_init.len Coil_init.strcoil_tmp.Pwire = meshrotate2(Coil_init.strcoil.Pwire, coilaxis, theta); Coil_init.Coil_tmp.P = meshrotate2(Coil_init.Coil.P, coilaxis, theta); %...
7cda322db972c03afcfd7414203eef4347e18fcd5c5342d40f359b3bd8d97034
MATLAB
1,601
52
function dimsiz = getdimsiz(data, field) % GETDIMSIZ % % Use as % dimsiz = getdimsiz(data, field) % % See also GETDIMORD if ~isfield(data, field) && isfield(data, 'avg') && isfield(data.avg, field) field = ['avg.' field]; elseif ~isfield(data, field) && isfield(data, 'trial') && isfield(data.trial, field) field...
c92026f4f0d3c69cf0fee02afd2474e81671dda33cbe396020bb4927f467cad7
MATLAB
1,601
49
function plotRawDataSurveyInd( obj, varargin ) % plot Indefinite Streaming raw data % % Syntax: % PLOTRAWDATASURVEYIND( obj ); % % Input parameters: % * obj - object containg data % * ax (optional) - axis where you want to plot % % Example: % PLOTRAWDATASURVEYIND( ); % % Available at: https://github.com/NCN-...
b52ee969d55933177d63df9f738fe5e6e439d3d6daecd5a76ed0e34d7e0e4d58
MATLAB
1,602
62
function mglPlaySound(soundNum) % mglPlaySound: Play a system sound % % $Id$ % usage: mglPlaySound(soundNum) % by: justin gardner % date: 02/08/07 % copyright: (c) 2007 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Plays a system sound. After calling mglOpen, all of % ...
e759ef88dbca4dd210f0c75c8bb608ddd93e2ffde940f4017127ba53f6cb27bd
MATLAB
1,602
60
function [Z] = ml_bs_accumulate_xy(bs, x, y, v) % This function discretizes the position values using the bin system % and then accumulates the associated value into the respective % locations. If v is nan, it will not be added. if isempty(x) && isempty(y) Z = zeros(size(bs.XX)); return ...
2569d29594adad3442c3cd2cc02a45e7dd003996678309043b5f929742866ebd
MATLAB
1,604
59
% endScreen.m % % $Id$ % usage: myscreen = endScreen(myscreen) % by: justin gardner % date: 12/21/04 % copyright: (c) 2006 Justin Gardner (GPL see mgl/COPYING) % % purpose: close screen and clean up - for mgl % function myscreen = endScreen(myscreen) % make sure to display cursor mglDispl...
54b6da6773ec9f07e62896136c3eec5be0ec941cda07a23d91c1de23e0a5b92d
MATLAB
1,604
44
function IntPC = getIntPC(v,g) %GETPC replacement of PET, try to redefine the pathway current % getPC(v(1:16,strt_prd:end_prd,1:5), g(1:16,1:16,strt_prd:end_prd,1:5)); % Connectivity p_base = [0.1184, 0.1552, 0.0846, 0.0629, 0.0323, 0.0000, 0.0076, 0.0000; 0.1008, 0.1371, 0.0363, 0.0515, 0.0755, 0.0000, 0....
4a7ea306dcc468c826473c0bc7d80882cdf3dda8a1df47debd68a145e1c62a0a
MATLAB
1,606
40
% Y = VEC(x) Given an m x n matrix x, this produces the vector Y of length % m*n that contains the columns of the matrix x, stacked below each other. % % See also mat. function x = vec(X) % % This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko % Copyright (C) 2005 McMaster University, Hami...
7336f0cd68798b1d430ab07b89889b0bc1f43704fcf7a56d261c3eda6fb0c6b5
MATLAB
1,606
51
function [rmTbl] =reformatTbl(tbl, vars2remove) %% reformatTbl % Marc's output is confusing so add a column that indicates session number % based on the name of the recording. Use column 'dayUsed' to index day of % testing. %tbl = analysisResults.RateMatrices; animals = unique(tbl.animalName); rmTbl = []; for a = 1:le...
7926a09c07c744ebebf5ba1e98b7bdd674c04a958bc2010b822692961cd32de2
MATLAB
1,606
58
function [L,dL,ddL] = neglogli_poissGLM(wts,zaso,fnlin) % [L,dL,ddL] = neglogli_poissGLM(wts,X,Y) % % Compute negative log-likelihood of data under Poisson regression model, % plus gradient and Hessian % % INPUT: % wts [m x 1] - regression weights % X [N x m] - regressors % Y [N x 1] - output (binary vector of 1s a...
f9d3103565a100a77565791df15bcef56a9f253f341b439ebb7ac4729a4da63e
MATLAB
1,606
71
function [ans, Prefix] = PrefixStatus (Prefix) % % [Status, Prefix] = PrefixStatus (Name) % %Purpose: % Determines if the name chosen is a valid for an AFNI Brick % If you pass a name containing prefix only and no view then % View is assumed to be +orig % % %Input Parameters: % Name: a string containin...
ff7559ec0e481d454bb6d2902a3394291af671a6d3b5e39552b017eead45be6c
MATLAB
1,606
38
function phi_dt = worm_phase_velocity(ProjectedEigenValues, parameters) %This function outputs the phase velocity time series given the PCA time series% not used in paper phase_determining_PCs = [2, 3]; %which PCs are the sine and cosine of worm locomotion phase_determining_eigen_values = ProjectedEigenValues(...
d1556a695331544c520b570686f2754df9b3e507975858eaa9f8942db5538404
MATLAB
1,607
66
% % Generate assortativity plots. % % PARAMETERS % $network Name of the network % % INPUT % dat/data.$network.mat % dat/info.$network % % OUTPUT % plot/assortativity.[auv].$network.eps % consts = konect_consts(); network = getenv('network'); data = load(sprintf('dat/data.%s.mat', network)); info = read_info(ne...
0e60751a1d1e7a3a3dba0ce497fd251a110a269b3e77db9e3fc6dcf126518dc1
MATLAB
1,608
73
function [l] = read_label(sname, lname) % l = read_label(<sname>, lname) % % reads the label file 'lname' from the subject 'sname' % in the subject's label directory into the vector l % l will be nvertices-by-5, where each column means: % (1) vertex number, (2-4) xyz at each vertex, (5) stat % % IMPORTANT: the vertex ...
83ec32d4a490c4c424cea923b0a4f827bec455ad9307ad2f2645fef09be9db0f
MATLAB
1,608
50
% addMyPaths.m % % function to add relevant ephys data analysis paths, including subfolders % % Users: change the following paths to match those on your local computer function addMyPaths() % Determine which computer this code is running on comptype = computer; % get the string describing the computer type ...