sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
ecc17424923e6220068734d8d898501c1e5923d328b4493cab8f43408cd2f1fb
MATLAB
1,797
48
clear addpath('../../') % Load two EEG time-series data alpha_eeg = load('data/alpha_eeg.mat').first_eeg; gamma_eeg = load('data/gamma_eeg.mat').second_eeg; %create an EMCM object emcm = EMCM(); alpha_number = 1; gamma_number = 2; % Assign the time-series to the object emcm.set_timeseries(alpha_number...
67fdd94df1267ba860873030ace468028c36a670b63488f06111645ba59cbc34
MATLAB
1,798
69
function [S,d_max] = cluster_center_k_greedy_Fnc(K,P,S,figFlag,MAXREPNUM) %CLUSTER_CENTER_K_GREEDY k-greedy法でのクラスタを作り、その中心に近い点を選ぶ % Lloyd's algorithmの移動場所が離散的になっているバージョン % P : data points. #points * #dim matrix % W : weight of each points. #points * 1 array. % S : index of selected points % S_w : total weight o...
07891252ac503fc6361c38e1eea644b7f86b939d7ee6a1cfe63e090fa58b687e
MATLAB
1,799
65
function data = parseCompound(did, data) %did is the dataset_id for the containing dataset %data should be a scalar struct with fields as columns if isempty(data) return; end tid = H5D.get_type(did); ncol = H5T.get_nmembers(tid); subtids = cell(1, ncol); ref_i = false(1, ncol); char_i = false(1, ncol); bool_i = fal...
ad039a9517d2b87d53cedbbc23690e7e25ae78855cbb6b832b9bd3c31bfa7761
MATLAB
1,799
55
% computeDFF.m % % Function that takes in background-subtracted fluorescence signal over % time, performs bleaching correction (sum of two exponentials), and % returns dF/F. % For bleaching correction, fits sum of two exponentials to portion of % fluorescence curve taken as input and uses it as F0 in dF/F = (F-F0)/...
cb6b366dfbdc84dace3a8ea3c19e4474a29b9d3d0bc46004bda0df2369cdcfa8
MATLAB
1,799
63
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% hook up instructions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Cerestim needs: % % a power supply % % a USB cable, plugged into the presentation computer on the rig % % three NO GROUND blue cables from the back of the cerestim to the splitter boxes % % a patient ground cable connected...
12d3ccbb5daaaf582fa5a778a500ce754a65d1ff3c4d14ae3e39f0849e50688e
MATLAB
1,800
70
% mglPoints2.m % % $Id$ % usage: results = mglPoints2(x, y, size, color, isRound, antialiasing) % by: Benjamin Heasly % date: 04/17/2022 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: plot 2D points on an OpenGL screen opened with mglOpen % usage:...
4b82cf65c232ca4e0c2106d12072801c6ae0083e9ab48aa737518dca67fdd71e
MATLAB
1,800
62
function [ Kappa ] = calc_curv_spline( Lambda, regularization, consistency, isLinear, plotflag) % Calculate the curvature of the L-curve by using spline differentiation % This function outputs the curvature Kappa. % % Parameters: % Lambda: vector with regularization weight values % regularization: vector with regulariz...
ef70fe608a8be7be9e3f21f17102a627bb06d499682671ac0751862aceaa7010
MATLAB
1,800
33
function fH = plotDeltaLMMregressionSlopes_v_pRFExp(deltasGroup,deltasSubj, ... resampledCSTExp, deltaIdx, cmapROIs,saveFigs,saveFigDir) fH = figure; set(gcf,'Position',[1 1 800 941]); hold all; for idx = 1:size(deltaIdx,1) prfSizeDiff = resampledCSTExp(:,deltaIdx(idx,1))-resampledCS...
2f3ffab932b567dba51aa82522b6d78629a26f14cea366f26c32e8eb921b54d3
MATLAB
1,801
59
clear; % folder of the raw video dir_video=fullfile('..','data','data_TENASPIS','added_refined_masks'); % name of the videos list_Exp_ID={'Mouse_1K', 'Mouse_2K', 'Mouse_3K', 'Mouse_4K', ... 'Mouse_1M', 'Mouse_2M', 'Mouse_3M', 'Mouse_4M'}; %% vid= 1; % 1:length(list_Exp_ID) Exp_ID = list_Exp_ID{vid}; DirSa...
7fdaa385468ef8a0dc0f763523645f33360f2a380dbbeba2640916b47f0de3aa
MATLAB
1,801
62
function y = any(x) % ANY True if any element of a vector is a nonzero number or is % logical 1 (TRUE). ANY ignores entries that are NaN (Not a Number). % % For vectors, ANY(V) returns logical 1 (TRUE) if any of the % elements of the vector is a nonzero number or is logical 1 (TRUE). % Otherwise it returns logical 0 ...
9996046049dfef7fb1ce74d48b647e1f029195baafd63ef140013ed68215230b
MATLAB
1,801
72
function[out,h]=SONADCToDouble(in,header) % SONADCTODOUBLE scales a SON ADC channel to double precision floating point % % [OUT {, HEADER}]=SONADCTODOUBLE(IN {, HEADER}) % % Applies the scale and offset supplied in HEADER to the data contained in % IN. These values are derived form the channel header on disc. % ...
5e5fb36dbce878990f29552dbab7920714e2a360afb5eec0ae86f1c212df13ee
MATLAB
1,804
47
function bg_params = check_bg_params(bg_params) % bg_params = check_bg_params(bg_params) % % This function checks the elements of the struct bg_params to ensure % that all fields are set. Fields not set are set to a list of default % parameters. The struct checked is: % % - bg_params - Struct containing paramet...
e717099c74d0525c5ff0ab9cab3c888a1b07b629d6d087d19810b8edec683cda
MATLAB
1,804
34
function plot_velocity_and_ellipse_ratio(stim_while_turning_peaks,current_rails_dur,dummy_array_with_velocity_info,dummy_array_with_ellipse_ratio_info,stim_color,negative_vel_threshold,ellipse_ratio_threshold,folder_index, track_index) %%%% This function plots the velocity and ellipse ratio light_pulse = area(...
a68e44fe3e087dc4bea2259017e2c535274a7fa3a0ac7139e0b342e539ddf935
MATLAB
1,805
59
% this function will call figure2_subplanels to create all 4 subplots of % figure2. % % figure2(data_dir, read_from_excel) % INPUTS: % data_dir (str): Path to source data (default: 'source_data'). % % read_from_excel (bool): Flag to read from Excel (true) % or .mat files (false) (...
ba2c81ac70080217c4a58f4577c7fe51df915299f4bc0eefe6b187a8e7893f14
MATLAB
1,805
64
function handles = fix_FixUpdateFly(handles,fly) % sets fly plot properties based on fly data % splintered from fixerrorsgui 6/21/12 JAB if isdummytrk(handles.trx(fly)), return; end ii = handles.trx(fly).off+(handles.f); if strcmpi(handles.plotpath,'all flies') || ... (strcmpi(handles.plotpath,'seq flies') &...
7174175ab2fb939431b29c576cf0d541926ddc375480392cdcd5cdc71c055812
MATLAB
1,806
50
% mglBltTexture.m % % $Id$ % usage: mglBltTexture(texture,position,hAlignment,vAlignment,rotation) % by: justin gardner % date: 05/10/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Draw a texture to the screen in desired position. % % te...
94e4d6ff787e9a0e9b98b64620bc51afa57a16821330e97c76c7133f8c300eeb
MATLAB
1,806
61
function [yData,betas,P,errors] = tsne_d(D, parameters) %TSNE_D Performs symmetric t-SNE on the pairwise Euclidean distance matrix D % % [yData,betas,P,errors] = tsne_d(D, parameters) % % The function performs symmetric t-SNE on the NxN pairwise % distance matrix D to construct an embedding with no_dims dimensions ...
08cdd67530fc77cbba28fa4a4ab8bc88055701934b4753b4a50f7f9e454646d0
MATLAB
1,807
43
function ret=SONSetWaveMarkChan(fh, chan, sPhyCh, dvd, bufsize, comment,... chantitle, rate, scale, offset, units, points, pretrig, ntrace) % SONSETWAVEMARKCHAN creates a REALMARK channel % % RET=SONSETWAVEMARKCHAN(FH, CHAN, SPHYCH, DVD, BUFSIZE, COMMENT,... % CHANTITLE, RATE, SCALE, OFFSET,...
4bf116088d3763c016eac403f12b65363448e8f3e3ba6e74dccf08cb29730e75
MATLAB
1,807
60
%# -*- texinfo -*- %# @deftypefn {Function File} {} discrete_cdf (@var{x}, @var{v}, @var{p}) %# For each element of @var{x}, compute the cumulative distribution %# function (CDF) at @var{x} of a univariate discrete distribution which %# assumes the values in @var{v} with probabilities @var{p}. %# @end deftypefn func...
d94fe2863ae19060e70165c7744e256e119902cf1953938f56249feb9a3bf49d
MATLAB
1,807
46
function working_background_file_name = core_tracker_fit_background_model(output_background_file_name, ... input_video_file_name, calibration, ... input_background_file_nam...
4334938b4b8ceebb8ee2fe98154d944774ca705d5cec5c399d882da9c18bc704
MATLAB
1,808
47
clear; close all; initime = clock; addpath('funcs'); % get the change of PET in parameter space Delta_e_start = 0.28; % cannot equal to 0 Delta_e_end = 0.28; % can equal to 0.5 Delta_i_start = 0.013; % cannot equal to 0 Delta_i_end = 0.05; % can equal to 0.5 Delta_steps = 101; Iattn = 0.02; time = 5000; strt_prd = 30...
d40ed0d93573596475e6ccc615f4c7aa4491be8f3ac45b9e6972d3b79a144cab
MATLAB
1,808
52
% wrapper for epoching skin conductance data % uses eeglab % https://sccn.ucsd.edu/eeglab/index.php % version used here: eglab2019_0 close all clear all addpath '/data/pt_02306/main/code/github/pain-reliability-spinalcord/1_preprocessing/' addpath '/data/pt_02306/main/code/github/pain-reliability-spinalcord/helper_func...
ee3f1da42af0b83d41e327a9ca62ca411353fea7c2ae31b506cf72ec4ba06ba7
MATLAB
1,808
38
% makeGaussian.m % % usage: makeGaussian % by: justin gardner % date: 09/14/06 % purpose: This function *name* is deprecated. Use mglMakeGaussian (same functionality) % instead. function m = makeGaussian(width,height,sdx,sdy,xCenter,yCenter,xDeg2pix,yDeg2pix) % check arguments m = [];...
2da4bd35c0fd5ddb9e23c27534b3a5f55423f80793f8bfc493c6ebd7c49d7db8
MATLAB
1,809
41
function [r_s,edges_s,edge_type,P] = stress_fibers(r_s,edges_s,edge_type,P) % create nodes for the stress fibers at the bottom aux = find(r_s(:,2) == min(r_s(:,2))); aux = aux(1:2:end); r_s_aux = r_s(aux,:) - [0 1*P.y0/2]; r_s_aux2 = r_s(r_s(:,2) == P.y0/2,:) - [0 2*P.y0/2]; r_s_aux3 = sort([r...
3e5e390786b76deca68373996bb75b9ee3be57026a7da2e5f237f83ddb5ca4b6
MATLAB
1,809
45
clear %load F1s.mat filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4',... 'sim_5','sim_6','sim_7','sim_8','sim_9'}; radii = [4:8]; SNRs = [3:4:23]; [list_Recall, list_Precision, list_F1] = deal(zeros(length(filenames),length(radii),length(SNRs))); parfor n = 1:(length(filenames)*length(radii)*length(SNRs)) [p,q...
3fe735168452747574de843847124e05d1d7e55b4cf568d2956496961709fd50
MATLAB
1,809
36
function [x_bounded, y_bounded, xedges, yedges, xi, yi, sxi, syi, ... spikeCountMap, visitedCountMap, dwellTimeMap, ... positionProbMap, meanFiringRateMap, ... meanFiringRate, peakFiringRate, ... informationRate, informationPerSpike, ... dwellTimeMapSmoothed, meanFiringRateMapSmoothed, ... meanF...
7932079b070d16f305da1ff14851c0209ef92f73052ea36128523375ec30b43d
MATLAB
1,809
56
function [roll, pitch, yaw] = q2e(q0,q1,q2,q3) % Convert quaternions to Euler angles % Euler angles rotation sequence: z-y'-x'' (yaw, pitch, roll) % The Euler angles rotation is intrinsic, i.e., rotate along new axes % J. Chen, July, 2019 % % Ref: https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Eul...
268999ce31da81aace44fdb1848f84ecad26cf66c23e28e08ffcb7fa04e180b4
MATLAB
1,810
37
clc;clear % set FSL environment -- check without the last 4 lines setenv('FSLDIR','/usr/local/fsl'); % this to tell where FSL folder is setenv('FSLOUTPUTTYPE','NIFTI_GZ'); % this to tell what the output type would be fsldir = getenv('FSLDIR'); fsldirmpath = sprintf('%s/etc/matlab',fsldir); path(path, fsldirmpath); cl...
7e5d402e16fdf656a495fc0f87d065037de404e2775ca11fc2966b14cc70e2cf
MATLAB
1,810
40
%% mff_getObject.m % Matlab File % author Colin Davey % date 3/2/2012, 12/3/2013 % Copyright 2012, 2013 EGI. All rights reserved. % Support routine for MFF Matlab code. Not intended to be called directly. % % Returns objects of various types: % com.egi.services.mff.api.MFFResourceType.kMFF_RT_Any % com.e...
9bf339a3e48e8e46a653020e983fc64ad853c81d203467b8d6a79da832b21488
MATLAB
1,810
53
% wrapper for epoching skin conductance data % uses eeglab % https://sccn.ucsd.edu/eeglab/index.php % version used here: eglab2019_0 close all clear all addpath '/data/pt_02306/main/code/github/pain-reliability-spinalcord/1_preprocessing/' addpath '/data/pt_02306/main/code/github/pain-reliability-spinalcord/helper_fun...
f02993e3e7ee8fbc23589c494e9df72ac9547ebedd635582aac2707e3b30ec8a
MATLAB
1,810
47
function [Pad_curves] = Shifting_padding_profile(profile, length_times) % % Function shifting the profile to the padded profile center based on % the resultant peak location and padding profile with replicated % padding method (along the temporal borders). % % Input: profile = profile ...
2d95c2563712cd0c5e4650b2ccdfce2dd41b573e9f26cc828953f716c7458dd4
MATLAB
1,811
66
function spk_delta = spk_t2delta(spk_t,data_len,msec) % Function to produce a delta function from a list of spike times % % function spk_delta = spk_t2delta(spk_t,data_len,msec) % % Enter as arguement: % % t_spk = times of spikes in seconds - may be a vector or array % arrays assume rows = trials % data_l...
02204309eb15c8e554e8b612839025833ffd40ca01334aa5606cdf49e9c60a7d
MATLAB
1,812
52
clear; close all; clc; initime = clock; addpath('funcs'); Delta_E = 0.3; Delta_I = 0.032; lateral = 0.1; allTime = 4000; steps = 201; Iattn_start = 0.1; Iattn_end = 0.5; strt_prd = 300000; end_prd = allTime/0.01; % container PETAsheet = zeros(steps,16,16,5); PETOsheet = zeros(steps,16,16,5); finalRsheet = zeros(ste...
995e2f0ccb6578e06cd797ec324a9aa7c519d38d79eaa993b766c56e459d4ba6
MATLAB
1,813
54
function D=distance_wei(G) %DISTANCE_WEI Distance matrix % % D = distance_wei(W); % % The distance matrix contains lengths of shortest paths between all % pairs of nodes. An entry (u,v) represents the length of shortest path % from node u to node v. The average shortest path length is the % characteri...
40f7e22068b7025b7e527a774dc14a26e3fc9aaaa2f93f52b7246dbf2bc83165
MATLAB
1,815
52
function [datsmooth] = ft_preproc_smooth(dat, n) % FT_PREPROC_SMOOTH performs boxcar smoothing with specified length. % Edge behavior is improved by implicit padding with the mean over % half the boxcar length at the edges of the data segment. % % Use as % datsmooth = ft_preproc_smooth(dat, n) % % Where dat is an Nc...
502d04690b3c11a4e1bd44da1391cd84c0a8f47f8a7e1f95128cf122accc3c36
MATLAB
1,816
61
function plot_cluster_performance (silhouettes,info) mouse=info.mouse; date=info.date; if ismember('xtrafolder',fieldnames(info)) titlestr=[mouse,' ',date,' ',xtrafolder]; else titlestr=[mouse,' ',date]; end fullstring={titlestr}; %% statistics on silhouette scores stdev=std(silhouettes); average=mean(silh...
96c51691e473a3abf7ef95663b5e90b811dcf204a1e3bdba4e67cad0f7a6258f
MATLAB
1,816
51
function out = simseq_checkVoxelCorrespondance(coords, selectedpRFs) % Function check nr voxels of BOLD data and pRFs and make sure they correspond % Check which hemispheres were dealing with hemi = {}; if isfield(coords.pRFs,'lh') hemi{1} = 'lh'; end if isfield(coords.pRFs,'rh') if isempty(hemi), hemi{1} = 'r...
dd0a11d0e3e5165f75a58899765789fa3763a8e82363e60732ccfe610eee4ca1
MATLAB
1,816
41
function [startTimes, endTimes] = extractSegmentTimes(folder) %% This is a modified version of what was renamed as extractSegmentTimesXx.m %% Setup [~, file] = fileparts(folder); chanlist = readSpikeFile(fullfile(folder,[file '.smr']),[]); chanindsAll = [chanlist.number]; chaninds = find(arrayfun(@(x) any(strcmp(x.tit...
eb73c5da9086222f8a4cac1555742d6c12e971f2e197f399f92742759a89350e
MATLAB
1,816
51
function [bestMap, bestCombination, metricValue] = best_flip_combinations_mutualinformation(maps) numTrials = size(maps,3); flipCombinations = flip_combinations(numTrials); numCombinations = size(flipCombinations,1); flipMetric = zeros(numCombinations,1); flippedMap = zeros(size(maps,1), size...
4523017f9bb25c39bbe6c3e2d92f8b35a0512ac1f5782f092f213b15d38c77ed
MATLAB
1,817
63
%{ Maxwell Gagnon - September 2019 - This function finds all Maestro files in a directory, opens them, and saves them as a .mat file. - .mat files are easier to work with than the Maestro files. - The .mat files are also renamed to be more similiar to their behavior recording file counterparts. %} %% Set up clear;clc;...
13b1003290ff30456744d037bbd49c731f4d0ffd287884c9717f3219f0dc07b6
MATLAB
1,819
50
function [trackedPoints] = ml_cai_dlc_load_all(containerFolder, filenamePrefix) % This code reads in the multiple h5 files produced by DeepLabCut % Get a list of matching filenames h5Files = ml_cai_dlc_get_h5_filenames(containerFolder, filenamePrefix); numH5Files = length(h5Files); if numH5Files == 0 error('Unabl...
07902256d3ba292f1391d3234acb98caa936a3f8634ae4e9823ce8cb315c7139
MATLAB
1,821
44
% VL_QUICKSHIFT Quick shift image segmentation % Quick shift is a mode seeking algorithm which links each pixel to % its nearest neighbor which has an increase in the estimate of the % density. These links form a tree, where the root of the tree is % the pixel which correspond to the highest mode in the image. ...
0845768e9fbee62fb5985c45a9d6879dc47204e885409276e13f780fcbe2711f
MATLAB
1,822
60
% For in vivo spine data analyzed using MapManager V_20171028 % Author: Richard Roth (rhroth@stanford.edu) % Date: October 2019 % Based on MapManager-Matlab-1.0.1-alpha by Robert Cudmore, 20171016 function retVal = segmentCall(myMapList, MapName, SegmentNumber, SessionConditions, StatName, channel, PersCond, Min...
d3ce1565af5725f3e49d92301db6a0978bed54c54921fd680bb565442f7b73f9
MATLAB
1,822
41
% SONGETADCDATA returns data for Adc, AdcMark, RealWave ( and RealMark?) % data channels % % Implemented through SONGetADCData.dll % % [npoints, bTime, data]=SONGETADCDATA(fh, chan,... % maxpoints, sTime, eTime{, FilterMask}) % % INPUTS: FH = file handle % CHAN = cha...
eb798afad68a7905556a1ddb5bfb7c99db874dd1ac98acc5df7653f1332e4060
MATLAB
1,822
64
function res = thetaburst(amplitude, pair) %function res = thetaburst(amplitude, pair) %THETABURST automatic delivery of "theta burst" pulses - six trains of 200 % Hz, 50 ms duration each, with 117 ms in between. The procedure is % fairly automatic, requiring manual intervention (Ctrl+C or using the % em...
03a153720c5750e9fdb0dc528c411ce5599566629b77262ccd440bbfa3f25b04
MATLAB
1,823
57
clear all;clc fidx=dir('*.abf'); StimAmp_DP=0:50:900; TimeStim=[0.22,0.83]; %% for k=1:length(fidx) filename=fidx(k).name; [data,si,~]=abfload(filename,'start',0,'stop','e','channels','a'); % [data,si,~]=abfload(filename); dt=si*1E-6; dataV=data(:,1,:);dataV=squeeze(dataV);%µÚÈý¸öÊÇ...
ef1b8ab310812382e255e17b23dfd26532aed2bbece5502f20f9ee5d0a56bd48
MATLAB
1,823
50
% VL_HOG Compute HOG features % HOG = VL_HOG(IM, CELLSIZE) computes the HOG features for image IM % and the specified CELLSIZE. IM can be either grayscale or colour % in SINGLE storage class. HOG is an array of cells: its number % of columns is approximately the number of columns of IM divided % by CELLSIZE a...
1054fcce53aac77a3f02319855190c003f888d1dc5642b9ba729189d02c8e2fe
MATLAB
1,824
68
function mysavefig(h, folder,fileName, fs) % saves current figure as png, pdf and .fig, trying to maintain original aspect % h - figure handle % folder - location for saving figure % fileName - desired file name for figure % fs - (optional) font size to impose on pdf (default font size of saved file may vary according...
137550bc5532201407abb9fe50226d95b5c9c83a3fa29ab53e905b5c08f86d71
MATLAB
1,824
61
function aedes_errordump(errorstruct) % AEDES_ERRORDUMP - Write the lasterror structure into file % % % Synopsis: % % Description: % % Examples: % % See also: % % This function is a part of Aedes - A graphical tool for analyzing % medical images % % Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uku....
30397bd462684bcec7bfc78d25df8878bbe489ad708b2018035003e8ed3fac88
MATLAB
1,824
44
function status = getImpedance( obj, data ) % Extract impedance information. % % Syntax: % status = GETIMPEDANCE( obj, data ); % % Input parameters: % * obj - object containg data % * data - data from json file(s) % % Example: % status = obj.GETIMPEDANCE( data ) % % Available at: https://github.com/NCN-Lab/DBSc...
80c981b1534470266ee63f413a48c79904c9d2545bd73d969fee04a4afe4dfd2
MATLAB
1,824
60
function [track] = ml_cai_dlc_to_mlbehaviourtrack(trialDLCFolder, timestamp_ms) % This code reads in the multiple h5 files produced by DeepLabCut % and then converts the data so that it can be saved as a % MLBehaviourTrack hdf5 file used by the pipeline. %trialDLCFolder = pwd; %trialAnalysisFolder = pwd; % These are ...
188a6652f872388e32874867ec11b54a1216507a731c369e108ecf90e261cc97
MATLAB
1,825
61
%% updated 2024/2/22 % % 2024/2/15 mw, change xLim to be fixed or varargin % 2024/2/22 mw, remove Y tick label %% raincloud_plot - plots a combination of half-violin, boxplot, and raw % datapoints (1d scatter). % Use as h = raincloud_plot(X, cl), where X is a data vector and cl is an % RGB value. h is a cell...
421e1b5dfa36192d52d6b24552fb9588fd0c1681a8edef931e2ac92c83f0c1ee
MATLAB
1,826
41
% SONGETREALDATA returns data for Adc, AdcMark, RealWave ( and RealMark?) % data channels % % Implemented through SONGetRealData.dll % % [npoints, bTime, data]=SONGETREALDATA(fh, chan,... % maxpoints, sTime, eTime{, FilterMask}) % % INPUTS: FH = file handle % CHAN = ...
f0faca24ead52821c286394dfeded24a72adb7fc148566181627f240f4571ae0
MATLAB
1,826
46
clear %load F1s.mat filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4',... 'sim_5','sim_6','sim_7','sim_8','sim_9'}; radii = [4:10]; SNRs = [2:7]; % SNRs = [3:4:23]; [list_Recall, list_Precision, list_F1] = deal(zeros(length(filenames),length(radii),length(SNRs))); parfor n = 1:(length(filenames)*length(radii)*le...
e1c50c8c654c6c610c0802ec076691360fe946304cc8182312e2cc4125bab7fb
MATLAB
1,827
47
function [EER, FMR1000, fpr_mean, fnr_mean] = computeAverageEER_FMR1000(fpr_iter, fnr_iter, genuinesAggr_iter, impostorsAggr_iter, dbname, dirResults, plotta, savefile, param) % %init % minLength = findMinLength(fpr_iter, fnr_iter); % fpr_mean = zeros(minLength, 1)'; % fnr_mean = zeros(minLength, 1)'; % % %compute av...
d6ce84c523ac0e8cb04be67c5f61750caa72fbe321c40e069eb81b09413dc312
MATLAB
1,829
31
function [mag1, mag2] = get_linearityMeasurements(mag1, mag2) % Sac Start and End Times sacEndPoints = diff(~mag1.saccades_all); goodStarts = find(sacEndPoints == 1); goodStarts = goodStarts + 1; goodStops = find(sacEndPoints == -1); if goodStarts(1) > goodStops(1) goodStarts = [0; goodStarts]; elseif goodStarts(...
e0b3f313ebd44b9adc8f816e05f00076efbd2765fd5fe31fb6787957dcb6d223
MATLAB
1,829
63
% mglMakeSocket.m % % usage: mglMakeSocket(rebuild) % by: Ben Heasly % copyright: (c) 2021 Justin Gardner(GPL see mgl/COPYING) % purpose: rebuild socket-related mex-functions. % function mglMakeSocket() % Decide what to build. socketDir = fileparts(which('mglMakeSocket.m')); socketSrc = dir([socketDir...
7843177914c63f1176f43d1d3d0d2fec0b5b27cd523a26942e1d0af05d79baed
MATLAB
1,830
49
classdef EventWaveform < types.core.NWBDataInterface & types.untyped.GroupClass % EVENTWAVEFORM Represents either the waveforms of detected events, as extracted from a raw data trace in /acquisition, or the event waveforms that were stored during experiment acquisition. % OPTIONAL PROPERTIES properties spikeevent...
52276fb0976e608111977be4de15d53836c0323eeac18d138603123779957a20
MATLAB
1,832
59
%% This is little script for the extraction of trace from the area that corresponds to the whiskers of animals being recorded while head restrained % The Red channel values are extracted for a rectagular area % USE % (1) Choose the .avi file you want to process. % IMPORTANT % only .avi RGB video files work for ...
eb8effa9855e346cfbf638cc8aaf4e84971988a634956c2b22d597a4d12ec1d3
MATLAB
1,832
60
function [track] = ml_cai_dlc_to_mlbehaviourtrack(trialDLCFolder, timestamp_ms) % This code reads in the multiple h5 files produced by DeepLabCut % and then converts the data so that it can be saved as a % MLBehaviourTrack hdf5 file used by the pipeline. %trialDLCFolder = pwd; %trialAnalysisFolder = pwd; % These are ...
2e7ba7d72cdd92df57050e49f637c0a6e45f1859e509461c973d8c6c5229e5a7
MATLAB
1,833
59
function y = diff(x) % DIFF Difference and approximate derivative. % % DIFF(X), for a vector X, is [X(2)-X(1) X(3)-X(2) ... X(n)-X(n-1)]. % DIFF(X), for a matrix X, is the matrix of row differences, [X(2:n,:) - X(1:n-1,:)]. % DIFF(X), for an N-D array X, is the difference along the first non-singleton dimension of X....
690634b553ddc8bc0bebc1ccb682211c76f5a80b5182ed064c9ce262e2c34e50
MATLAB
1,833
73
% plotCaVelExTraces.m % % Quick script to plot example traces calcium imaging traces (left and % right dF/F, yaw velocity, forward velocity). For making figure of % example traces for paper % % Adaptation of plotPDataRawTraces.m % % CREATED: 5/13/24 - HHY %% plotting parameters dFFscale = [-1 1]; fwdVelScale = [-20 ...
6cbf4a95ba5cd1f313a4f547086b78eb9c99df7b73d996762353011f53b9e6d5
MATLAB
1,833
50
function [h,hc] = plotEllipse(cRow,cCol,ra,rb,phi,color,nPnts,lw,ls) % USAGE % [h,hc,hl] = plotEllipse(cRow,cCol,ra,rb,phi,[color],[nPnts],[lw],[ls]) % % INPUTS % cRow - the row location of the center of the ellipse % cCol - the column location of the center of the ellipse % ra - semi-major axis radius l...
39f9292f50d9baa538c8f4ef569eb6aed2f2afbc6c7fe809514212d540a6e328
MATLAB
1,834
58
% mglTextSet.m % % $Id$ % usage: mglTextSet(fontName,fontSize,fontColor,fontVFlip,fontHFlip,fontRotation,fontBold,fontItalic,fontUnderline,fontStrikeThrough) % by: justin gardner % date: 05/10/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: Set text ...
d379461e82ef639a926e4e39f5c1cf5f01e7d9db900a3da02c2fc6a9868a5c8c
MATLAB
1,834
39
% makeGrating.m % % usage: makeGrating(width,height,sf,angle,phase,<xDeg2pix>,<yDeg2pix>) % by: justin gardner % date: 09/14/06 % purpose: This function *name* is deprecated. Use mglMakeGrating (same functionality) % instead. function m = makeGrating(width,height,sf,angle,phase,xDeg2pi...
6185c01cabdc5250fb34d9648278968b7e3184837a7c96e923a5f889d5b521d4
MATLAB
1,835
62
% LBV.m % [fL] = LBV(iFreq,Mask,matrix_size,voxel_size,tol,depth,peel,N1,N2,N3) % % output % fL - the local field % % input % iFreq - total magnetic field % Mask - ROI % matrix_size - dimension of the 3D image stack % voxel_size - dimensions of the voxels % tol - iteration stopping crite...
d94b26aa8b46cfecfa3a5479b8b140a4e5e2e2c8838659f904dd3b3a4789aa98
MATLAB
1,835
51
function h = vl_hikmeanshist(tree,path) % VL_HIKMEANSHIST Compute histogram of quantized data % H = VL_HIKMEANSHIST(TREE,PATH) computes the histogram of the HIKM tree % nodes activated by the root-to-leaf paths PATH. PATH is usually % obtained by quantizing data by means of VL_HIKMEANSPUSH(). % % The histogram H h...
c8bb9fce7cadd02249073312115cd898c2ffc782b608312fa42ea0506d1988ae
MATLAB
1,836
56
% % Please cite this paper if you use any component of this software: % S. Soltanian-Zadeh, K. Sahingur, S. Blau, Y. Gong, and S. Farsiu, "Fast % and robust active neuron segmentation in two-photon calcium imaging using % spatio-temporal deep learning," Proceedings of the National Academy of Sciences (PNAS), 2019. % ...
1830e35a12d65607198b9a7da6af4b70d5656616e6d59be204b2970e94aa52d1
MATLAB
1,837
51
function [stat_info] = get_spec_stats(pow,f,srch_bnds,cntl_bnds,Alpha) %get_spec_stats.m 5/8/22 % this will return several fields % representing one- and two-tailed tests % and outputs that are useful different purposes (e.g., plotting) %confirm same orientation f = reshape(f,size(pow)); cntl_inds = find(f >...
e32e66024f93280532d84e75d875d5f0f39d66bff993fc34cd7224ff196402bb
MATLAB
1,837
67
function results = vl_test_imsmooth(varargin) % VL_TEST_IMSMOOTH vl_test_init ; function s = setup() I = im2double(imread(fullfile(vl_root,'data','spots.jpg'))) ; I = max(min(vl_imdown(I),1),0) ; s.I = single(I) ; function test_pad_by_continuity(s) % Convolving a constant signal padded with continuity does not change...
e4f2fa9240a5d52ddf8cba45ffa9b0c81e865670bb1268a62bc7b2241d3f6002
MATLAB
1,837
48
% VL_FISHER Fisher vector feature encoding % ENC = VL_FISHER(X, MEANS, COVARIANCES, PRIORS) computes the Fisher % vector encoding of the vectors X relative to the Gaussian mixture % model with means MEANS, covariances COVARIANCES, and prior mode % probabilities PRIORS. % % X has one column per data vector ...
51a5c9abc3a0fe6cf36ae2c741b6d74853a1fbaa12513cfa3f2d624b0ac3c2ca
MATLAB
1,839
74
function v_Data = ... f_LoadI16File( ... pstr_FileName, ... ps_FirstIndex, ... ps_LastIndex, ... ps_FileHdl) % % Function: f_LoadI16File.m % % Description: % This function loads an integer signal from a file where each data value % is stored in 2 bytes. % % Inputs: % pstr_FileName: name of the f...
f3c8a6af8922bec241a69e28146cf2b386c55dd7dbe8bba95615744f7c7ca24e
MATLAB
1,839
74
% generatePlotsPooledKernels.m % % Script to load analyzed data (from extractKernels.m) and generate plots % with plotMeanKernels.m. Saves figures % % UPDATED: 8/29/19 % datPath = '/Users/hyang/Dropbox (HMS)/2PAnalysis-Helen/AnalyzedData/190828'; figPath = '/Users/hyang/Dropbox (HMS)/2PAnalysis-Helen/Figures/190828_k...
28ebf0d0ab07dffd87c7833bce52cdc12981ea14053aa69644d9536ebf81a565
MATLAB
1,840
43
function simulate_data(path_of_script,number_of_noise_realizations,simulated_SNRs) simulation_parameters.outdir = {[path_of_script]}; [simulation_voxels_table, dataset_names] = simulation_load_paper_invivo_tensors(path_of_script); [simulation_voxels_axDKI_table] = simulation_load_pape...
72a29478f51f180c8c216ff372be3fd90f6d7099e781753fcbe9f43e48a6a8de
MATLAB
1,841
51
function [psth,psth_mean, sem] = psth_wave2_multi(trigger_times,interval,values, ... pre_time,post_time,control_from,control_to,offset,z_score) N = length(values); times = 0:interval:(N-1)*interval; times = times'; % val1 = cell(1,length(trigger_times)); % interval_rate=1/interval; % if interval_rate>=1&&inte...
85cdc7be9f4d45ccfe25ce0b45ff0a4e74b6200c5f6fb0162d66e23b9e74ea85
MATLAB
1,841
56
function [r] = ml_alg_smallest_enclosing_rectangle(tx, ty) % This code computes the smallest rectangle that encloses the points % given by tx and ty. NOTE! It will enclose all of the points so filter % out those that are due to noise if needed. It was written for the % auto placemap spike code that does...
ad48d9b8ac11bffcf8ff0a4489b8149617bc8209e1bb86317ea7c1c92d091a1c
MATLAB
1,843
41
% VL_KDTREEQUERY Query KD-tree % [INDEX, DIST] = VL_KDTREEQUERY(KDTREE, X, Y) computes the nearest % column of X to each column of Y (in Euclidean distance). KDTREE is % a forest of kd-trees build by VL_KDTREEBUILD(). X is a % NUMDIMENSIONS x NUMDATA data matrix of class SINGLE or DOUBLE with % the data index...
c1ff6718975cf83f8cecf16955f59f6d6f36184666488ff46442b19e54291770
MATLAB
1,844
60
function vessel_img = vessel_dilation(valid_vessel, N_cut, seed, max_disk, dilate_trace, t) %% this file is used to simulate the vessel dilations % N_cut: FOV divisions % seed: rand seed for repeating experiments % max_disk: dilation strength % dilate_trace: dilation amplitude % last update: 4/24/2022. % load v...
7dae83767a8c645dbcaac8377c76e95f5cc0da813d1aed609b3e45c4b0838042
MATLAB
1,846
81
distribution=cell(1,12); for i = 1:12 temp=pooled_clustering(i).clustering_info.cellids; temp(temp==0)=[]; distribution{i}=temp; end %% LINE PLOT FOR EACH DATASET figure('color','w') hold on c=[0 .447 .741;.85 .325 .098; .929 .694 .125; .494 .184 .556; .466 .674 .188; .301 .745 .933]; total_SOM=0; ...
52257702650764b49081203acf7a8a19ebe89dc5ff4bc804f3fcd2fd71db6de5
MATLAB
1,847
61
%% 230324, make figure on the effect of CK on amplitude, IPI (figure used in Fig 7) % use after "toRun_240324_ckFig7S.m" %% plot just dot, not cloud; vertical plot; also not as subplot xx=10; numbertoplot=1:xx; legendlabel={'-', '+', '-', '+', '-', '+', '-', '+', '-', '+'}; legendlabel2={'Arp3','CBD','FMNL1','Lifeact...
d17f4d3a494dcd3526a0939ed6ebe2cef52beb304ca314b77a5d8c3bf6d11889
MATLAB
1,847
54
% clear; addpath(genpath('.')) addpath(genpath(fullfile('..','ANE'))) %% dir_video=fullfile('E:','data_CNMFE'); list_Exp_ID={'blood_vessel_10Hz','PFC4_15Hz','bma22_epm','CaMKII_120_TMT Exposure_5fps'}; num_Exp = length(list_Exp_ID); eid = 4; Exp_ID = list_Exp_ID{eid}; DirSave = ['Results_',Exp_ID]; dir_add = fullfile(...
754e8bea13b49666ac3095fba4d3657bbd9e17287df08b8c080fb826e886673a
MATLAB
1,849
52
function grad = itab2grad(header_info) % ITAB2GRAD converts the original Chieti ITAB header structure into % a gradiometer definition that is compatible with FieldTrip forward % and inverse computations % % See also CTF2GRAD, BTI2GRAD, FIF2GRAD, MNE2GRAD, YOKOGAWA2GRAD, % FT_READ_SENS, FT_READ_HEADER % Copyright (C) ...
d4e43aa3f99e05d8e1af2620bdf598e0020bcae045da6b8a732396dc1fe0b847
MATLAB
1,850
50
%% detects surface semi-automatically (starts from manually selected location; multiple locations possible for multiple surfaces) function [surff]= surfaceDetectionAnterion_v01(complexSignal) col='rygbck'; sign2=log(flipud(medfilt2(abs(complexSignal),[7 7]))); [Gmag,Gdir] = imgradient(sign2); Gmag(isinf(Gmag)==1)=0;...
394810c404aee9d30de48bfd7430d1d17e5cfc21de684b2d0f86aabf68bc49e7
MATLAB
1,851
52
function [outermost, inside] = find_outermost_boundary(bnd) % FIND_OUTERMOST_BOUNDARY locates outermost compartment of a BEM model % by looking at the containment of the triangular meshes describing % the surface boundaries % % [outermost] = find_innermost_boundary(bnd) % % with the boundaries described by a struct a...
6045ce5b28c34055b8a889b376d4499aecc32e4a2025ca9df616e8cd7a39d0df
MATLAB
1,851
70
% mglClose.m % % $Id$ % program: mglClose.m % by: justin gardner % date: 04/03/06 % copyright: (c) 2006 Justin Gardner, Jonas Larsson (GPL see mgl/COPYING) % purpose: close OpenGL screen % function retval = mglClose() % check arguments if ~any(nargin == [0]) help mglClose return end...
ab00b4cbd3150c3663081798cd013c871bcba11746945cc4875a67e51b2d8c07
MATLAB
1,851
52
function [outermost, inside] = find_outermost_boundary(bnd) % FIND_OUTERMOST_BOUNDARY locates outermost compartment of a BEM model % by looking at the containment of the triangular meshes describing % the surface boundaries % % [outermost] = find_innermost_boundary(bnd) % % with the boundaries described by a struct a...
1e56fce7bbaccec710a4ed15f420009fdbafbc15ef8c3e16ad7d9ac543f832d0
MATLAB
1,852
45
function mask_unrelyPhase = create_mask_unrelyPhase2(phasedata, mask, Params, thresh) %% Author: Xu Li % Affiliation: Radiology @ JHU % Email address: xuli@mri.jhu.edu % % This function creates unreliable phase mask for QSM % Ref. Wang et. al., bioRxiv preprint doi: https://doi.org/10.1101/2021.06.28.450248 mask_unrel...
f89d988f8d3ee5e091b490ce336a30bafb99e91c70c0f4aa3e801c38724a2153
MATLAB
1,853
64
function stim = masktestStim(baseImg,seq,resampleSize) % Function to make test stimulus for stRet % % stim = masktestStim(baseImg,seq,resampleSize) % % Example: % userLoadFile = '/Users/insubkim/oak_home/spatiotemporal/experiments/stRet/data/subj01/session1/Stimuli/images_and_params_run01.mat'; % fs = 1000; % resamp...
0872ad8050b2ec27c4fbcf0028f9a56c9c4f47c6c763b5af673ea01c43e97255
MATLAB
1,854
65
function [wI,wIx,wIy] = vl_imwbackward(varargin) % VL_IMWBACKWARD Image backward warping % J = VL_IMWBACKWARD(I, X, Y) returns the values of image I at % locations X,Y. X and Y are real matrices of arbitrary but % identical dimensions. I is bilinearly interpolated between samples % and extended with NaNs to th...
0ca93624fe4419eee88d2d0a0f8113114ca89c3538426f22e475562ce1e5b05f
MATLAB
1,854
58
function [tensor_mrtrix,kurtosis_mrtrix] = nyu2mrtrix(dki_nyu) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % NYU (dki_fit) % % Tensor % D_ind = % 1 1 % 1 2 % 1 3 % 2 2 % 2 3 % 3 3 % % Kurtosis % W_ind = %1. 1 1 1 1...
dcf04210c718e6131d9cac4a0f7aec19171d85048de766ca4e0468d190d17485
MATLAB
1,854
47
if ~(struct.special) vline(struct.segLen * .25, 'r') vline(struct.segLen * .75, 'r') b = ylim; text(0, ((b(2)-b(1)) * .05) + b(1), '* Center') text(struct.segLen * .25, ((b(2)-b(1)) * .05) + b(1), ['* L Motion' ]) text(struct.segLen * .50, ((b(2)-b(1)) * .05) + b(1), '* Center') text(struct...
c881d4f804e4c370aee761aa85e3a45e165dded163b3e4934a2ad8ae81fffa42
MATLAB
1,856
68
%% bin=30; type='onsets'; param(1).type=type;param(1).stat='avg';param(1).extype='ratio';param(1).exthresh= 2; starts=-50:1:50; %% [outputSVM]= event_classifier(starts,bin,param(1),ds_events,'SVM','noshuffle','nodecay'); %% [outputLDA]= event_classifier(starts,bin,param(1),ds_events,'LDA','noshuffle','nodecay'); [...
3ffb5a5df3b0a70890cc7dda6b9fb1fe089a8db7e998cac91965761c46e71f57
MATLAB
1,858
61
function M = decode_qform0(hdr) % Decode qform info from NIFTI-1 headers. % _______________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % % $Id: decode_qform0.m 8776 2013-11-14 09:04:48Z roboos $ dim = double(hdr.dim); pixdim = double(hdr.pix...
655c265f284c4138c8c60896d9ae76fbee68197ec6a906425eaa3cc8bfa35c7a
MATLAB
1,859
51
function mltp_plot_best_fit_orientations_0_180_per_cell(obj, session) % Load the data matFilename = fullfile(session.analysisFolder, obj.config.canon_rect_placemaps_folder, 'best_fit_orientations_0_180_per_cell.mat'); if ~isfile(matFilename) error('The data file (%s) does not exist. Make sure it has...
7d8731e4aec2ed56bd0eb63bf6d7dbb7e341a9055e3f26c2ce7263adc15a5846
MATLAB
1,859
48
clear %load F1s.mat filenames = {'sim_0','sim_1','sim_2','sim_3','sim_4',... 'sim_5','sim_6','sim_7','sim_8','sim_9'}; radii = [4:8]; % radii = [9:10]; % SNRs = [2:4]; SNRs = [2:7]; % SNRs = [3:4:23]; [list_Recall, list_Precision, list_F1] = deal(zeros(length(filenames),length(radii),length(SNRs))); parfor n = 1:(l...
a2ceb1bfd114f0f64d6b4a1e414c4acd373d6679eab10214375e1c03fd5b374e
MATLAB
1,859
61
function ft_flush_data(filename, varargin) % FT_FLUSH_DATA removes all data from the data queue % % Use as % ft_flush_data(filename, ...) % % See also FT_FLUSH_HEADER, FT_FLUSH_EVENT % Copyright (C) 2007-2010 Robert Oostenveld % % This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip % for the...
4ccb12e443194dc28bd3e2f6b11bf2390680129430639eb48722f52ff45ce227
MATLAB
1,860
76
%tableS1_HR_diffs_primary_synthetic.m %% clear all; close all; clc; warning('on','all') scriptdirs = {pwd; '..\..\plot'; '..\..\analyze'; '..\..\helper_functions'}; addpath(scriptdirs{:}) datadir = pwd; ssfile = 'subsample1000_stdFR_stdRP.mat'; sspath = fullfile(datadir,ssfile); %% tabledir = datadir; tablefil...
9cf091402a6a70a12d4dad74f21514e114b8752ad213cd150b0bd47f14e0f1c5
MATLAB
1,860
86
function [net_config, exp_info]=cnn_load_model(input_path) % input_path can be a cached model file, or a folder which contains the % model file and the file name follow the pattern: net-config*.mat net_config=[]; exp_info=[]; if ~my_check_file(input_path) return; end if exist(input_path, 'dir')...
a3ca3c9faebd03734760223a2e90e4dde82bf9de780336d0a0c4b7db75242e84
MATLAB
1,860
57
%% open up csv file containin the gain and phase try pathname = cd; [~, filenameroot] = fileparts(pathname); File = [filenameroot '.xlsx']; [~, ~, array] = xlsread(File); catch File = uigetfile('*.*'); [~, ~, array] = xlsread(File); fprintf('Excel file not automatically found, please manual...
df5c14ddc6e8235afe7774ba5172ac851d0ce49197a7dd50a240dcc43d6b5947
MATLAB
1,860
41
% VL_BINSUM Binned summation % ACCUMULATOR = VL_BINSUM(ACCUMULATOR,VALUES,INDEXES) adds the % elements of the array VALUES to the elements of the array % ACCUMULATOR indexed by INDEXES. VALUES and INDEXES must have the % same dimensions, and the elements of INDEXES must be valid indexes % for the array ACCUM...