sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
9a6faf7964239e6888219bccee77061bfeae012c555932a2d60e3d5085541009
MATLAB
2,039
105
%% plotVisTime % clear; close all; clc %% Initialize parameters start = 1; stop = -1; stop = 98; plotOn = 0; rollOn = 0; stDay = 1; params = struct(); % set day 1 params params(1).buffSt = 2.5; params(1).buffEnd = 0.5; params(1).timeCue = 5; % set day 2 params params(2).buffSt = 1; params(...
caf29f18c135b292b6279e128278333aaedc2a92bee9491e2cff260b69e0d84c
MATLAB
2,041
48
function varargout = check_ch(self, channels, checkType, varargin) %check_ch - Check that the appropriate channels are present % % check_ch(OBJ, CHS, 'any') checks that at least one of the channels % specified by CHS are present in OBJ. CHS must be a single row char % array or a cell array containing single row ...
4f3594b12002af7b465251d04a99cc7e74349fcfe0846bacab822a60a42bb444
MATLAB
2,042
72
% Causal diagrams clear; clc N = 10*10^3; nvartot = 5; addpath("~/gdrive/Dottorato_Matlab/ToolBox/robince-gcmi/matlab/") %% COLLIDER : 2 --> 1 && 3 --> 1 (SYNERGY) X = randn(N,nvartot); X(:,1) = 0.8*X(:,2) + 0.3*X(:,3) + 0.15*randn(N,1); out = goi_gradients(X,nvartot); fprintf("COLLIDER: 2 --> 1 && 3 --> ...
531f629412a03707d6d35462531503805bb831d1d159f0554215047a1e440bed
MATLAB
2,043
64
%% Motion Correction % Motion correction is designed to correct for motion artefacts in the raw % images that often result from movement of the sample. This may occur % through microscope drift or movement of the sample (e.g. animal) itself. %% See Also % * <matlab:doc('utils.motion_correct') Motion correction utilit...
f6ec6dee236cf02508401bf3becf23b1075507489389e915020e0d3201c4299c
MATLAB
2,044
90
function sff = sff_dk(sff) %SFF_DK % % RS, 05/2022 n1 = sff.gp1.cln.n; n2 = sff.gp2.cln.n; [dk,dkres] = dkRobust(n1,n2); sff.clb.dk = dk; sff.clb.dkres = dkres; end function [dk,res] = dkRobust(N1,N2) %DKROBUST Calculates dk from raw N (number of objects) time series % Removes outliers due t...
ba7243134b5a37ec614f22d92079c8210616ab783018368bba6cf09a78cac868
MATLAB
2,054
67
close all force % clear load('a0_0_bhv2trialStrct.mat'); load a19_0_downSizeAverageHeatMaps.mat load a19_1_calculateGradAveragesForEachConditionAndBaseline.mat %} %% nTrial = numel(dataTrl) ; NTrial = 1:nTrial; tAll = tic; hWB = waitbar(0,'checking the trials ...'); nTrialAllNext = 0; iTrialAll = 0; distAll = na...
7d6c240f6b4bc6ea5d6502bba4593ad3d5624bb74b25afbee5bdbab01cf55398
MATLAB
2,057
89
function [uF,uA] = testPointPlace % Test adding a line that follows the cursor as it goes down. % % Clicking adds points. Shift-clicking removes them. uF = uifigure; uA = uiaxes('Parent',uF); uA.DataAspectRatio = [1,1,1]; % Make axis aspect ratio square pan(uA,'off') zoom(uA,'off') ...
cd2e56032cd72567999109f9eecb6114100ca1171d6c93071c493511209f5155
MATLAB
2,059
81
clear all thetaRight = -[67.5 112.5 157.5 157.5 -157.5 -112.5 -112.5 ... -67.5 -22.5 -22.5 22.5 67.5]; thetaLeft = -[-67.5 -22.5 22.5 22.5 67.5 112.5 112.5 ... 157.5 -157.5 -157.5 -112.5 -67.5]; thetaFB = -((0:30:330) + 15); % Parameters from data fit a = 29.2282; b = 2.1736;...
0ffc2b47cee086f734eadfba129a610c75be0e87e1c8a72bda1dc3459077c68e
MATLAB
2,060
80
function y = nanstd(x,dim,flag) % FORMAT: Y = NANSTD(X,DIM,FLAG) % % Standard deviation ignoring NaNs % % This function enhances the functionality of NANSTD as distributed in % the MATLAB Statistics Toolbox and is meant as a replacement (hence the % identical name). % % NANSTD(X,DIM) calculates the st...
272e85c1f2c79ad1ac632c45997579b14ca32eb07b8e0df44e711599ff06a94a
MATLAB
2,060
50
function f = LK_PlotFiringRateInOutPlaceField_20231012(dt) % % LK_PlotFiringRateInOutPlaceField_20231012 plots the firing rate inside % vs. outside the place fields (using a boxplot). % % Input is a structure with multiple fields. % % Output is a figure handle. % % Lukas Kunz, 2023 %% groups % mean and standard error...
d7ee2f9db2b521f437bfae7d630c783c3a4a38acfd255ce3389353414f6f8030
MATLAB
2,060
64
% this code will read all the gaze files from the trials and covernt them % to the image coordinate. clear close all force warning on imSize = [733, 977]; pix2deg = 34.910; hWB = waitbar(0,'checking the trials ...'); %load tirals info load('a0_0_bhv2trialStrct.mat'); I = arrayfun(@(x) isfield(x.analyze,mfilename),...
6386d80fbdb511287df63f4910c46b89e28f6b299abb4fba04920d05ebc80e4b
MATLAB
2,064
58
function process_sub(self, varargin) % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % 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 Foundation, either version 3 of the Licen...
9c2713dce4d09b12443f4a380e72028e9deccfe002adcc9c6c9cece1c3ee21d8
MATLAB
2,064
73
%% % Reproduces Fig. 5B and 5C in: % IA Oldenburg, WD Hendricks, G Handy, K Shamardani, HA Bounds, B Doiron, % H Adesnik. The logic of recurrent circuits in the primary visual % cortex. Nature Neuroscience (2024) % % Written and edited by G Handy, IA Oldenburg, and WD Hendricks %% clear; % Load the simulation...
e5683c63e8490151f95a7bcb8a7212cb7f3d2678690b5fe81aa86fc9caeb8615
MATLAB
2,066
59
%% % Recreates the key experimental panels (Figs. 2-4) of the paper: % IA Oldenburg, WD Hendricks, G Handy, K Shamardani, HA Bounds, B Doiron, % H Adesnik. The logic of recurrent circuits in the primary visual % cortex. Nature Neuroscience (2024) % % Written and edited by G Handy, IA Oldenburg, and WD Hendricks...
3436cb88fde397ba0eb13a7fe907f31cfefe618f01d871346b99db535f08bf62
MATLAB
2,067
68
function plot_traces(self, varargin) % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % 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 Foundation, either version 3 of the Licen...
2731d2ffbc5fc9325223211233d4ceefdef47bd7800a42ce8cdcbebe24e936ca
MATLAB
2,072
65
function stimLoc = computePosition(display,percCenter,angle,distance) % return stimloc [percx percy pixx pixy] % Adjust for angles equal to or greater than 360 divides = floor(angle/360); angle = angle - (360*divides); screenDims = [pix2angle(display,display.numPixels(1)) pix2angle(display,displ...
90dfa22bdbb4289a0efa5c17a939c95015d22d09c3456fb25e876214c0cd3b75
MATLAB
2,073
57
function [All] = calcOffTargetRisk(All,opts) thisPlaneTolerance = opts.thisPlaneTolerance; onePlaneTolerance = opts.onePlaneTolerance; numExps = numel(All); for ind =1:numExps %%offtargetRisk stimCoM = All(ind).out.exp.stimCoM; numCells = size(All(ind).out.exp.allData,1); allCoM = All(ind).out.exp.all...
005284169655dc302c95e0d6d476acb68e3575e8efab531c9adb27e4dc30b6b6
MATLAB
2,074
74
classdef Mock_ProcessedImg < ProcessedImg & IMock %MOCK_PROCESSEDIMG Summary of this class goes here % Detailed explanation goes here % ================================================================== % properties calcMock = Mock_Calc(); end % -------------------------...
0d6b0bff2fd121d5ce0e5315aebf584d119017ddecfe99b8c9d6768587325b94
MATLAB
2,080
67
classdef laser_power_tests < matlab.unittest.TestCase % These tests ensure that future changes to the code will not alter the laser power calcs % % properties hZP = []; % Class instance will go here chanSamples % The pre-computed data configDir = './laser_power/'; %use setting...
128affa16568cec965a4ee1691fa5d58387984465e6548a14d0affcaef8005f4
MATLAB
2,080
61
function self = choose_acq(self) %choose_acq - Protected class method allowing the user to manually % specify/create the acq structure % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU Ge...
53902d973edc791a6194357a76486324d39ac21ac4768dd7cd9f03c5aaa54748
MATLAB
2,084
56
function im = returnCurrentFrame(obj,nFrames) % Return the last recorded camera image and optionally the last n frames % % function im = zapit.pointer.returnCurrentFrame(nFrames) % % Purpose % Return the last frame and, if requested, the last n frames. % % Inputs % nFrames - [optiona...
cf713f08e183cec754c742af60bbbf861e2f66cb8d09edaf528cb0c8fed09023
MATLAB
2,087
69
function CellsortPlotPCspectrum(imgSeq, CovEvals, PCuse) % CellsortPlotPCspectrum(fn, CovEvals, PCuse) % % Plot the principal component (PC) spectrum and compare with the % corresponding random-matrix noise floor % % Inputs: % imgSeq - input image sequence % CovEvals - eigenvalues of the covariance matrix % PCuse...
9e1678549dd51552aaa95670c79b8d752393d12e2e73034a492f66ecfa7ef8ff
MATLAB
2,089
59
classdef Test_CalcFindROIsCellSort < matlab.unittest.TestCase %Test_CalcFindROIsCellSort Summary of this class goes here % Detailed explanation goes here % ================================================================== % methods (Test) function testNoROIs(self) ...
aff89bac0cfaabf783e49ef622cd1100e05591cb07e0a47dca10e17686aa38e3
MATLAB
2,091
61
function adjImgData = adj_traj_delay(delayTime, imgData, pixelTime, ... xChannel, yChannel) % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % 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 % ...
af10e3a261f448ed41936e9a5ade4b6129b3405fe750c7f2fa1273a45c54032f
MATLAB
2,093
51
%% Preprocessing clear all;close all;clc; opts = delimitedTextImportOptions("NumVariables", 9); opts.DataLines = [1, Inf]; opts.Delimiter = ","; opts.VariableNames = ["Var1", "VarName2", "VarName3", "VarName4", "VarName5", "VarName6", "VarName7", "VarName8", "VarName9"]; opts.SelectedVariableNames = ["VarName2", "VarNa...
59c6390ad76bd6d124fb2b919b91022412f4410a5f752badac00cdaf6b773cdc
MATLAB
2,096
66
%%% baseline_plot.m %%% Omkar N. Athavale, May 2023 %%% Run and plot simulation for an extended duration (300 s) with no %%% stimulation addpath('../matlab_common/') % run simulation [t, s, a] = ICC_SMC_Neuro([0 0 0 0 0], [1 1 1], 0, 0, [0 300000]); T = a(:, 7); Vm_ICC = s(:,3); Vm_SMC = s(:,1); %% quantify varia...
24544189cc96b75f09c27f0dffa15b4a68a330bfa94c6cf16247113eb35b9bd7
MATLAB
2,097
64
%%% aligned_event_plot.m %%% Omkar N. Athavale, May 2023 %%% Plots a single event with aligned start times but peak rising derivative %%% across a configurable sweep of parameter values. Default config is for panels of manuscript %%% Figure 2B. addpath('../matlab_common/') names = {'k_{iAno1}', 'k_{iNSCC}', 'k_{iCa50...
c32150da8d1acb444d3f32d137ab275c0b4faad693edd501606b6e42c7b32a34
MATLAB
2,097
47
function f = LK_PlotPowSpectrogramDuringHCRipples_20231005(dt) % % LK_PlotPowSpectrogramDuringHCRipples_20231005 plots power spectrograms % during hippocampal ripples. % % Lukas Kunz, 2023 % create figure f = figure('units', 'centimeters', 'position', [5, 5, 6, 6], 'Color', [1, 1, 1]); % depict HC ripples ax1 = axes(...
d3bd3bdbfdf2c1afdd2a05684fcc0e6b5e048ab8d5f762d15ca992907073861a
MATLAB
2,098
49
function cfrdObj = from_ImageJ(varargin) %from_ImageJ - Load ROIs from ImageJ ZIP-file % % OBJ = from_ImageJ() prompts the user to select a ZIP-file % containing the ImageJ ROIs and will create a % ConfigFindROIsDummy object using the provided information. By % using <a href="matlab:help utils.create_ImgJ_mask"...
b6f9ab11f93bcaf77b6507b8e3d1c725783cdfc0f972ec20ca48c4e3bb768d91
MATLAB
2,103
79
clear close all force warning on imSize = [733, 977]; %load tirals info load('a0_0_bhv2trialStrct.mat'); I = arrayfun(@(x) isfield(x.analyze,mfilename), dataTrl); if any(I) I(I) = arrayfun(@(x) x.analyze.(mfilename) , dataTrl(I)); end NTrial = find(~I); nTrial = numel(NTrial); UMuscimol = unique([dataTrl.iM...
3a8d922a03bcc00989f98cef63a630c0269ea8c7a3611e16200be70aa8270fb5
MATLAB
2,104
78
[sa,X] = network_simulation_beluga.getHeadModel; folder = fullfile(dataFolder,'simulations','example_embedding'); load(fullfile(folder,'model.mat')); network = network.rebaseNetwork(folder); [ids,ts,ei] = network.getprenetwork(network.spikingFile); cons = csvread(fullfile(folder,'postsynaptic_network','connections.cs...
a59e14c843a1fb8434d70dc514cd6a7dee2a9abdf8de6f63d3c5324bad07eed6
MATLAB
2,104
73
function [channel, result] = sshfrommatlabissue(channel,command) %SSHFROMMATLAB issues commands to a remote computer from within Matlab % % [CONN, RESULT] = SSHFROMMATLABISSUE(CONN,COMMAND) % % Inputs: % CHANNEL is a Java ChannelShell object % COMMAND % % Outputs: % CHANNEL is the returned Java ChannelShell ...
9b82983a871e28e26c90830ba53379caa69c2587cfdfac21b5b6272c37c6419e
MATLAB
2,114
74
% sim_spinecho.m % Robin Simpson and Jamie Near, 2014. % % USAGE: % out = sim_spinecho(n,sw,Bfield,linewidth,sys,tau) % % DESCRIPTION: % This function simulates a spin-echo experiment with instantaneous RF pulses. % % INPUTS: % n = number of points in fid/spectrum % sw = desired spectral wi...
410eb7d03de357c21feba3c3043797d5c6aa9914e5cb67c7ccdf625467c39a4c
MATLAB
2,115
74
function I = goi_mi_gg(x, y, biascorrect, demeaned) % MI_GG Mutual information (MI) between two Gaussian variables in bits % I = mi_gg(x,y) returns the MI between two (possibly multidimensional) % Gassian variables, x and y, with bias correction. % If x and/or y are multivariate rows must correspond to sample...
e03a16cfdac3daa77822321b9246b6f730d75edcc4ced870e4ce2457de1ce41d
MATLAB
2,117
55
function to_long(self) %to_long - Convert the images to long format % % to_long(OBJ) converts the rawdata of the RawImg object to long format. % That is, the image lines are rearranged into a single, long image % frame. This is useful when working with image types that are % line-based instead of frame-based (...
d39a6901115f53d47e364e49228d62a2db08ffa49f502ce217f86f55b15573de
MATLAB
2,119
69
function plot_streaks(self, varargin) % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % 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 Foundation, either version 3 of the Lice...
2dd612a8dacf73b93aaff8571ebcd33ea867aa0244c1c910b099943b12915cd4
MATLAB
2,120
52
function [ match_vector,distances ] = matchPuncta(puncta_rndA,puncta_rndB,pixels_rndA,pixels_rndB) %This matches round B to round A, getting the nearest 5 neighbors in terms %of euclidean distance between centroids [IDX,D] = knnsearch(puncta_rndA,puncta_rndB,'K',5); %getting five other options match_vector = zeros(si...
7fc90fbc63ef1763c92c8ab389694c99078e811fda7b8165984f9900c6d748a5
MATLAB
2,120
60
function rr = eq(aa, bb) %eq - Test two CalibrationPixelSize objects for equality % % eq(OBJ1, OBJ2) tests scalar CalibrationPixelSize objects OBJ1 and OBJ2 % for equality, returning logical 1 (true) if the two objects are % identical, or logical 0 (false) if they are not. % % See also CalibrationPixelSize, Cal...
f24cde1377c5907a956136e814308b4370b7075cebadbd8ba6c494f4ee1d283e
MATLAB
2,122
62
function varargout = file_exists(val) %file_exists - Check that the file exists % % file_exists('fn') checks that fn is a path to a file that exists. If % it is, nothing else happens; if it is not, the function throws an % exception from the calling function. % % ME = file_exists(...) returns the MException ob...
21538dc2a9a257012ea0cecab647d70ab560b4c85c15369a3520cd52607714ba
MATLAB
2,130
54
%Helper function to be used to plot voxels onto coronal plane function plotVoxelsOnMRIPlane(axis, intersectingVoxels, planeLabel, cursorPosition) % Get the spm plotting object global st % bouding box for the MRI boundingBox = st.bb; sagitalBoundingBox = boundingBox(:, 1); coronalBoundingB...
3fa9fca546d9340e6720d8cbec101958e0bc2fd07dc6a227702946d3fcea4a83
MATLAB
2,130
103
clear all close all gdfX='exampleRaceFile/raceEEG.gdf'; txtX='exampleRaceFile/raceLog.txt'; sampling = 512; txtFile=txtX; [signal,h]=sload(gdfX); AA=readtable(txtFile); nEvents=size(AA,1); eventHeader=[]; for e=1:nEvents string=char(table2array(AA(e,2))); matchStart=string(1)=='s'; if(...
b1602bf6b01d95c8a4fe8f802d60ac778c54850204e32c51ef8b66a4eb473301
MATLAB
2,131
78
%sim_onepulse_arbPh.m %Robin Simpson and Jamie Near, 2014. % % USAGE: % out=sim_onepulse_arbPh(n,sw,Bfield,linewidth,sys,ph) % % DESCRIPTION: % This function simulates a pulse-acquire experiment with an ideal % (instantaneous) excitation pulse and an assumed lorentzian lineshape. % The function calls the function 's...
d2bfd765d50d7b26c0bc46e2bd06e87a6f4147829f5e70f500124f836211083f
MATLAB
2,133
76
%% consistency % % Calculate VAR model consistency % % <matlab:open('consistency.m') code> % %% Syntax % % cons = consistency(X,E) % %% Arguments % % See also <mvgchelp.html#4 Common variable names and data structures>. % % _input_ % % X multi-trial time series data % E re...
9bccaf00db78030790dbbe8999e2c623abdd4d0c1cf718aa4121eefed846f7fe
MATLAB
2,134
75
% the pattern separation toolbox: analyse spike train ensembles % Copyright (C) 2022 Alexander D Bird function [decorr_obj] = decorrelation(input,output,num_params) %DECORRELATION Records normalised decorrelation of the spike trains if nargin<3 || isempty(num_params) num_params=struct; end if ~isfield(nu...
a44b3761760e55a5d82dbdc7c170a9c048983ea2849c2ef5614ccfd1ec473abd
MATLAB
2,137
65
% op_dccorr.m % Jamie Near, McGill University 2014. % % USAGE: % [out,dcOffset]=op_dccorr(in,mode,var1); % % DESCRIPTION: % Do a DC Correction on the data. This method is a frequency domain % operation. % % INPUTS: % in = input data in matlab structure format. % mode = ppmrange('p') or Value('v'). In ppmrange mo...
988cd14b35ae3a0fc992937c26be876d7d9094030481a227ed415ca2213a17f1
MATLAB
2,139
90
% PL_TREE Topological path length. % (trees package) % % PL = PL_tree (intree, options) % ------------------------------ % % Returns the topological (!!) path length PL to the root node in the tree. % For metric path lengths use Pvec_tree. % % Input % ----- % - intree ::integer: index of tree in trees or str...
75806f8a713d04c2f3a86205c1d0ae19d71f46158b681ef14c2fe41f5ebb199b
MATLAB
2,140
43
function trialAveragedNormalizedROIs = trialAverageAndNormalizeArray(genotypeStimArray, targetTimes, stimStr) [nPulses, pulseDurMilliSec, ... ISIseconds, nTrials, ... ledPowerLEDunits, stimDur, freqHz] = parseStimStrOptogenetics(stimStr); % I should read the Mark_points.xml, but for now, I know the first stimulus %...
7c611533af58d437a24755445cbb6cdadd24e13cbbd4cf98caff58354ab9dae9
MATLAB
2,140
119
%% plotLocationConsistencyCombined clear all; close all; clc %% Plot day-by-day spatial correlation folds = findSubF('RBRLoc.mat',1,[],0); % useIdx = [2 3]; % type = 'bad'; useIdx = [1 4 5 6]; type = 'good'; maxDay = 10; RBRLocComb = cell(1,maxDay); for ii = 1:length(useIdx) load(folds{...
88cd20ef0a27ef44d9a54203013e0c1ecf43883c1e3a5e850b4270a82dbbaf9e
MATLAB
2,140
64
function [lineOut, fillOut] = stdshade(amean, astd, alpha,acolor,F,smth) % usage: stdshading(amatrix,alpha,acolor,F,smth) % plot mean and sem/std coming from a matrix of data, at which each row is an % observation. sem/std is shown as shading. % - acolor defines the used color (default is red) % - F assignes the ...
ecb4590f306d65dd3823a05d9d82bbe7d62c52bef9f680835097046d7d040edb
MATLAB
2,141
55
function shuffle_synapses(rValue) addpath('/lustre04/scratch/nbrake/code/simulation_code'); if(nargin<1) comboID = 13; end comboID = 13; mCombos = zeros(11*10/2,2); count = 1; for i = 1:11 for j = i+1:11 mCombos(count,:) = [i,j]; count = count+1; end end folder = ['/lustre04/scratch/nbrake...
7c969dcd7d4b451097489ee7942cc2ca71d3da6dc2dda4f8186df8cc2a3eadbb
MATLAB
2,142
83
load('figure_4_data.mat'); % plot median power spectra of the cortex and thalamus during waking, % anesthesia, seizure, and 5-meo-dmt states figure; subplot(4,2,1); inds=[find(freqs>=58.5&freqs<=61.5)' find(freqs>=118.5&freqs<=121.5)' find(freqs>=178.5&freqs<=181.5)' find(freqs>=238.5&freqs<=241.5)']; freqs1=freqs; ps...
ed9b9241adc164acb9516c3d15bf43ec5db05a3dffd5a9dc9e52d9f892a565fa
MATLAB
2,142
55
%% power curve clc;clear;close all; %% % This code plots power curve % T-test, vary sample sizes % effect size Cohensd = 0.5; % SD for normal distribution that governs the correlations of % non-covariate-related edges sigma0 = 1; FWER_threshold = 0.05; % Number of repetitions M_rep = 100; % Number of permu...
410c01c53c6c8b53f2faad12b036573a9e1cfc99b305eb160b5eb8405a46762a
MATLAB
2,147
63
function varargout = not_empty(val, varargin) %not_empty - Check that the value is not empty % % not_empty(val) checks that val is not empty. If it is, nothing else % happens; if it is not, the function throws an exception from the % calling function. % % not_empty(val, 'VarName') includes VarName in the excep...
8add1dce3c36b843e5a88e48f79e5cd38530df1beba2c9a4f02867227db603b6
MATLAB
2,147
58
function varargout = verify_license(feature, className, varargin) %verify_license - Verify that a particular licence is available % % This function is not intended to be called directly. % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % This program is free software: you can redistribute i...
575a8a8bc2cddec573bada0a6274ea9613781d637bc4909cc0745e38b705d7e5
MATLAB
2,149
66
function cfg = validateConfig(cfg) %VALIDATECONFIG Validate and normalize pipeline configuration. required = ["phaseFile", "magnitudeFile"]; for name = required if strlength(string(cfg.(name))) == 0 error('fmriPhase:config:MissingRequired', ... 'Configuration field "%s" is required.', name); ...
8c30278ee9daaeee92f34fc3d86549dff7e21dbc2cd149f743bb63bae129988a
MATLAB
2,152
54
% Generate hybrid model input from EEG source activity % % USAGE: % preprocess_external_input(output_fileid, source_activity, regionsMap) % % INPUTS: % output_fileid - String that contains the filestem for the output textfile % source_activity - [68 x 259184] matrix containing EEG source activity for % ...
9d3ddc1776a8d5f13bbd9684274e5e77c0f7539adba2c59ce422023ec7e15c77
MATLAB
2,153
50
%Written for the first splintr barcode dataset from Oz FOLDER_NAME = 'ExSeqAutoSlice'; FILEROOT_NAME = 'exseqauto'; for roundnum = 1:30 %Load all channels, normalize them, calculate the cross corr of %channels 1-3 vs 4 chan1 = load3DTif(sprintf('/om/project/boyden/%s/input/%s_round%i_ch00fixed.tif',F...
d68636e088dab371556b6fb3294700dfe1916506e53240cf6f7f0128ff6e89e0
MATLAB
2,154
68
% Extract and downsample state variables from simulation results % % USAGE: % statevars = extract_statevars(waveform_file) % % INPUTS: % waveform_file - String that contains the filename of the ..txtwf % waveform file output by the hybrid model C code % % OUTPUTS: % statevars - struct that co...
e9a133d492dd87fa71999728193088bf423f27b9259035562c7ae93234f7f449
MATLAB
2,154
66
function [] = dispDistsPlots() % Plot disparity probability distributions used for main figs in paper and controls % Load in disparity histograms based on each KSD load('./analysisFiles/disparityStats/dispHistStruct.mat'); % Define stats subsets imgSet = {'sando','walking'}; region = {'Circ','V1','V2','MT'}...
2960559841c4cdfed48daffce9f3df60211f71a993d03e9069336b09446db0b8
MATLAB
2,157
86
% RINDEX_TREE Region-specific indexation of nodes in a tree. % (trees package) % % rindex = rindex_tree (intree, options) % -------------------------------------- % % Returns the region specific index for each region individually increasing % in order of appearance within that region. % % Input % ----- % - intree :...
06620f083bd539c4ded5b55d2de455c495d4ce1851af8304ecfebc26f58f3fc4
MATLAB
2,160
58
%% power curve clc;clear;close all; %% % This code plots power curve % T-test, vary sample sizes % effect size Cohensf2 = 0.15; % SD for normal distribution that governs the correlations of % non-covariate-related edges sigma0 = 1; FWER_threshold = 0.05; % Number of repetitions M_rep = 100; % Number of per...
acd41610b364b4af0f7b02cd4ec70e3814e540f7c6a4cd5444080ad63dd10d52
MATLAB
2,161
58
classdef Constants % properties( Constant = true ) % % end % methods (Static) function d = getDir output_dir = 'p1'; simulator_dir = 'p2'; sessionDate = 'p3'; d.analysisoption = 9; d.sessionDate ...
72e6bab22776c833b3e41f5d658cc7919268046540650c0a916bd6292d0e4383
MATLAB
2,162
67
function varargout = plot_ROIs(self, objPI, hAxes, varargin) % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % 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 Foundation, eithe...
802aaac5a0911cf6929e64db678da68f1546ab614963e4f4c4681a7761aefa6c
MATLAB
2,163
84
% LOAD_STACK load stack file into a stack structure. % (trees package) % % [stack name path] = load_stack (name, options) % ---------------------------------------------- % % loads a stack structure from a file. % % the stack structure as in "save_stack": % stack has to be in the following form: % stack.M ::cell-...
90a726decdf119dabf6b3265ee69f9107576d17707ee8ed7fe8687603e684098
MATLAB
2,164
75
% rf_blochSim.m % Jamie Near, McGill University 2014. % % USAGE: % [mv,sc]=rf_blochSim(RF,tp,fspan,f0,peakB1,ph,M0); % % DESCRIPTION: % Perform a bloch simulation of an RF pulse. This code simply runs Martyn % Klassen's excellent bloch equation simulator. For more information, see % help file for bes.m. (~FID-A/rf...
1bd0b5da9856358b32fefc81be8e7c96f0b9eae8d7a9d7fb1caa9c49200b019a
MATLAB
2,166
75
function [segregation, global_segregation]=systemsegregation(conn_mat, CA) %conn_mat is the n x n input connectivity matrix. This matrix should only %have positive connections %CA is an n x 1 matrix containing modular assignments for each region n %convert diagonals to 0 conn_mat(logical(eye(size(conn_mat))))=0; %Onl...
fb74188d19f2a86e95d9fe8f2a69e912b2da41128c348bbbaca01cf5dac05b11
MATLAB
2,166
60
function model = addPenaltiesToModel(model, B, TM, TG, UCyto, UMito, dontPenalize, TMT) % addPenaltiesToModel % % Adds EAMCA maintenance costs to the model % % Input: % % model The model to modify % % B Base cost - maintenance cost per protein unit without transportation or utilization penal...
4bff6ba1c19648b400258160af62d7f476d3e65d40202b07d62e00d928236c5e
MATLAB
2,167
67
function X = taft_preprocess_load_fMRI(job) % X = taft_preprocess_load_fMRI(job) % % Calls function for fitting HRF amplitude, reshapes into design matrix. % % INPUTS: % job = structure with settings for creating TAfT object, specifically: % .goodTrlIdxfMRI= numeric vector, indices of trials to include; to...
96b06ee7b59a7939b0c08a8b89baf86a8000211e36dee730cbe9cba1cd243895
MATLAB
2,167
64
function [hHG, plotName, idxStart] = check_plot_args(validPlotNames, ... args, hgType) %check_plot_args - Helper function to check and return plot arguments % % This function is not intended to be called directly. % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % This program is free s...
b15ff7b85f6c930fab5a53a1c41b11a3cf7f6b2e1868c995a4d96bfafccde074
MATLAB
2,172
49
function rawImg = from_files(varargin) %from_files - Create a RawImgDummy object from a list of files % % OBJ = RawImgDummy.from_files() prompts for all required information and % creates a RawImgDummy object. % % OBJ = RawImgDummy.from_files(FILENAME) creates an object from the % specified filename(s). FILENA...
d4b08e6e64fe055e94baa40b4ab5de71419a60e3a01885fe3f3a6a067e95f638
MATLAB
2,175
64
% this code will read all the gaze files from the trials and covernt them % to the image coordinate. clear close all force warning on imSize = [733, 977]; pix2deg = 34.910; hWB = waitbar(0,'checking the trials ...'); %load tirals info load('a0_0_bhv2trialStrct.mat'); I = arrayfun(@(x) isfield(x.analyze,mfilename),...
6c1f7df299f1c879c8e4392aafabc0d7da340a45852a9f2d4aa551978ab5e5ba
MATLAB
2,176
77
function [loglik] = EEGfMRIPav_cbm_mod02(parameters,subj) % Standard Q-learning model with delta learning rule and with Go bias. % ----------------------------------------------------------------------- % %% Retrieve parameters: % 1) Feedback sensitivity: nd_rho = parameters(1); % normally-distributed rho rho ...
1c559620f6c4b1d05021e313118a3aceb23307c49eed3de4c01d3e94069fd5d5
MATLAB
2,177
78
%WORK IN PROGRESS function out = op_CSISelectVoxels(in, x, y) arguments in (1,1) struct x (1,2) double = [-1,-1] y (1,2) double = [-1,-1] end global selected selected = []; if(x(1) < 0 && y(1) < 0) fig = sim_plotCSI(in); ax = fig.Children(1); set...
59880da44827755723e01c34972e1318ac2745fbc1a0c5c625373539f5997b21
MATLAB
2,177
85
% RATIO_TREE Ratio between parent and daughter segments in a tree. % (trees package) % % ratio = ratio_tree (intree, v, options) % --------------------------------------- % % Returns ratio values between daughter nodes and parent nodes for any % values given in vector v. Typically this is applied on diameter, but: %...
1f012cdc707cdf9c96b40e392dc0c4fb742937d5c2b60f058a7da9734fc634c2
MATLAB
2,179
76
% SMOOTHBRANCH Smoothen points along one path. % (scheme package) % % [Xs, Ys, Zs] = smoothbranch (X, Y, Z, p, n) % ------------------------------------------- % % smoothes a branch given by consecutive (!) 3D coordinates. This changes % (shortens) the total length of the branch significantly. % % Input % ----- % - X...
72e6e9a7d9dd9af6ce325753decdc2157fa127bcf4bd53e41314710092125ec6
MATLAB
2,181
83
function y = nanvar(x,flag,dim) % FORMAT: Y = NANVAR(X,FLAG,DIM) % % Variance ignoring NaNs % % This function enhances the functionality of NANVAR as distributed in % the MATLAB Statistics Toolbox and is meant as a replacement (hence the % identical name). % % NANVAR(X) calculates the variance along t...
d076c4fd2909176a23813b570ec069c2d383dcf5919e8c4657315c6dad9373e0
MATLAB
2,182
57
function makeText(display,stimulus) % makeText(display,stimulus) % % Purpose % Generate text which can subsequently be flipped onto the screen. % % Input % display - Generated with loadDisplayParams and openScreen. % stimulus - Structure containing text parameters. % .text - String to be rendered. % .xP...
006510abe0b48626e74f3b190d54a80233df3e20cb436fabc8b66e0af5e4b23a
MATLAB
2,186
85
function [corrStats] = corrEffectSize(data1,data2,testName,nUnits) % Performs two-tailed pearson linear correlation. Outputs all statistics in % a cell array. Can be used to manually generate correlation information % for compliance with journal manuscript requirements. If only one data % matrix is input, a correla...
ab312c6c031d1f422331b5501bd6b98c7adbdaf4f2de22ea4dace0d7317079ad
MATLAB
2,186
52
function install_bfmatlab(varargin) %install_bfmatlab - Install the files required for Bio-Formats % % install_bfmatlab() installs the files required for Bio-Formats from the % Open Microscopy Environment website to the subdirectory bfmatlab within % the CHIPS root directory (as returned by utils.CHIPS_rootdir). ...
3bc9c95e578acf88e990bce4211c60555faae4439938fe8c61341224e204eca9
MATLAB
2,188
57
function [windows, time, yPos] = split_into_windows(self, windowTime, ... nOverlap) %split_into_windows - Split the raw image data into windows % % [WINDOWS, TT, YY] = split_into_windows(OBJ, T_WINDOW, N_OVERLAP) splits % the raw image data into a matrix WINDOWS, and also returns the time % value (TT) and ve...
8947072f9fc3656d57d075f127d694ea4b0671e74805c085cd8fa665084e74d8
MATLAB
2,195
58
%RunElectodesClassificationMatlabFunc clear all matlabImpute = true; imputeIters=20; %NumTreesVec = [10,20,40,80]; NumTreesVec = [80]; substractMouseMean = true; %LeaveOut = 'Stimuli'; %LeaveOutVec = {'Stimuli','Session','mouse'}; LeaveOutVec = {'mouse'}; %ElectodesClassificationMatlabFunc(unifyContextClasses...
0d5add75d5af17282db1f723bd7ebb65c527e24d83d51c080c76a77e7f5d13d2
MATLAB
2,197
46
%% READ ME: % % Written by Zachary Sanger, M.S. % University of Minnesota % Biomedical Engineering Department % May 16th, 2023. % IF YOU FEEL THERE ARE ERRORS, please reach out at sange019@umn.edu! % please cite if you use the code % % For informal use only, please double check your code for validity and proper imp...
226127df006e29f2fe30c1618a88ec65947b2f6860554e4533f4b5721068d83a
MATLAB
2,198
58
%% power curve clc;clear;close all; %% % This code plots power curve % T-test, vary sample sizes % effect size Cohensf2 = 0.15; % SD for normal distribution that governs the correlations of % non-covariate-related edges sigma0 = 1; FWER_threshold = 0.05; % Number of repetitions M_rep = 100; % Number of per...
b7a313d8f37c65b057f6e8d19480df030304b59af496179559397950699abb60
MATLAB
2,199
88
% PVEC_TREE Cumulative summation along paths of a tree. % (trees package) % % Pvec = Pvec_tree (intree, v, options) % ------------------------------------- % % Cumulative vector, calculates the total path to the root cumulating % elements of v (addition) of each node. This is a META-FUNCTION and can % lead to variou...
3a7b4b7c67fabe58e47fdfe4f8ac0f6e1d17d8631d1e2e8ffe0485acf0d1dc4d
MATLAB
2,201
58
function h = t2n_plotTrees(tree,targetfolder,col,ostruct) % This function plots each tree in a nice way and saves them as eps files, % eg for using in Adobe Illustrator. % % INPUTS % tree TREES toolbox tree cell array % targetfolder target folder for output files % col (optional) cell array with rg...
69fbd7ddc5a788db08ac7622e7581297f21077deb0242eb5515cdd12fd909325
MATLAB
2,201
67
% the pattern separation toolbox: analyse spike train ensembles % Copyright (C) 2022 Alexander D Bird function [binned_spikes]=bin_outputs(output,output_code,binsize_ms,max_time,wordsize) n_trial=size(output,1); n_rep=size(output,2); if nargin<4 || isempty(max_time) max_time=0; for ward=1:n_trial ...
efa2aea978bfdd880219c11a0fd5b8c8d2801d31dc52507b8936d0a84c704687
MATLAB
2,205
57
function [DataMatrix, Labels,MouseIDs,Days,sessionNames, stdMatrix] = AverageSessionData(DataMatrixSrc, LabelsSrc ,MouseIDsSrc,DaysSrc,sessionNamesSrc) sessionNum = zeros(1,length(sessionNamesSrc)); SessionNameWithoutBout = cell(1,length(sessionNamesSrc)); for k=1:length(sessionNamesSrc) curName = sessionName...
f54b5b5849260f496f78859667ae6abc93afa8d4a574f3b877c20eb05666d8fe
MATLAB
2,205
98
function [fn, savename] = st_plot_optHRF(hrfTable,sumTable) % hrfTable = cleanHRFtable(hrfTable); % hrfTable= tableRemoveHRFDuplicateCoords(hrfTable); % sumTable= tableSumHRF(hrfTable); %% fn = figure('position',[0 0 1500 500]); savename = ['hrfs']; % figure panel 1 params=[]; roiList = {'V1','V2','V3','hV4','VO','...
1b3dff1f145e00c936f387eb51727d2cacaf28ff5029ea9c149b28dc9d30350b
MATLAB
2,209
83
function [out] = EEGfMRIPav_cbm_mod01_osap(parameters, subj) % Standard Q-learning model with delta learning rule. % ----------------------------------------------------------------------- % %% Retrieve parameters: % 1) Feedback sensitivity: nd_rho = parameters(1); % normally-distributed rho rho = exp(n...
6568b6574e05e65cedd66989b05b2bfdf47ea0ce457d5c950662627e26833623
MATLAB
2,209
52
function [W_DSD_greedy, Clist, CID] = greedy_multiple_CID(Wp, func, threshold_DSD) % GREEDY_MULTIPLE_CID performs a greedy clustering algorithm on a weighted graph. % This function applies a greedy peeling algorithm to identify clusters in the graph. % The algorithm iteratively finds clusters until the average value...
74204c76a1938ddf8f9dd8c17c4eb9472b2904d8c100e232bd188bdd85a32dc2
MATLAB
2,212
91
clear close all force warning on imSize = [733, 977]; load('a0_0_bhv2trialStrct.mat'); NIm = {[1:62]}; %{ I = NIm{1} == [... 1 3 15 16 21 22 32 33 34 43 46 54 58 61 62]; NIm{1}(any(I)) = []; %} NIm{1} = NIm{1}'; tic %nMuscimol = numel(dataExp.sMuscimol); %UMuscimol = [0,12,9,4,1]; UMuscimol = [0, 12,9 ...
193cd88efc00979c37e514166c6121ed1452ad544ff96ec9635b9c68ee1dac79
MATLAB
2,213
42
function [TwoAnimalsInteractionTimeInSec, DistanceBetweenTwoAnimalsPixelPerSec]=... Analyze_Free_Video_Results_23012020(filenameBehavioralVideoData,FramesTimesInSec,AssumedFrameRateVideoCam1) %TRACKMICEPOPULATIONSUMMARY Summary of this function goes here % The aim of this function is to extract the results of a v...
80e5d63419f812f28bf1eead4fd0b28b77a4660e0944877430ea4e8341884699
MATLAB
2,213
64
function details = checkForNewVersion % Check whether there is a GitHub release with a new version of the software % % details = zapit.updater.checkForNewVersion() % % Purpose % Use GitHub's releases and the local reported version number to decide % whether there is a new version up on GitHu...
180709e9b51a2cc5eb969028dcd6a345f67c3debcab43bbb2f67e73dd6ba5d92
MATLAB
2,214
65
function betas = taft_preprocess_fit_HRF_trial(job, data) % betas = taft_preprocess_fit_HRF_trial(job, data) % % Take upsampled data epoched into trials, fit separate HRF per trial. % % INPUTS: % job = structure with settings for creating TAfT object, specifically: % .add_intercept= whether to add intercept...
efc577e40585bdb33644b7e4c7f9233e59c8e55ea27353429cefd264f1333736
MATLAB
2,214
51
%Written for the first splintr barcode dataset from Oz FOLDER_NAME = 'ExSeqAutoSlice'; FILEROOT_NAME = 'exseqauto'; for roundnum = 1:30 %Load three of the channels, ignoring ch02 chan1 = load3DTif(sprintf('/om/project/boyden/%s/input/%s_round%i_ch00.tif',FOLDER_NAME,FILEROOT_NAME,roundnum)); chan2 = load3D...
d4c0234c354f603877a57babe7c6d851567229f62c0a975434f23b9bab4edfc2
MATLAB
2,217
81
rand('seed',0) randn('seed',0) N_1=500; N_2=500; N_3=0; GeneralNoise_N=50; N_SubClusters1=10; N_SubClusters2=10; x_c1=1-0.2; y_c1=1; x_c2=1+0.2; y_c2=2; x_c3=x_c1+0.8; y_c3=y_c2+1; R1=1; R2=1; R_noise=0.05; SD_x_3=0.1; SD_y_3=0.1; Y_factor=1; %straching(/squeezing) y vs x GeneralNoise_xRange=[0 2]; GeneralNoise...
4568ee2cb360f8bd5596dded80ddeaabe4bae3a2dfccd1e376575542dfd27571
MATLAB
2,218
59
function channelToUse = choose_channel(chsAvail, chsReqNames, procImgType) %choose_channel - Helper function for choosing channels % % This function is not intended to be called directly. % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % This program is free software: you can redistribute ...
5f721c2832598820b9dd71692a3556266a3e12b257e3e5ea0291ed14e7683ad0
MATLAB
2,218
93
clear all close all currentdiectoryLocation=pwd; addpath(strcat(currentdiectoryLocation,'/functions/')) [decoder.preprocessing.bandPassFilter.b,decoder.preprocessing.bandPassFilter.a]=butter(2,[8 30]/(512/2)); dataLocation = 'expertMIData'; allRunsInfo = dir(fullfile(dataLocation, '*.gdf')); nRuns=size(all...
cd0441b9a9f4a68989f861986ac513d33aeea7c31f6485bbb9d484e962023e8c
MATLAB
2,219
52
function [X_train,Y_train,X_test,Y_test,p,nmax]=problem(xx) % Input and preparation of the training and testing data for the NN model warning off if xx==1 filename='Loan-Approval-Prediction.csv'; % Example 1 data=readtable(filename,'ReadVariableNames',true,'ReadRowNames' ,false,'TreatAsEmpty' ,'-'); ...
a9c2093506dfd6e269b7c5a850e80ce08b9d4e235e39d42ab8d723b419c71dce
MATLAB
2,220
63
clear all averageAllBoutsFromSession = true; substractMouseMean = true; useStdMatrix = false; maxUnknownsEquationsRatio = 0.5; rng(0) load('AllBouts.mat'); for k=1:length(sessionNames) sessionNames{k} = [sessionNames{k},'_MouseID',num2str(MouseIDs(k))]; end if averageAllBoutsFromSession [Da...