sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
268e09a44c9d857fb42b0198e446555df7cdd96f7cca967c3d2bebc4e163a8ae
MATLAB
1,199
37
% Last modification:01/22/2023 % by Peisheng Ding (peisheng.ding@mpi-halle.mpg.de, peisheng.ding@mail.utoronto.ca) function [filtered_image,radii,radii2] = cores_locations(image_input) % this function detect the cores loaction by regionprops % The the outlier data are removed by defining an reasnable range of the...
c751e897e61cdb923a459bfe988e36b4f4735a3f1621f790e7cebe1c320e62f0
MATLAB
1,199
35
function cPointsVolts = calibratedPointsInVolts(obj) % Convert the calibrated points (sample space) into voltage values for the scanners % % zapit.stimConfig.calibratedPointsInVolts() % % Purpose % This method returns voltage values that can be sent to the scanners in order % to point the be...
2f8ad035c881d01d653b2b50bb51098f3eb1801d477cb3d09bdca59cd11d09ed
MATLAB
1,204
31
% op_CSIZeroBaseline % % Takes mean of ppm baseline and substracts spectra by this baseline. This makes % the ppm baseline zero. % % INPUT % MRSIStruct = MRSI structure used in FID-A % ppmBaselineRange = ppm range of the baseline % % OUTPUT % MRSIStruct = MRSI ouput function MRSIStruct = op_...
39e0a363ac17350fdd0cc300240f26d8a96f08d718e5ea9b5a10fdc5472aa430
MATLAB
1,205
1
function dispStringInCenter(display,dispString,vLoc,textSize,colorRgb) % dispStringInCenter(display,dispString,[vLoc],[textSize],[colorRgb]); % % 06/2005 SOD ported to OSX if ~exist('vLoc') vLoc = 0.5; end if ~exist('textSize') | isempty(textSize), textSize = 20; end if ~exist('colorRgb') colorRgb = display.textCo...
dd2178201718ae29059de7e361f122c6f207117a9fdae798201099509cb2e546
MATLAB
1,206
23
function [m, chunk_points_logical]=mesh_extract_triangle_regions(m, triangle_regions, varargin) % Removes all points, triangles and data that are not contained in that % triangle_region. Also all tetrahedra are removed. You can use absolute % region numbers by disabling the relative_numbers flag. % relative_n...
e3daa49d268e43d30dca62d010c5a14b3f40937c2be9e2e705d75766fc7f3d5b
MATLAB
1,206
41
classdef Live2pWS < WebSocketClient properties end methods function obj = Live2pWS(ip, port) % constructor uri = ['ws://' ip ':' num2str(port)]; obj@WebSocketClient(uri) end end methods (Access = protected) function onOpen(obj,message) ...
f8b743c0da9fbaff6e602a577df8a84846b0c6c0b9beb5d1e5a0ab9f2bf11a40
MATLAB
1,207
44
function [trialmat trialmatmod] = sim_trials(lf, hf, num_trials, Fs, num_sec) %function trialmat = sim_trials(lf, hf, num_trials, Fs, num_sec) % %This function creates a matrix of simulated trial data (trials stored as columns) %which contain 'lf' modulating 'hf' PAC. Each trial is 'num_sec' seconds in length %and the ...
3305a916f7a853d036d0c5541cf031ba11fe8df3f8dca9948496f44a71d6eac1
MATLAB
1,208
59
function analogInput_Continuous % Example showing how to record data continuously through an analog input channel % % function out = daqtoolbox.AI.analogInput_Continuous % % Purpose % Records data continuously and plots to screen. % Displays positive values only. % % Rob Campbell - Basel 2016 %Create a session using...
34c35a8ac05292356f0a6dee68014feee3eda337de88def2776fa7b42a5fbef3
MATLAB
1,208
34
%DUSK Black-blue-green-gray-red-yellow-white colormap % % Examples: % map = dusk; % map = dusk(len); % B = dusk(A); % B = dusk(A, lims); % % A black to white colormap with several distinct pastel shades reminiscent % of colors at dusk. This colormap converts linearly to grayscale when % printed in black & whit...
de26e93d38b8edae9397a3eec8a0d9bfe696708acc8a682f5d9a1bbfedbc53dc
MATLAB
1,209
35
function DataMatrix = SubstractMouseMean(DataMatrix, StimuliLabels, MouseIDs,Days,sessionNames) uniqueSLabels = unique(StimuliLabels); uniqueMouseID = unique(MouseIDs); meanPerMouse = zeros(size(DataMatrix,1),length(uniqueMouseID)); for m=1:length(uniqueMouseID) meanCurMouse = 0; cnt = 0; cntVec...
d12ba3fb3b926b42038f2cb3a7d28d4a1f7e5e8220dd681935752281528eccb7
MATLAB
1,211
34
function [R,C,reg] = RectifyStackDFT(vol, start, upscale) [~,~,Nz] = size(vol); % Nx,Ny R = zeros(Nz,1); C = zeros(Nz,1); reg = zeros(size(vol)); %figure('WindowState','maximized'); target = vol(:,:,start); %imgaussfilt(vol(:,:,start), 3); % %forward for i = start:Nz source = vol(:,:,i); %imgaussf...
1318d8470d99775a24a77fb809fa347bc4c153ef1f8c46b558e4a6e7bbe8d260
MATLAB
1,213
33
function MRSIStruct = op_CSIZeroFillTime(MRSIStruct, numPointsToZeroFill) arguments MRSIStruct (1, 1) struct numPointsToZeroFill (1, 1) double {mustBePositive} end checkArguments(MRSIStruct) [MRSIStruct, prevPermute, prevSize] = reshapeDimensions(MRSIStruct, {'t'}); data = getData(MR...
0714c310c0ad28595d4607fb66611f739b058bff13c0738cbf3ec7bddbceffb8
MATLAB
1,219
31
function mask = choose_mask_rows(self, strBoundary) %choose_mask_rows - Protected class method to choose an individual mask % based on the image rows % 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 term...
6d7866ad2133f8782f3086c6b5e170011535fdefa0fd65d629085f397e20977c
MATLAB
1,219
32
function tf = is_deeper_than(strFun, varargin) %is_deeper_than - Check if the level of recursion is deeper than a limit % % 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 it and/or m...
f664c89f371c89f6b8e3de7855880db6baeaf37aca619891f67171a05738f339
MATLAB
1,219
34
function trace = measure_ROI(imgSeq, xIdx, yIdx, propagateNaNs) % 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, ei...
b66f38bf3e8c8949257019b7c91d5cd875ede912704ce1dfcb62eefbf8b7a0e1
MATLAB
1,220
38
function plot_frame(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 Licens...
e33877d7f33d6ad944d98e049ea104a427cf03b2419e42afa8573e3af959b557
MATLAB
1,221
25
function [metabolitePlotArray, lcModelYIndexRange, lcModelXIndexRange] = makeLcModelHeatMap(lcModelTable, selectedMetaboliteIndex) lcModelYIndexRange(1) = min(lcModelTable.Row); lcModelYIndexRange(2) = max(lcModelTable.Row); lcModelXIndexRange(1) = min(lcModelTable.Col); lcModelXIndexRange(2) = max(lcMo...
961b3433c7e065b1751370b3550ed81f413131f76ef225acd8be4ea377b306af
MATLAB
1,222
47
%% check_dist_tree %% test 1 dLPTCs = load_tree ('dLPTCs.mtr'); for counterN = 1 : 100 for counter = 1 : length (dLPTCs{1}) tree = dLPTCs{1}{counter}; dist_tree (tree, [50 100]); end end %% test 2 dist_tree (sample_tree, [50 100], '-s') tprint ('./pane...
bc79fff84cf515d187d7c381bff197806dc4f650e7fc5c9e4f9bf6d21aca698f
MATLAB
1,222
35
function analyze_simulations(i) addpath('/lustre04/scratch/nbrake/code/simulation_code'); folder = '/lustre04/scratch/nbrake/data/simulations/mixed_input'; [sa,X] = network_simulation_beluga.getHeadModel; compute_spectrum(sa,fullfile(folder,'baseline')) compute_spectrum(sa,fullfile(folder,'high_aperiodic')) compute_s...
4fba120777e45dd73a8c7675b0f1fe1e247efb2b5bfce0794eb3343e6af12c4b
MATLAB
1,224
41
function [outVars] = missedTargetDetector(All,outVars,opts) numExps = numel(All); c=0; ensMissedTargetF = []; ensMissedTarget =[]; for ind = 1:numExps us = unique(All(ind).out.exp.stimID); for k=1:numel(us) s = us(k); sidx = find(us==s); % h is the hologram ID h = All(i...
3f44f7571969214ab8ee0089ae76f8dc2ad473d62622b177b1e2599de2a1d66a
MATLAB
1,227
31
function mask = choose_mask_columns(self, strBoundary) %choose_mask_columns - Protected class method to choose an individual mask % based on the image columns % 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...
580383bb0fe069ce909b86e78b990322ca9f7f8b296da6e1f09244c0b79b91cf
MATLAB
1,227
38
%decc_plotFigS1 % Related to Viswanathan, Stein, Nieder, PLOS Biol, 2024 % PV 2024 load('DECCdataFigS1.mat') % PLOTS for m = 1:2 %for monkey % Scatter plots (Figure S1B) figure1 = figure('Color',[1 1 1]); pos = [100, 100, 80, 120]; set(gcf,'Position',pos) set(gca,'XLim',[1-0.5 2+0.5],'XTick',1:...
d4110f11d6c6a02411a6868bcd5473b996b93a96b89525469a3a6c170b215183
MATLAB
1,228
47
classdef Mock_Data < Data & IMock %MOCK_DATA Summary of this class goes here % Detailed explanation goes here % ================================================================== % properties time raw1 raw2 processed1 processed2 mask1 m...
df561b07642445ee20585314c0de21ec782668bfc9b591037fda84458ddba990
MATLAB
1,228
27
function [ PCuse ] = defaultPCs(~, mixedfilters, FOV) %defaultPCs - Select PCs to analyze automatically % defaultPCs selects range of PCs to be used for further analysis % automatically. The bounds of cropped interval are determined by amount % of structural information in the PCs and expected number of relevant ...
00daa0ef9a1a20227d6ef8d6429af77a9547c35afade5fd4a5e85a375ed7811a
MATLAB
1,229
33
function f = LK_PlotAvFRForPrefAndUnprefObjects_20231008(dt) % % LK_PlotAvFRForPrefAndUnprefObjects_20231008 plots the average firing rate % for preferred and unpreferred objects. % % Input is a structure with multiple fields. % % Output is a figure handle. % % Lukas Kunz, 2023 % create figure f = figure('units', 'cen...
60058d7265270e1ff53f34a2951c91eca50bde5243382250945fe20176de6768
MATLAB
1,229
35
folder = fullfile(pwd,'example_embedding'); % Initialize network network = network_simulation_beluga(folder); % Initialize post network network = network.initialize_postsynaptic_network(2,[1,2]); network.spikingFile = fullfile(network.preNetwork,'spikeTimesLong.csv'); % Presyanptic network parameters nPreNeurons = 3...
a3113735b2dddfd6d7244c48a34028deae7918c98e8d649a8ffde46a755c3e51
MATLAB
1,230
32
function crop_and_move_files(round_num) %interpolateDataVolumeSummary Load data and upsample the data FILEROOT_NAME_INPUT = 'exseqautoframe7i'; FILEROOT_NAME_OUTPUT = 'exseqautoframe7icrop'; %Taken from Fiji so the XY might be measured from the wrong origin YRANGE = 451:950; XRANGE = 1001:1500; ZRANGE = round(43*(.5/...
765f0ce21ecb6fe0758cd33d80fae367ce0f6aa13123dec7f36aa635ae9ef505
MATLAB
1,236
43
function [Rair,Rarg,Rh1,Rh2,Rw,Kair,Karg,Kh1,Kh2,xh1,xh2] = mfc_param_read_v2(fileID) % Reads MFC parameters from LabVIEW log file header % reads ranges, k values and hydrogen concentration % skip the header header = 5; for k=1:header fgetl(fileID); end fscanf(fileID,'%s',2); % reads the words before the numeric...
dddcb2199c8af6642333d28a4e4efbe065aff39825ab143132c0e79a34abcd89
MATLAB
1,236
42
% normalization function success_code = normalization_cuda() loadParameters; if length(params.SHIFT_CHAN_STRS) ~= 4 disp('# of channels is not 4.') return end arg_list = {}; postfix_list = {}; run_num_list = 1:params.NUM_ROUNDS; for run_num = run_num_list arg_list...
ee5ad563ed66caeb19f8c726e0a09bc219572e5c608a8ad9e7c511653f5690d9
MATLAB
1,237
33
function checkaddpath(dirPath) %checkaddpath - Check a directory is on the path, and add it if needed % % checkaddpath(DIR) checks that the directory DIR, a subdirectory of the % CHIPS root directory, is on the matlab path and, if it is not, adds it. % % See also utils.CHIPS_rootdir, path, addpath % Copyright ...
02149d27de272f08aaac76c79d405f9f173deabab35247931bc7b79d73777b0b
MATLAB
1,238
53
function [img_sequence, nimg, img_durations]= mkTemporal(ExpDesign,temporal) % counterBalance spatial and temporal conditions. % Tries to minimize presentation order bias % nSpace = 36; nTemporal = 9; % output % ExpDesign: temporal sequence of [Run X Spatial Loc] % % %% % nFrames ifi = 1/temporal.fs; if ifi ==60 ...
c37a0c1dd2ba95d65ab3a0017b6fddf2cf41509865dfa0173209ceb7dec92f59
MATLAB
1,239
36
function tf = is_on_worker() %is_on_worker - Is the current execution occurring on a parallel worker % % TF = is_on_worker() returns a binary flag specifying whether the % current execution is taking place on a parallel pool worker. % % See also getCurrentTask, gcp, parpool % Copyright (C) 2017 Matthew J.P. B...
109617f31eff44c66c6d1c22a38b1ee39c045d9721b36779fbd46bde7fbff4c7
MATLAB
1,240
34
function DataMatrix = SubstractMouseMeanWithNans(DataMatrix, StimuliLabels, MouseIDs,Days,sessionNames) uniqueSLabels = unique(StimuliLabels); uniqueMouseID = unique(MouseIDs); meanPerMouse = zeros(size(DataMatrix,1),length(uniqueMouseID)); for m=1:length(uniqueMouseID) meanCurMouse = 0; cnt = 0; ...
3194333629e262d8a067a4c11ad8266d9fd0d4df8184ee5543d97963c0ec69a9
MATLAB
1,241
34
% getTemporalPts.m % Jamie Near, Sunnybrook Research Institute 2024. % % USAGE: % NPtemporal = getTemporalPts(kTable,MRSIStruct) % % DESCRIPTION: %This function accepts as input a "kTable" (the output of the function %'readkFile.m' for a rapid MRSI seuqence and the corresponding MRSI %structure 'MRSIStruct' and retu...
8f281736c0c54ab81b33ee3e5a0eab765fe9e395c175a1d3b7ceefcebc8776d2
MATLAB
1,242
29
function [genotypeStimArray, nFlies, varargout] = getGenotypeStimArray(validTimeSeriesCollection, ... genotypeStr, stimStr) genotypeInds = arrayfun(@(x) ~isempty(strfind(FindSessionPrefix(... x.dataPath{1}, x.dataPath{2}, x.dataPath{3}...
27428f85783c3cea5e151cb417d1879f5813b67ec3aa9ee01b7f8a9fbc1e8325
MATLAB
1,246
48
% INTERPD_TREE Interpolates the diameter of the nodes between two node indices % (trees package) % % tree = interpd_tree(tree,ind) % --------------------------------------------- % % Linearly interpolates the node diameters between two node indices % % Input % ----- % - tree ::structure: structured tree % - ind...
27d4778040b2b18203248c7817bbbcb74737cd271860caa8418c4c7cdb0d9fe4
MATLAB
1,246
36
function plotONOFFTracesFromCell(allNeuronsOnOffTraces, cellTypeStr, figDir, colors) cLims = ZeroCenteredBounds(cat(1, allNeuronsOnOffTraces{:}), [0 100]); hFig = createPrintFig(13 * [1 1]); hSubAx = plotLasagnaTracesFromCell(hFig, allNeuronsOnOffTraces, colors); nNeurons = numel(allNeuronsOnOffTraces); ylabel...
78b19cf083f06521a98e05f73c140b3a5754fa829c55ed6b0cb75b48e844594e
MATLAB
1,246
39
function [data_bin, ts_dig, dig_Fs, dig_file_ver, dig_num]= PhotometryLoadDigitalInputs(filename) %% Load file % filename = 'Test_20190719.dig'; fid = fopen(filename, 'rb'); file_data = fread(fid, 'uint32'); fclose(fid); %% Process data dig_file_ver = file_data(1); if dig_file_ver == 1 dig_num = file_data(2); ...
bd46ae0304fc0b523f3c11521bd477d41d6ded06dedb0710cbe59631801c7ecb
MATLAB
1,247
68
clear close all force warning on imSize = [733, 977]; load('a0_0_bhv2trialStrct.mat'); NIm = 1:62; tic UMuscimol = [0, 12,9 ,4,1]; nMuscimol = numel(UMuscimol); UMonkey = [1,3]; nMonkey = numel(UMonkey); NIm = [7 11 25 27 38 39 40 47 49 53 56 60...
bf859e0055b150710900e31a97f938a9c8d6bc2fc69ff2405ec7197130bf37a6
MATLAB
1,249
54
function [h,F] =plotwitherror(x,y,isstdrr,varargin) if(strcmp(isstdrr,'CI') | isstdrr == true) ymu = nanmean(y,2); % ymu = nanmedian(y,2); z = icdf('norm',0.975,0,1); ylo = ymu-z*stderror(y')'; yhi = ymu+z*stderror(y')'; elseif(strcmp(isstdrr,'SE') | isstdrr == false) ymu = nanmean(y,2); ylo = ymu-stde...
ed46ef69b28876286571d164a2169a11b9e8c5eebcd478d38095e28b75de6d55
MATLAB
1,249
54
function stage_registration() loadParameters; % sub-stage 1: calculate descriptors ret = make_links_in_normalization_dir(); if ~ret return end [ret,messages] = check_files_in_calculateDescriptors(); if ~ret calculateDescriptorsInParallel(); [ret,messages] = check_...
2fcdb9ad92309fc1907482fa162b3ca7c1ee2b78c66c007a33c1571a47819409
MATLAB
1,252
40
function [Power2D, SF2D, Power1D, SF1D] = CalculateSpNoiseSpectrum(RespTrial, SizePxl) %% % [Power2D, SF2D, Power1D, SF1D] = CalculateSpNoiseSpectrum(RespTrial, SizePxl) % % Calculate the noise power spectrum of the signal (mean subtrated power % sprctrum), given RespTrial (HxWxT) and pixel size SizePxl. Retur...
4d422ddf3010fad34d6f17823d332c842817bb2e0ed546fe9634a0447a28f316
MATLAB
1,252
49
function clickPosReporter % clickReporter % % Brings up a figure window which places a marker on the % axes where the user clicks. Each time the user clicks, % marker moves and the position is reported to the title. % % % Make an empty figure window fig = figure(7824); fig.Num...
b53a85e8ab64d3b6b00aa0ddf1757ddc9c435dc01ce418ffe0ef848696979b4d
MATLAB
1,252
51
function f = LK_HistogramFigure_20220321(dt) % % LK_HistogramFigure_20220321 creates a histogram figure. % % Input is a structure with multiple fields: % figPosition % axPosition % data % binEdges (optional) % normalization (optional) % xline (optional) % xlabel % ylabel % title (optional) % fontSiz...
67d5eef4b125c45017d9efebec12eae74b0fc16e625f54938635cf38d5c9c26b
MATLAB
1,254
51
function y = nansem(x,dim) % FORMAT: Y = NANSEM(X,DIM) % % Standard error of the mean ignoring NaNs % % NANSTD(X,DIM) calculates the standard error of the mean along any % dimension of the N-D array X ignoring NaNs. % % If DIM is omitted NANSTD calculates the standard deviation along first % non-singl...
0d83ba0175148bd6fae87352804b8c9ba7746447d8c3a52cf6d7f94e29b91b4b
MATLAB
1,255
58
function [uF,uA] = testPointPlace % Test adding points to a figure window by clicking on the plot uF = uifigure; uA = uiaxes('Parent',uF); uA.DataAspectRatio = [1,1,1]; % Make axis aspect ratio square pan(uA,'off') zoom(uA,'off') grid(uA,'on') uA.XLim = [0,1]; uA.YLim = [0,1]; ...
4570074f646974e60d7f3a8261b031e0706e85c99ba248a72e423a0179986cbd
MATLAB
1,255
48
function r = LK_PearsonCorrelation_20220816(v1, v2) % % LK_PearsonCorrelation_20220816 estimates a Pearson correlation between % the two vectors v1 and v2. This implementation is faster than Matlab's % corr function. % % Use as: r = LK_PearsonCorrelation_20220816(v1, v2); % % Input: % v1 --> n x 1 vector; % v2 --...
5800c0421cdd5db2007cba8622d6f5d4f3e9ccb3fe70d58a545c2cef50698c0b
MATLAB
1,255
47
function bool = checkfields(s,varargin) % Check for the presence of a field, possibly nested, in a structure % % bool = checkfields(s,varargin) % % We often check for a field that is nested within other fields within a % structure. We have been doing this with a series of nested or grouped % isfield statements. This...
cf16fbec95bc79a304432fc0d17c91339c396c4c3bb6d0ad694902e1f3d473bb
MATLAB
1,255
33
function [sagital_voxels, coronal_voxels, transverse_voxels] = findIntersectingVoxels(voxels, center) numSagitalVoxels = 1; numCoronalVoxels = 1; numTransverseVoxels = 1; sagital_voxels(numel(voxels)) = Voxel(); coronal_voxels(numel(voxels)) = Voxel(); transverse_voxels(numel(voxels)) = Voxel();...
633c73111d43d8be76f7462d68e15916a23b755a0bef74831416cdff5afc0968
MATLAB
1,257
51
function [U D,n_eig] = gen_eig(A,B,option,n_eig) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Extracts generalized eigenvalues for problem A * U = B * U * Landa % n_eig -- Number of eigenvalues to compute (optional) % option = 'LM' or 'SM' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
2ae779ae31be969864c033d83a06d653c618e4e82683d1aee873bc07af162cfa
MATLAB
1,260
37
% the pattern separation toolbox: analyse spike train ensembles % Copyright (C) 2022 Alexander D Bird function [output_spiketimes] = spike_thinner_temporal(input_spiketimes,n_rep,filt_len) %SPIKE_THINNER_TEMPORAL Removes spikes from input trains if they are within %'filt_len' of the previous spike. if nargin<2 ...
3c1d0a0e158a9350d8670f48810ea258308b3583894b7da434a34398a2d0a5a3
MATLAB
1,261
28
function [amplitudeArray, positionArray, widthArray, responseIndArray, ... categoryLabel] = getParamsArrayFromStimTable(StimTable, qualityMeasure) [fitParams, gof] = getFitParamsStructArrayFromTable(StimTable); % domain = StimTable.nonParamTuning{1}(1).domain; switch qualityMeasure ...
14c813ca5fbbd2a878ec0d9830c49008a606be218bbd1e45c292d228aea1a589
MATLAB
1,264
28
function [ firing_rate ] = create_firing_rate_matrix( full_firing_rate, angles ) % 'angle' should be between 0 and 2 * pi global NUMBER_OF_ESTIMATED_ANGLE_BINS BEHAVIORAL_SAMPLE_RATE BEHAVIORAL_SAMPLES_PER_TEMPORAL_BIN; CENTER_OF_ESTIMATED_ANGLE_BINS = [0.5 * (2 * pi) / NUMBER_OF_ESTIMATED_ANGLE_BINS:...
60d496b3e14607ab4b18f4af491532addc9331216153931b5e4731c64b858916
MATLAB
1,264
41
classdef Test_Config_params < matlab.unittest.TestCase %Test_Config_params Summary of this class goes here % Detailed explanation goes here % ================================================================== % properties (TestParameter) classConf = utils.find_subclasses('Config'); ...
ab2f5a13317688f01c1e946d45df5a70b522f636fc274c88caa28a5ddaf4ae0c
MATLAB
1,264
57
% SAVE_STACK save images into a file. % (trees package) % % name = save_stack (stack, name, options) % ---------------------------------------- % % save images from a stack into a matlab type file % data has to be in the following form: % stack.M::cell-array of 3D-matrices: n tiled image stacks containing % fluore...
2d14d652116bf56b40540261a1a9a664b24cf48e8a809e11e36bc3a9cb2ea29e
MATLAB
1,265
49
function outliers = removeOutliers(X,obsdim,prc) %flip so observations are on first axis if obsdim ~= 1 X = X'; end Report = zeros(size(X)); n = size(X,2); %variables outliers = []; for i = 1:n x = X(:,i); finf = find(isinf(x)); fnan = find(...
f22dcf44eeccfe1068abf1880f7041753d57e9866db014c9b40e0b7dce8ba773
MATLAB
1,265
49
function f = plot_distributions(data, colors) width = 0.5; % mammals base = 1-width/2; % mammals % figure; for idx=1:length(data) curr_data = data{idx}; nObs = size(curr_data, 1); jit = (rand(nObs,1))*width; jit = jit + base + idx-1; f{1,idx} = scatter(jit, cur...
841b3357c2e8fbd31ada8725450c8aed995f5830c98b1485e311ab4c64b89af3
MATLAB
1,267
42
function [correctimage, countimage]=applyOffset(imagedata, iFrame, ... offsets_pf, edgebuffer, correctimage, countimage) %pick out the number of frames and size of images [~, Sy, Sx]=size(imagedata); %loop over the lines we are considering placing for jLine = 1:Sy-2*edgebuffer %pick out the line of the data ...
1761c2c6e30e4fcf9bc4864863def0e0a8d72bdb286c4b95545d2347367d70dd
MATLAB
1,268
36
function update_rawImg_props(self) %update_rawImg_props - Class method to ensure that all appropriate % properties are updated when the rawImg property changes (e.g. when % constructing an ImgGroup). % Copyright (C) 2017 Matthew J.P. Barrett, Kim David Ferrari et al. % % This program is free software: you can...
f26681b047e35561a78399e9206bfad02774a5137050bf4582e3a8867ba70413
MATLAB
1,268
29
function citation() %citation - Output the citation where this software was first published % 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 ...
4cf23f06df1918442e63e45992dcdd9e60cec4c8a60e878c41181189ac2b94d3
MATLAB
1,274
32
function [maskFilters, maskSegments] = ROIsToMask(self) %ROIsToMask - Create mask from ROI pixel data % % [maskFilters, maskSegments] = ROIsToMask(OBJ) requires a % CalcFindROIsCellSort object and returns second stage of ROI % masks produced by the CellSort algorithm. The third stage is yet to be % exploited (i...
1a9ea916029f93c5ffb9c129ef06aee27fd9d2532fad49df601be84795b61f1c
MATLAB
1,276
36
function f = LK_PlotCoactivityAdditionalInformation_20231015(dt) % % LK_PlotCoactivityAdditionalInformation_20231015 plots additional % information related to the coactivity maps. % % Lukas Kunz, 2023 % create figure f = figure('units', 'centimeters', 'position', [2, 2, 7.5, 6]); % plot data axes('units', 'centimeter...
8c201e2dea8f8883f4579c22c352dc22c71a58f702765bedae4dd2febb8fa424
MATLAB
1,276
30
function out = getONOFFParamsFromTable(StimTableNeuronStim, varargin) if nargin > 1 nToExcludeFromEnd = varargin{1}; else nToExcludeFromEnd = 1; end for iNeuron = 1: size(StimTableNeuronStim, 1) responseInd{iNeuron} = [StimTableNeuronStim{iNeuron, 1}.responseIndex{:}]; params = [StimTableNeu...
39289d286930c9818c19fedd557e8daa6a7c2e0cf37d52075789ab781ef6a804
MATLAB
1,277
42
function [x,a]=data_prep(data) % Preprocessing Data: change strings with numbers [m,n]=size(data); x=zeros(m,n);k=0; for j=1:n if isreal(data{1,j}) x(:,j)=data{:,j}; elseif isdatetime(data{1,j}) x(:,j)=datenum(data{:,j}); else b=str2double(data{1,j}); if ~isnan(b) ...
f63c38497707166c43757416aa0ace13f35e21126fb4d156b57cae4c2b3e8acc
MATLAB
1,277
39
classdef Test_CalcDetectSigsClsfy < matlab.unittest.TestCase %Test_CalcDetectSigsClsfy Summary of this class goes here % Detailed explanation goes here % ================================================================== % properties (Constant) end % ================================...
763310187362887635aa745516a136879092def21fe22e2d451306c3012649c1
MATLAB
1,278
34
function [ merge_flags ] = calculateMergeFlags( puncta_centroids,MERGE_DISTANCE) %calculateMergeFlags For a cell array of centroids per round and a distance %for which it's likely that two (or more) puncta could get merged if the %colors were the same, give each puncta a number for the possible merge %errors around it ...
b3d4443e5674ed3b544f9c32752ff72fcf0c5f8ea2e31c5fbca4e62b5237eb8f
MATLAB
1,280
68
%mice are in this order: clear; close all; clc % % Slowing % ylab = 'Predictive Slowing (%)'; % A = [78.15801024 % 62.52792071 % 60.00126751 % 79.71455351 % 85.03011564 % 74.70156268 % 72.00241561 % ]; % B = [81.85264945 % 74.96015417 % 75.06798356 % 68.97577327 % 56.49964455 % 65.69598949 % 71.69...
28ac93d12530ff3346ff4dd7ee26df4a9d8b6908d537735c578706590b61c3df
MATLAB
1,281
45
%% check_angleB_tree %% test 1 angleB_tree (sample_tree, '-m'); %% test 2 dLPTCs = load_tree ('dLPTCs.mtr'); for counterN = 1 : 100 for counter = 1 : length (dLPTCs{1}) tree = dLPTCs{1}{counter}; angleB_tree (tree); end end %% test 3 angleB_tree (sample_tree, '-s...
d0b6aea8ef23444069762cbcc73cc967d72966b690fdcd8d32729e3377bb46d4
MATLAB
1,282
40
function [xVolts, yVolts] = pixelToVolt(obj, pixelColumn, pixelRow) % Converts pixel position to voltage value to send to scanners % % function [xVolts, yVolts] = zapit.pointer.pixelToVolt(obj, pixelColumn, pixelRow) % % % Purpose % Converts pixel coordinates to volt values for scanner mirro...
54061fd1e326eec22c104d2891f93d079a7125bec60981c899872b0a1d2344e2
MATLAB
1,286
56
%% Stream Example % % <html> % Read a streaming data store into Matlab from Tank server during a recording <br> % </html> %% Housekeeping % Clear workspace and close existing figures. Add SDK directories to Matlab % path. close all; clc; [MAINEXAMPLEPATH,name,ext] = fileparts(cd); % \TDTMatlabSDK\Examples [...
99e729f7fcec6aaadbbf9c34236519a3822716d3955d98ac7e0b3ab1cd7d4464
MATLAB
1,286
43
function varargout = plot_trajs(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 o...
0c18e9565750ae35720161251540c09216a02501bc9916805089cd77bdd9fe57
MATLAB
1,287
27
%function [rSpk, Res, Clu] = GetRawSpk(DatFileName,Res,Clu,nSpkSamples,Channels,Par) %loads from .dat file the waveshapes of spikes corresponding to Res/Clu from given Channels % nSpkSamples is either number, then the waveshape will contain equal number of samples left/right or a 2 element vector [left right] # of ...
36b4ce53e97be563689af4556cc0785e8072ef7f3132f1ac564e83d344374888
MATLAB
1,289
41
svrobj = svr({'C=1', 'optimizer="andre"', kernel('linear')}); dataobj = data('spider data', double(discovery.dat)', discovery.Y); % clear rating [~, svrobj] = train(svrobj, dataobj, loss); weights = get_w(svrobj)'; bias = svrobj.b0; % save('VIFS', 'weights', 'bias', '-v7.3'); % load('Discovery_dataset.mat'); ...
1a8f5bdcf71e545c43e6da1d47f701a0cfcb49cf4e32f4029b5c9516f1263a00
MATLAB
1,290
56
%% Stream Example % % <html> % Read a streaming data store into Matlab from Tank server during a recording <br> % </html> %% Housekeeping % Clear workspace and close existing figures. Add SDK directories to Matlab % path. close all; clc; [MAINEXAMPLEPATH,name,ext] = fileparts(cd); % \TDTMatlabSDK\Examples [...
cbe5bbca48b632c64bab5fc16a81bc80977ffdd4b0d017a2e280c233c4e1f8a8
MATLAB
1,292
43
% op_CSIPlotVoxelfids.m % Brenden Kadota, SunnyBrook Hosptial 2021. % % USAGE: % [out]=op_CSIPlotVoxelfids(in, x, y, ppmmin, ppmmax, xlab, ylab, title); % % DESCRIPTION: % Plots the fids of one voxel in the CSI FID-A structure. Additional % arguments augments the output plot. Uses the op_plotfid function. % % INPUTS:...
53d0ec7e5a8c69dbdf64317824d3194e11c3134499ee7c63eb2cd00554f16b93
MATLAB
1,293
37
function generate_images() addpath(genpath('TOOLBOX_DIR/BrainNetViewer_20191031/')) addpath(genpath('TOOLBOX_DIR/vistasoft/')) niis_dir='PROJECT_DIR/results/restfmri/dnn/niis/indiv_niis/'; output_dir='PROJECT_DIR/results/restfmri/dnn/brain_plots/indiv_plots/'; file_list=dir(niis_dir); for nii_...
29616414d84d86acf9614c8f02f726078114104241d95b9f4424e14a898c075b
MATLAB
1,294
25
%Swapping the target directory %MUST be ran in root repo directory! %Eggplant directory: %target_dir = '/mp/nas0/ExSeq/AutoSeq2/xy10HP'; %No trailing slash! %target_dir = '/mp/nas0/SplintR/09deconv'; %No trailing slash! %target_dir = '/mp/nas0/SplintR/09deconv'; %No trailing slash! target_dir = '/mp/nas0/SplintR/09dec...
744a1129782b1b7f11ee395479bc730b43c15d879af559e9db7d67d70e8ba2e4
MATLAB
1,295
29
function [spikeMat, tVec] = t2n_poissonSpikeGen(freq, par, nTrials) % This function creates Poisson spike trains at a frequency 'freq' the % output is a spike matrix and a time vector, both which can be used to % define a artificial NEURON VecStim that follows such a spike train. % % INPUTS % freq desired freq...
e657e74e0a6e6a663e7c6afe2240b64127b5258b2115bdf3ebdab49867c7628f
MATLAB
1,295
27
% CONSTRUCT % % functions to generate synthetic trees % % Files % allBCTs_tree - Outputs all possible trees with N nodes. % BCT_tree - Creates a tree from a BCT string. % clean_tree - Cleans a tree from nodes inside of main branches. % clone_tree - Cloning a tree type using the MST c...
2fde131c883d4b3c7d6930427f0dbab46eb9ac570df9f3407fa7d6c9d70c6c38
MATLAB
1,296
35
function [ roiTcs ] = ApplyROIsToStack_TimeCourse( I, roiStruct ) % takes a 3D stack and roiStruct and extracts time courses from the stack % for the ROIs. adapted from matlab file exchange 26482. this approach is % ~3x faster than my original approach, which obtained a ROI's timecourse % by repmat'ing the mask to the ...
110df5d14788a115f134d182c9ac71ffd5e6e11a1355383afc1e5abb7b6e4132
MATLAB
1,298
43
function bfunc = basisFuncSphHarm(obj,n) % Outputs basis function for index n of spherical harmonics % n = index of phs_spha in sampHighOrder.m x = obj.phs_grid.x; y = obj.phs_grid.y; z = obj.phs_grid.z; switch n case 1 bfunc = ones(size(x)); case 2 bfunc = x; ...
dc8bce759fe36e13e47570573b12768497503fd61ef606ef08feb01664b6f9c0
MATLAB
1,298
40
function varargout = plot_average(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...
a878aac49ba78717b5bc423c577d21e908ac14c997037807fd584acdb861317e
MATLAB
1,299
48
function [h,p] = my_sig_test_fdr(pacval, pac_shf_values, alpha, measure) % function [h,p] = my_sig_test_fdr(pacval, pac_shf_values, alpha, measure) % % Returns a binary value for significance 'h' and a p-value 'p', given a % value under analysis 'pacval', a distribution of values for comparison % 'pac_shf_values' and a...
84ee251582db36b84e9beaa3e3d2f60e8932e3cb53ac9a3d7aa95fa6bcf18725
MATLAB
1,300
45
%% Trigger Input % % <html> % This examples shows how to start a Synapse recording using an external % trigger into your processor <br> % Matlab monitors the bit input and controls Synapse state <br> % </html> %% Housekeeping % Clear workspace and close existing figures. Add SDK directories to Matlab close a...
8d37535f9edbd832d34019e7c3a5ea0efd7263c5fdfe0201f7894940cfc0e49f
MATLAB
1,300
48
function [bp_sig1, bp_sig2] = filt_signalsWAV_bp(sig1,sig2,... Fs, freq_vec, width) % function [bp_sig1, bp_sig2] = filt_signalsWAV_bp(sig1,sig2,... % Fs, freq_vec, width) % % This function band-pass filters sig1 and sig2 using a wavelet filter. % Bandwidth of filter assumed equal to the difference between max(f...
0678e6dec7b857ddefc8b6d34e64af04284e7a8e93d017ddf6aaed03142227ef
MATLAB
1,301
33
function MakeSbxZ(sbxPath, sbxInfo, shiftPath, varargin) % Load interpolation results load(shiftPath,'-mat'); RS = RS1 + RS2 + RS3 + RS_chunk; CS = CS1 + CS2 + CS3 + CS_chunk; ZS = ZS1 + ZS_chunk; tic fprintf('\nLoading %s', sbxPath); tic; sbx_data = readSBX(sbxPath, sbxInfo, 1, sbxInfo.Nscan, -1, []); toc ...
88e4bcd4af9e2b6369e609dd42e9a5ab920a1cbb03ed4f209b5d6d9b9574e97b
MATLAB
1,303
38
function c = redblue(m) %REDBLUE Shades of red and blue color map % REDBLUE(M), is an M-by-3 matrix that defines a colormap. % The colors begin with bright blue, range through shades of % blue to white, and then through shades of red to bright red. % REDBLUE, by itself, is the same length as the current figu...
ff8d9c0471dad58773b00d9b615fe27da9aea18a7ead53f58c4a1b3e555ad232
MATLAB
1,305
39
function [ b_out ] = A_pca_3d(Fpsf, weights, x, Size, BG, padding) % [ b ] = A_pca_3d(Fpsf, weights, x, BG, pad, crop) % Fpsf: 2D Fourier transform of PSFs, size Ny x Nx x Npc x Nz % Ny - num pixels in y (after padding) % Nx - num pixels in x (after padding) % Npc - num of spatially varying PSF...
97a0adff935d6c85e9d8e994f9de679525a13e766d5427e7974e194f238f9246
MATLAB
1,307
33
dataFolder = 'E:\Research_Projects\004_Propofol\manuscript\Version3\Data'; load('E:\Research_Projects\004_Propofol\data\experiments\scalp_EEG\raw\time_series_all_channels.mat') load(fullfile(dataFolder,'data_time_information.mat')); t0 = timeInfo.infusion_onset-timeInfo.object_drop; elName = {'Fz', 'Cz', 'Pz', 'C3', ...
c4561230855eb1753276c62b9e5b34a02c7cefa65cab315198a3969bb82be6e9
MATLAB
1,309
43
function [shuffled_output_spiketimes] = spike_expansion_random(input_spiketimes,n_exp,n_rep,p_del) %SPIKE_EXPANSION_RANDOM Expands input spike trains into random numbers of output units if nargin<2 || isempty(n_exp) n_exp=5; end if nargin<3 || isempty(n_rep) n_rep=8; end if nargin<4 || isempty(p_del) p_del=...
f368d881aaaadc719a6e82c88d95438a7098575f5d9788eab7521877c39892c1
MATLAB
1,309
46
function [xVolts, yVolts] = mmToVolt(obj, pixelColumnInMM, pixelRowInMM) % Converts position in the image in mm to scanner voltage value to send to scanners % % function [xVolts, yVolts] = zapit.pointer.mmToVolt(pixelColumnInMM, pixelRowInMM) % % % Purpose % Converts mm coordinates to volt v...
8721673f95b49c77b38915acb93a53decb8013126a702af7c4ae3c2c2239aad1
MATLAB
1,313
33
load('figure_2_data.mat'); % The variables "all_wake_thal_to_cort" and "all_wake_cort_to_thal" contain % the average normalized patterns of spectral information transfer between % the thalamus and cortex, estimated on a sub-sample of our data, for 9 % human ET patients, 8 Long-Evans Rats, 7 GAERS rats, and 5 C57/BL6 m...
291a50db752fa87bc24e150ac9e22bbaba8bb45d548103c8cc4708f64afc0385
MATLAB
1,314
40
function initialize_network(masterFolder,branchNo,arrayID) addpath('/lustre04/scratch/nbrake/code/simulation_code'); fid = fopen('dyad_morphologies.txt'); txt = textscan(fid,'%s%s','Delimiter',','); mTypes = cat(2,txt{:,1},txt{:,2}); for j = 1:10 i = 10*(arrayID-1)+j; m_ID(1) = mNa...
d2811e320ee3ff9c60bac439e02e7da86261db0143847e62baa4fed2e4ac9320
MATLAB
1,315
45
%% check_dissect_tree %% test 1 dLPTCs = load_tree ('dLPTCs.mtr'); for counterN = 1 : 100 for counter = 1 : length (dLPTCs{1}) tree = dLPTCs{1}{counter}; dissect_tree (tree); end end %% test 2 dissect_tree (sample_tree, '-s'); tprint ('./panels/dissect_tree1', ...
1af744a96a3422a0ff4e0e7bf71f810fa35f947496fd62a3109cfc4c1024f75c
MATLAB
1,316
35
function pac_plot_fun_tf(pacmat, time_vec, amp_freq_vec, measure,... structure1, structure2, dataset, ph_freq) % function pac_plot_fun_tf(pacmat, time_vec, amp_freq_vec, measure,... % structure1, structure2, dataset, ph_freq) % % This function plots a PACgram with time along the x-axis and modulated % (higher) f...
3e48241acb8043dcd622a9b92a7248114f864450072fbf2441904de97fc538ca
MATLAB
1,316
38
function goi = goi_gradients(ts,maxorder,biascorrect) % Compute low order O-infomation descriptor of data % INPUT % ts input (observations x variables), time series or static/behavioral data % maxorder maximum order for the gradients % biascorrect apply or not bias correction for en...
94a5a1fd61418ed8997dcf6d7f6c3bb6e6b46161d26b1d85a44f18f0222e27b4
MATLAB
1,316
57
raw_data = '/Users/gustavo/git/ahof_vocalmat/vocalmat_classifier/training/.rawdata'; model_name = 'alexnet_pretrained'; dataset_name = '18-october-dirty'; load(fullfile(raw_data, model_name, dataset_name, 'table_performance.mat')); scores = table2array(T(:,5:16)); sorted_scores = sort(scores,2); ratio = sorted_sc...
cd2b48381ba36f2f1094c6e6b368608b4bf3afd07cd76d07db995fc12ac2509b
MATLAB
1,316
59
% op_leftshift.m % Jamie Near, McGill University 2014. % % USAGE: % out=op_leftshift(in,ls); % % DESCRIPTION: % Remove leading datapoints from the fid to get rid of 1st order phase % errors. % % INPUTS: % in = input data in matlab strucure format. % ls = number of points to remove from the beginning of the f...
f507da3acdc1aecfe142cf4c548376a9a793ec3481ed4a0d13eac81287d93f5b
MATLAB
1,316
50
function varargout = DAQmxVersion % List DAQmx version via the .NET assembly % % function [versionAsString, versionAsStructure] = nidaqmx.DAQmxVersion % % Purpose % Query the NI DAQmx version using the .NET assembly. If no outputs are % requested, the results are printed in screen. If outputs are requested, % the user ...
a0b74932096effa31af5b7f67ad35197820041d97398764faebee087b700d63d
MATLAB
1,319
35
function [t, a] = computelorenz(sigma, beta, rho,tspan, h, x0, y0, z0) % sigma, beta, rho: Lorenz attractor parameters % tspan: a 2-element vector [t0, tf] specifying the initial and final time % h: the time step size % x0, y0, z0: the initial values of x, y, z at t0 % t: a column vector containing the time steps % x, ...