sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
3e686f3f782c72d54452656e0ddb22ef147dd2019056373f1a3c0284fa986d3d
MATLAB
1,977
74
% Symmetrize % Mode 1: Symmetrize a Field with some noise % Mode 2: add symmetric perturbations % PertMode: 'add' add the Pert to one HC % 'prod' multiply to one HC function L4EUseOut = symmHCs(L4EUse,N_HCOut,NPixX,NPixY,varargin) if isempty(varargin) FlagPerturb = false; else FlagPerturb = true; ...
bac1d9389020bbe2a5a92ea5fe4fb719d4f9b68310d2a713e7d8d38d5b3d1d27
MATLAB
1,977
55
function save_session (app) datafile = app.settings.file_path; savestruct = struct(); tmp = find(datafile == '\',1,"last"); [file, path] = uiputfile ('*.ssf' , 'select file / path to save the session', [datafile(tmp:end) '_' num2str(app.settings.interval(1,1)) '-' num2str(app.settings.interval(1,2)) '_save.ssf'] ); sa...
3a10096afbc3393919c922e601708cea58c5a5c1cd1d8a0d1681cdb30d5c0637
MATLAB
1,979
48
function auto_hb(app) %auto_hb checks if hb is already detected and runs hb_det_2 on the ecg if %not % Detailed explanation goes here if isempty(app.hb_res) if ~isnan(app.settings.channel_idx.ecg) if app.settings.interval(1,1) < app.data(app.settings.channel_idx.ecg).ts(1) app.settings.inter...
74e1c428c78943b9520e4aa67a17d29b410e8654e433cd8b9a5a07a78c8da82f
MATLAB
1,979
66
function supp_fig6_compare(folder, save) %% Supplemental Figure 7: Sex difference in connectivity % Subplots/information: % - Imagesc of difference maps %% Load if nargin == 0 folder = 'diff'; end load(fullfile(folder, 'data'), 'map'); map = map.density; N = size(map, 1); ipsi = map(:, 1:N); contra = map(:, N+1:e...
27260094aff8399d545273067e9aef93435c3de0f0f46eeceb776e81e1ab3c34
MATLAB
1,980
45
function [cleanSignal,filt] = filterFP(rawSignal,sampleRate,cutoff,order,filtType) %filterFP - Filter raw photometry signals % % [cleanSignal,filt] = filterFP(rawSignal,sampleRate,cutoff,order,filtType) % [cleanSignal,filt,adjustedSamplingRate] = filterFP(rawSignal,sampleRate,cutoff,order,filtType,downsamplefac...
ab0e30669ff99094e510202d248ef1828eec00c2a708fb05641325238417b88a
MATLAB
1,980
60
function [data] = processFP(data,params) %Process Fiber Photometry % % [data] = processFP(data,params) % % Description: This function is designed to process fiber photometry data % for the lab. The function performs demodulation (if selected), % filtering, baselining, and downsampling for all photometry ...
85b0c58a368604f209cae52f152a748db4af89bfa2d10d1f5af4d820a5228870
MATLAB
1,981
64
function plotAllFigures(obj) %PLOTALLFIGURES Plot all figures if isempty(obj.hFigs) obj.spawnFigures(); elseif ~all(obj.figApply(@(hFig) hFig.isReady)) % clean up from an aborted session obj.closeFigures(); obj.spawnFigures(); end % plot sim score figure if obj.hasFig('F...
8677edc185c3dab9f51cdcf993ff18d4ce2a00b9dba3d8b98db4db0dbc32f327
MATLAB
1,982
56
function P=select_data() rootdir = '/home/romain/data/spectro/PROTO_SPECTRO_DYST/Sujet_dicom'; sujet_dir_wc = {'Sujet'}; %sujet_dir_wc = {'2008_06'}; %sujet control %for BGL %sujet_dir_wc = {'Sujet03','Sujet04','Sujet05','Sujet07','Sujet08','Sujet10','Sujet15','Sujet02','Sujet22','Sujet11','Sujet01'}; %for MCL suj...
8dd274fc3e6ac99a8795c1b73758729c47bf7debdcc1ef325f916d8e9052f19e
MATLAB
1,982
69
function make_profile(session, channel, unit) % Make neural profiles % % Parameters % ---------- % - session: scalar % Session number with format: yymmdd % - channel: scalar % Channel number % - unit: scalar % Unit number info = get_info(); profi...
4463cd6aede5446ec529520a9cf57fbe9d4346e1b7db967893fb199d01a9b5c3
MATLAB
1,984
59
function [ProcessedEventWindowData_SAVE,varnamesDATA_SAVE] = relativeBLperDFFV2(EventWindowData,EventWindowDts,varnames,varnamesDATA,setupParam) ST1 = {'Raw'; 'Recentered'; 'DecayAdj';}; inUseST = fieldnames(EventWindowData); STidx = zeros(1,numel(ST1)); for i = 1:numel(ST1) if ismember(ST1(i),inUseST) ...
ebac47fa8b9eab3d9386c5709238fc41fed47726f5802a6fe6ff0bcb2502f2b9
MATLAB
1,986
70
%time in s %conc in uM %V in um3 %Atotal and Acluster in um2 function[relTot]=plot_dynamin_fromODE(time, conc, V, Atotal, Acluster, n) copies=conc*602*V;%conc is in units of uM. convert to copies. c=copies(:,4)/Atotal; ac=copies(:,2)/Atotal; acd=copies(:,5)/Acluster; ad=copies(:,6)/Acluster; f=figure(n); ax=axes('P...
13708bece0004c0aafa1a554366eddffcdc1a150456647ce8d7506f0cf6ebdcb
MATLAB
1,988
61
function [ maxTimestamp ] = maxTimestampInTicks( nexFile ) %[result] = maxTimestampInTicks(nedFile) -- calculates maximum timestamp % of the variables in nexFile data structure. maxTimestamp = 0; if(isfield(nexFile, 'neurons')) for i = 1:size(nexFile.neurons, 1) if size(nexFile.neurons{i}.timestam...
65d16065a9dc97a5876934c7e570f2fbf1b433ca91622a94c97aea37c2c6dce9
MATLAB
1,990
50
function [T_ISA,startinds,endinds]=hbf_TM_Phi_LC_ISA2(D,ci,co,ISAsurf) % HBF_TM_PHI_LC_ISA2 makes a BEM transfer matrix for potential using LC % BEM and isolated source approach % % [T,startinds,endinds]=HBF_TM_PHI_LC_ISA2(D,ci,co,ISAsurf) % D: D matrix, cell [N(meshes) x N(meshes)] % ci: conductivity inside ea...
fffe9c0ae0c5948c604dbb45b2e66a76f6b53e44a050c1faa984192c924cd3d4
MATLAB
1,990
46
filt_const = 1e-2; vel_th = 0.01; %Mass constants %M_h = 1e8; %Head mass M_h = 0.2; %Head mass make it bigger or make grapser mass smaller % M_g = 0.4; %Grasper mass M_g = 0.1; %Grasper mass M_f = 0.05; %Food mass %Spring constants K_sp_h = 2.0; %spring constant representing neck a...
d2663fe03d1eb4a56d544b5287490624a823e2fc34d459babc48a6c11b2d83f3
MATLAB
1,991
45
% Computes the metastatic mass via a first order quadrature % Growth PT follows model growth_model_PT (with parameters param_PT) % Growth of Mets follows model growth_model_met (with parameter set param) % flagNb = 0 or 1 depending on whether we want the number of mets to be % computed or not % Model is designed to be...
3163083b09ca85f86ca2eb32aff485833b03c889e164bbfd20cb9acf6c84ed3b
MATLAB
1,993
57
%% YT 10/19 % Simplified versions of efcross3Array.m classdef EFcross3_Array_v2 < handle properties mouseName = ''; sessionDate = ''; trialNums blockType trialType trialResponse visStimType somStimType end ...
5c2a237d4b5f6c26a759f1d1faae1f6befaa319450b4dae3506041183e5163cb
MATLAB
1,995
67
%% CROSS-CORRELATION cross=zeros(chNO,chNO); delay=zeros(chNO,chNO); CorrLength = (2*size(A,2))-1; meancorr=zeros(chNO,CorrLength); % ALL THE CHANNELS for channel=1:chNO Correlations=zeros(59,CorrLength); y1=A(channel,:); j=0; valmax1=zeros(1,chNO-channel); lag1=zeros(1,chNO-channel);...
a5b098d8fd6910082b99e7aad5b1ce8afddf64163805198ca37fa085cd93fdb0
MATLAB
1,996
81
% Test the instantaneous correlation of different signals % Reza Sameni, 2009 % clc; clear; close all; % Typical ECG data. Download from: http://homes.esat.kuleuven.be/~smc/daisy/daisydata.html load('FOETAL_ECG.dat'); data = FOETAL_ECG(:,2:end)'; time = FOETAL_ECG(:,1)'; clear FOETAL_ECG; fs = 250; L = size(data,1)...
a9994292e9f31b4fffe58bb58c1421fd2e1a33ef8f54778eedffbbdacede8209
MATLAB
1,996
65
function fname = spmup_resize(P,bb,vs) % routine that resizes one or more images to match the desired bounding box % and voxel size % % FORMAT: fname = spmup_resize(P,bb,vs) % % INPUT: P is a cell string with images to resize (see spm_select) % bb is the bounding box (default is [-78 -112 -70; 78 76 86]) % ...
6f7ddc8c90bf708ceb028c3629999b9e9932d47f898fc13023bbccd7344e924a
MATLAB
1,997
57
%% YT 03/19 % Simplified versions of EFcross3_switchArray.m classdef EFcross3_switchArray_v2 < handle properties mouseName = ''; sessionDate = ''; trialNums blockType trialType trialResponse visStimType somStimType end ...
9e714a5ca85be7f6f79672ed779755ed181bdeb19279b7ea4472c77ba6d08abd
MATLAB
1,997
58
function V = model_ther(param, time, t_start, k_e, Ci, Vc, Vi) % param: alpha0, beta, k alpha0 = param(1); % relative growth rate at size V0 = 1 cell beta = param(2); k = param(3); M = length(Ci); Ci = reshape(Ci, 1, M); tau = t_start:1:t_start + M - 1; % administration times tau = reshape(tau,siz...
7f5706cfe348df48682282fc74e81126a60914294f3e3421c2f23185d912bf01
MATLAB
1,999
60
clear clc %cluster cordinates load [file, path] = uigetfile('clusters_coordinates.csv'); datafile = fullfile(path, file); [~,~,raw] = xlsread(datafile); cd(path); %load cell display outpute (analyzed data) [file, path] = uigetfile('*.mat'); datafile = fullfile(path, file); load(datafile); if ~iscell(all_data) ...
2127723efc318fa5224d6d419333eb12907384db819c65d8e9de4e7f3cfd77a5
MATLAB
2,001
80
function X = nufft_table_interp(st, Xk, order, flips, om) %function X = nufft_table_interp(st, Xk, order, flips, [om]) %| %| table-based nufft %| %| in %| st structure formed by nufft_init (through nufft_init_table) %| Xk [*Kd nc] over-sampled DFT coefficients %| order 0|1 0th or 1st-order interpolation %| default...
30d2341e9a161a65160189dc77dee469c06716737603a73fb42533b3fe07e0d0
MATLAB
2,003
91
function dist=KLdist(TRANS_1,TRANS_2) ns=size(TRANS_1,1); EMIS_1 = eye(ns); EMIS_2 = eye(ns); % check row full of zeros %-------------------------------------- flag_zeros = 0; S1 = sum(TRANS_1,2); S2 = sum(TRANS_2,2); if sum(S1)<ns flag_zeros = 1; elseif sum(S2)<ns flag_zeros = 2; end if f...
d71b7430fac03774731327205c3d6c16d7b58ee97ddfc8feabe0d403688c7e13
MATLAB
2,006
54
function [modularity, nCommunity,meanCommuntiySize,stationarity,S,flexibility] = multiSliceCommunityStats(A,gplus,gminus,omega,varargin) %% parameters and Output: % A : cell array % Modularity : the value of the modularity function % NCommunity : the number of communities % meanCommunt...
da57c0ea097403bf434a151f9df94a5d7baaadd0d209a25badc8f5f53568ab5f
MATLAB
2,008
77
function plot_mean_resp(session, channel, unit, fold, tlim, prb, win) % Plot response of specific s-model for given trial % % Parameters % ---------- % % - fold: integer scalar % Fold number % - tlim: [scalar, scalar] % Time limits from saccade % - prb: 2-by-1 integer vector % [x, y] postion of a probe % - window...
2404b18c5ecadcb39263b695ba21f9202198d36e57d58c73359b61520914e5a0
MATLAB
2,009
32
function PeakTouchInterval % ƒNƒƒXƒRƒŠƒIƒOƒ‰ƒ€‚̃Cƒ“ƒ^[ƒoƒ‹‚̃s[ƒN•ª•z global CCresultRtouchWon CCresultLtouchWon RpegTouchallWon LpegTouchallWon SpikeArrayWon tfile pegpatternname trimFolder2 IntervalCount PeakInterval findpeaks(CCresultLtouchWon,'MinPeakDistance',30); [Lpks,Llocs]=findpeaks(CCresultLtouchWo...
8b77418c8471fc56e9468255c73890e2eb936efd12d828e7bb22abd70e36826e
MATLAB
2,009
59
%% interactive create waveforms_file clear clc [file, path] = uigetfile('cluster_info.tsv'); datafile = fullfile(path, file); w = tdfread(datafile); cd(path) gwfparams.dataDir = path; % KiloSort/Phy output folder gwfparams.fileName = 'temp_wh.dat'; % .dat file containing the raw gwfparams.da...
a95b0f98a907b8564f2b951832fb4b3dcbcda4ff4d6c73567f975e7a62853a19
MATLAB
2,009
46
function [ nexFile ] = nexAddContinuousWithMultipleFragments( nexFile, fragmentTimestamps, fragmentIndexes, adFreq, values, name ) % [nexFile] = nexAddContinuousWithMultipleFragments( nexFile, fragmentTimestamps, fragmentIndexes, adFreq, values, name ) % -- adds continuous variable to nexFile data structure ...
d7f21969cc208864381192cd84a801b2d2b33eb74ed382ffb672021a1bed7143
MATLAB
2,009
57
function [] = supple_weight5HT(htR, err) % This program is intended to visualize regression weights. % Figure 5d % % weights session1,session2,session3,session4 % 5-ht1a: [-1.0804, -0.4457, -0.6127, -0.1996] % 5-ht1b: [-0.9963, -0.6573, -0.1008, -0.2822] % 5-ht1f: [-0.2012, -0.3286, -1.1479, -0.1028] % 5-ht2a: [ 0.211...
750f6d6d36cadf587da1a5d97f035809ee2e3f00f9d5d1520240c044c828999b
MATLAB
2,012
86
% Run the "pre" or "post" on lines 5-6 and 9-10 as appropriate smooth = 5; odors = {'hex','iaa','oct','cyhex','bza','cit'}; % load('pre_training_data.mat') load('post_training_data.mat') o = []; for i = 1:6 % eval(sprintf("d = %s_pre;",odors{i})) eval(sprintf("d = %s_post;",odors{i})) s = [];...
cc887f9b7ca009df6b21270773b128a9c5d84b6f6fc6d6d64670d31b3bfe8b44
MATLAB
2,012
69
function makeSpikeTrain(folders) analysis_dir = eval(folders); disp(folders); for i = 1:length(analysis_dir) disp([num2str(i),'/',num2str(length(analysis_dir))]); workfolder = analysis_dir{i}; cd(workfolder); mkdir('spike_ch'); savefolder=[workfolder,'\spike_ch']; %Make spike_de...
2a14ddf6d64a26de702f079d7d029588c38c25bb5a142de24ef69d020556c655
MATLAB
2,013
71
clear all; clc; close all load('alldata.mat'); %% plot heatmaps for different conditions % Odor on period: 2 to 6s, off period: 6 to 10s conditions = {'hexon','hexoff_05s','iaaon', 'bzaon', 'bzaoff_05s', 'citon'}; onum = [1,1,4,2,2,3]; %which odor to plot in paper odors = {'hex','bza','cit','iaa'}; time = 1/30...
c8f11d3b20dff7a67ab9b3dde5016b132db77886cda9dbbc2d8d4e190ea518b1
MATLAB
2,014
68
function f1 = plotFullResult(AD) % Manage Inputs ############################### if isstr(AD) %path to .AD file AD = load(AD,'-mat'); end %delete me! AD.inputs.minRho = 15; % Plotting ############################### f1 = figure('Units','Normalized','Position',[0 0 1 1],'Color','w'); subplot(1,2,1); hAxis1 = p...
e8698497debfc52e1777fd9ba297379b4fe885d46cfa835758e5e23b85c5afa4
MATLAB
2,016
53
function [BIC,AIC] = bicCluster(X,Y) % [BIC,AIC] = bicCluster(X,Y) % % Returns BIC and AIC criteria for a clustering solution. BIC (or AIC) is % being computed based on the log-likelihood distance, which in this case, % is determined using within-cluster variances. Like the Calinski-Harabasaz % index, BIC and AIC penal...
7e22ec5bf3c0ae27dd4d02a615e5f271fc05379393535d2f78f4713318ca95e8
MATLAB
2,018
65
function [newVectors, whiteningMatrix, dewhiteningMatrix] = whitenv ... (vectors, E, D, s_verbose); %WHITENV - Whitenv vectors. % % [newVectors, whiteningMatrix, dewhiteningMatrix] = ... % whitenv(vectors, E, D, verbose); % % Whitens the data (row vectors) and reduces dimension....
84e4735dc707fbb07aac5327b5cb9424a56383cabe78ab3e741413c2c7700925
MATLAB
2,018
78
function [CB_Pixels,CB_Perimeter] = Detect_Cell_Body(Im,GS2BW_Threshold,Scale_Factor,Plot1) Perimeter_Connectivity = 4; % GS2BW_Threshold = 0.9; Open_Close_Disk = 1.5; Dilation_STREL_Size = 10; % Convert to BW and do opening & closing: I1 = im2bw(Im,GS2BW_Threshold); sec = strel('disk',ceil(Open_Close_Disk/S...
14ac3bcac4ce210310244b2137774d15e32c3c44c7be05370aca51b680ddd197
MATLAB
2,020
48
% Dependencies: carcinom, model_metastases %% Import data import_data import_survival import_covariates %% Plot simulation of therapy on mets using parameters estimated from a vehicle group. Approximation GR = 0 % Results exported in ./ther_mets/ % Vehicle groups manips_plot_popfit_PT_met_param_2016 % Treated groups ...
4f618fcb95594cf1f125d2024633f78e9f22a9be1a3ab49a5d8aede563eb5012
MATLAB
2,021
68
clearvars close all %addpath(genpath('cubric/scratch/sapac10/MATLAB_toolboxes')); addpath(genpath('/storage/stella/MATLAB_toolboxes/')); % script using the bitensorial model %% this is the fraction of free water map, registered to the S0 fmat = load_untouch_nii('FW_reg.nii'); fmat = double(fmat.img); disp(size(fmat)...
58751e483d4892fe98f8ece4e904b644c632773610592d57ad93906e70837c54
MATLAB
2,021
67
function conc = correct_water_content(conc,par) %if ~isfield(par,'scale_fact') % par.scale_fact=1; %end if ~isfield(par,'water_faction') par.water_fraction = [0.78 0.65 0.97]; % par.water_fraction = [0.83 0.71 1%]; end if ~isfield(conc(1),'fgray') fprintf('no field fgray so no correction ...\n'); return end ...
3c8e63f67ba51cd359da6fe29e153df0d3d0b5c1171e6cff8dc373956790d894
MATLAB
2,022
73
% 1-d example of leslie greengard's gaussian kernel-based nufft % (type 2) R = 4; % oversampling ratio Msp = 12; % spreading parameter - the number of neighbors to spread % to in each direction M = 32; % dimension of uniform grid on which we evaluate nufft tau = 1/M/M*pi/R/(R-0.5)*Msp; % width of gaussian Mr...
46bff042186c3b19287be8f66ddfe21de13ac13b0f26ca341e9412a566046258
MATLAB
2,022
93
close all; clear; clc; % parameters subject = 'Dog_3'; number = 10; path = ['E:\Sameni\Projects\Seizure\' subject '\']; mode1 = 'interictal'; mode2 = 'preictal'; ch = 1:16; % desired channels time = [1 10]*60; % in seconds nfft = 10000; SpectralWinLen = 10; % in seconds SpectralOverlapPercentage = 50; % [0 99] % load...
8c624776352bbf7b081feed7eb5f8923a01dfe3c9bde257280e372e9c4b508a5
MATLAB
2,022
57
classdef intch_wc_reader < handle properties sr max_segments opened_file segmentLength open_file t0_segments end methods function obj = intch_wc_reader(par, raw_filename) load('intan_meta_data.mat','sr','lts','channels'); ...
1b3b2a26b8ea90c907c3f3ec99f046a47b1a08c06ba184da39753a8a059ee97a
MATLAB
2,027
59
function y = bp_filter_complex_ma_alt(x,fc,bw,order) % bp_filter_complex_ma_alt - Bandpass filter using multi-stage moving average filter with % frequency shift (an alternative implementation for bp_filter_complex_ma) % % Syntax: y = bp_filter_complex_ma_alt(x,fc,bw,order) % % Inputs: % x: vector or matrix o...
4000b53c9002562b22bae994678828198a31b2934ed47cc2bbe4e1c29202742b
MATLAB
2,027
59
function [y, W, A] = sca_nsca_component_analysis(x, f1, f2, I, order) % sca_nsca_component_analysis - Sort components by spectrally desired components vs nonstationary components. % % Usage: % [y, W, A] = sca_nsca_component_analysis(x, f1, f2, I, order) % % Inputs: % x: Input data array (channels x samples)....
55c01c343960a8cb69a5f9cc9aadecb5d9ef3161c173307a128941ca9dcbea32
MATLAB
2,027
43
function Workspace1 = Vertex_Shape1(Workspace1) for i=1:numel(Workspace1.Vertices) if(length(Workspace1.Vertices(i).Rectangles_Angles) == 3) % Vertices Angles Diffs: Arr1 = zeros(3,4); % One row for each angle. Arr1 = [[1:3]',Workspace1.Vertices(i).Rectangles_Angles']; Arr1 = sortrows(Arr1,2); ...
d399888e89cb0fb538e0f29323895fc5d5b74b0449eabb8a83663e29b7d2c6fb
MATLAB
2,027
38
clear; close all; cd 'C:\Users\Admin\Git\repo\ZS-DeconvNet\Python_MATLAB_Codes\data_augment_recorrupt_matlab'; % change this path to your cloned path addpath(genpath('./XxUtils')); addpath(genpath('./GenData4ZS-DeconvNet-SIM')) % necessary field system_params = {}; system_params.NA_ex = 1.17; ...
05584d3ad7f261ad5d7a7a8308b8d01f237035b10e85d7d673d988b65b2a5908
MATLAB
2,028
78
% Test Adults ECG/VCG scatter plots % clear; close all; % % % fs = 1000; % % % data = load('s0010_re.txt'); % % % % data = load('s0014lre.txt'); % % % time = data(:,1)'; % % % data = data(:,2:end)'; % % % I = 1:10*fs; % % % data = data(:,I); fs = 1000; load patient165_s0323lre; data = data(101:50100,2:e...
1afe476b19eefe562277f83ddfc78e48269ee0f90a84f287208047aec1838372
MATLAB
2,028
54
% 3D reconstruciton for sLFM % The Code is created based on the method described in the following paper % ZHI LU, SIQING ZUO, MINGHUI SHI etc. % High-fidelity long-term intravital subcellular imaging with confocal scanning light-field microscopy % in submission, 2023. % % Contact: ZHI LU...
a2a6ecfc750a799956a3faac85459ec0c966cf807b9fa2b7e269397d372ca25d
MATLAB
2,030
59
% ¶‘«”½‰žcellƒEƒCƒ“ƒhƒE2ŒÂA‰E‘«”½‰žcellƒEƒCƒ“ƒhƒE1ŒÂ@LƒEƒCƒ“ƒhƒE34ARƒEƒCƒ“ƒhƒE‚P WR3_90=0; WL3_90=0; WL4_90=0; CountL0R0_90L23R2=0; CountL1R0_90L23R2=0; CountL2R0_90L23R2=0; CountL0R1_90L23R2=0; CountL1L2_90L23R2=0; CountL1R1_90L23R2=0; CountL2R1_90L23R2=0; CountL1L2R1_90L23R2=0; for n=1:(length(SpikeAr...
dc52e1bac9201fdeb8a17b8f4e867c8ae57cd4eeb77fa03f47bc6feeeb71f914
MATLAB
2,030
83
clear all close all clc folder = './fit_PT_met_SAEM'; fit_r = load([folder '/fit.mat']); iwres = fit_r.stats.iwres; colors = get(gca,'ColorOrder'); % Scatter plots of the residuals type_data = []; for j = 1:fit_r.N data_met_loc = fit_r.data_met{j}; time_met_loc = fit_r.time_met{j};...
948069e96ae2f2a7741cbafb34c57fbd04ae1c3c932b2e414be8313ebeb53dd1
MATLAB
2,031
52
%% compare number of responsive cells per exp in 2 data sets clear clc %load responsive cells per exp (output of calculate IR responsive from data %set 1 (PFC) [PFC_file, path] = uigetfile('C57 cells per exp.mat'); cd(path) X1 = load(PFC_file); X1 = X1.responsvie_and_ie_table2; %load responsive cells per ...
1b75769b37b11eae76bebf1a5a923d7e0d920aa5387efa324b858fb6d5506a04
MATLAB
2,032
50
function [movieCutouts, traceCutouts, cellOutlines, neighborOutlines] = getEventMovies(movie, traces, filters, events) % get event movies for all events of all cells [ areas,centroids,cvxHulls,cvxAreas,outlines ] = getFilterProps( filters ); windowSpace = 20; windowTime = 20; for c = 1:length(eve...
5fa2b10aa736c1a4146c226879bb4814be03ad189e03f1218964314151913792
MATLAB
2,032
43
function hFigMap = plotFigMap(hFigMap, hClust, hCfg, selected, channel_idx) %PLOTFIGMAP Plot probe map iWaveforms = hClust.meanWfGlobal(:, :, selected(1)); clusterVpp = squeeze(max(iWaveforms) - min(iWaveforms)); vpp = repmat(clusterVpp(:)', [4, 1]); if ~hFigMap.hasAxes('default') hFigMap.a...
9a75be8bf61a87c7c1fe963ebf16bcfaa06e142d62824f353de26fc79ab6ae1c
MATLAB
2,032
88
function epochs = find_epochs( cc, threshold, sign,gap ) % *WAVE* % % FIND EPOCHS locate epochs in a logical array, based on some simple % heuristic parameters % % INPUT % cc - correlation array (1,t) % threshold - thresholding value, to produce a logical array (sc) % Edits by DBP 2022 % thre...
35e3cb4af0853fc8b0867aa19b62a55421e1d0952685d6bd36957a85bc73796f
MATLAB
2,033
75
function cdata = iconRead(filename,guessalpha) % ICONREAD read an image file and convert it to CData for a HG icon. % % CDATA=ICONREAD(FILENAME) % Read an image file and convert it to CData with automatic transparency % handling. If the image has transparency data, PNG files sometimes do, % the transparency data ...
ba7ea723179945275cb8c8b21e8dc593ce4c6acc0ee07f898326cb14fcedc0e3
MATLAB
2,033
61
function [main] = shadederrbar(x,y,sem,varargin) %Name: shadederrbar %Created By: Pratik Mistry %Created On: 27 July 2018 %Updated: 31 July 2018 -- Turned the main plot into a output variable. % %[main] = shadederrbar(x,y,sem,color) % %Description: This code creates a plot of the main graph with transparent %s...
995a9b2b40175bfebdb16ee4a0932aa461f51f9bb3e54d76ad13d4393503b0df
MATLAB
2,035
69
% ecg_gen_dtw Test Script % % This script demonstrates the usage of the ecg_gen_dtw function to generate % synthetic ECG signals using the warping transformation from the phase domain. % % Revision History: % 2023: First release. % % Reza Sameni, 2023 % The Open-Source Electrophysiological Toolbox % https://github.co...
d11c3cd3ea39eba73d593e3497160ecac589d22f71f380e965262911f9a46d5a
MATLAB
2,036
73
function modulation20190709 global ACresult ACresultW CCresultDrinkOn SpikeArray TurnMarkerTime RpegTouchallWon LpegTouchallWon render... RpNum LpNum CCresultSpike locsP1time locsP2time locsP1time2 locsP2time2 pksA1 pksA2 CCresultRtouchWon CCresultLtouchWon dpath3... StartTime FinishTime DiffMaxMinR Dif...
97833ffd022d6b82f25e42c4716360ef2c7ce8bea45d06b94a04ad4c5075deb4
MATLAB
2,037
76
function f = nufft_diric(k, N, K, use_true_diric) %function f = nufft_diric(k, N, K, use_true_diric) %| %| "regular fourier" Dirichlet-function WITHOUT phase %| nufft_diric(t) = sin(pi N t / K) / ( N * sin(pi t / K) ) %| \approx sinc(t / (K/N)) %| %| caution: matlab's version is different: sin(N * x / 2) / (N * sin(x...
997b29677c6ca234f8ccce591bb564ae91885fe382c1f03593e1d8d5b4a0d158
MATLAB
2,037
77
clear clc cd('I:\My Drive\ELYASHIV\PFC_paper_results_after_revision\figure4 ( PHb)') PHB = importdata("PHB_IR_all_ints_data.mat"); PFC = importdata("PFC_IR_all_ints_data.mat"); %% add tags PHB.tag = repmat({'PHB'}, size(PHB, 1), 1); PFC.tag = repmat({'PFC'}, size(PFC, 1), 1); %% CANGE PHb CLUSTER NUMBERS...
82c6d91f01b011ef0c67f3958a8c88ed644778b94327893991732827d44391f2
MATLAB
2,038
75
function file_obj = readFile(file_path,varargin) %x Opens up a LabChart file and extracts meta data. % % file_obj = adi.readFile(*file_path,varargin) % % file_obj = adi.readFile(*file_path,options) % % This function reads some preliminary data from the specified LabChart % or simple data file and exposes access...
52dc4431b5fe6fa3d2d6e6dec7aa369f0c09d4a2565461443c2ba6101562506c
MATLAB
2,039
68
function [s, W, A, B, C] = sca_notch_filter(x, fc, Q, fs) % % Multichannel notch filter using Spectral Component Analysis (SCA). Designed % for removing powerline and its harmonics from multichannel recordings. % % Usage: % [s, W, A, B, C] = sca_notch_filter(x, fc, Q, fs); % % Inputs: % x: Multichannel input signa...
89ea86f0f10f19cf841d49e8b168c2867b688d19ca8e2f7f9a3a7c8aa76ff0df
MATLAB
2,039
64
function[t, pvals_corr,X] = plot_PermT(Data,time,lim,green_on) % ********************************************************************* % Date: Octobre 2014 Programmé par: D. Bolger % Function to carry out a permutation test with correction fdr entre % deux vecteur de données (le grande moyen pour deux co...
cb724198ef130f385edba284819d3cb3d749c6d7a41f738a6f7d447c57c522f4
MATLAB
2,039
65
function volume = sphereIntersection(circleCenters,radius) % Used to estimate the SOZ, resected, and resected SOZ volume by % inflating each channel by a sphere and computing the total volume of % the resulting mask if size(circleCenters,1) == 0 volume = 0; return end %...
10b73e523a0947e65474f5e76e5c075f933d89bfe49fb8f6e37db1541a66d71f
MATLAB
2,040
64
function density = calc_packing_density(dim,N,min_euclidean_dist) %CALC_PACKING_DENSITY Density of packing given by minimum distance % %Syntax % density = calc_packing_density(dim,N,min_euclidean_dist); % %Description % DENSITY = CALC_PACKING_DENSITY(dim,N,MIN_EUCLIDEAN_DIST) sets DENSITY to % be the density of a packi...
1af586e2a272dc97d7b0d03c5fb85f1b8edfb38e7749336b581e41c2ece6bd6e
MATLAB
2,042
70
function precomp = causalInferencePrecomp(params, Tmax, varargin) % % precomp = causalInferencePrecomp(params,...) % % Perform precomputations for causalInference.m. % % INPUT: % % params - GPFA model parameters % % Tmax - number of timesteps of the longest trial in dataset % % OUTPUT: % % precomp - data structu...
3f5093be5002c8076a8be979be0b3c014818eeba237f4613c314bc22296d5f22
MATLAB
2,044
58
function [D,A,L,phi,out] = Get_Corrected_Cylinder_Params(D0,A0,L0,R4) % Input arguments: % D0 is midline distance (distance of vertex center from closest midline point). % A0 is midline orientation (angle relative to tangent of the closest midline point). % L0 is the rectangle length. % R3 and R4 are the ter...
0ea977b74ea6aad413d986586b19f766ad0b4ca0b79cc8af177347b9bef7a368
MATLAB
2,047
69
% ecg_gen_dtw Test Script % % This script demonstrates the usage of the ecg_gen_dtw function to generate % synthetic ECG signals using the warping transformation from the phase domain. % % Revision History: % 2023: First release. % % Reza Sameni, 2023 % The Open-Source Electrophysiological Toolbox % https://github.co...
e5b8822e74a19c5bb9186b7bbf3f2076740cf0e305caaa17df09df4242ba71ea
MATLAB
2,047
47
%Authors: Adrià Tauste /Raul Adell %Description: Function to estimate tau coefficient for each neuron separately %Date: 5/9/2023 function [tau, resnorm, exitflag, fittedParams] = Intrinsic_timescale(spikeCounts, maxLag, win_size, win_step) % Compute autocorrelation for different lags using sliding square filt...
f7a044c6720f8b0c78d7eaf58bf851f3c99e20765ad6bf947a673138762b0190
MATLAB
2,049
92
function tf = isvar(name, varargin) %function tf = isvar(name, varargin) %| %| Cetermine if "name" is a variable in the caller's workspace. %| %| If argument is of the form 'name.field' or 'name.field1.field2' etc. %| then this uses isfield(st, 'field') recursively as needed> %| %| To have isvar always return false wh...
849573510cfbe27d100ba494e4b96c0ac49266e38ba41e5f67db9d2ab976b0fb
MATLAB
2,050
61
% Pre-process MEG in analysis app (Filter 1-150Hz, add the triggers in, notch, % remove bad channels, mean field correct, remove bad trials, then export % to workspace. Run convert_2_FT.m % Sections for analysing both MEG and EEG %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Hous...
2e5d85005975d465f655ba2b7876b695d2e7b59b3b5f3d89615c41f1a0ce2646
MATLAB
2,051
68
function [R_Dis_statistics,C_Dis_statistics] = Length_statistics(A) % A应当为测试所需的label图 scale = 1.226994; [x,y] = size(A); for i = 1:x for j = 1:y if A(i,j) == 94 % if A(i,j) == 1 A(i,j) = 255; else A(i,j) = 0; end end end [L,N] = bwlabel(A,8);...
8d7565239a23346c86a5e10446d1e66d03ec2667502a2b4356b1aeb3e05957a1
MATLAB
2,051
75
function String = disp_stats(Stats, P, Label) % displays as string a statistic of interest % From Lapse-causes Fieldnames = fieldnames(Stats); if any(strcmp(Fieldnames, 't')) % paired t-test if isfield(Stats, 'p_fdr') pValue = Stats.p_fdr(P(1), P(2)); pString = 'p_fdr'; else pValue =Stats.p(P(1), P(2)); ...
615ba36bd12dadfda7c0de19d33606e66965e0731561405dd92ae542dd5f91e3
MATLAB
2,053
47
function Data = Vertices_Analysis_Index(Im,Data) % assignin('base','Workspace_Pre_0',Data); CB_BW_Threshold = Data.Parameters.Cell_Body.BW_Threshold; Scale_Factor = Data.Info.Experiment(1).Scale_Factor; % Scale_Factor = Data.User_Input.Scale_Factor; [CB_Pixels,CB_Perimeter] = Detect_Cell_Body(Im,CB_B...
9c249575d69143351b93b2cbfec025aaea6dee055bde4c921d0de517e4288044
MATLAB
2,053
62
function [I,check]=plane_line_intersect(n,V0,P0,P1) %plane_line_intersect computes the intersection of a plane and a segment(or %a straight line) % Inputs: % n: normal vector of the Plane % V0: any point that belongs to the Plane % P0: end point 1 of the segment P0P1 % P1: end point 2 of the...
74cb248f8de866ececeb5db15fc3729b4b08f913276a8c3d1d10f7e13204ffab
MATLAB
2,054
64
function [ accs, dec_dims, weights,ve ] = tone_iterative_removal(p,t_pool_tone,n_rep,n_iter,rand_control,precomputed_dims,time_dependent,n_tr,nullspace) % project data into motion / avoid nullspace tone_null = []; for t = 1:size(t_pool_tone,2) % loop over time tone_null(:,t,:) = nullspace' * squeez...
28d0d937889bfb5167514d6aeadee2bd56a2cca6fdd9af8830ff9d17be04b356
MATLAB
2,059
70
function spmup_setparallel(varargin) % simple routine to set the up the parallel processing % % FORMAT spmup_setparallel(N) % set N if you want to use a specific number of processors % useful on servers with dynamic attribution to limit oneself % % Cyril Pernet & Remi Gau % -------------------------- % Copyright (C)...
63264c1026e9990bef49bdb62bc972c9e53bf95bb02611d3ea099c63455578f5
MATLAB
2,059
60
function CollectAllData20180804 clear all; close all; TargetDirectory='C:\Users\B133_2\Desktop\CheetahWRLV20180729'; cd(TargetDirectory); % cd('C:\Users\B133_2\Desktop\CheetahWRLV20180729'); H=ls;%CheetahWRLVƒtƒHƒ‹ƒ_“à disp('H='); disp(H); for n=1:length(H(:,1)) TrimStr1=strtrim(H(n,:)); if ~st...
7577031992db6d5a2218f89376854e23102a3011e9d200d6873cc4e33d24228a
MATLAB
2,059
80
[cols,alpha] = chooseColors; %% plot av1/2 over sessions time_win = 6:15; this_cols = {};% need to reverse order for some reason.. this_cols{1} = [208 28 139]/255; this_cols{2} = [241 182 218]/255; this_cols{3} = [77 172 38]/255; this_cols{4} = [184 255 134]/255; this_cols{5} = [67 162 202]/255; this_cols{6} = [.7 ...
9cc3bdfd738a70940f6539122c48366eb82bf6576cdb7ebddb43c9cc280aad79
MATLAB
2,059
58
function groupinfo(obj,~,t,g,data,h) %% Response to a mouse left button click on a structure % autocorrelatemap() and crosscorrelatemaps() depend on this function. % % obj: handle of clicked graphics object % t: array of all structures objects % g: array of all labels objects % data: data from graph function %...
7d389bf7b7e7275e2dfde523e2fc94ca021c6f03363b378bd7b754b57511cb30
MATLAB
2,062
62
clear all clc odors = {'hex10','hex','iaa','two_oct','hxa','two_hep','ani','hex01',... 'msal','lcar','euc','gua','chex','bza','ger','etha',... 'apin','one_oc3','neem','gar','cit','lin'}; c = 1/255*[[33 125 255];[33 125 255];[33 125 255];... [33 125 255];[33 125 255];[86 105 105];[86 105 105];... ...
261b388261fdc2446fdeef1c1ecee636872101d2c8becf3d1478c2315883c37b
MATLAB
2,065
64
function [data] = JT_processFP(data,params) %Process Fiber Photometry % % [data] = processFP(data,params) % % Description: This function is designed to process fiber photometry data % for the lab. The function performs demodulation (if selected), % filtering, baselining, and downsampling for all photomet...
6340d1f50405b28f95b93eee92a4aa507dda0db201af69f27a7b6d02bdacc5d2
MATLAB
2,066
74
function S = LoadSpikes(tfilelist) % % S = LoadSpikes(tfilelist) % % inp: tfilelist is a cellarray of strings, each of which is a % tfile to open. Note: this is incompatible with version unix3.1. % out: Returns a cell array such that each cell contains a ts % object (timestamps which correspond to times at w...
012bec44e17827219034c44c0dee5538554b6df43a04232779dce639c47272f1
MATLAB
2,067
55
function data = alignData2Lick(data,tBefore,tAfter) if isfield(data,'final') Fs = data.gen.Fs; if tBefore > 0 tBefore = tBefore*-1; end tBefore = tBefore * Fs; tAfter = tAfter * Fs; nSamp = length(tBefore:tAfter); data.lick.time = [tBefore:tAfter]'/Fs; if isfield(data.final,...
0bcc632769264a155c86a9a46ae2810f2a5a09f6a3f78f5b092ada86bcf60f07
MATLAB
2,067
61
% load data from .npy files % trainFolder = 'trainRecord_anti_R_5_1'; b1 = readNPY(sprintf('data/%s/b1.npy',trainFolder)); b2 = readNPY(sprintf('data/%s/b2.npy',trainFolder)); eta = readNPY(sprintf('data/%s/eta.npy',trainFolder)); lambda = readNPY(sprintf('data/%s/lambda.npy',trainFolder)); w1 = readNPY(sprin...
3c3c939786f8cfcda26529fd3965c8a584506ba8401e17da66b54a4a357e1f2e
MATLAB
2,068
60
function [y, W, A] = spectral_component_analysis_ma(x, f0, bw, order) % spectral_component_analysis_ma - Spectral component analysis (SCA) using multi-stage moving average (MA) filtering approach. Extracts and ranks linear mixtures of multichannel data with maximal energy in a given frequency band. % % Usage: % [...
3d967bf29966881df8d947ccd1c8c9169c98c9e91ecefb919427075790811ede
MATLAB
2,068
69
function making_heatmap(mat_file_after_converting, dir_root_OG ) % mat_file_after_converting = "HB329.mat"; % dir_root_OG = 'HB329/'; csv_name = '16bit_allen_csv_20200916.csv'; label_file_name = append(dir_root_OG, '/tubemap/elastix_labels_to_resampled/result.tiff'); load(mat_file_after_converting); i...
0d1f9df65543b0c0dd8c2c93426448aa3377d80e23bacc1e31d17b8d02f9c959
MATLAB
2,070
63
function [h pi] = fdr(p, q) % FDR false discovery rate % % Use as % h = fdr(p, q) % % This implements % Genovese CR, Lazar NA, Nichols T. % Thresholding of statistical maps in functional neuroimaging using the false discovery rate. % Neuroimage. 2002 Apr;15(4):870-8. % Copyright (C) 20...
1c38b2c123bf526170b459c7315fa6f9312d7348d64706809140a0d7f60b54fa
MATLAB
2,070
54
% Copyright (c) 2008-2026 the MRtrix3 contributors. % % This Source Code Form is subject to the terms of the Mozilla Public % License, v. 2.0. If a copy of the MPL was not distributed with this % file, You can obtain one at http://mozilla.org/MPL/2.0/. % % Covered Software is provided under this License on an "as is" %...
4af400bf2251d63beed23fa6d106bad305661e423ede2d88c40db8b95667a5db
MATLAB
2,070
59
clear all close all %% S-curve with load line, V(I) load Scurve_data_VI.mat f = figure(1); f.Position(3:4) = [600 500]; lines_width = 1.5; % rectangle('Position',[0.77 1.44e-4 0.29 3.76e-4],'LineWidth',0.5,'LineStyle','-','FaceColor','#F5CD8B') hold on ax2 = scatter(Scurve_meas.V(1:2:length(Scurve_meas.V)/...
f678a6f349d566207e57975bee6f0b8d2ebc36a4762f5a06c53cb7cb49ec66a1
MATLAB
2,070
65
function [x_SAVE,y_SAVE,eb_SAVE] = plotFormatEntireSession(superStackAVG,varnamesENTIRE,setupParam) All = superStackAVG.all.average; VN = varnamesENTIRE; ST1 = {'Raw'; 'Recentered'; 'DecayAdj'; 'RefDecayAdjExp'; 'RefDecayAdjPoly'}; inUseST = fieldnames(All); STidx = zeros(1,numel(ST1)); for i = 1:numel(ST1) ...
ef182fcb1e2fdf02c5b26a873bdd8b15b4c6276cfae375ba2315cf7e3589d518
MATLAB
2,071
60
function varargout = subsref(this,subs) % Subscript referencing for GIfTI objects %__________________________________________________________________________ % Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging % Guillaume Flandin % $Id: subsref.m 7291 2018-04-12 08:43:08Z guillaume $ if length(this) >...
4f5862bea9afed2c71fa29cbb52aedd184c9f78f8f074dddb69ee8a869ea1dc6
MATLAB
2,073
69
function [R_Dis_R,R_Dis_C,C_Dis_R,C_Dis_C,R_suffix,C_suffix,A] = MainFunc_Draw_Line(A) % 将语义分割鉴定之后的图片转为Label作为输入 % R_Dis_R % R_Dis_C % C_Dis_R % C_Dis_C format='um';% 文件格式 Num = 200; scale = 1.226994; [x,y] = size(A); for i = 1:x for j = 1:y if A(i,j) == 1 A(i,j) = 255; els...
6d0f5f4084cd1f5d557524009ee906244c1c4d8da289d869a4196511739c9763
MATLAB
2,073
57
function predictionperactual = importfile(filename, startRow, endRow) %IMPORTFILE Import numeric data from a text file as a matrix. % PREDICTIONPERACTUAL = IMPORTFILE(FILENAME) Reads data from text file % FILENAME for the default selection. % % PREDICTIONPERACTUAL = IMPORTFILE(FILENAME, STARTROW, ENDROW) Reads da...
fae874774eb70403f53c1f40f1478fbfc0fe6d565c64439cbec6ff21380c2ea4
MATLAB
2,073
66
function deleteClusters(obj, deleteMe) %DELETECLUSTERS Delete clusters either specified or selected if obj.isWorking jrclust.utils.qMsgBox('An operation is in progress.'); return; end if nargin < 2 && numel(obj.selected) > 1 return; elseif nargin < 2 deleteMe = obj.s...
707e01ec8434e70503e00bc4d3ae2ebf7dfc7851dd8c639dafc7073ed11827a6
MATLAB
2,074
57
%% get necessary data clear p = params_2DAA; sub = 11; sub = p.subjects(sub); % get heuristic sorting if any fpath = fullfile(p.rootDir,'miniscope',['subject' num2str(sub)],'jointExtraction','sorted','heuristic_sorting.mat'); if exist(fpath) sData = load(fpath,'heurist...
95dfe713c66ac07c94db7afe438208cba4debe41247704bc45e112f45ef3e62f
MATLAB
2,074
65
%% plot pupil deluted VS regular X = all_data; nac_3 = [4 6 26]; nac_5 = [13 37 48 108 115]; nac_2 = [49 131]; cluster_6 = [17 96 98 99 103 127]; cluster_1 = [92 104 106 109 115]; delay = 1.1; %% Y = nac_5; regular = []; pupil = []; for i = 1:length(Y) cell_name = (['cell_' num2str(Y(i))]); regul...
c1045b06fb1ee6e1afe78825a11178ecf51bd6b9461e7b58660b11abc16bb8ca
MATLAB
2,075
53
function [ av_trials,err_trials ] = collect_ae_trials_tone_end_alignment(p, traces, bvs, tis, speed_control,tone_start_control) spd_dims = 18:22; %dlc pre_steps = 15; post_steps = 5; for sub = 1:p.nSubjects % first collect all av trials and keep track of the action % start times tha...
567bff740430bd39a45b999c86318fe8b3d916e2af3a5e843e38fa777a3015a0
MATLAB
2,077
56
function updateFigHist(obj) %UPDATEFIGHIST Plot ISI histogram if isempty(obj.selected) || ~obj.hasFig('FigHist') return; end plotFigHist(obj.hFigs('FigHist'), obj.hClust, obj.hCfg, obj.selected); end %% LOCAL FUNCTIONS function hFigHist = plotFigHist(hFigHist, hClust, hCfg, selected) %PLOT...