sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
2108fcdc165a45335a14f1c113b3a8fdd9fe266f0111e4f8ca733ec0e2367f4d
MATLAB
4,164
148
clear close all clc % load ECG1 % s = data; load ECG2 s = data(14, 1:end); % s = randn(1, 10000); fs = 1000; % load ECG3 % s = data(2, 1:end); % s = resample(s, 0.3*fs, fs); % fs = 0.3*fs; s = LPFilter(s - LPFilter(s, 1.0/fs), 100.0/fs); s = s(:)'; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
280881ccd70702893938f19bb3e61f767bceb49fd967486690658e9be3357c0b
MATLAB
4,167
152
close all; clear mex; funtype = 'gpu'; %funtype = 'cpu'; %funtype = 'matlab'; kCNNFolder = '..'; addpath(kCNNFolder); addpath(fullfile(kCNNFolder, 'matlab')); if (strcmp(funtype, 'gpu') || strcmp(funtype, 'cpu')) kMexFolder = fullfile(kCNNFolder, 'c++', 'build'); kBuildFolder = fullfile(kMexFolder, funtyp...
e83e54442b1d13c694d184b733a023e538714cbbf8e506a7bb89c171f78e9041
MATLAB
4,172
112
function [sig] = digitalLIA(modSig,refSig,freq,Fs,lpCut,filtOrder) %Digital Lock-In Amplifier Demodulation % % [sig,filtStruct] = digitalLIA(modSig,refSig,Fs,lpCut,filtOrder) % % Description: This function demodulates a signal using a phase sensitive % detection method. The function takes two inputs: modula...
7bad1aaba4956943d3271fd7c8ecdf27bc59cb4e5fd07c25037bb46506f9f610
MATLAB
4,173
154
function controlfilename = createLCmodel_control_laser117T(metabname,l1,l2,l3,preproc_dir) do_water_scaling=0; doecc=0; %basis_set_file_path = '/home/romain/tmp/basis/basis_LASER_TE_20_11T.BASIS'; basis_set_file_path = '/servernas/home/romain/data/spectro/Basis_set/laser_11T_mouse/basis_LASER_TE_20_117T_MM.BASIS' ...
a1ac73669c649884cdde1c84739f4258d1e651daa048f1b98a2daecde349c5fb
MATLAB
4,175
136
%{ ---------------------------------------------------------------------------- Determine the time window for task relevant neurons %Start of task %Sound on %Sound off %Before choice %After choice (0sec) %After choice (1sec) %After choice (2sec) %p = 0.001 %Each epoch, predict the prior, sensory and choice...
b22a2342d3d1642fb3a7b1a4cf23ae715ca64bb509d4c24d47295bdc05fc0dd1
MATLAB
4,185
118
function seq = cosmoother_gpfa_viaOrth_fast(seq, params, mList) % % seq = cosmoother_gpfa_viaOrth_fast(seq, params, mList) % % Performs leave-neuron-out prediction for GPFA. This version takes % advantage of R being diagonal for computational savings. % % INPUTS: % % seq - test data structure % params - ...
9d5bc6f48f61460470e1e4408a5c317c7928c1e807b8f326a4fc2a09d7b61e6f
MATLAB
4,188
153
function controlfilename = createLCmodel_control_mega_2HG(metabname,l1,l2,l3,preproc_dir) nb=1; do_water_scaling=0; phantome=0; basis_set_file_path = '/home/romain/data/spectro/Basis_set/MEGA5_inv/MEGA5_inv.BASIS'; %basis_set_file_path = '/home/romain/data/spectro/Basis_set/MEGA5_inv_no_gln/MEGA5.BASIS'; %basis_set_...
1db31ebf4eacb14833b04dc3dd9b0ec848292478738e5716f8020d54200fbcad
MATLAB
4,190
109
%{ ---------------------------------------------------------------------------- Determine the time window for task relevant neurons %Start of task %Sound on %Sound off %Before choice %After choice (0sec) %After choice (1sec) %After choice (2sec) %p = 0.001 %Each epoch, predict the prior, sensory and choice...
421fc209154148b763af0366d32e631bd6bff466128e8d2e76be952f1cdd8cb7
MATLAB
4,190
120
function PVD_Generate_Dataset(Im_In,Im_Out,S) % This function generates a training set made of input-output pairs of PVD patches from annotated grayscale images. % Note: % To generate samples with an even number of rows and columns, an asymmetric x-range and y-range are used around each pixel (-d:(d-1)). % In...
177a7a84b346eb1fe221b781b9ed55f3818a515dba57a7bf5179257dbc0e18d5
MATLAB
4,192
173
% with reduced dimensions clear; close all; fs = 1000; data = load('s0010_re.txt'); % data = load('s0014lre.txt'); time = data(:,1)'; data = data(:,2:end)'; data = data - LPFilter(data,1.5/fs); data = LPFilter(data,150/fs); I = 1:10*fs; data = data(:,I); N = length(data); % % % mn = mean(da...
535ae6797254b5ce3e2be4330ef68b69d541f8b06504a490dd7dc16c8b410fef
MATLAB
4,193
133
function createBasisSet() par.BasisSetDir = '/home/romain/data/spectro/Basis_set/Gosia/new_MEGA/basis_MEGA_edit_CENIR_SS/'; par.name_basis = 'basis_SS_inv'; par.element_basis_name={'NAA','GABA','GLU','MM'}; par.element_basis_name={'NAA','GABA','GLU','GLN','MM'}; par.element_basis_filename={'NAA','GABA','Glu','Gln','...
4df772b56b503b22edaedc25f1342bd41ddc98fe32e991a5d73f47d015651b18
MATLAB
4,197
86
function [rr_interval_corrected, rr_interval_differences, matched_peaks_indexes, smoothed_matched_output] = peak_det_matched_filter_pwr_env(x, matched_template, type, wlen, PP_diff_wlen, PP_diff_th, average_peak_det_rate, fs, varargin) % peak_det_matched_filter_pwr_env - matched filter R-Peak detector % and smoothed he...
5eff597c8de2606e13a84bc19ff094826c7198dce0432c065d6c2058867fc1fb
MATLAB
4,200
137
%{ ---------------------------------------------------------------------------- First_take number of frames in each tif files Analyzing imaging data simply At least for the correct rate ---------------------------------------------------------------------------- %} function Figure3c_Task_kaiseki_tokyo1_2022021...
01486589d9dd4084eb15555993d22002ba8726c895eec7dcea9745b5c35265bc
MATLAB
4,208
171
% read .PRINT file and plot data % valabregue 02/2012 function [met cormat] = readprint(filename) %filename = '/home/romain/data/spectro/hipo/repro_study/lcmodel/9session_Naj_last_mean/BA_MM/REPRO_HIPO_01_mean.PRINT'; [pathstr,fname,ext] = fileparts(filename); lcmodelresults.name=fname; % open .COORD file fprintf('...
7857aaf785789bbd12620eb10c47117781cd40c3996b329b2fe3ee0948caaae9
MATLAB
4,211
136
function [ch_table_new] = Bad_Channels(data_f,ch_table,fs) %Plots channels and provides ui to remove bad channels % data_f... nsamps x nchans matrix % time...time vector % ch_table...table containing columns name, status, with channel names and % good/bad status % hp/lp...filter cut off values for band pas...
e0435d83f1977c9dbe65bd215c60dec9d02f9e40e8a2100e48140cc2b121f3cc
MATLAB
4,211
150
%This script will generate data and then fit pibdfc as an example. %% addpath('pibdfc_functions'); addpath('bdfc_functions'); rng(34); %% Generating the data run('create_gaussian_simset.m'); %% Concatonating dataset y_dat = zeros(N*Subs,R); true_states_long = reshape(true_states(:,1:Subs),N*Subs,1); for i = 1:Subs ...
14ec9ceb52b6ba3a67843454a8fb0925aebcd5568aee8330101fb6198c0e075a
MATLAB
4,214
107
function [BrightnessThresh]=mnl_DetermineBrightnessEffects_v4(FragmentValues,FragLength,EuclideanThreshold,ErrorThresh) %This is the version 2 of determining what is an appropriate brightness %threshold to use based on the data provided. It was initially designed to %be compatible with mnl_ProcessTracesFromNeurolucida_...
b3be7e78efabef64ea69bea4eebe17ed4b897cdc9f2b2d18b6b3069ac8fa9a57
MATLAB
4,214
176
% with reduced dimensions clear; close all; fs = 1000; data = load('s0010_re.txt'); % data = load('s0014lre.txt'); time = data(:,1)'; data = data(:,2:end)'; data = data - LPFilter(data,1.5/fs); data = LPFilter(data,150/fs); I = 1:10*fs; data = data(:,I); N = length(data); % % % % mn = mean(...
a1666eb1d4aadfeaf117867b74fffb99b08dd0a0751a9ac46f854f476f5be7f1
MATLAB
4,230
118
load(cleanupFile) run([RETROMOCOBOX_PATH '/addRetroMoCoBoxToPath.m']); %run([MIRT_PATH '/setup.m']); addpath(SPM_PATH); %% fidHTML = fopen([htmlDir '/index.html'],'a'); %% And put the reconstructed images into the html all_ims = rn([outDir '/GRE.nii']); all_ims_corrected = rn([outDir '/GRE_corrected.nii']); ov...
2bfba94cca7217197989fc188095eb620ddef853b86f7a79654576604893b9ff
MATLAB
4,234
107
function Both_RLt_Pattern_4Seq_20200304 path=['C:\Users\C238\Desktop\touchcellLtRt_terashita']; cd(path); LS=ls; RLtouchPoint=zeros(1,7); RLtouchFire=zeros(1,7); X=[]; RLtouchUnit=[]; RLtouchPointUnit=[]; for i=1:length(LS(:,1)) TrimFolder=strtrim(LS(i,:)); if ~strcmp(TrimFolder,'.') &&...
968894d6820839eca15ff27ea11c5ae5fe15ed8649609bef1146d397531b8906
MATLAB
4,235
145
function []=mnl_ViewXFPdistribution_Model(Dimension) NumDim=size(Dimension,2); figure for i=1:NumDim NumCopies=size(Dimension(i).Cells,2); for j=1:NumCopies VecNormMatrix=Dimension(i).Cells(j).NormXFPvals; tn=sprintf('%d%s%d',i,' Dimensions, Copy Number - ',Dimension(i).Cells(j).CopyNumber); ...
c5c733d582cfdd7b3060207e8d0178891f104875638b189acd5c04e8e5626d72
MATLAB
4,237
100
function [data,numChan,labels,txt,fs,gain,prefiltering,ChanDim] = eeg_read_bdf(filename,SecLoad,reshape) % this function loads at least "SecLoad" seconds of EEG data from the % specified bdf-file "filename". If all available data is needed, specify % 'all' instead of "SecLoad" like this: % [...] = eeg_read_bdf('test.b...
e8c0a8160e7334b599a40d8e0378045b869b0ef4a5a1f21b7638eae22f53dcb5
MATLAB
4,237
155
function controlfilename = createLCmodel_control_laser(metabname,l1,l2,l3,preproc_dir) do_water_scaling=1; doecc=0; TEMET=0; basis_set_file_path = '/home/romain/data/spectro/Basis_set/sead/3T_SIM_SEAD_FRANCE_2011_11_23.BASIS'; [pathstr,filename ] = fileparts(metabname) wd = fullfile(pathstr,preproc_dir) if ~exist(...
8a4dd70271bd68d7a89bf2f2fd6eb180aa1d6bc8d3d67c4c1db75725e81970d3
MATLAB
4,238
112
%% clear [file, path] = uigetfile('*.mat');%When the user clicks the load data button, a window should open to enable the user to select a file. datafile = fullfile(path, file); %save path load(datafile) close all clc delay = 1.16; %% %sort clusters by size [~, I] = sort(clusters.num_of_cells, 'descend') binsize = 0.1...
0d21f1c392dc665457d23e7b119fb8ed53370f3c70183fa02a1366fb176e5ee4
MATLAB
4,240
112
%new calculate premutation paeird t-test only on cimogenetics before and after cells clc clear [file, path] = uigetfile('*.mat','MultiSelect','on');%When the user clicks the load psetion button, a window should open to enable the user to select a file. cd(path) datafile = fullfile(path, file); %save path %% if ~iscell(...
7449c69247ed455c92efe1068ef6702e4baeb0f2ce735102692a867e1d27cc0d
MATLAB
4,240
116
function W = Adjust_Rect_Width_Rot_Generalized(Im,Rotation_Origin,Rect_Angle,Rect_Length,Rect_Width_Min_Max,Origin_Type,Smoothing_Parameter,Width_Ratio,Im_Rows,Im_Cols) % Description: % This function detects the local apparent width of the neuron. % Calling functions: Find_Cell_Body, Add_CB_Branch, Trace1. % In...
14954277617bef087fc438b09051365bb01bc9d6b356709bff411eb3e2b0c2b0
MATLAB
4,241
109
function [lead_fields,UnitMDip] = Forward_OPM_single_sphere(x,y,z,slots_all,normal_unit,sphere_origin) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% mean_sphere_origin = sphere_origin; %% number of channels Nch = size(slots_all,1); %% voxel position in CTF and in metres vox_pos_ctf = [x y ...
d0f46d2db6d0efdfe3059dd17b449e2e5ef22c7f115ce7cfa00a4d637b448b39
MATLAB
4,245
108
function [ecg, phi] = ecg_gen_stochastic(N, fs, varargin) % ecg_gen_stochastic - Generate synthetic single-channel ECG with beat-wise stochastic deviations. % % Syntax: % [ecg, phi] = ecg_gen_stochastic(N, fs, params) % [ecg, phi] = ecg_gen_stochastic(N, fs, f, f_deviations, alpha, delta_alpha, b, delta_b, the...
8b8669c41cc54fc3ec976dfb2fe2df987f50449fc798e513e0951ccb62bad1db
MATLAB
4,250
133
% A test script for Laplacian Eigen-maps for ECG signals % Reza Sameni, 2020 % The The Open-Source Electrophysiological Toolbox % https://github.com/alphanumericslab/OSET.git clc clear close all; load('SampleECG2.mat'); data = data(:,2:end)'; %/////////////////////////////////////////////////////////////////////////...
8c048f1189510dcbc32dc93f194007a08c705c02130ac3af26ea883fda01e5a8
MATLAB
4,250
149
function [Data, t] = simulate_periodic_eeg(CenterFrequency, BurstAmplitude, BurstDensity, BurstDuration, Duration, SampleRate, Plot) arguments CenterFrequency = 10; BurstAmplitude = 20; BurstDensity = .5; BurstDuration = 1; Duration = 10; SampleRate = 250; Plot = false; end % [Data, t] = sim...
c4236e88e685db3004412dae0154fd4119ce16ffc5738af009ede9b941c6f01e
MATLAB
4,255
126
function [fid, dcmInfo_arr] = spec_read_all(dn, sortmethod) % function to read spectroscopy time series data from a % directory with sequentially named siemens .ima/.dcm files % usage: [fid, dcmInfo_arr] = spec_read_all(dn, [sort]) % arguments dn = filename, [sort 0=Filename/Alphabetical, 1=InstanceNumber] v...
edd51af5bcc3ab917721ba82ea89cddc4c1cc9c49e226685a9a5ab4a078447eb
MATLAB
4,257
89
function [AD, readOut] = ArrayDesignerGRASP(AD) %Book-keeping / unpacking for brevity pathnameAD = AD.inputs.pathnameAD; pathnameROI = AD.inputs.pathnameROI; pathnameSolSpace = fullfile(AD.inputs.pathnameHeadModel,'Utils','scalpSolutionSpace_10_2p5.txt'); pathnameSolSpaceLabels = fullfile(AD.inputs.pathnameHeadModel,'...
4d0eb61a744194ed524384b423864bb7f080f4c33d5f4a6f27d0d6174d31ed49
MATLAB
4,266
150
function [peaks, peak_indexes] = peak_det_adaptive_hr(x, ff, fs, varargin) % peak_det_adaptive_hr - R-peak detector based on max search over sliding window with adaptive width % Syntax: % [peaks, peak_indexes] = peak_det_adaptive_hr(x, ff, fs, flag, [th, th2], rejection_threshold) % % Method: % detects R-pea...
81d4d6db7a0de1321be238f66724b7b4ff00a2bf8aea9f68eae6bd5bc4f6b223
MATLAB
4,267
89
function [x,v] = randfixedsum(n,m,s,a,b) % [x,v] = randfixedsum(n,m,s,a,b) % % This generates an n by m array x, each of whose m columns % contains n random values lying in the interval [a,b], but % subject to the condition that their sum be equal to s. The % scalar value s must accordingly satisfy n*a <= s <= n*b. ...
ae6f8e11261eedbf180f11070094446c844fd614374fd924c84974fd9def66e1
MATLAB
4,268
121
function Colors = pick_colors(N, Order, Color) % Selects from colorblind friendly pallettes the requested colors. % N can be either 1 or 2 values; the first indicates the number of hues, % the second the number of luminance changes. if no second value is % indicated, than a N x RGB matrix is returned. Otherwise, an N(2...
1d7f47fe111956e722dc53728db62c62ee24fe8ba1c87ec7ef742f0c3aa55144
MATLAB
4,270
112
function nnd_distance_map_2 = nnd_distance_map(skeleton_data, radii_data,target_resolution, atlas_resoultion, atlas_size) asd = ones(atlas_size); asd_x = asd .* [1:1:atlas_size(1)]'.* atlas_resoultion; asd_y = asd .* [1:1:atlas_size(2)].* atlas_resoultion; asd_z = asd .* permute([1:1:atlas_size(3)], [1,3,2]).* ...
21c535e428287657d0bfee84400d02245dc51bf54b37f24c2f18882c61f22040
MATLAB
4,271
148
clear close all; R1 = importdata('/Users/rsameni/Desktop/Seizure/kaggle/SourcesWithResultsBackup/testFreqDomainEnergyIncreaseRate01.txt'); R2 = importdata('/Users/rsameni/Desktop/Seizure/kaggle/SourcesWithResultsBackup/testICASubspaceAngles01.txt'); R3 = importdata('/Users/rsameni/Desktop/Seizure/kaggle/SourcesWithRes...
c529ab43ffa74ca86f6ae2043ab58e4a518adedbc88f32c214f787a5381e5992
MATLAB
4,271
174
function [spikeMatrix, peak_idxs, peakTimes_ms, classes, peak_vals, dip1, dip2 ]=comBIN12_v01(aaa,filename,NBINS_peak,NBINS_dip,NBINS_dip2,npointsbeforepeak,npointsafterpeak) if nargin<6 npointsbeforepeak=20; npointsafterpeak=20; end load(filename,'data','sr'); data=data'; templateMatchedSpikes=aaa.spikes; peak...
602a07134738cde2dfab4751bac239304f7431a844bd1343d0f00dda7ff53ca7
MATLAB
4,272
117
function [ ripple_info ] = ripple_detection_apply_threshold( lfp_signal, lfp_threshold ) % Usage: % [ ripple_info ] = ripple_detection_apply_threshold( lfp_signal, lfp_threshold ) % Input: % lfp_signal Return value of ripple_detection_preprocess % lfp_threshold Return value of ripple_detection_determi...
02b2fe11d8d7f1d58fa57725a7398735be47fff05c322c90ab9bc4091c6dd8bc
MATLAB
4,274
117
% EM algorithm, bic and plot % ------------------------------------------ % This file is part of the adaptative_threshold SPM plug-in % Copyright (C) Cyril Pernet and Chris Gorgolewski 2012 classdef ExpectationMaximization < handle properties components mix end methods func...
083163ef54d9ecb8243408a1b0c158efe6df123a0a3c871d3753d7937def5830
MATLAB
4,274
135
function [CSIdata] = write_fid_to_nii(fids,rootdir,naming_convention) if ~exist('rootdir') rootdir=spm_select([1 Inf],'dir','Select directories to write nii','',pwd); end if ~exist('naming_convention') naming_convention=3; end for k=1:length(fids) f=fids(k); CSIdata.dim = [1 1 1]; CSIdata.vox =...
494a122b1dba22c67952f64a2289295711b1e33ec2f3235e9a49a11fccd07e63
MATLAB
4,275
175
% Test semsitibity od different ECG segments to ICA dim reduction % Reza Sameni, Copyright 2008 clear; close all; fs = 1000; data = load('s0010_re.txt'); % data = load('s0014lre.txt'); time = data(:,1)'; data = data(:,2:end)'; data = data - LPFilter(data,1.5/fs); data = LPFilter(data,150/fs); I =...
b9b53cb71db89bcbf387cc4f1583320704b20a92d7459fd324f3078450664e4a
MATLAB
4,281
177
function [spikeMatrix, peak_idxs, peakTimes_ms, classes, peak_vals, dip1, dip2 ]=comBIN12_v01(aaa,filename,NBINS_peak,NBINS_dip,NBINS_dip2,npointsbeforepeak,npointsafterpeak) if nargin<6 npointsbeforepeak=20; npointsafterpeak=20; end load(filename,'data','sr'); data=data'; sr=1e4; templateMatchedSpikes=aaa.sp...
42138de6467f4f713b814d2384dfd57a9c9650a7eeed665343eb6ee79dd9bc5c
MATLAB
4,284
135
load osCategorizedTable.mat % NRvnTable = osCategorizedTable(strcmp(osCategorizedTable.condition,"NR"),:); NRvnTable = osCategorizedTable(strcmp(osCategorizedTable.condition,"NR") | strcmp(osCategorizedTable.condition,"DR"),:); dataTable = NRvnTable; DistFromMainAxis = 0; DistAlongMainAxis = 0; %Only mainDi...
3a5c5de8dfcb03cbf5034109f7de69b71768fc143c170ec11a3c18ae0125e94a
MATLAB
4,286
134
function samplesOut = bandpassFilter(samplesIn, hCfg) %BANDPASSFILTER Summary of this function goes here try hCfg.updateLog('bpFilt', sprintf('Applying bandpass filter to %d samples', size(samplesIn, 1)), 1, 0); samplesOut = filtfiltChain(single(samplesIn), hCfg); catch ME hCfg.updat...
b553102665d7f3039ea2bf728a72e106184ee910181a7479854bbd10ebcc8593
MATLAB
4,286
120
function flag = recover(obj, ask) %RECOVER Inconsistent data recovery, with a hammer %returns -1 if canceled by user, % 0 if failed % 1 if succeeded and spikeClusters DID NOT change % 2 if succeeded and spikeClusters DID change if nargin < 2 ask = 0; end ...
99b64ecc17f1d9ff92220254a84790c0c8c03c71ce23477a92ff6c2c91b8d796
MATLAB
4,299
148
clear close all; R1 = importdata('/Users/rsameni/Desktop/Seizure/kaggle/SourcesWithResultsBackup/testFreqDomainEnergyIncreaseRate01.txt'); R2 = importdata('/Users/rsameni/Desktop/Seizure/kaggle/SourcesWithResultsBackup/testICASubspaceAngles01.txt'); R3 = importdata('/Users/rsameni/Desktop/Seizure/kaggle/SourcesWithRe...
4ba67af06ded2027863b28ad83698fd103466bf633a7fd92f6d6eca14956351f
MATLAB
4,304
145
clear all % this script contains code to reproduce Figure 3b, 3e-d %% load data % drag and drop corresponding file (S3 Data) %% data content description % D contains the region acronyms % I_anes contains segemented and trial-averged data from anesthetized recordings (100 regions x 192 frames x 32 sessio...
4cdc5d0f082e0f62ff5869a3066974fbdd09e99add6c7dabdb643bf98ebb82ab
MATLAB
4,304
135
function [clu, tree] = run_cluster(par, multi_files) dim = par.inputs; fname = par.fnamespc; fname_in = par.fname_in; % DELETE PREVIOUS FILES if exist([fname '.dg_01.lab'],'file') delete([fname '.dg_01.lab']); delete([fname '.dg_01']); end dat = load(fname_in); n = length(dat); fid = fopen(sprintf('%s.run',fn...
466e2cbed67d28df3ba31f4b699b88f617a8614d890b979af765e2d2957b0547
MATLAB
4,307
131
function extract_cell_data(file, cell_num,ploting) cell_name = ['cell_' cell_num]; load(file) cluster_num = file(1:(end-4)); mkdir (cluster_num) cd(cluster_num) cell_data = all_data.(cell_name); %relevant_cell response_window = 65:125; mkdir(cell_name) cd(cell_name) % cell_data = clusters.cluster_cells.cluster_3{1,31}...
b4d6eabb3f39761a681b50f09838c42b97e687a61ecc2993a218e13475500322
MATLAB
4,308
119
% datarange = 1:length(data); datarange = 137:139; dt = 5e-5; for i =datarange if isempty(data(i).EPSP) continue end data(i).amp_single = []; data(i).halfwidth_single = []; data(i).maxdv_single = []; data(i).area_single = []; data(i).risetime_single = []; if isempty(data(i).EPSP)...
958088862d85b8cee588a94d19365ab8d6b207dbe76c732763caf6c869a7ca25
MATLAB
4,309
121
function varargout = wave_clus_aux(varargin) % WAVE_CLUS_AUX M-file for wave_clus_aux.fig % WAVE_CLUS_AUX, by itself, creates a new WAVE_CLUS_AUX or raises the existing % singleton*. % % H = WAVE_CLUS_AUX returns the handle to a new WAVE_CLUS_AUX or the handle to % the existing singleton*. % % ...
9983bdb2490a3ec6bf38222c8ee6a79bf512b66fa536257bb327408b60b22bbd
MATLAB
4,310
164
% Return time frame of a NIFTI dataset. Support both *.nii and % *.hdr/*.img file extension. If file extension is not provided, % *.hdr/*.img will be used as default. % % It is a lightweighted "load_nii_hdr", and is equivalent to % hdr.dime.dim(5) % % Usage: [ total_scan ] = get_nii_frame(filename) % % filen...
ed8c736fdaae47c0ccf943a37c5af0f4bc7826035b844dbc3f00f4ded6150ab9
MATLAB
4,313
129
load paper_indices; load demographic; LABELS = group(inds==1); del_inds = find(LABELS==-1); dup_inds = find(LABELS==1); con_inds = find(LABELS==0); %load the feature matrices load TBM_gray_down/features; GM = features; load TBM_white_down/features; WM = features; %%things to modify GRP_INDS = 1:206; numIter = 100;...
9e10a42114e98b7fa5daa0099043a4631a4e8909acdfc6c354b605e0f073f495
MATLAB
4,314
135
function [clu, tree] = run_cluster(par, multi_files) dim = par.inputs; fname = par.fnamespc; fname_in = par.fname_in; % DELETE PREVIOUS FILES if exist([fname '.dg_01.lab'],'file') delete([fname '.dg_01.lab']); delete([fname '.dg_01']); end dat = load(fname_in); n = length(dat); fid = fopen(sprintf('%s.run',f...
2e762ca319fb14506f736345f769cd4d11f67b7ccad07245098e14ba74b8483c
MATLAB
4,321
127
function [sqrl_all, Z, rho_all, eta] = multi_nhmm_pg_draw(xDat, sqrl_old, Z_old, Z_prior, rho_old, eta_old, eta_prior, s_assign, a0, b0) %% This function is a Gibbs sampling step to sample new values for the log linear coefficients %% in the Holsclaw et al. paper for sampling from heterogenous HMMs. %% Inputs: % Xi_o...
53b739d28bb734d17aec50310fad6a85d7475643c3cdf257ef42489210d3c28b
MATLAB
4,322
92
%% Transfer Entropy Calculation %Set-up - need installation of JIDT toolbox https://github.com/jlizier/jidt %Add JIDT jar library to the path, and disable warnings that it's already there: warning('off','MATLAB:Java:DuplicateClass'); %javaaddpath('C:\\Users\\natas\\Documents\\PhD\\Code\\infodynamics-dist-1.6.1\\inf...
7ece6f750a114e24a4a55c7e0182edbe14a074d8e49ad9ac663ea8c5f20ff59b
MATLAB
4,322
154
close all; clear; clc; % parameters subject = 'Dog_2'; path = ['J:\Seizure\' subject '\']; ch = 1:16; % desired channels time = [7 10]*60; % in seconds d = dir([path '*.mat']); NumRecords = length(d); mode = zeros(1, NumRecords); powerradio = zeros(1, NumRecords); A = zeros(1, NumRecords); skew = zeros(1, NumRecords)...
0f0f3b5dd45bef9ece25c53bb41010d6630478fd072adeadbe07c4da1dcc0a8f
MATLAB
4,323
118
%{ ---------------------------------------------------------------------------- Determine the time window for task relevant neurons %Start of task %Sound on %Sound off %Before choice %After choice (0sec) %After choice (1sec) %After choice (2sec) %p = 0.001 %Each epoch, predict the prior, sensory and choice...
bbba8a6797b8c48b1ff072635721002fa3ab2bdaadf8b610805d5aebd5438841
MATLAB
4,326
120
function lick_psth_summary_FF(sessions,resdir,issave) %LICK_PSTH_SUMMARY_FF Average lick PETH for fiber photometry recordings. % LICK_PSTH_SUMMARY_FF(SESSIONS,RESDIR,ISSAVE) plots average lick PETH % (beam break time stamps aligned to an event). Session indicated in % SESSIONS as pairs of animal and folder na...
3fec28a282044c193accf39ef82bd20e41cce9e60cfa50a21d3f7f5b3353e699
MATLAB
4,327
152
function intervalHist190507 %”­‰Î‚ª‚ ‚Á‚½‚Æ‚±‚ë‚̃Cƒ“ƒ^[ƒoƒ‹‚̃qƒXƒgƒOƒ‰ƒ€‚ðì‚é %ŽžŠÔƒCƒ“ƒ^[ƒoƒ‹ % cd('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51'); % dpath=('C:\Users\C238\Desktop\CheetahWRLV20180729\119\2017-6-7_20-8-33 11901-51\'); % dpath3=('C:\Users\C238\Desktop\CheetahWRLV...
8036dae5a3cac6759b937da2808add61e943a30d2787164f863a2f197b3a2ac1
MATLAB
4,327
117
%{ ---------------------------------------------------------------------------- Determine the time window for task relevant neurons %Start of task %Sound on %Sound off %Before choice %After choice (0sec) %After choice (1sec) %After choice (2sec) %p = 0.001 %Each epoch, predict the prior, sensory and choice (...
eeb0b45ef785e84c581166c6a4ea0473637e1370a70070821f597d20e250195d
MATLAB
4,328
127
function [sqrl_all, Z, rho_all, eta] = multi_nhmm_pg_draw_par(xDat, sqrl_old, Z_old, Z_prior, rho_old, eta_old, eta_prior, s_assign, a0, b0) %% This function is a Gibbs sampling step to sample new values for the log linear coefficients %% in the Holsclaw et al. paper for sampling from heterogenous HMMs. %% Inputs: % ...
152dfafa7a01ee69fde9bc495e5d19780f7506342229223c80505644a2c0523b
MATLAB
4,329
130
function create_mat_file(filename,varargin) %create_mat_file function to create .mat files readable by the MNG toolbox % % create_mat_file(filename,varargin) create a mat file named filename % defined by varargin % create_mat_file(__, Name, Values) % % Name-Values Arguments % % 'channel' - define channel w...
69d80b6ffd244a4550b9187d818b04484e333f82388b73e7ac2ef637e00bb25a
MATLAB
4,331
162
%% plot av/err vs iti/rand for different number of iti transitions [cols,alpha] = chooseColors; figure for g = 1:length(gaging_var) subplot(2,3,g) hold on % plot av/err dc_rep_mean = squeeze(mean(all_acc(:,g,1,:,:),4))*100; sample_mean = mean(dc_rep_mean); plot(sample_mean,'Color','k','LineWidt...
c3545ae95c98e920ce56db49cda8424963ed18dec2958e6b3af63d4fc97bfd35
MATLAB
4,331
87
%% loading data load('dataFig7.mat'); PLkIPDmax = mean(refractoryIPD.RTmaxPLk); PLkIPDmin = mean(refractoryIPD.RTminPLk); PSpIPDmax = mean(refractoryIPD.RTmaxPSp); PSpIPDmin = mean(refractoryIPD.RTminPSp); PExIPDmax = mean(refractoryIPD.RTmaxPEx); PExIPDmin = mean(refractoryIPD.RTminPEx); PLkILDmax = mean(re...
e4296324171528153a69607210125952d9d9b8089c61f14dfdc28356b881033f
MATLAB
4,336
130
function [class,distance] = rst_outlier(data,method) % Allows to detect outliers % % FORMAT [class,distance] = rst_outlier(data,method) % % IMPUT data a vector of data points % method = 1 - is the standard MAD Median rule % = 2 - is the MAD Median rule with adustement for small samples % ...
cea55e76ad78295b6942a80501630de72729de642f458b441df14af664ed0a40
MATLAB
4,340
117
%% Complete data array for each recSite % Concatenate sessions % Fill with nan % Get firing rate average % load data array load('E:\Data_array\AllTrials_10bin_Smooth_lickOnset\data_array.mat') % load('E:\Data_array\AllTrials_100bin_noSmooth\data_array.mat') % Import setting B = 2; % number of contexts: respond-t...
f84d2ae929ffef3fd72a7c365b230f373b1de3e315a1e16763e69dc38c3d40d9
MATLAB
4,344
180
function [fix, start_end_sac, peaks_sac, start_end_fix, peaks_fix, locss, amplitudesac] = fixsacepoch(TrackingData) %FIXSACEPOCH Process tracking data to determine rapid head movements and fixation epochs % fix= fixation timestamps % start_end_sac= onset and offset timestamps of head movements % peaks_sac= peak head m...
5cd865caab7941c6bdf91c19448269923f6b5399ee32ee3b553cd62f5b33f86f
MATLAB
4,346
92
%% single cell simulation: to collect mean V (and firing rates) function [v, meanV,fr] = MEanFieldEst_SingleCell_L6(NeuronType, f_EnI, ... N_EE,N_EI,N_IE,N_II,... S_EE,S_EI,S_IE,S_II,p_EEFail,... ...
4cc645ad36f7fa8164740bae6bc384ceb3db919d7699e72a0491724c6b964ff7
MATLAB
4,356
92
function save_regression_res(app) [int_idxs,~] = listdlg('PromptString',{'Please select intervals ',... 'to be plotted/saved.',''},... 'SelectionMode','multiple','ListString',app.popup_int_entropy.Items); [form_idxs,~] = listdlg('PromptString',{'Please select fileformat ',... ''},... 'SelectionMode','...
58bce6c235aff2d1e8f7117ec4f425a6bbbba2924190b5fe3a6d9a4a34d1129d
MATLAB
4,357
92
function save_regression_res(app) [int_idxs,~] = listdlg('PromptString',{'Please select intervals ',... 'to be plotted/saved.',''},... 'SelectionMode','multiple','ListString',app.popup_int_stepwise.Items); [form_idxs,~] = listdlg('PromptString',{'Please select fileformat ',... ''},... 'SelectionMode',...
80edeafade7fb82a4660300511c876a17f39d1ae2ce247ad38bd70e41ed9b0ef
MATLAB
4,360
140
classdef TemplateClustering < jrclust.interfaces.Clustering %TEMPLATECLUSTERING A Kilosort(2) clustering %% TEMPLATE-MATCHING PROPERTIES properties (Dependent, SetObservable) amplitudes; % extracted amplitude for each spike templateFeatures; % matrix giving the magnitude of the...
433d6523671079be5dfb2c8325430649facef33052baa2cfea13a304387e079e
MATLAB
4,362
140
clear close all clc %% [file, path] = uigetfile('*.mat','MultiSelect','off');%When the user clicks the load psetion button, a window should open to enable the user to select a file. cd(path) cell_num = (inputdlg("cell_numebr")); cell_name = ['cell_' cell_num{1}]; %% load(file) cluster_num = file(1:(end-4)); mkdir (cl...
37221cbbbce2d577a43ca8b7756aa1e4d1e8b25f16995e85070cdd505f2a5a40
MATLAB
4,365
124
function spmup_smooth(P,Q,s,dtype,M) % just like spm_smooth with additional mask to mask data before smoothing % useful when applying brain mask % % 3 dimensional convolution of an image % FORMAT spm_smooth(P,Q,s,dtype,M) % P - image(s) to be smoothed (or 3D array) % Q - filename for smoothed image (or 3D arra...
52116e619a6b8a9779dccd854fc37ae31ac93d6aa905e4a1f4494237ead32eb7
MATLAB
4,365
135
close all; clear; clc; resultfname = 'results.txt'; % parameters subject = {'Dog_1', 'Dog_2', 'Dog_3', 'Dog_4', 'Dog_5', 'Patient_1', 'Patient_2'}; f0 = 60; % powerline frequency Hz Q = 30; % notch filter Q-factor wlen = 5.0; % energy window lengths in seconds bins = 0:.01:3; epochlen = 15; % epoch length in seconds e...
679acb86d9a45f0f2b628e1189ae1929adc17f4244ec35e13966b84574443858
MATLAB
4,366
126
function [Lead_fields, L_reshaped] = Forward_OPM_shell_FT(mri_file,sensor_info,sourcepos) % Use FieldTrip to create a single shell lead field model % mri_file = .mri file % sensor_info = sensor positions (Nx3), orientations(Nx3), and labels (Nx1) % skanect_file = where to save/load things to/from %% Load OPM sen...
eebca4e5223ecba75bb7df0bfb8816ba75339170cb7f2c05ed197aa4c08c0e6e
MATLAB
4,366
107
%Author: Tatjana Schmitt, 2019-2023 function [radial_vectors_fitted, borders] = fitting_BF_vectors(stats, idx_vectors, ... radial_vectors_BF, radial_vectors_mean_BF_smoothed) % fits BF course of vectors, calculates turning points, sets borders and % calculates edges of auditory cortex %% initialize variables...
5576497553ff75d8a1dcbb3242ba145e70dac0d060e72b445ad6a999d088c44c
MATLAB
4,367
141
function [CSIdata] = write_fid_to_nii(fids,rootdir,naming_convention) if ~exist('rootdir') rootdir=spm_select([1 Inf],'dir','Select directories to write nii','',pwd); end if ~exist('naming_convention') naming_convention=3; end for k=1:length(fids) f=fids(k); CSIdata.dim = [1 1 1]; CSIdata.vox =...
da234ce7db0774cdb7aa001d64e87f48ef5db4184411416a11876a50ec87b35a
MATLAB
4,375
174
function [spikeMatrix, peak_idxs, peakTimes_ms, classes, peak_vals, dip1, dip2 ]=comBIN(aaa,data,sr,NBINS_peak,NBINS_dip,NBINS_dip2,npointsbeforepeak,npointsafterpeak) %comBIN(spks,data,sr,1,1,1) if nargin<7 npointsbeforepeak=20; npo...
26ac3c07766c6c0262f306df52ec0a23461d14793f3a71e7fe26f8b03d30e466
MATLAB
4,376
124
function fit = rst_weibullfit(AFC, stimlevel, pc, CritY, labelx, estdelta, flag) % Fit a cumulative Weibull function to relationship between vectors: % stimlevel and pc, both obtained in N-alternative discrimination task. % Set AFC to N. % % CritY = threshold proportion correct. default is halfway between chance % and...
786f8d85f756983b23acd07c2e4ee1231a4baa0baf1b6621173221d122bf2906
MATLAB
4,379
106
% ************************************************************************* % * This code implements and illustrates three distributions, namely * % * 'Rayleigh', 'Rician' and Phase distributions for envelope and phase * % * introduced in [2]. * % * >>> Refer to...
c1d7a86d60d6594d9416474f4bf9a48b2c346fef25746b45b1cc5c6c77cd4697
MATLAB
4,379
147
close all; clear mex; funtype = 'gpu'; %funtype = 'cpu'; %funtype = 'matlab'; kCNNFolder = '..'; addpath(kCNNFolder); addpath(fullfile(kCNNFolder, 'matlab')); if (strcmp(funtype, 'gpu') || strcmp(funtype, 'cpu')) kMexFolder = fullfile(kCNNFolder, 'c++', 'build'); kBuildFolder = fullfile(kMexFolder, funtyp...
e22a0104b2ea2c8e98492ab93878eb8b134b2f657981304bd1a94d878b7ef185
MATLAB
4,379
112
function Data = zScoreData(Data, Dimentions) % z-scores a matrix across the first dimention (presumed participant) and % seperately for the last dimention (presumed frequency), if option % selected. % 'last' indicates that last dimention is also to be kept separate % 'last-1' indicates the second to last dimention is a...
535d1ac9f120a6108d06258e3c34a20da8ace2df94097cfcffe098ffad23906a
MATLAB
4,384
95
function [ECG_mean, ECG_median, ECG_cov, ECG_mean_robust, ECG_median_robust, stacked_beats, beats_sqi] = ecg_features_time_domain(data, peaks, params) % ecg_features_time_domain - Extracts time-domain ECG mean and median beats, and beat covariance matrix. % % Usage: % [ECG_mean, ECG_median, ECG_cov, ECG_mean_robust, ...
2b0eb022df07c3c9920537352d03eda738f105f5c893b6e8a8e9014c6f52ba46
MATLAB
4,387
148
function OnePhaseSpike190514 %¶‘«‚̃^ƒbƒ`‚̊Ԃ̂ǂ±‚ʼnEƒ^ƒbƒ`‚ª‚ ‚Á‚½‚©Ì¶‘«‚̃^ƒbƒ`ŠÔ‚łǂ±‚ŃXƒpƒCƒN‚ª‚ ‚Á‚½‚© % global cd('C:\Users\C238\Desktop\CheetahWRLV20180729Part1\119\2017-6-7_20-8-33 11901-51'); dpath=('C:\Users\C238\Desktop\CheetahWRLV20180729Part1\119\2017-6-7_20-8-33 11901-51\'); dpath3=('C:\Use...
c9d2358981c5f249a2de39823c90ef41e323dcc51f1d4683eb99c0b87a9490ee
MATLAB
4,390
136
%{ ---------------------------------------------------------------------------- Determine the time window for task relevant neurons %Start of task %Sound on %Sound off %Before choice %After choice (0sec) %After choice (1sec) %After choice (2sec) %p = 0.001 %Each epoch, predict the prior, sensory and choice (...
89ce0229d7d17ad86c5f8f8547373442e059dbf3a27d9e896156f3514c3a18ff
MATLAB
4,397
45
close all; clear; clc; % testFreqDomainEnergyIncreaseRate01 % % testICASubspaceAngles01 % % testWeightedHistogramAveraging02 % % testProcessSeizureEEG_EnergyDistributions01 % testProcessSeizureEEGAllSpectralFeatures % % AnalyzeResults11_WithCrossValidationResults % AnalyzeResults13_SpectralFeaturesFunction('Anal...
247f8d6dcfac6b2e6f695f5730258155482659c09f2b6f5ffec4f5cae0afacbf
MATLAB
4,404
85
% MARK CLUSTERS IN TEMPERATURE DIAGRAM function mark_clusters_temperature_diagram(handles,tree,clustering_results) handles.par.min.clus = clustering_results(1,5); % creates cluster-temperature vector to plot in the temperature diagram nclasses = max(clustering_results(:,2)); class_plot = []; for i=1:nclasses ind...
9692ef1a3e95c74e48060739bbbdb49acec6f754c44bd71d145821809efbcdaf
MATLAB
4,406
115
%{ ---------------------------------------------------------------------------- Analyzing behavioral data At least for the correct rate ---------------------------------------------------------------------------- %} function FigureS1d_Dual_ML_analysis_220818_para_all analysis_folder = { 'G:\Ishizu_data\...
43c998a27c2b77c171d4ce694a8d91e5b41ce1072d60430b8a93303df091a480
MATLAB
4,408
145
%{ ---------------------------------------------------------------------------- First_take number of frames in each tif files Analyzing imaging data simply At least for the correct rate ---------------------------------------------------------------------------- %} function Figure_c_Task_kaiseki_tokyo1_2022021...
96ae26717355def66c231e9b3ab2cff36e0a371be1314754fb31e1772e79e165
MATLAB
4,410
111
function Apply_PVD_CNN_Test_Set(My_CNN) % This function gets a trained neural My_CNNwork and a grayscale image and produces a matrix of probabilities. % Each pixel in the output matrix contains the probability of the corresponding pixel in the grayscale image of being % a neuron pixel or a non-neuron pixel. ...
9bec362207c6b3b3ad7f9b23292439388193ec29636d71b095abc486a25fa451
MATLAB
4,415
119
classdef adi % % Class: % adi % % This class is meant to hold simple helpers for the package. methods (Static) function view() % % adi.view(*file_path) % % This is %TODO: Run the viewer file_path = adi....
3acf782f07a6e81424dc2e83789c751dfa9eb9ad7ae6d9f0122026e8ce25c3ac
MATLAB
4,418
116
%% % top: blcok types (respond-to-touch: blue; respond-to-light: red) % middle: tactile stimuli % bottom: visual stimuli % right lick (green); left lick (orange); no lick (gray) % block start (dash line) % cue for block transition (star) % setting y_idx = [2 1]; lick_color = {[0.5 0.2 0.55] [1 0.4 0.15] [0...
de12d2170e2e1e93431af0349992cf7255cb4bd67fc9b565295354948abde16c
MATLAB
4,423
148
function [threshold, index, par, spikes] = detect_spikes(data, sr, par) %DETECT_SPIKES Summary of this function goes here % Detailed explanation goes here %default config init_date = now; threshold = []; index = []; spikes = []; seglen = par.segments_length*sr*60; num_seg = ceil (length(data)/(seglen)); %% process ...
a301cb7ddef485c42e6fdf88d2ad169be3f740e5044ac6c6bd09261b158bb6c7
MATLAB
4,425
130
%BOFRE AND AFTER for i = 1:2 [pl2_file,pl2_path]=uigetfile('*.pl2','Select all individual .pl2 files','MultiSelect','on'); datafile = fullfile(pl2_path, pl2_file); exp_name = inputdlg(pl2_path,pl2_path,[1 40],"after_OPN"); pl2_path1{i} = pl2_path; datafile1{i} = datafile; exp_name1{i} = exp_name...
2af52a4798ddbc5eea02fe73b2f2b3789690539db430b031d6465bb9ca5b8814
MATLAB
4,426
133
%{ ---------------------------------------------------------------------------- Determine the time window for task relevant neurons %Start of task %Sound on %Sound off %Before choice %After choice (0sec) %After choice (1sec) %After choice (2sec) %p = 0.001 %Each epoch, predict the prior, sensory and choice...
12acd85f23c6716a96312ae47afd7c40d494846cdf217b839239ac9fdaeefded
MATLAB
4,428
128
function combined = combine_IQR(set1,set2) % combine values from IQR analysis across animals, easier for statistics for shuffle_idx= 1:2 if shuffle_idx ==1 shuffle_indicator = 'shuffled'; else shuffle_indicator = 'not_shuffled'; end ...
21885d6ecb3a8b7383cbb13e6e8d1e7d3192c7672a9a112e965f3e3af18bbca0
MATLAB
4,428
145
function [nCIJtree CIJtree mdeg globalcosteffmax costmax E ]=threshold_omst_gce_wd(CIJ,flag) % threshold_omst_gce_w Optimizing the formula GE-C via orthogonal MSTs. % % [nCIJtree CIJtree mdeg degree vector cost ]=threshold_omst_gce_wu(CIJ) % % This function thresholds the connectivity matrix by absolut...
af54c2fa84f0c1e11160ea08dd2271e01de2608cc0b202a26e3af36e0568659b
MATLAB
4,429
124
%% EAG_Analysis_ExampleDrift % bla % % Version: 25-Mar-24 (R2023a) % Clean up clc; clear all; close all; % Add paths: % --- Current paths addpath(genpath(pwd)) % --- Toolbox for exporting publication quality figures % https://github.com/altmany/export_fig addpath(genpath('...\GitHub\export_fig')) mkdir('FIGs') %%...