sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
4b639324d0d4b0fa00129119603e4bc08d39e7738bf2e684b29b4f6c3238d386
MATLAB
2,590
81
%% you need to change most of the paths in this block function rez = my_prog_master(path_output, is_new_layout) % Master script of the KiloSort2 pipeline, adapted to process the RIFF NA. % % Created by AlexKaz 02.2020 ops = create_my_prog_ops(); ops.fproc = fullfile(path_output, 'temp_wh....
6dc1812bcb797503d1af7f9922ddb144b33ddde79ed80028bdcce055e7461384
MATLAB
2,594
91
% checkKiloSortOutputs % Made by BMC - 9/28/2020 % Take Kilosort, individual trial align, plot rasters % Take Kilosort, all visual event median and mean, plot SDFs %Kilosort outputs are in .rez file. clear close all PostSetup('brock') global SORTDIR CODEDIR STIMDIR cd(STIMDIR) load('PhyPref.mat') %Matlab versio...
126d17c70915645c31faa623b738e8e17fab2dee096125192fc3c85b38ed72d7
MATLAB
2,602
90
clc clear close all sample_neuron = 68; load xx_108_4_single_e2o_perf exe2obs_cell = cellfun(@mean, test,'UniformOutput',false); exe2obs = cell2mat(exe2obs_cell); exe2obs = exe2obs-100/3; load xx_108_4_single_o2o_perf obs2obs_cell = cellfun(@mean, verif,'UniformOutput',false); obs2obs = cell2mat(obs2obs_cell); obs2...
214b4038157dc996812f08ad5e27f7d51228a0a8097aa789ce230e8e8cdc63dc
MATLAB
2,602
100
function visIDX_EffectofTuning(IDX,dataType) %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).tm; ThisCodeDidNotProduceExpectedResults_CheckForBug uctLength = length(IDX.allV1); % B. pull out all laminar matrices 3x(6,450,el#) %preallocate SDF = nan(size(IDX.allV...
a517c6549336b1dacc533def5da6c5d54b761c0c21d81624ded12149b68a4fa1
MATLAB
2,604
42
%----------------------------------------------------------------------- % Job saved on 19-Feb-2020 14:40:45 by cfg_util (rev $Rev: 7345 $) % spm SPM - SPM12 (7771) % cfg_basicio BasicIO - Unknown %----------------------------------------------------------------------- function matlabbatch=spm_anat_segmentation(Dir_ana...
dc5601bfca4d2be0c909974667e58791bf1e6e70ee367186ac3c8668077b2363
MATLAB
2,605
70
function [brightFactor, frameNo, endFrame] = playTif(inputFile) % PLAYTIF plays given tiff + getting frames brighter. % Params: % inputFile - name of the .tif file. % from - frame to start the TIFF from. % % Run example: % playTif('animation.dual_test3.tif') % % ...
d5bc4afe4f348dcbc4470ec5e062f23ba8b0683b7621a270d20612c357c794e5
MATLAB
2,610
76
function [Mean, V, phase, amp, A, B, C] = Compute_mean_variance(P, D, eta, is_stack, M, s, phase, w_mean, w_max) %{ Compute the theoretical mean and variance curve, also the corresponding phase. For special case, compute the constant term of the variance A. Parameters: P, D: constant of learning eta: number of ...
da94efd392a1604279f87835376947625e26dff805a0d2807a693d71f5d683cd
MATLAB
2,610
73
function setupSystem(saveFileDir) %SETUPSYSTEM sets up the system for use of PsychDetect. % Arguments: % saveFileDir - full path to base directory to which experimental data % will be saved. [default: 'HOME/experiment_data'] % % setupSystem will create a directory 'experiment_config' within your % home di...
fc9ed8cf9fd5623327f227320f0c644ff005d1a5ba5218fc70e971cb0964fd96
MATLAB
2,610
91
%% % Simulation results for the spatial model for networks with and without % astrocyte ensheathment of exc synapses %% % Default network with no spatial correlations load('./CompressedData/Spatial/default_net_ex1'); load('./CompressedData/Spatial/astro_net_ex1'); % Default network with spatial correlations load('...
7b21a252438842fc0226669e6207de64ed1e5389778342c4aea930a6e03ae84d
MATLAB
2,611
98
%% % Make a raster plot % 1000 neurons are plotted, split between the population %% function plot_raster(times, tinds, Ntot, Npop, Ncells, pinds, plot_num ) % color_scheme = [0.8500 0.3250 0.0980; % 0 0.4470 0.7410; % 0.4660 0.6740 0.1880; % 0.3 0.3 0.3]; % color_scheme = [81,128,68; % 255,0,0; % ...
bd1639aff414ed2a83cb9c2b3e71e2148f79855e9b569a26c69a3f17a0a761cd
MATLAB
2,612
86
% Main script for the RIFF pipeline. % This script processes data recorded from the RIFF % For instructions, see https://github.com/jniediek/RIFF_publication/wiki % We provide two sample recording sessions to illustrate the usage of this % code % 1. A ten minute session without neural recordings % https://figshar...
2693f8dd06b104095913ad77d1fb4fd99345bc3100964d825c88afc03a18df4a
MATLAB
2,618
85
function gramm_2x2_subline_NSNDEvariation(IDX) %% Goal % use gramm and plot the simultaneous congruent, incongruent, and monoc % preferred. % line plots using "methods for visualizing repeated trajectories" %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).TM(1:560);...
978d4c412d42fc7576b2135464c5cadd8e9f398a70ad167c9d8b11484cebe9b0
MATLAB
2,624
90
function check_mdp_timing(mdp_table, stats, fig) % JN 2020-04-28 figure(fig) if ismember('strig', mdp_table.Properties.VariableNames) mode = 'strig'; else mode = 'ttrig'; end switch mode case 'ttrig' % specific to this method: find points where the ttrig column increased ts_idx = f...
b8a0a71a6f9cc8aa2762e8a2b0fef8c81634a9617a6755db3c5dbd9ad6e110dc
MATLAB
2,624
83
%% % Creates the connection matrix % Function Inputs % Ne: number of excitatory, Ni: number of inhibitory % Kab: # of connections between neurons of type a and b % % Function Outputs % Vectors of the target/firing neurons pairs and the number of connection % Connections are chosen with replacement, so neurons can conne...
0a2f4bca703bc8ff3c1029596b882ed8d1e739faf575a4a2bfa91f611eefbee0
MATLAB
2,631
89
function [data_subSUB,data_subORG,varnrm] = tdrSubspaceProjection(data_fulORG,subpars,plotflag) % tdrSubspaceProjection Project population response into subspace % % Inputs: % data_fulORG: population response in orignal space (original basis) % subpars.subSUB_fulORG: projection matrix from original space (original % ...
54d76ac3b9e5fb0e640ecec6c0b07e13c431251123f919d19027ba5ed87cd324
MATLAB
2,632
56
%% Reshape data for prior direction clear; clc; for m = 1:2 if m == 1 load('Data_A_trial.mat'); else load('Data_B_trial.mat'); end dataT = struct('unit',[],'time',[]); %unit dataT.unit = struct('response',[],'task_variable',[],'dimension',[]); for i = 1:size(c1,2) ...
3c002d051a1b6742b3ee152c9ebd24af16579fd0b3ba645a39bb4af59b6b9824
MATLAB
2,640
123
function [MOV_DATA,FRAME_IDX]=fb_retrieve_mov(FILE,varargin) %fb_retrieve_mov retrieves the movie data for a split mat file (the mat %files in the 'mat' directory created by fb_data_split) % % [MOV_DATA,FRAME_IDX]=fb_retrieve_mov(FILE,varargin) % % FILE % specify the filename to process, if left empty the user is prese...
b74309c851450d610471c3e4a01bb66649278b594c9a62b56fd49a0226c668dd
MATLAB
2,653
85
function tdr() % The TDR ('Targeted Dimensionality Reduction') toolbox implements the % dimensionality reduction methods described in the paper: % % 'Context-dependent computation by recurrrent dynamics in prefrontal cortex' % by Mante, Sussillo, Shenoy, and Newsome, Nature, 2013. % % The neurophysiology and behavior...
0a649fa1d8d3fd5a6e1329b8cef7d51e1260146bdc94bb722140c44ada83b635
MATLAB
2,658
60
function ops = create_my_prog_ops(ops) % % ====== CHECK OUT THIS PAGE FOR PARAMETER SPECS: % https://github.com/cortex-lab/KiloSort/wiki/Config-Variables#Nfilt % if nargin == 0 ops = struct(); end % ops.chanMap = 'D:\GitHub\KiloSort2\configFiles\neuropixPhase3A_kilosortChanMap.mat'; ...
613ab9d6f4992f247abaa909774f82146f155f7c76627807c9e2aeb8a7717e62
MATLAB
2,658
95
function Img = func_DrawLine(Img, X0, Y0, X1, Y1, nG) % Connect two pixels in an image with the desired graylevel % % Command line % ------------ % result = func_DrawLine(Img, X1, Y1, X2, Y2) % input: Img : the original image. % (X1, Y1), (X2, Y2) : points to connect. % nG : the gray leve...
a5c67dcf1012c338e7824f02dcf4cca03307350eea65046a0c33a2d40e969b10
MATLAB
2,661
112
%% distance in subspace clear; clc; %load data load('subspace_position_A.mat'); a = sdata; load('subspace_position_B.mat'); b = sdata; % ah_dis = []; al_dis = []; bh_dis = []; bl_dis = []; ah_wx = []; ah_nx = []; al_wx = []; al_nx = []; bh_wx = []; bh_nx = []; bl_wx = []; bl_nx = []; for n = 1:27 %time=101:20:621(w...
9e08dbb085b683f68e3ba8fccea976e27255d22c4dc642a430ebc191e2f4ec3e
MATLAB
2,671
56
%% Reshape data for all directions (prior direction, two outer directions) clear; clc; for m = 1:2 if m == 1 load('Data_A_trial.mat'); else load('Data_B_trial.mat'); end dataT = struct('unit',[],'time',[]); %unit dataT.unit = struct('response',[],'task_variable',[],'dimension'...
7cae97bafa8e6aede39b9cbbf42dbd2146c544df828bee07939b4b98284578a1
MATLAB
2,672
94
function data_nrml = tdrNormalize(data,nrmlpars) % tdrNormalize Normalize population responses % % Computes R* = (R - m)/(s + c) % % R* are the normalized responses % R are the raw responses % m is the mean across trials/conditions and time % s is the standart deviation across trials/conditions and time % c is a ...
0a9fd5ca67d6ab1c722a8eb54d7cda6b5922c4b996ee5a875ee534de502ab3af
MATLAB
2,674
64
function [valid_flag,err,is_formula]=check_if_legal(comp,prop,val,def_arr,var_arr) % CHECK_IF_LEGAL checks the legacy of the given val as a Ramp_comp-object property. % [VALID_FLAG,ERR,IS_FORMULA]=CHECK_IF_LEGAL(COMP,PROP,VAL,DEF_ARR, % VAR_ARR) checks that VAL is a legal value for the Ramp_comp-object property-PR...
e319a6f49b568a07b839c0731d245f31d4154079cb06b4facdeecfbf4797e3d6
MATLAB
2,674
90
function [countsNoNoise] = gui_FFTfilter_old(counts, gauss_blur_radius, spectral_radius, scaling_factor) % Scale the image im = counts * scaling_factor; % Mean of all values mean_value = mean(im(:)); % Center the distribution im = im - mean_value; % Add custom blur if gau...
ed84d4f7c919954216c9924437dcd09e2bc9827f2559d7389663d6c035e3ae52
MATLAB
2,674
80
function h = dmaxflat(N,d) % returns 2-D diamond maxflat filters of order 'N' % the filters are nonseparable and 'd' is the (0,0) coefficient, being 1 or 0 depending on use % by Arthur L. da Cunha, University of Illinois Urbana-Champaign % Aug 2004 % % Part of the Nonsubsampled Contourlet Toolbox % (http://www.mathwor...
d098536cbb5838ab3673e929834ecc7440c4fba5bfb32e59dfe48bde4b3b8f57
MATLAB
2,677
96
function [ filtered ] = frst2d( image, radii, alpha, stdFactor, mode ) %FRST2D Applies Fast radial symmetry transform to image % Check paper Loy, G., & Zelinsky, A. (2002). A fast radial symmetry transform for detecting points of interest. Computer Vision?ECCV 2002. % Three different modes are available: 'bright', ...
ec2c4d31fee9e503f40b3e358c93eb4d4ede8ca808dbc3b068d66efd42b7a402
MATLAB
2,680
67
%Author: Tatjana Schmitt 2019-2022 function [boundaries, complete_boundaries_map] = borders_map(edges_turning_points_maps) % smoothes coordinates and combines to one map number_of_ones = zeros(1, size(edges_turning_points_maps,2)); for ii = 1:size(edges_turning_points_maps,2) number_of_ones(1,ii) = sum(edges...
2afac74d3e30120ba66319524495083c650c77019a5c40a31d5fa19d6e831ee9
MATLAB
2,688
90
function gramm_2x2_subline(IDX) %% Goal % use gramm and plot the simultaneous congruent, incongruent, and monoc % preferred. % line plots using "methods for visualizing repeated trajectories" %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).TM(1:560); clear DataFor...
48e3aeea7de8c233b03e3871ddfd6051b358134bf3ff8555233aeadcd404a770
MATLAB
2,688
68
% [kcMap,A0Map] = getLocalDcorr(im,tileSize,tileOverlap,r,Ng,figID) % --------------------------------------- % % Estimate the image local cut-off frequency based on decorrelation analysis % % Inputs: % im 2D image to be analyzed % tileSize Size of a tile in pixels % tileOverlap Spatial overlap between tw...
cdc3408c31510e526ea7735c273cd71f4add322a8e697769dd6d759f7001765d
MATLAB
2,688
83
classdef NewTrialState < LogbookState %NEWTRIALSTATE happens when an AudioObject has been played. % Author: Lasse Osterhagen properties (SetAccess = private) trials = cell.empty; shamTrials = cell.empty; ignoredTrials = cell.empty; ignoredShamTrials = cell.empty; audioObjects = cell.empty ...
c0f854bb1965884253b1ce4c94fcb3242d41bb73b25e2edc403a19af3d9e6a1e
MATLAB
2,696
81
function [Mean, V, phase, amp, A, B, C] = Compute_mean_variance(P, D, eta, is_stack, M, s, phase, w_mean, w_max) %{ Compute the theoretical mean and variance curve, also the corresponding phase. For special case, compute the constant term of the variance A. Parameters: P, D: constant of learning eta: number of ...
1e706a14e862b7bf03e7163dc8ad6cd90a42d2e740c43d5ec55aa9a08b7b98f7
MATLAB
2,697
74
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <normTimeseres: calculates %change from baseline signal > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free ...
b02140c8f15d080783cc6bd6ba545a2a534aaa94277dbe36e3efbf156094d6b3
MATLAB
2,717
73
function plot_r21(rtData,diffData) % rtData: 5 subjects X S1/DLPFC X speed/accuracy % diffData: 5 subjects X S1/DLPFC X speed/accuracy number_subjects = size(rtData,1); figure %% 1: Mean RTs subplot(2,2,1) bar(1, mean(rtData(:,2,2)), 'b', 'BarWidth', 1); hold bar(4, mean(rtData(:,2,1)), 'r', 'BarWidth', 1); bar(2, me...
bf88fe7fc2b49b0a5ee1b4b0ff7bafdd4a8984161196f0fc067e2bd3e6562716
MATLAB
2,717
83
function out = extractCharacterStream(nevStruct, triggerBit) % extractCharacterStream(nevStruct, [triggerBit = 1] extracts characters % from the digital input data of a Blackrock NEV-file. % The output is a 2-by-N cell matrix with the first row representing the % sample number of the stream starts and the second row th...
6cad6f171592f725a2a9efba25e7380554b28369b5b1cec8466b3d9b0df0fe93
MATLAB
2,718
87
function gramm_adaptation_RESP(IDX) %% Goal % use gramm and plot the simultaneous congruent, incongruent, and monoc % preferred. % line plots using "methods for visualizing repeated trajectories" %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).TM(1:560); clear Dat...
50a8c05105b8650062d008b6ff3a28c9fe04cbe868a98b4d71e7771a2dc2ddd5
MATLAB
2,719
89
classdef ImageDescription < handle properties descstr dict; keys; end methods function obj = ImageDescription(varargin) if numel(varargin)==1 obj.descstr = varargin{1}; elseif numel(varargin)==0 obj.keys = { ...
f60d1da8b068df2c20da844ee24345ed5d12cf672cac5ef648439e858abf649b
MATLAB
2,720
79
%% This scripts loads MEG connectivity and power values for each subject and resamples them for functional resting-state networks % (Yeo et al., 2011; https://doi.org/10.1152/jn.00338.2011) % % Written by Christina Stier, 2022 % load surface description for remapping from suma vertex-resolution to yeo-networks load('...
2c5734daa9afb96fdb055899bbf5cbeedbdb534903fefeb4225df26f56a2516e
MATLAB
2,728
79
function sampled_points=generate_signal(handles,trial_index) % GENERATE_SIGNAL generates the sample points of the Signal. % SAMP_RATE=GENERATE_SIGNAL(SIG,SAMP_RATE,PARAMS) generates the sample % points of the given Signal. The number of points is determined by the % given samp_rate. % params is a collumn vector that h...
154e92210f448434e60a8ee5ea557afac13d88f75086d0d326219ef59a42be03
MATLAB
2,731
69
function [valid_flag,err,is_formula]=check_if_legal(comp,prop,val,def_arr,var_arr) % CHECK_IF_LEGAL checks the legacy of the given val as a Freq_comp-object property. % [VALID_FLAG,ERR,IS_FORMULA]=CHECK_IF_LEGAL(COMP,PROP,VAL,DEF_ARR, % VAR_ARR) checks that VAL is a legal value for the Freq_comp-object property-PR...
933a9d5c022b8d59188efc51fcd8db04c721cfb69e071875354ef7214bc007e3
MATLAB
2,731
86
function values=get_values(coord,comp,crid) % GET_VALUES returns the table of values of the component. % VALUES=GET_VALUES(COORD,COMP,CRID) returns the table of % values of the given component. % CRID is the coordination index that define the order that the % values of this component will be taken relative to the oth...
bfaac102887e5b9872bd5623f7b9b8420236eb719e4be5f7ecd8cab8ac1d3896
MATLAB
2,731
66
function [valid_flag,err,is_formula]=check_if_legal(comp,prop,val,def_arr,var_arr) % CHECK_IF_LEGAL checks the legacy of the given val as a STime_comp-object property. % [VALID_FLAG,ERR,IS_FORMULA]=CHECK_IF_LEGAL(COMP,PROP,VAL,DEF_ARR, % VAR_ARR) checks that VAL is a legal value for the STime_comp-object property-...
032a254ddcaad50cc8ca332202458aab66754216549a00267311906b3647639c
MATLAB
2,742
125
function FS_AV_Parse(DIR,varargin) % FS_AV_Parse % Parse Data from FreedomScopes % Created: 2015/08/02 % By: WALIII % Updated: 2015/04/18 % By: WALIII % FS_AV_parse will do several things: % % 1. Seperate Audio and Video, and place them into .mat files in a .mat % directory % 2. Make spectrogram .gi...
ef01e3d8052e8574f334aaee2569e91ca6695b04b44fdf67067073015c5ea509
MATLAB
2,752
97
function res=check_params(varargin) % res=CHECK_PARAMS(PARAM1,VAL1...) checks the validity for a Sweep object. % Checks that PARAM1 field can hold the given VAL1 value and the same for % PARAM2,VAL2 and so on. % If all params are legal - returns 1. Otherwise returns 0. global SWEEP_MAX_TRIALS; global SWEEP_MODE_NAME...
417c4793ff24d4ef041f7866c937f9dd02e1ebcd0f807bbcf6f0d9f954ac2c21
MATLAB
2,754
66
function [valid_flag,err,is_formula]=check_if_legal(comp,prop,val,def_arr,var_arr) % CHECK_IF_LEGAL checks the legacy of the given val as a STime_comp-object property. % [VALID_FLAG,ERR,IS_FORMULA]=CHECK_IF_LEGAL(COMP,PROP,VAL,DEF_ARR, % VAR_ARR) checks that VAL is a legal value for the STime_comp-object property-...
588d97bde6b0a6a285675e4f1a23d01a2305a5bbbcda3b52da54d4d1f5f0257d
MATLAB
2,757
127
function [mask,mu,v,p]=EMSeg(ima,k) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Expectation Maximization image segmentation % % Input: % ima: grey color image % k: Number of classes % Output: % mask: clasification image mask % mu: vector of class...
342bff3c1a89eb847a8b89fbff70bb97b2631e521b57d89297a3cc8783776b2f
MATLAB
2,776
93
function gramm_dCOS_RESP(IDX) %% Goal % use gramm and plot the simultaneous congruent, incongruent, and monoc % preferred. % line plots using "methods for visualizing repeated trajectories" %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).TM(1:560); clear DataForVi...
c756faaf792e0cf051a3626a5fa5efa1b324ac9ebcf0be352d52b37c7487e926
MATLAB
2,776
90
function plotAdj(data,sortIndex,categoryColorOpts,plotColor,suppresstext) newROICount = []; if length(categoryColorOpts)==3 && isvector(categoryColorOpts) colorVals = [139,0,0;... 0,128,0;... 0,0,255]/255; newROICount = categoryColorOpts; elseif isvector(categoryColorOpts) colorV...
4c76e444583e15349aa130af11f7f5a49afcba726488b6cd09608bdf491f73da
MATLAB
2,780
70
function B_fitting(datswitch) load('A_dataload.mat','NE','NM') switch datswitch % choose between near miss and narrow escape data case 1 dat = NE; case 2 dat = NM; end name = dat.outcomename; EEGtime = dat.eegtime; EEGdat = dat.eegcurve; beh...
bc99530244385ef6df68bc2e39016d9229f9bbb6b9c9533c6ad6216515d17efb
MATLAB
2,785
66
function [valid_flag,err,is_formula]=check_if_legal(comp,prop,val,def_arr,var_arr) % CHECK_IF_LEGAL checks the legacy of the given val as a Trial_dur_comp-object property. % [VALID_FLAG,ERR,IS_FORMULA]=CHECK_IF_LEGAL(COMP,PROP,VAL,DEF_ARR, % VAR_ARR) checks that VAL is a legal value for the Trial_dur_comp-object ...
2c47e2d4ec60b57e34f3e9df0d12ffa6dc4e4b072d289eb067ada44ccfefdc04
MATLAB
2,794
61
function [Z_MIP, phi_MIP, Zs, phis] = MIP_search_probs( probs, options) %----------------------------------------------------------------------- % FUNCTION: MIP_search_probs.m % PURPOSE: Find the Minimum Informamtion Partition by the exhaustive search % from probability distirubtions % % INPUTS: % probs: pro...
c7893093d93069934dd3c06cc316ddefc4906a5a0d9b123e8b0fe0e1b191743a
MATLAB
2,800
63
function fixed_SNR = interpolate_missing_SNR_trigs(SNR_timings) % Function interpolate_missing_SNR_trigs fills in missing triggers in the SNR trigger stream. % There can be arbitrary number of missed trigs, including triggers missed in a raw. % Assumptions: % 1. The SNR triggers are produced at a unifo...
004b4cdcecb617a30a0233a22af49cc8085bd5765a0977dbf3bb661d40138ef5
MATLAB
2,810
90
function snr_times = AO_process_ttls(in_folder, result_folder) fnames = dir(fullfile(in_folder, '*.mpx')); n_fnames = size(fnames, 1); if n_fnames == 0 log_msg(result_folder, 'no-mpx', ... sprintf('No .mpx files found in %s', in_folder)); error('No .mpx files found in %s', in_folder) end % JN 2020-0...
458371ea85fbe428282f05d794651bdb832cf55b0ec3f88377dfbc6e35291709
MATLAB
2,815
93
function gramm_2x2_RESP_NSNDEvariation(IDX) %% Goal % use gramm and plot the simultaneous congruent, incongruent, and monoc % preferred. % line plots using "methods for visualizing repeated trajectories" %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).TM(1:560); c...
1904ed5285050f82b8aaff7018e123dee0a29b1bdf346605671bc3aa08e0ce64
MATLAB
2,817
49
function SUBJECT = ASLT1fromM0Processing(SUBJECT, prefix, fast) % ClinicalASL toolbox 2023, JCWSiero % Construct T1w image from multi PLD M0 image % brain extraction on M0 image system(['bet ' SUBJECT.ASLdir prefix '_M0 ' SUBJECT.ASLdir prefix '_M0_brain' ' -m -f 0.4 -g 0']); % extract brain mask of M0's system...
bdd0812d61e8112021f01c0b05437abd46f8bd988784c7f3c906dbd90aa28901
MATLAB
2,817
75
%---------------------------------------------------------------% % This is the main script for get decoding error of animal's % % current position using rate maps from N' in a trial-by-trial % % basis -- Wenbo Tang (Jan 05, 2023) % %-------------------------------------------------------...
ef534abc68bca95c737308e47e09e7e6ee3e004557f8b16100d92c41c89dee57
MATLAB
2,822
90
function events = AO_extract_ttls_from_mpx(fname) % JN 2019-02-10 % extract TTL events from MPX files fid = fopen(fname, 'r'); data = fread(fid, 'uchar=>uchar'); fclose(fid); pre_alloc_size = 30000; isAnalog = zeros(pre_alloc_size, 1); ttlnums = zeros(pre_alloc_size, 1); sampling_rates = zeros(pre_alloc_size, 1); o...
b3fcfc9381edec408a3e9571db8741efa46a53e0879f186bba6d9df271022e96
MATLAB
2,823
89
function gramm_2x2laminar_line(IDX) %% Goal % use gramm and plot the simultaneous congruent, incongruent, and monoc % preferred. % line plots using "methods for visualizing repeated trajectories" %% Initial variables conditNameForCC = IDX.allV1(1).condition.Properties.RowNames; TM = IDX.allV1(1).TM(1:560); clear Dat...
cff028be5bdfd53ce83891405e36c4881177268435f99cfe9b6b56be418f2f9d
MATLAB
2,837
62
function [labels] = getTIFFLabels(path, varargin) % This is a function for loading tiff labels, whether it be a multipage tiff % or a folder of individual tiff files. You are expected to provide a path % to the Point that holds your data. If your Point is a folder that has % some internal structure more complicated tha...
9b20d118bed1ac4c4c545b62330d8b87702df4bcfeb712bfd1143b0a17bf69dd
MATLAB
2,864
148
sb v_data plot(t, V) ylim([-70, 35]) xlim([1.01, 1.135]) % Action potential, membrane currents and intracellular Ca2+ % Nernst potentials Na_o = data.Na_o; Ca_o = data.Ca_o; E_k = nernst(K_i, K_o, 1, data); E_Na = nernst(Na_i, Na_o, 1, data); E_Ca = nernst(Ca_i, Ca_o, 2, data); % Fast delayed rectifier K+ cur...
23730ef2ea3b218f6eab4959b5365aa7b76a901109dc797972826f76c3e5d07c
MATLAB
2,875
71
%% Create urgency signal % Oscillations in the higher Beta band (16:30) are taken as indicators of motor preperations % and are use to constrain our neurally-informed models, the grand-average Beta amplitude % waveform in the 8 sec ITI was taken (Calculated with dataAnalysis.m) and normalised according % to the motor...
e0f0b16ce1c42c06427d4d41e6f79384dbc32d012c30d00c849556af4a3f9fc3
MATLAB
2,877
95
function asyncSoundOUT_test2(q,sounds) send(q,'start'); qout=parallel.pool.PollableDataQueue; send(q,qout); S=load(sounds); sounds=S.sounds_data; dev=audioDeviceWriter; dev.Driver='ASIO'; dev.Device='ASIO MADIface USB'; dev.SampleRate=192000; dev.ChannelMappingSource='Property'; dev.ChannelMapping=1:14; dev.SupportVari...
6745b79f03264466cdbb13328ba704a07bf2d240ea5f86754922d95ede4b961e
MATLAB
2,882
67
function sig = Signal(varargin) % Signal class constructor. % Signal(name) constructs a signal with a given name. % Signal is the base class of all signals (BBN, FREQ,MTF ...etc) . % Creating a new signal: % % Creating a new Main_signal (assuming it's name is NEW_SIGNAL): % 1. Creating a library with the name : @NEW_S...
0309cad68b605a3b92bf2e53c0ebce1a39714d62401ac16d928889f6242583ce
MATLAB
2,888
76
function sig= update_comp_by_index(sig,index,input_method,varargin) % UPDATE_COMP updates the given componentof the Signal with the given input % method. % UPDATE_COMP(SIG,COMP_NAME,INPUT_METHOD,VARARGIN) updates the relevant component % (according to comp_name) with the given input method ('STATIC_VALUE', 'SWEEP',or %...
47b410d3b7d4e0bcbc99e5b23a90aea7c81399b2c2c971f2642b7b160a040800
MATLAB
2,889
87
function runTrainingSession(kind) %RUNTRAININGSESSION opens a GUI to run a detection training session. % Arguments: % kind - 'gap' for gap-in-noise detection training [default]; % 'tone' for tone-in-noise detection training. % Author: Lasse Osterhagen if nargin < 1 kind = 'gap'; end switch kind ...
bb118fe7c97bdd4fd13cee8367a8c07e7574a154511e6070f1c80e7244aa2b81
MATLAB
2,889
78
function summary = RELIABILITY_SELECTION(dat_in, varargin) % dat_in does not acount for time % dat_in is a cell array of the samples that the function draws from. In a % sense this is the trials for a given condition of interest or the % "features" presented. I.e. datin = 1x3cell [eye_1,eye_2,eye_3] %%% THIS function ...
7d108777409e7b508e584e9b643e8686ab2cfdf391dc46d1b6095bf99b534edf
MATLAB
2,907
63
function db1Pulse = PPS_MakePulse(inNSamp, chPType, varargin) %Utilty function generating a pulse. %Synopsis: % DB1PULSE = PPS_MakePulse(INNSAMP, CHPTYPE, [VAR]) %Input: % -INNSAMP: number of sample of the output pulse % -CHPTYPE: charater array specifying the type of pulse. Can take the % following val...
7e5b2c7918ca0c637200b0fe8facd54028558d1d1eba2a07c7f267d4ed48bb49
MATLAB
2,910
97
function res=check_params(varargin) % res=CHECK_PARAMS(PARAM1,VAL1...) checks the validity for a Basic_line object. % Checks that PARAM1 field can hold the given VAL1 value and the same for % PARAM2,VAL2 and so on. % If all params are legal - returns 1. Otherwise returns 0. global LINE_REAR_NAMES; global LINE_LEAR_N...
fc19e185fc25adbee8e0d68b432491b88ccb2e63d28b5131bc32d4f432a6b52e
MATLAB
2,911
84
function [X,N_features,featurenames,featureind,coeff]= preprocess_features(X,pars) N_features=length(X.datapars.featurenames); featureind=1:X.datapars.N_features; featurenames=X.datapars.featurenames; if pars.oldonly %use only WENDLING 2005 features featurenames=X.datapars.featurenames(X.datapars.oldfeatur...
4718ed32b30d7240f16e77d2c96b153ba6e6c8496d9b92a096f886bd2d713484
MATLAB
2,912
73
classdef ExtendChanSampleFactory < AudioObjectSampleFactory % Decorator that can be used to extend the number of audio output % channels of an AudioObjectSampleFactory to the number of output % channels in use by an AudioPlayer. Those additional audio channels % will all be zeroed. % Example: If an AudioObjectSampleFac...
76a69e46365693ea975207e33c4b4f2bccc2f92fdd26f18ccf40a2c8fed3463a
MATLAB
2,914
74
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <freqSpec: returns the frequency amplitude (or power) spectrum of input timeseries data > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License a...
65dabc00bdbcdd5ba59a3e3459d0d2003bd2638f48c711f1019d20742e7dd13a
MATLAB
2,917
64
function [metablock,line_coordinated_channels]=invert_metablock(meta) % INVERT_METABLOCK invert the metablock in a way that the Trial-duration % component of each line will be considered when coordinating and building % the trials table of values for the Metablock. % [METABLOCK,LINE_COORDINATED_CHANNELS] = INVERT_META...
535aacb62d1a4db03dd67d062aa4ecae40d0ba8c51de6ec6ce3bd72296dc5049
MATLAB
2,923
96
function asyncSoundOUT_test2(q,sounds) send(q,'start'); qout=parallel.pool.PollableDataQueue; send(q,qout); S=load(sounds); sounds=S.sounds_data; dev=audioDeviceWriter; dev.Driver='ASIO'; dev.Device='ASIO MADIface USB'; dev.SampleRate=192000; dev.ChannelMappingSource='Property'; dev.ChannelMapping=1:14; dev.SupportVari...
fac48709f232e680eb30d5a0ab76c8a3f36fbed95011d82b28971567b49ef0a8
MATLAB
2,933
71
% MIBI smooth stitching script % Author: Dmitry Tebaykin % Contact: dmitry.tebaykin@stanford.edu %% Necessary parameters % Provide the XML file path from the run, stitching parameters will be % extracted automatically. Example: xmlFileName = '180501_Hip_Panel3ug_Final-2b.xml'; xmlFileName = ''; % Leave this blank for ...
19491a63f73b830c7cf7185a85dffadced5b295f17208ac0fe3567a666f4f74b
MATLAB
2,947
89
classdef ArduinoDevice < InputOutputDevice %ARDUINODEVICE establishes a serial connection to an Arduino (Uno). % Data transmission is realized by 2-byte arrays with the first byte % specifying the pin involved and the second byte specifying the % associated value. % If the class receives data from the Arduino, ...
6ca8f74a99892244bd0c549838cff6c02000c02cec69d3d654cec60dfe0759a0
MATLAB
2,950
46
% Authors : Tatjana Schmitt & Simon Wadle 2019-2022 function time_points = time_points_frames(txt_filename_frames, varargin) % normalizes frames to real time points in ms and frames % output is a cell array with time points & frame number of each presented stimulus and % all start and end times & frames for calcul...
ea81b1891aff6467d41de4fd555a41915490d79b59bb264b4d584ee310f32017
MATLAB
2,953
78
function generatePanels_FigS5_rev(FigS5) %% READ ME %% Colormap figure(150); colors=flip(FigS5.constants.colormap((1:4),:)); tempMap(1,:)=FigS5.constants.colormap(1,:);%REM tempMap(2,:)=FigS5.constants.colormap(4,:);%Active Awake tempMap(3,:)=FigS5.constants.colormap(2,:);%Quiescence tempMap(4,:)=FigS5.cons...
fdc317cc2469a418604cd74fe7f74320f45f62dd63fc427da70cc7a6b4bbe5ff
MATLAB
2,960
90
classdef GapTrainingStimuliGeneratorTest < matlab.unittest.TestCase % Author: Lasse Osterhagen properties (Constant) defaultGapDurMean = .01; defaultGapDurStd = .002; defaultStartDelayBounds = [1, 5]; end properties % default config config defaultGapDurBounds % (constant property ...
b67704958d71abd5d9de05e1f5cb74a38ae20d6fcaf2517854500b55ef378e95
MATLAB
2,962
91
function line=set(line,varargin) % SET Set Line properties and return the updated object % Property names are: % % Right ear - a String that represents the channel that participate % in the syntisiesed on the right ear. % The options are: '1', '2', '3', '4', '3+4', '2+3+4', '1+2+3+4','SILENCE'. % % Left ear - a String...
bb139688214d72ff9d3afebf764aeab572fc15e9d48496c91a8abd1ba50e8699
MATLAB
2,967
116
function Wsoc = soc_function(W_initial, rate, desired_SA, gamma, end_exc) % Code from Vogels et al., 2018, Nature Neuroscience % By Jake Stroud %% Create a stability-optimised circuit Wsoc = W_initial; % Plot spectrum of W_initial figure subplot(2,1,1) plot(eig(Wsoc),'*'); xlim([-10 10]); ylim([-10 10]); xlabel('Rea...
14d696307cebc4dcd71beb03d449bcc23422baf2ba0579fe6face568a704717d
MATLAB
2,971
77
% Copyright (C) Alex A. Bhogal, 2021, University Medical Center Utrecht, % a.bhogal@umcutrecht.nl % <import_RGM: imports GEN4 RespirAct data > % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Founda...
3d883aaa0cae801057c1aa8425cc3116a3d159a937082a9938ff1ab0945a19e3
MATLAB
2,974
101
function [ phi_G, Cov_E_p, A_p ] = phi_G_Gauss_AL( Cov_X, Cov_E, A, Z ) %------------------------------------------------------------------------------------------ %PURPOSE: calculate integrated information "phi_G" based on information geometry % with an augmented Lagrangian method % % See Oizumi et al., 2016, PNAS...
a2f0f1171b574cacefcc55f73eb7f7e6c15de3d07ca2a2ee329080777285620e
MATLAB
2,976
112
% script to extract betas %dbstop if error glm= 'GLM_GUSTO'; task='hedonicreactivity'; list_roi = {'Pirif', 'insula'}; % which contrast con_list = {'con_0002.nii'; 'con_0003.nii'}; % con_name = {'reward'; 'neutral'}; % %% DEFINE PATH cd ~ home = pwd; homedir = [home '/OBIWAN']; for k=1:length(con_list) ...
b910608d0d77b2e6b0b539284a66a5b721d14559afd7aaffd0d84a32565df31a
MATLAB
2,984
104
function plot_supp_2(my_axes, S, param, axlabel_flag) ns_pre = S.ns_pre; thr = .25; dset = S.dset; clear('S'); time_const = 29.997; rats = 4:8; days = 22:23; start_time = .5; % sec after prev_fdb stop_time = 9; % sec after prev_fdb start_samp = round(start_time * time_const) + ns_pre; stop_samp = round(stop_time *...
f0a53d133dc2555f1a979d49801d1d3723cc1e1d44aa6276715369464d10aa83
MATLAB
2,988
93
function [snr_time_fixed, stats] = ... fix_state_timestamps(method, snr_time, mdp_states, ... last_idx_before_skip, folder_log) onset_window = 3600; % 1 hour if strcmp(method, 'ttrig') % specific to this method: find points where the ttrig column increased ts_idx = find(diff(mdp_states.ttrig) > 1e-5) ...
03dc9b6ea17e90c534f8c07c849a72ba5dbe7fabe91df3b2cfbb519643757b28
MATLAB
3,000
77
function C_fitting_lag(datswitch) load('A_dataload.mat','NE','NM') switch datswitch % choose between near miss and narrow escape data case 1 dat = NE; case 2 dat = NM; end name = dat.outcomename; EEGtime = dat.eegtime; EEGdat = dat.eegcurve; ...
404f88e68c461e498c30c7bd6fd7aacdc3a12b4316ef1f6db906b41b218fc7c3
MATLAB
3,003
79
function sig= update_comp(sig,comp_name,input_method,varargin) % UPDATE_COMP updates the given componentof the Signal with the given input % method. % UPDATE_COMP(SIG,COMP_NAME,INPUT_METHOD,VARARGIN) updates the relevant component % (according to comp_name) with the given input method ('STATIC_VALUE', 'SWEEP',or % 'SEQ...
31411e41fecf3bac75bad1e842f3c507c066db0fedc285de9a788f062441ef1e
MATLAB
3,005
82
classdef GapStimulusSampleFactoryTest < matlab.unittest.TestCase % Author: Lasse Osterhagen properties(Constant) gaps = [1, .1, .01, .001]; sFs = [44100, 192e3]; gates = [.001, .0005]; end methods(Static, Access = private) function [outSamples, requiredSamples] = applySampleFac(gapDuration, ...
384d3b40c1c95a4b78c9880a251094773b67dc9211a0bf5ff9880ec08e229f89
MATLAB
3,007
75
% Function to get 1 point per y value % Updated: August 30, 2022 function [dendSkel] = SinglePointBin(dendSkel,dend_lbl,dendCent,dendMax,dendNum,neur_mvmean,neur_idx_avg) % Determine how large of deviation is permitted pxldev = 7; % For each pixel row, keep the point that is closest to the moving mean ...
18bcbb9a31389e0a155762e4c8f541fbb0d32bed544ec54bc831e156a594da3a
MATLAB
3,010
76
function [remapped] = mapEmbedding(embedding,sourceEigVecs,destEigVecs) % mapEmbedding Remaps the matrix of row vectors embedding from the space % spanned by sourceEigVecs to the space spanned by destEigVecs. % % IMPORTANT: % embedding = matrix whose rows are the points in embedding space % represented by row ...
398bd55b365275921e81096ea3742ff8d837bb4686b9b17c4f9e43c69af6726b
MATLAB
3,013
104
function struct2csv(s,fn) % STRUCT2CSV(s,fn) % % Output a structure to a comma delimited file with column headers % % s : any structure composed of one or more matrices and cell arrays % fn : file name % % Given s: % % s.Alpha = { 'First', 'Second'; % 'Third', 'F...
82d3d54cd25630194be38baeb547f3937453f90b8a4b27b6fea9685177b460da
MATLAB
3,016
95
function [sortIndex,newROICount,firstSort,secondSortID] = chanSort(ECoGchannels,ROI_table,majorROI,minorROI,suppressWarning) % Sort ECoGchannels by major and minor ROIs %% Default is to sort first by newROINum, second by oldROINum if nargin<3 || isempty(majorROI) majorROI = 'newROINum'; end if nargin<4 || isem...
20215fa090f9547b8665c56ad45b0f9a886a004f57a653177bbcdd3c9c969805
MATLAB
3,022
81
clc clear close all load same_or_diff_LDA.mat % find neurons with at least one matched bin ind_bins = same_or_diff==1; ind_neurons = any(ind_bins,2); n6c = sum(ind_neurons); disp(['N_Fig06C: ',num2str(n6c)]) % load classification performance as plotted in fig.4A load xx_108_4_single_e2o_perf exe2obs_cell = cellfu...
ab9f1367664d3aa739b2e2802e7349e57c5c80fb2869eedde264fd36981b107e
MATLAB
3,024
99
%% significance of distance clear; clc; %%%% distance in subspace %%% %load data load('subspace_position_A.mat'); real_a = sdata; load('subspace_position_B.mat'); real_b = sdata; load('permutation_A.mat'); perm_a = sdata; load('permutation_B.mat'); perm_b = sdata; % null distance = struct('A',[],'B',[]); distance.A ...
e048e87dd484d5859c83bfb643bfe4eb36fae6e1ccce95930e5f3936b8da04e2
MATLAB
3,028
133
function fb_detrend_and_align(DIR,TEMPLATE,ROIS,varargin) % % % % % % nparams=length(varargin); fs=22; per=12; cut=25; out_dir='extraction'; save_dir='detrended_aligned'; dat_dir='trace_data'; padding=[0.25 0.750]; if mod(nparams,2)>0 error('Parameters must be specified as parameter/value pairs'); end for i=1:2:np...
aba523ec0b3a968819c5f40b2faacb7af07f1292a1be349d32c37f0420456534
MATLAB
3,038
85
% Displays MIBI images, calculates and overlays visual mask function display_segment(handles, pipeline_data, varargin) %get info for creating base display [display_point, channel_index, channel_name, channel_counts] = retrieve_view_data_info(handles, pipeline_data); sfigure(pipeline_data.displayImage); ...
3d323b6b8c56c4b72d561d33be4dff7612db3a9869b071d22acff5949e1389f9
MATLAB
3,052
91
function [P, PE] = gaussianFit( X, Y, opt ) %gaussianFit Gaussian fit % Makes a 1-D Gaussian fit of a distribution of points % % [P,PE] = gaussianFit(X,Y,opt) % % X is the x-axis input array (n x 1). % Y is the y-axis (n x 1) input array. Y can be a (n x m) matrix. % In this case each column must be an array...
95b0c420eea47b1429984141c4a8ead0a35c88733fbca0987b9ca47691626e9b
MATLAB
3,052
104
%% clear; clc; close all; %% Define parameters group_name={'group_1' 'group_2'}; dir = 'dir1\'; map_dir = 'map_dir\'; x_pix = 400; y_pix = 400; spec_frame = 99; ext = '.txt'; ext1 = '.xls'; ext_fig = '.fig'; ext_jpg = '.jpg'; % load referece spectrum load pure_chemicals_...
4e1799df474c9573887e0dc390a1a82c0169ae7050a208722c280d6632ed7aa0
MATLAB
3,054
106
function [q_TPM, q_past, q_joint, q_present] = est_q_table(p_past, p_joint, p_present, N_st, Z, sigma_table, pow_cell) %------------------------------------------------------------------------------------------------- % PURPOSE: estimate mismatched probability distribution q from the original probability distribution ...
eecab9208d4220108849ed92be9fc21356c045ae29235c28202b24b2a65cac77
MATLAB
3,058
61
function preprocess_anatomical_prep(fsldir, subjectdir, bet) k = strfind(subjectdir,'subject'); sub = [subjectdir(k:end),' - ']; clear k % This is simply helping with the text that will be displayed as the % function is running. 'sub' is a string with the name of the subject that % will be printed with every upd...