sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
10c609b8de12135a132ed88466c5fd96c0085956bd74f13127b2792f746d2d45
MATLAB
6,240
143
function WonWoffTtest3000 global StartTime FinishTime fname SpikeUnits TurnMarkerTime OneTurnTime RPegTouchAll LPegTouchAll DrinkOnArray dpath3 render... MedPegTimeR MedPegTimeL RpegTimeArray LpegTimeArray RpegTouchall LpegTouchall WaterOnArrayOriginal WaterOffArrayOriginal... RpegTimeArray LpegTimeArray DrN...
4f9b0eb18b01ec91b9ff502b584c22f9cd70ee09f2687989bee6bc0d3fc7156e
MATLAB
6,248
164
function SF = spm_psc(SPMs,varargin) % either return the maximum heights of regressors among SPMs or % computes the percentage signal change using the information from the % SPM.mat - if the scaling factor is not specifed, figures will pop out for % each subject and the SF will have to be specified. % % FORMAT: spm_ps...
5743d52591b889e01276d12e0065a662f2818c26f821af8fc1e830cffd70e7d6
MATLAB
6,248
156
function [eeg_data, emg_data, fs, varargout] = bdf2mat_main(trl_num, elec_num, emg_ch, eeg_ch, filename, varargin) % % [eeg_data, emg_data, fs] = bdf2mat_main(trl_num, elec_num, emg_ch, eeg_ch, filename) % [eeg_data, emg_data, fs, emg_onset_sampl, emg_onset_time] = bdf2mat_main(trl_num, elec_num, emg_ch, eeg_ch, filen...
35dcc7f9e8bcddddbb1888ccb0321b7096bc0a40d648a61a88100950ee3ecfb8
MATLAB
6,254
123
function update_entropy_axis(app) %%update_entropy_axis plots the result of the entropy analysis cla(app.ax_entropy1) cla(app.ax_entropy2) cla(app.ax_entropy3) cla(app.ax_entropy4) int_idx = find(strcmp(app.popup_int_entropy.Value,app.popup_int_entropy.Items)); int_name = app.popup_int_entropy.Value; channel_idx = fi...
580d6e59748ebe30c901202b7a3064eb6b205cd9bf0866e244be18de61d875e0
MATLAB
6,259
151
function plotIndividualEntire(PreprocessedData,allTrials,setupParam,FitCurve) tempX = PreprocessedData.DecayAdj.Dts; allTrialsID = allTrials.ID; if setupParam.CompareGroups == 0 figure(1) %signal subplot(3,3,1) title('Raw Signal') hold on plot(tempX,Prep...
674891cfb95c760c610bc39e71631e5cca8b60c73f72c08b0eb5b3afdc1e21e7
MATLAB
6,265
150
function layers = cnnsetup(layers, isgen) assert(strcmp(layers{1}.type, 'i'), 'The first layer must be the type of "i"'); n = numel(layers); for l = 1 : n % layer if strcmp(layers{l}.type, 'i') % scaling assert(isfield(layers{l}, 'mapsize'), 'The "i" type layer must contain the "mapsize" field'); if (...
d35f2d8acaabf452c360a4d1c1eb7de94d9f8b1eeacdc78567118a5e3bd8fc8f
MATLAB
6,270
162
function [layers, pred] = forward(layers, passnum) n = numel(layers); batchsize = size(layers{1}.a, 4); % number of examples in the minibatch for l = 1 : n % for each layer if strcmp(layers{l}.type, 'i') if (passnum == 3) continue; end; if (isfield(layers{l}, 'mean')) layers{l}.a = ...
3bba453b0d78e3c7ecd362dd62c9a6640745f11f1f34021fe7c5f6d682dd6268
MATLAB
6,274
145
function WonWoffTtest2000 global StartTime FinishTime fname SpikeUnits TurnMarkerTime OneTurnTime RPegTouchAll LPegTouchAll DrinkOnArray dpath3 render... MedPegTimeR MedPegTimeL RpegTimeArray LpegTimeArray RpegTouchall LpegTouchall WaterOnArrayOriginal WaterOffArrayOriginal... RpegTimeArray LpegTimeArray DrN...
b1d1bd94c03816d1d04de10bac1ea8a52a1dba76200ccb27f67f4148b6b45d32
MATLAB
6,287
146
function out = getFiring2ACh(units, beh) % Align firing rate of units to peaks and troughs of ACh photometry signal % % out = getFiring2ACh(units, beh) % % INPUTS % 'units' - structure containing spike times for units and recording ID, % for matching to behavioral data in 'beh' % 'beh' - structure co...
36b5881ad33fdafb1d01b111f36b5ae0cc8def86f1323811bde63be602c33f4b
MATLAB
6,289
198
function out=import_wcp(fn, varargin) %IMPORT_WCP Import WinWCP files. % OUT=IMPORT_WCP(FN) imports data recorded with WinWCP, where FN is a % string containing the filename. OUT is the output struct containing the % following fields: % S Cell with C elements, where C is the number of channels. % ...
a668d8eb56b00f46ad6a9c72e6c67a133b4c1d9ac5bcb71a815940f17daf380d
MATLAB
6,291
159
%% Precomputing on Planes: Give input, compute firing rates as functions of inputs % Output: save([SaveFolder 'MFpV_LDE_' num2str(InputCtgr) '.mat'],... % 'f_EnIOut','meanVs','SteadyIndicate','FailureIndicate','L4ERcrd','L4IRcrd') % Input: InputCtgr: Choices from 1-3. Orthogonal, suboptimal, optimal %...
2141525cb7ce963afd8dd1fd15cb81b6a8a09f5036536e30bf93b1ac6dcba42a
MATLAB
6,298
196
function [Bursts, Diagnostics] = aggregate_cycles_into_bursts(CycleTable, CriteriaSet, KeepTimepoints) arguments CycleTable CriteriaSet KeepTimepoints = [] end % goes through all peaks found, puts them into structs according to % whether they make up a burst, or if they are on their own. % Peak_Thresholds i...
bc9e8a2d8705145666557bf8c50baacdb2f79c1997b7409ea14ba4df0e6b5640
MATLAB
6,304
209
function conc = correct_water_content(conc,scale_fact,ttype) if ~exist('ttype') ttype=0; end %ttype=0 spectro dystonie %ttype=1 spectro hypocampus %ttype=2 spectro 7T gosia if ~exist('scale_fact') scale_fact=1; end if ~isfield(conc(1),'fgray') fprintf('no field fgray so no correction ...\n'); return end...
3a0d855e4c821c42f00385c59facc8b8b89e1d935f308586938446beff4b1b4a
MATLAB
6,305
196
close all clear [fname,chemin]=uigetfile('*.*','MultiSelect','on');%loads file if isequal([fname chemin],[0,0]) return else dir_result=[chemin,'Resultats_Ensemble\']; if (exist(dir_result))==0 mkdir(dir_result) end %chemin='F:\Donnees_Experiences_general\Analyse_Agnes_stanislav1401...
69a2308f0564e5e82a4c6014a48fd31af5e96b89f1d60883437df1e9070e427f
MATLAB
6,313
243
%PGDRAW Sample from the PolyaGamma distribution % X = pgdraw(...) generates random variates from PG(1, z) % % This file implements the Polya-gamma sampler PG(1,z). % This is a MATLAB implementation of Algorithm 6 in PhD thesis of Jesse % Bennett Windle, 2013 % URL: https://repositories.lib.utexas.edu/bitstr...
de566b1e682797bdf30e848833deacb2e596551fe443d57ee21a4f752bdbec74
MATLAB
6,314
158
function [this_fitMat_mm, thisRot, rotMatDisplacement_mm] = getAffmatsForHost(this_fitMat,twix_obj,reconPars) % this_fitMat = fitResult.MPos_cent.mats; % reconPars.swapDims_xyz %% Try to establish slice orientation - this has not been rigourously tested for all possible orientations...! sNormal = twix_obj.hdr.MeasYa...
e9479e8cc3eaeacde9962251de11fc8ece444d1737d485052caf24052933b700
MATLAB
6,316
122
% Raster plot of baseline activity % Chang et al., Fig 2a % Load data load('E:\CM_NeuralActivity_Analysis\ROC\block_selectivity\Unit_AUC_BP_100msBin_1000nBoot') % block selectivity load('E:\seFilePaths_SiProbe'); % File paths for MSessionExplorers load('E:\CM_NeuralActivity_Analysis\Unit_quality_metrics\filter'); % U...
88daef6977d31a40bf5e61b05b7d2833f8a469144f3f99c92ec2b6d6f7878a36
MATLAB
6,319
205
function Randomizer_ShowDataSet2(handle) % Copyright 2009-2018 Thomas Koenig % distributed under the terms of the GNU AFFERO General Public License figure(handle); uitableNames = uitable; out = get(handle,'UserData'); pos = [0.05 0.10 0.45 0.85]; set(uitableNames,'Data',out.Names,'ColumnName',out.conds,'Units','Norm...
20f7429be5061ca371170d54d06a65bef5ab816c2531f9c4e532104739bcdc07
MATLAB
6,324
246
%PGDRAW Sample from the PolyaGamma distribution % X = pgdraw(...) generates random variates from PG(1, z) % % This file implements the Polya-gamma sampler PG(1,z). % This is a MATLAB implementation of Algorithm 6 in PhD thesis of Jesse % Bennett Windle, 2013 % URL: https://repositories.lib.utexas.edu/bitstr...
4f884f6d8c713fea7684d39e888e273da6239a84e09ca3c9cedd1665157cbe78
MATLAB
6,325
148
function WaterOnOff20190705 global StartTime FinishTime fname SpikeUnits TurnMarkerTime OneTurnTime RPegTouchAll LPegTouchAll DrinkOnArray dpath3 render... MedPegTimeR MedPegTimeL RpegTimeArray LpegTimeArray RpegTouchall LpegTouchall WaterOnArrayOriginal WaterOffArrayOriginal... RpegTimeArray LpegTimeArray D...
d466f6fbff2acee4b3f3299968a73a8580b72c85d3257379965a9e63a524d41f
MATLAB
6,327
167
function varargout = Phase_Features(phase_sig1, fs, Th, varargin) % % varargout = Phase_Features(phase_sig1, fs, Th) % varargout = Phase_Features(phase_sig1, fs, Th, phase_sig2) % % ************************************************************************* % * Calculating popular phase related quantities, i.e. Phas...
60560b1fcc955d7c401b0183c50f2d05829d43c0a063b36600d3765a1d40e662
MATLAB
6,332
166
classdef (Hidden) mat_file_sdk < handle % % Class: % adi.mat_file_sdk % % This should expose the SDK in a similar manner as the regular SDK % but it should do it from a mat file. % % The h5_file_sdk borrows implementations from this class and then % changes some of the me...
5e116ed36845d18801c768467ca59d1fb19beab6b2f76afda849b69ef210636f
MATLAB
6,336
165
function senpai_prune(parcellation,varargin) % senpai_prune % This function runs a GUI that displays, one by one, all the neurons % in the input parcellation. The GUI is intended to allow the user to % assess eventual misassignments. It is possible to mark unrecognized % neural cores that ca...
569d49598e96ac5df7177fe750b71483539d59464ad3c866ec0196d2171b184c
MATLAB
6,339
182
classdef (Hidden) handle_manager % % Class: % adi.handle_manager % % This class keeps track of open files and attempts to prevent % closing a file that for some reason is not actually open. % % This class is called directly by functions in adi.sdk % % It is only used ...
25a6b67010babb6f3cc2f6ce2c57017d318ba09585ffac6e721fe522dc2952cc
MATLAB
6,341
174
% _skipMoCo version strips out all MoCo to speedup getting through ASPIRE % pipeline for testing load(cleanupFile) run([RETROMOCOBOX_PATH '/addRetroMoCoBoxToPath.m']); addpath(SPM_PATH); run([ASPIRE_HOME '/aspire_startup.m']); %% Run ASPIRE on both noMoCo and MoCo data.read_dir = tempDir; data.filename_mag = fu...
4071fd8dff533ab895ef047e7d3af1f104e65e93b14703259e1d49c51a088fe3
MATLAB
6,342
192
new_path = '/Users/rsameni/Documents/GitHub/OSET/external/MutualInformationICA'; current_path = getenv('PATH'); setenv('PATH', [new_path ':' current_path]); %The first step is to compile the C-source codes into executable files, which will be then called be the MATLAB Programms % for example (under linux) % icc -c...
fa4a6fa1e271e992587728bab80dbcb12ec0b2adb9616a57b00375904f1cb6c6
MATLAB
6,343
136
% Test script for an ECG denoiser based on a data driven MAP estimator in % the phase and time domains close all clear clc % Load data % datafilepath = '../../../../DataFiles/Physionet.org/files/ptbdb/1.0.0/'; % Change this path to where you have the .mat data files % fs = 1000.0; % Sampling frequency of the data (pu...
ac2144af2b2910571e407a11f14780f108f5cb428829cbbc6c13232b5acbb2a2
MATLAB
6,344
163
function [ecg, phi] = ecg_gen_afib(N, fs, params, phase_bins, varargin) % ecg_gen_afib - Synthetic atrial fibrilation ECG generator % % Method: Generates synthetic ECG signals by generating Gaussian mixture % models with stochastic deviations in the phase domain, followed by % inversion of the polarity of the T-wa...
9039558895418a5f7af37bb9fbb78cbc9a8aa385cf97f5f96ba341ed354fc0a9
MATLAB
6,359
218
%This function performs the MCMC for pibdfc and stores the output into the %structure: post_draws %% Input [T timepoints, R regions, N subjects) % Y - TxRxN array of the observed data % xDat - TxKxN array of the exogenous variables % S - int number of connnectivity states % Z_prior - SxS matrix of the prior means for ...
ac6943f87df2650f86a3334cb7fd5756e63b323a0320b5754fdcee4b9cad6568
MATLAB
6,363
139
function [rhos,pvals,spatial_system,flag] = virtualRemovalSP(feature,coordinates,soz) % computeSPMap Applies a perturbation on the spatial system by virtually % removing the SOZ as described in the original manuscript. % % [rhos,pvals,data] = virtualRemovalSP(feature,coordinates,soz) takes as % input the cha...
3e1e955dffb85aa02601fb1dec5b5b45f6cd6a3d184b50f56316d69676ac0e12
MATLAB
6,373
193
function [Thresh]=mnl_EvaluateColourDistribution(nDim,efPxTrace) %% Option 1 - Evaluate the range of colours in the traces - cumulative plot % Possion distribution at various copy numbers Spreads=[0.5 1 2 4 6 8 10]; NumPoints=size(efPxTrace,2); %Do the same number as the number of somas szSp=size(Spreads,2); % Generate...
8520479dbe97d8584e7e8bb0c4043536855ff56e710176b0bfd2f28f34d45db5
MATLAB
6,381
194
function [Dimension,ThresholdsPerDim]=mnl_EvaluateNdimensions2(maxDim) Spreads=[0.1 0.2 0.5 1 2 4 6 8]; %NumPoints=(2^maxDim)-1; %If we can discriminate On and Off cells NumPoints=10000; szSp=size(Spreads); %% Generate Poission Distributions For Each Set of Dimensions for i=1:maxDim [Dimension(i).Cells]=mnl_Generat...
abdb01efaa8f031ce3ed57e5bd5cd870453609fcfa55ff4753c6cd37d73e2d3e
MATLAB
6,381
153
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This script plots fitted models to different groups of treated animals, % using growth and dissemination parameters from untreated animals reported % in [Benzekry et al., Cancer Res, 2016] but setting the primary tumor % growth rate to zero...
4d712394cc2e118e6efcb8a422a67ccb6a1dd4e056cd7be198f6259a3f1c5627
MATLAB
6,382
136
function out = getSynchrony(units, beh) % Compute pCIN-pCIN cross-correlogram % % out = getSynchrony(units, beh) % % INPUTS % 'units' - structure containing spike times for units and recording ID, % for matching to behavioral data in 'beh' % 'beh' - structure containing behavioral data, including on...
f0cd775c50b7948960f8ee01460a61348ffbe11d0bee828ffa9baa2627632a07
MATLAB
6,383
49
% Cardiac model ToR-ORd % Copyright (C) 2019 Jakub Tomek. Contact: jakub.tomek.mff@gmail.com % % 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...
ca9af2e23688fcaa3ecc836480925b54d31c32483701a1de66594119f817c7de
MATLAB
6,384
166
% Copyright 2024 Eelke Spaak, Donders Institute. % See https://github.com/Spaak/rift-phase-and-visibility for readme/license. % Belongs with: % Spaak, E., Bouwkamp, F. G., & de Lange, F. P. (2024). Perceptual foundation and extension % to phase tagging for rapid invisible frequency tagging (RIFT). Imaging Neuroscience,...
8b19238d48b0a660907ffc147b528ea128d5fede7509ea09201a18d14a392e8d
MATLAB
6,385
181
%impoved HMM code for batch processing by Yunxiang Zhang (yxzhang@gmail.com) %last updated Nov 9th, 2021 function HMMint=Hmmtrace(filename) %Import the observation sequence intis=readmatrix(filename); intis1=intis(:,2)-intis(:,3);%background subtraction-pay attention to definition of each column intis1(find(isnan(inti...
63f31a9625190606254edd9fbeffa695e738f7faea29c87dfd0db15b0c18d837
MATLAB
6,387
164
function [ecg, phi] = ecg_gen_inv_t_wave(N, fs, params, phase_bins, varargin) % ecg_gen_inv_t_wave - Synthetic inverted T-wave ECG generator % % Method: Generates synthetic ECG signals by generating Gaussian mixture % models with stochastic deviations in the phase domain, followed by % inversion of the polarity of...
266be575a03d55e535aa3597b8c5aef9b49ebd8730fdc003f95bc5f84a00e89f
MATLAB
6,388
257
clear clc %% add togethter meny WF files [filename 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. datafile = fullfile(path, filename); %save path %% CTP = []; for i = 1:length(datafile) % CTparameters. ...
71adda78a043db46cc5ee361461e5aaa0c7c9c405ff65778cca7815f32de5fc5
MATLAB
6,391
184
function [y1,y2,Pbar,Phat,PSmoothed,Kgain] = KFNotch(x,f0,fs,varargin) % % [y1,y2,Pbar,Phat,PSmoothed,Kgain] = KFNotch(x,f0,fs,Q,R,gamma), % Removing Power-Line noise using a linear Kalman filter and smoother % % inputs: % x: vector of noisy signals contaminated with power-line % f0: the notch frequency % fs: s...
32262a0a09a0ef83ca9a970f0dfc738b39cf0d566e35c1037f7d105625e8a56e
MATLAB
6,402
165
function M = smc_oopsi_backward(S,V,P) % this function iterates backward one step computing P[H_t | H_{t+1},O_{0:T}] % Input--- % Sim: simulation metadata % S: particle positions and weights % P: parameters % Z: a bunch of stuff initialized for speed % t: current time step % % Output is a single structure ...
db6659b936f9b8a9a23408560f5db82e10ea18ea8773971e2081d96c06c05269
MATLAB
6,411
118
function update_entropy_axis(app) %%update_entropy_axis plots the result of the entropy analysis cla(app.ax_entropy1) cla(app.ax_entropy2) cla(app.ax_entropy3) cla(app.ax_entropy4) int_idx = find(strcmp(app.popup_int_entropy.Value,app.popup_int_entropy.Items)); int_name = app.popup_int_entropy.Value; channel_idx = fi...
4a2d4b3ac5b8c168747c63b7b89244cd8c632cd23bf6c816da21af8f064d7028
MATLAB
6,413
161
function varargout = RaguCollapseXAxis(varargin) % RAGUCOLLAPSEXAXIS MATLAB code for RaguCollapseXAxis.fig % RAGUCOLLAPSEXAXIS, by itself, creates a new RAGUCOLLAPSEXAXIS or raises the existing % singleton*. % % H = RAGUCOLLAPSEXAXIS returns the handle to a new RAGUCOLLAPSEXAXIS or the handle to % t...
70aa9fa6dbd316ff6885dde13dc6ce3601ae80e5c80d04a8a23e8f25f67db24f
MATLAB
6,418
135
function AnalyzeResults16_SpectralFeaturesFunction(Rdata, Rtextdata, outputfileame1, outputfileame2, per_subject, ntrees) % close all; % % parameters % % % % logfileame = 'SVMOptimizedParamters03.txt'; % outputfileame1 = 'Submission55.csv'; % outputfileame2 = 'Submission55_unbiased.csv'; % % % bins = [50 75 100 120 180...
ad8455786907a4e99df86d2bbb42c22c41fb2e329457b711110c0cf9ea7bf02f
MATLAB
6,421
133
% This program is intended to extract % % % time series of BOLD signals from session2 % % % by Hiro Taiyo Hamada, Araya Inc. addpath(fullfile(pwd, '/programs')) % session2Day datapath_session2nd = fullfile(pwd, '/data/session2'); listing_tph_session2 = makeList(datapath_session2nd , '*TPH*'); listing_cont_sess...
6708bffa8850aae3e2f688561a47dccc08c870cb187137223610176e27f84ff4
MATLAB
6,434
171
%% Calcium Imaging Analysis Operator (manually select ROIs) % CIAO_02b_selectROIs allows you add a manual selevtion regions of % interest. % We assume that there is a 03_Data_Processed folder within the main animal % folder that contains a mat-file for each stimulus, the meta_info.mat % file, and the img_segmentation.m...
606f3f968f322ad7910bd471b7870a38193c6fa625bbc4f80b0edc4602e622a7
MATLAB
6,437
165
% this script calculates the variance of FWF and T1w in % NAWM of MS patients and check its correlation with significant behavioral % scores and clinical parameters clearvars close all addpath(genpath('/storage/stella/MATLAB_toolboxes/')); addpath('/storage/stella/Analysis/matlab_scripts/'); cd('/storage/stella/Analy...
66d3f96dc2acdfddd676ad19ba6c14b42668877ecfbc07f0bff06c35ca626a4b
MATLAB
6,441
162
%% Precomputing on Planes: Give input, compute firing rates as functions of inputs % Output: save([SaveFolder 'MFpV_LDE_' num2str(InputCtgr) '.mat'],... % 'f_EnIOut','meanVs','SteadyIndicate','FailureIndicate','L4ERcrd','L4IRcrd') % Input: InputCtgr: Choices from 1-7: 6 division of the angle. % ...
4693591981ad7555b4729c8c5f01f362b70d189c0e75e0ad9accc943040ef234
MATLAB
6,444
109
%% NOTE: Add ambient, add synaptic failure, maybe change ref setup %% Great Change here: % Adding E-to-E synaptic delay for 1 ms % EEDlyRcd is an N*T sparse matrix, each column record the number of % pending kicks that is waiting, with T_i*dt ms remaining. Each raw record % all the pending E kicks for one E neuron ...
44ebae07dddf2e1177b362b9c5f98717a78e52547924a74d6f687c51c4d7f242
MATLAB
6,449
115
clear; close all; clc; addpath 'G:\Sameni\Documents\Papers\Journal 40 (Spline ECG Filtering)\CODES' randn('seed', 0); rand('seed', 0); % % % dbstop if warning type = {'Normal', 'Arrhythmia', 'PTB'}; for ttp = 1 : length(type), switch(type{ttp}) case 'Normal' pth = 'J:\ECGData\Normal'; ...
71dbe74c4963dc4469a21eaaa4d2ad04d828ab30bc86c6daa75e6c3bbf462673
MATLAB
6,457
180
%-------------------------------------------------------------------------% % This script can be used % % a)to change the format of images in order to have the input data for the% % python script % % b)to visua...
7ba1096951dee7743d7e9a5df7ee7724fc1861423b30676753a4f3f6fcb7d0a4
MATLAB
6,458
183
function [volume_outliers, slice_outliers] = spmup_spatialcorr(varargin) % look at the time series per slice, and compute correlations % this allows testing that images are alike and spots drop out easily % % FORMAT: [volume_outliers, slice_outliers] = spmup_spatialcorr % FORMAT: [volume_outliers, slice_outliers] = sp...
a5994d7a51286f9a155735751cf925424bcacb3c14bc760a36ffa33d0694cbe0
MATLAB
6,458
191
% Test program for maternal ECG cancellation using EKF and EKS % % Dependencies: The baseline wander and ECG filtering toolboxes of the Open Source ECG Toolbox % % Sample code for testing naive maternal template subtraction technique % % Reza Sameni (C) % Email: rsameni@shirazu.ac.ir % Web: www.sameni.info % ...
752079207b5b0b390f2ffb4021913d00a3894e072d14fda902ee01a3d6b3cccf
MATLAB
6,459
175
function SpikeDataAnalysis clear all; close all; % SpikeDayMatrix//“ú•tABgra‰Û‘è”ԍ†A89or89‰Û‘è”ԍ†AC‰Û‘è”ԍ†Aƒeƒgƒ[ƒhx8i>RatioARcell”j %@AllSpikeData‚Ì—ñ@Š„‚è“–‚Ä TargetDirectory='C:\Users\B133_2\Desktop\CheetahWRLV\119'; cd(TargetDirectory); % cd('C:\Users\B133_2\Desktop\CheetahWRLV\119'); ...
757faaa5527f265421009fab9821b5e1c394c9356219a98ce724249f97e915dc
MATLAB
6,461
113
function [FinalIm,ConInc,FinalCompLevel,datestamp,NumAttempts] = IncompleteLetterLoopFitFun(ImWidth,ImBorder,PropComp,CheckSize,WhichLetter,NumImages,Tol,MaxAttempts); % [FinalIm,ConInc,FinalCompLevel,datestamp,NumAttempts] = IncompleteLetterLoopFitFun(ImWidth,ImBorder,PropComp,CheckSize,WhichLetter,NumImages,Tol,MaxAt...
0ea741297e3425c6006722310e7bab5fad52aefc263aa66005c64a89723e3648
MATLAB
6,470
165
close all; clear; clc; resultfname = 'testProcessSeizureEEGAllSpectralFeatures4.txt'; resultfname_wavelet = 'testProcessSeizureEEGSpectralWaveletFeatures4.txt'; % this is the same as the previous one; except that the feature vectors are % kept in the frequency domain (look at F, F1, and F2 and how they are % transposed...
630fe53c82a37e0a0bea1d0b590cc26516ed664038108736d21e005e2b3ef3f6
MATLAB
6,470
189
% Load data clear load gm1/results_gm1.mat load gm2/results_gm2.mat load Cv1/results_Cv1.mat load Cv2/results_Cv2.mat load R1/results_R1.mat load R2/results_R2.mat load VTH1/results_VTH1.mat load VTH2/results_VTH2.mat color_VTH1 = {'#362A15', '#C39A54'}; color_VTH2 = {'#144814', '#55D455'}; color_gm1 = {'...
739fdcb87751cb40cdda131de9a1efd5f6db4ce109a2bca7bc1c4adbc4ad6891
MATLAB
6,471
232
% Save NIFTI or ANALYZE dataset that is loaded by "load_untouch_nii.m". % The output image format and file extension will be the same as the % input one (NIFTI.nii, NIFTI.img or ANALYZE.img). Therefore, any file % extension that you specified will be ignored. % % Usage: save_untouch_nii(nii, filename) % % nii -...
9c2425a9ecc944bb65df2d95404d353b11577b6d63d4ad5006f3440c4e0dfc03
MATLAB
6,472
168
function [y, h] = white_noise_wiener_filter(x, fs, nvar_est_mode, params) % WHITE_NOISE_WIENER_FILTER - Designs and applies a Wiener filter to suppress % white noise in a signal with estimated or provided noise variance % % Inputs: % x - Input signal % fs - Sampling frequency (Hz) % nva...
35e6878531fe411731843a26dd747d010bb3bad824112255830760cd44078991
MATLAB
6,479
162
%% Feature Explorer ******************************** % Script to plot boxplots, pdfs and explore effects % %% Load Tabel ************************************** Import_FinderSpiker; button = questdlg('Paired data?','Data'); Load_Default_Directories; Dirpwd=pwd; slashesindx=find(Dirpwd=='\'); CurrentPathOK=[Dirpwd(1:sla...
c2bf406b31e598784383bc0aed70b61829823e185503177fa8c1a1660dadef63
MATLAB
6,482
166
close all; clear; clc; % parameters subject = {'Dog_1', 'Dog_2', 'Dog_3', 'Dog_4', 'Dog_5', 'Patient_1', 'Patient_2'}; ffs = 160; % resample rate f0 = 60; % powerline frequency Hz Q = 30; % notch filter Q-factor epochlen = 60; % epoch length in seconds epochoverlap = 50; % overlap between epochs in seconds sourcenum =...
afdf6b47a0a3d6eac5886d57c178ee366505c3be3a7370ace27d2acec2ffd9d4
MATLAB
6,490
224
% The deflation algorithm and double KF for fetal denoising % Copyright Reza Sameni, 2018 % Created 2008 % Modified June 2018 % clear; close all; load('FOETAL_ECG.dat'); data = FOETAL_ECG(:,2:end)'; time = FOETAL_ECG(:,1)'; clear FOETAL_ECG; fs = 250; L1 = size(data,1); L2 = size(data,2); bins = fs; % R-...
34c64b75a7ea860a93e7a479483c758f569c93cb228b962d4136a8f6f7fb9dbb
MATLAB
6,497
182
function [score1, score2, peaks1, peaks2, rank1, rank2] = sqi_multi_matched_filter(x,f,fs, varargin) % sqi_multi_matched_filter - Signal quality index based on three fixed % template matched filter output envelope scatter and average waveform standard % deviation % % Usage: % [score1, score2, peaks1, peaks2...
638f36b5dcd1c584f9c521228febd2c893d56e5d73d251726d8c27ea4b5d954c
MATLAB
6,513
226
function [cluster_res] = cluster_spikes(index, spikes, par,threshold) par_inp = par; %% min_spikes4SPC = 16; % if are less that this number of spikes, clustering won't be made. %default config par_input = struct; parallel = false; make_times = true; make_plots = true;%make_plots = true resolution = '-r150'; sav...
660af4c50df19eb4dc95e0ae745dde27f28a0700b486e6c9dfa7f94e21c7e686
MATLAB
6,515
188
function success = revert(obj, revertTo) %REVERT Delete history success = 0; if revertTo < 0 || revertTo > obj.nEdits return; end % load history from file if exist(obj.hCfg.histFile, 'file') ~= 2 error('history file %s not found!', obj.hCfg.histFile); end fidHist = fope...
fc8e1c8d6c56550b9c4d8570ee3f9b4b566bea054e6acc8d73ce32653ef65d45
MATLAB
6,515
212
%% load data clear p = params_2DAA; fpath = fullfile(p.processed_data_dir,'allData.mat'); load(fpath,'tis','bvs','traces','evs') [cols,alpha] = chooseColors; z_cutoff = 1.96; saveFigs = 1; %% add action start to TIs for non-aa sessions for sub = 1:p.nSubjects for ses = [1 10 11] spd_diff = diff([bvs{sub...
edc3874d642ea978f181ef91ffacd901038107184acb813622aac0a89e5398bd
MATLAB
6,519
226
function [cluster_res] = cluster_spikes(index, spikes, par,threshold) par_inp = par; %% min_spikes4SPC = 16; % if are less that this number of spikes, clustering won't be made. %default config par_input = struct; parallel = false; make_times = true; make_plots = true;%make_plots = true resolution = '-r150'; sav...
561df4fc4e5c8f31ed774764e16f5508679951ec9115690555a80603c5e2096c
MATLAB
6,521
157
function corre_report(app) [int_idxs,~] = listdlg('PromptString',{'Please select intervals ',... 'to be plotted/saved.',''},... 'SelectionMode','multiple','ListString',app.popup_int_spect.Items); [form_idxs,~] = listdlg('PromptString',{'Please select fileformat ',... ''},... 'SelectionMode','multiple...
dbd271a106808d82f359b48b0a087ef671361964b4d6b04ab16a0f8b9cd5e1ef
MATLAB
6,524
160
function corre_report(app) [int_idxs,~] = listdlg('PromptString',{'Please select intervals ',... 'to be plotted/saved.',''},... 'SelectionMode','multiple','ListString',app.popup_int_spect.Items); [form_idxs,~] = listdlg('PromptString',{'Please select fileformat ',... ''},... 'SelectionMode','multiple...
665982edee8b025ccc6fbe518e6a7899782e2ed3d4b1d6da9713461adacb7ec4
MATLAB
6,527
173
function varargout = pdftops(cmd) %PDFTOPS Calls a local pdftops executable with the input command % % Example: % [status result] = pdftops(cmd) % % Attempts to locate a pdftops executable, finally asking the user to % specify the directory pdftops was installed into. The resulting path is % stored for future refere...
a5ecf1aea67cfff0d8f812d16f75778def478c3d86f1de858c1afc220d01a070
MATLAB
6,531
146
%%This script calculates the average cell activity and saves the data in %%the allTraces variable. Run the extractBehaviorData to pull the bins %%data used in this trace. %%James Hyde 3/21/18 function [allTraces] = averageAllCellsFunct(bins, treat, start, startTime, stopTime, normal, normalWindow, baselineBehavi...
57f10aeaa5657167f87cff9da958f6f8dcbf36fb7f9929782379be40bdc03b10
MATLAB
6,537
279
function [c,imap,xm,ym] = dsp3DMap(map,ChanPos,varargin) % dspCMap - Display topographic scalp maps % ---------------------------------------- % Copyright 2009-2011 Thomas Koenig % distributed under the terms of the GNU AFFERO General Public License % % Usage: dspCMap(map,ChanPos,CStep) % % map is the 1xN voltage map t...
fa041fb675047c6f5c93e921d9da3c7249780ba946f4e8a72e247af3094e65a3
MATLAB
6,537
161
function [CB_Vertices,Pixels0,Pixels1] = Find_CB_Vertices(Im,CB_Perimeter,CB_Pixels,Scale_Factor,GS2BW_Threshold,Plot1) % TODO: add a step that finds the best perimeter point to start with. % Plot1 = 0; % [CB_Pixels,CB_Perimeter] = Detect_Cell_Body(Im,0.9,Scale_Factor,1); Pixels1 = []; Pixels0 = []; Smoot...
07463dbb2438b86d94ef4cbb0566a060fbb94b9a8cc9940b56cdbfe9fe5ccb9f
MATLAB
6,540
213
function [nCIJtree CIJtree mdeg globalcosteffmax costmax E]=threshold_omst_gce_wu_very_fast(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...
9ac5ca919ce74bce0e903c665ad9bd61e0d66c65daaa50aaf57502cad968f3e6
MATLAB
6,541
191
% compute width etc. for single cluster EPSP datarange = [3,22];%1:length(data); %% for i = datarange if isempty(data(i).EPSP_singleclust) continue end data(i).amp_single = []; data(i).halfwidth_single = []; data(i).maxdv_single = []; data(i).area_single = []; data(i).risetime_singl...
6e9c8906ba11e6d38ce2fc4bcd1bf01c225415b0c4c6ab334ff0826315706220
MATLAB
6,543
175
function varargout = Ragu_LoretaOptions(varargin) % RAGU_LORETAOPTIONS M-file for Ragu_LoretaOptions.fig % RAGU_LORETAOPTIONS, by itself, creates a new RAGU_LORETAOPTIONS or raises the existing % singleton*. % % H = RAGU_LORETAOPTIONS returns the handle to a new RAGU_LORETAOPTIONS or the handle to % ...
02d0ed65954be2bd4dc109964ff8c65342b61d75d80b0e349bad36f12e40373c
MATLAB
6,544
135
function AnalyzeResults17_SpectralFeaturesFunction(Rdata, Rtextdata, outputfileame1, outputfileame2, per_subject) % close all; % % parameters % % % % logfileame = 'SVMOptimizedParamters03.txt'; % outputfileame1 = 'Submission55.csv'; % outputfileame2 = 'Submission55_unbiased.csv'; % % % bins = [50 75 100 120 180 250 300...
cbb694f364bc3f0a03e479b79a9770eb4c04102d0ff425e1607fd8bf95bfd796
MATLAB
6,551
195
function varargout = ZoomRotate(varargin) % ZoomRotate % % Allows the user to zoom the display, change the speed of rotation, and % spin the current axes. % % Copyright Benjamin Cowley, Matthew Kaufman, Zachary Butler, Byron Yu, 2012-2013 % ---GNU General Public License Copyright--- % This file is part of DataHigh. %...
b26716d1aa2122cd979c640f6b26da02b200d9345f9b7efe83bc8f03b3d14b8f
MATLAB
6,566
63
clear cd D:\Canada_2020\UK_biobank\reports minimal=readtable('minimal_ukb44677.csv'); FI=readtable('D:\Canada_2020\UK_biobank\reports\ordered\FI.csv'); FI(isnan(FI.FluidIntelligenceScore20016_0_0),:)=[];FI.eid=FI.f_eid;FI.FID=FI.f_eid; %horzcat(FI.f_eid(~isnan(FI.FluidIntelligenceScore20016_0_0)),FI.f_eid(~isnan(FI.Flu...
8606e64a457d4ca599458ffe1803ab3027f7842f342898917878d69fd1ff9605
MATLAB
6,571
191
function [pmat_td, pmat_gr, reest] = TM_hierarchical(sbj_id, mode, beta, delta, epsilon, gamma, datdir) %% data load game = []; dirt = []; % south:1, east:2, west:3, north:4 resp = []; % left:1, forward:2, right:3, 4: listen tigroar = []; varnames = {'game','dirt','tigroar','resp'}; Nses = 4; for s = 1:Nses if ...
ff0adc46279a2180a2c15c72828859e3494bab168debc14f9c080a4b4fabcec4
MATLAB
6,600
198
function [a_kf_prior, a_kf_post, a_ks, P_kf_prior, P_kf_post, P_ks, kf_gain, eta, a_kf_pred, P_kf_pred, innovations] = tvar_kalman_sys_identify(y, L, varargin) % tvar_kalman_sys_identify - A Kalamn filter and smoother using time-varying % autoregressive moving average (TV-ARMA) model. % % Syntax: [a_kf_prior, a_kf_...
484982aee6fe2690a59b94dc5ad18272119f41e9ffc98361c40bd8557ed328dd
MATLAB
6,607
157
% Script to create markers based on the OptiTrack for the right index % finger abduction task in EEG-MEG. Trigger is when finger returns to % initial position (i.e. end of finger abduction) % For this, we need the EEG data, MEG data, and OT data % Zelekha Seedat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
d8364c23a9832ee504b7b3cb4a5b14833bf984c312b474f2f027e2cdbf5ed666
MATLAB
6,607
118
% This is the simulation as % PaperFigurestestAllDataECGSmoother08_KnownVarianceOptimized.m, just with % an over estimated noise factor clear; close all; clc; addpath 'G:\Sameni\Documents\Papers\Journal 40 (Spline ECG Filtering)\CODES' randn('seed', 0); rand('seed', 0); % % % dbstop if warning type = {'Normal', 'Arr...
e98e37a2d156d285bec73a1fcf264c6fffd2b688d38d70f672d97245dd7aa7d4
MATLAB
6,613
171
function [PR, PS, PL, PDV, PD] = Phase_Features_MultiCh(meth, sig1, sig2, fs, f0, varargin) % % [PR, PS, PL, PDV, PD] = Phase_Features_MultiCh(meth, sig1, sig2, fs, f0) % [PR, PS, PL, PDV, PD] = Phase_Features_MultiCh(meth, sig1, sig2, fs, f0, WS, ndft, pertnum) % % ***************************************************...
af499b10d4788b5d07ed6c6c96e08cf65961383baf3281de59c83a7e5b110bc0
MATLAB
6,629
244
function res=hbf_CheckMesh(input1,varargin) % HBF_CHECKMESH performs some tests on a boundary mesh % % status=HBF_CHECKMESH(mesh,lasttesttodo) % status=HBF_CHECKMESH(points,elements,lasttesttodo) % mesh: hbf struct for triangle mesh % points: mesh vertices, [N x 3] % elements: mesh triangle description, [M x ...
c1d6439cea43db93d191d6b5dd19f7ef2cb9aa2a5e2a0f81bc2db2dbf7c395be
MATLAB
6,631
171
function varargout = RaguDataProps(varargin) % RAGUDATAPROPS M-file for RaguDataProps.fig % RAGUDATAPROPS, by itself, creates a new RAGUDATAPROPS or raises the existing % singleton*. % % H = RAGUDATAPROPS returns the handle to a new RAGUDATAPROPS or the handle to % the existing singleton*. % % ...
a2fe768f7d3ff1ad78b89dfcab018a420f2f8ce16c0000e687a06b59ec127138
MATLAB
6,646
173
function [x_filtered, x_filtered1] = ecg_den_seg_wise_smoother(x, varargin) % ecg_den_seg_wise_smoother - Implementation of the piece-wise ECG filter using smoothness priors. % % [x_filtered, x_filtered1] = ecg_den_seg_wise_smoother(x, DiffOrder, wlen, lambda, guardlen_l, guardlen_u, adapt, withwindow) % % Inputs: % ...
a13d9e77bde0f758ba68dc87fc1293f781bcaae5a08e6cc2199c37bd1536f4ab
MATLAB
6,647
149
% This file is a demo for testing the ERD/ERS analysis functions % This function is produced by Esmaeil Seraj (esmaeil.seraj09@gmail.com) % % Dependencies: Functions "bdf2mat_main.mat", "emg_onset.mat", % "trigger_avg_erp.mat", "BPFilter5.mat", "BaseLine2.mat" % and "sig_trend.mat" (provid...
4dddad4e7fa7e260958ee836e33bd4bb55d6aea6cc6e338ffb64648f4dccb334
MATLAB
6,648
257
%% oscillations in spike trains? %% spectrum of psths %% %% load data load('PSTHdata_wCellTypes.mat') %% get reliable responses rangeThresh = 3; reliThrsh =-1.645; zThresh = 3.29; statGoodVals =stat.reliVec<=reliThrsh & stat.rangeFRVec>=rangeThresh & stat.peakAbsZVec>=zThresh; runGoodVals = run.reliVec<=reliThrsh &...
b2c846e5217c4e0b7bfbcf5d54b336381cdff741f5b0b876ad900675ccd72780
MATLAB
6,649
160
%% SCRIPT TO REMOVE BAD ELECTRODES AND TO INTERPOLATE REMOVED ELECTRODES. % Date: 28-05-2018 Programmed by: Deirdre Bolger. % This script allows the user to both remove noisy electrodes and to % interpolate these electrodes using spherical spline interpolation. % The bad electrode rejection and...
beab8f8658c7c6712dba95ad2d1649b599ba550034343eb297f3276ec8118cbe
MATLAB
6,651
267
classdef linear2dFit<conicFit %A class for executing and managing 2D line fits properties (SetAccess=protected) %angle; %inherited x1y1(2,1) double %line segment end points x2y2(2,1) double end properties (Dependent,Hidden) abc (3,1) ...
d1f9fe3d29b7acc26ec0964e4e6bac714ca3ba4d9ab87a07156ed1baf28250e5
MATLAB
6,651
73
%% Set parameters %Subject numbers: subjNums=[100307 120212 162329 196144 221319 530635 702133 885975 123117 142828 163432 197550 249947 552544 729557 887373 103414 124422 143325 167743 199150 250427 559053 732243 889579 103515 125525 255639 579665 734045 894673 103818 128632 149337 172332 200614 293748 581349 748258 ...
33dfd3cb1253fd90d6b5cbda9f344f2f385309818768f1513c798ae10b4eb1c6
MATLAB
6,653
178
%% Neural Ensemble Detailed Features Display % Script that read and boxplot by EACH Ensembles Features % between or among Conditions of one Several Experiments % Figs % '%Neurons','Time Active',... [1] % 'Domminance','ErrorClass',... ...
a2bad36b6211497e84f2475d33d5557545177d9f086b85084379d9ef33a78f9d
MATLAB
6,653
206
clear close all clc load Liza_all_data_psth.mat %% Scatter contol/5th(4d) ON_ctrl = (max(all_psth(1:2:end,50:70)'))*5; ON_5HT =(max(all_psth(2:2:end,50:70)'))*5; [t,o] = ttest(ON_ctrl,ON_5HT) [c,p] = corrcoef(ON_ctrl,ON_5HT) r_sq = (c).^2 set(figure(1),'Position', [10 400 600 280]) subplot(1,2,1) scatte...
852ac5b55de7cc77fa93f5434c5a6e88dfcb82ccb758cf68b7b54dac0346e469
MATLAB
6,663
219
function [hCfg, res] = spykingcircus(loadPath) %SPYKINGCIRCUS Import a SpyKING CIRCUS session from NPY files [hCfg, res] = deal([]); phyData = loadPhy(loadPath); if ~isfield(phyData, 'loadPath') return; end loadPath = phyData.loadPath; cfgData = struct(); cfgData.outputDir = loadPath; % load params and set them ...
d9e6d28a440a81928da6b55fce7f1184211f6a1ebb007c9d7fd49333961f13f5
MATLAB
6,667
206
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/Gosia/First/basis_LASER_TE=65_CENIR.BASIS'; %basis_set_file_path = '/home/romain/data/spectro/Basis_set/Gosia/LASER/TE_65/basis_LASE...
0eaa5d40f74b47457a3037adc25bb0a0adc2fe068a61682fd694c9ea843f0a36
MATLAB
6,668
146
%MakeFragLetterSloan %code to generate fragmented letters, similar to the VOSP test %here using Sloan letters, loaded from image files %specify image size, IntactProp (proportion letter intact = 1/fragmentation) and checksize under image parameters below % %code by Keir Yong, modified J Greenwood %v2.1, June 2022 clea...
2482d23e43da1bf576578d28293d98509b7c1a43a5b3b4b213acecb967291f86
MATLAB
6,669
237
% - analysis of tone-action interaction in 2DAA (drop in tone signal with % action start) % - this came out very nicely in the 2TAA experiment (CS1 shuttles in T2) % - for 2DAA we have a similar situation: at the start of task 2 animals % perform d1 shuttles, but tone is not shut off % - collect error trials for sessi...
69ae13411e5c1d4deaadbba496508482ae7eb0712198b60360bf89918e7f7897
MATLAB
6,676
226
%% Analyse PSTH metrics by cell-type %% onset and offset features by cellType plotFlag=false; for itype = 1:3 %%%%%%%%%%%% onset features %%%%%%%%% statVals = stat.onsetCharVec(statGoodVals & stat.cellType==itype); runVals = run.onsetCharVec(runGoodVals & run.cellType==itype); statSessions = stat.session(statGoodV...
b134750b5f3b3d81ea220845cabc0be3ac87839ef7634beff4659c1ae6cfe0b9
MATLAB
6,689
120
function [myArbitrator myState1 myState2]=Bayesian_Arb(myArbitrator, myState1, myState2, myMap) %% model option modelOpt = 2; % 1: dualBayesArb, 2: mixedArb %% Preparation myArbitrator.m1_thr_PE=myArbitrator.PE_tolerance_m1*[-1 1]; myArbitrator.m2_thr_PE=myArbitrator.PE_tolerance_m...