sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
4e2f0c48b67e63a07c8b4d4581bff8e1866688c4522b2825e2affea1a1b46579 | MATLAB | 6,320 | 176 | function [obj] = mergeConditionsCSMS(obj, cond2merge)
% MERGECONDITIONSCSMS - Merge multiple conditions into collapsed conditions
%
% INPUTS:
% obj - RecordedData object
% cond2merge - Cell array specifying condition merging
%
% OUTPUT:
% obj - ... |
c0f25d5b62da20c7a7b3318a9029f39027ea2345d62e738ad0dd7f2beba41c15 | MATLAB | 6,322 | 243 | function res = tc_source_cluster_fieldtrip(dataA, varargin)
if nargin > 1
if ~ischar(varargin{1})
dataB = varargin{1};
vararginds = 2:2:length(varargin);
else
dataB = zeros(size(dataA));
vararginds = 1:2:length(varargin);
end
else
dataB = zeros(size(dataA));
varargin... |
f557c7ec15704ce2a86b0efdfaed8e0a4eaae1906a7133b7192c17a776d8054c | MATLAB | 6,344 | 186 | %% Build weekDensityData at THRESHOLD from populationDistances
dDiv = 7; % days per week
min_neurons = 5; % minimum neurons to include a sample
num_shells = 8;
shell_width = 0.1; % mm (100 µm shells: 0–0.1, 0.1–0.2, ..., 0.7–0.8)
densCells = cell(5, num_shells); % weeks 0..4 -> 1..5
nu... |
d2f6412dc597663331adf00fa82d2c717e162e19009c96be14fa162bba6e6743 | MATLAB | 6,345 | 160 | function OutputFile = bst_create_nirs_data(condition_label, signals, time, chan_names, srcs_pos, dets_pos)
% BST_CREATE_NIRS_DATA forge NIRS data into brainstorm for the subject "test_subject" in the protocol "nst_utest".
%
% [OutputFile] = BST_CREATE_NIRS_DATA(CONDITION_LABEL, SIGNALS, TIME, CHAN_NAMES, SRCS_POS, DE... |
c73a832109851213eabf25cbb8bbcc47dbdf9bce7de58a91046a176d0b964e88 | MATLAB | 6,350 | 139 | classdef ChordPlotTest < matlab.unittest.TestCase
properties
network_atlas
edge_test_options
chord_plot
plot_axes
axis_width
plot_matrix
direction
color_map
chord_type
upper_limit
lower_limit
z_order
end
methods... |
abb3ed5d877a45cf87013817c89ce8a8e1ce71dbc0df804b8214805f01171c19 | MATLAB | 6,353 | 135 | function nodeData = remove_source_leakage_b(nodeDataOrig, protocol)
%REMOVE_SOURCE_LEAKAGE correct ROI time-courses for source leakage
%
% NODEDATA = REMOVE_SOURCE_LEAKAGE(NODEDATAORIG, PROTOCOL)
% produces orthogonalised node time-courses NODEDATA from
% uncorrected node time-courses NODEDATAORIG
%
% PROTOCOL i... |
ce0fe540cd2b6e7a31df730c6f1d882ff56087ed24bc60c6ee188c218546857f | MATLAB | 6,366 | 218 | function [locs,minimas,q2locs,avgCL,numofpeaksoverall,newpeakheight]=Omseg2(signal,peakheight,peakdist,minpeakheight,minpeakdist,minboundary,segchoice,minmumofpeaks,numimages,div,before,after)
% Function for segmenting a signal based on CL according to user settings
% Chris O'Shea and Ting Yue Yu, University of Birmi... |
9bb8735bc0d07a1cdc8f90aa8be66b95bd7aa1a109cbbb913e670d9552fe081c | MATLAB | 6,373 | 191 | % Load NIFTI or ANALYZE dataset, but not applying any appropriate affine
% geometric transform or voxel intensity scaling.
%
% Although according to NIFTI website, all those header information are
% supposed to be applied to the loaded NIFTI image, there are some
% situations that people do want to leave the ... |
78554a1277d7c352ff4effb2ccb7a4ea4d8699716f871784f91cd204f0d162d7 | MATLAB | 6,377 | 153 | function obj = splitTensorWithParams(obj, params, fixedBinFlag)
% SPLITTENSORWITHPARAMS - Prepare multi-dimensional tensor split by task parameters
%
% INPUTS:
% obj - RecordedData object
% params - Parameter matrix (conditions x parameters)
% fixedBinFlag ... |
0347e8cd29a00c3db7122ae34c0c3716a169285ceca8bfa61710cb9a8ccb2b71 | MATLAB | 6,381 | 123 | %% define subject parameters
% current working directory needs to be /path/to/scripts
mainpath = pwd;
for subSel = 1:52
alphaSettings = [];
alphaSettings.lowerBP = 2;
alphaSettings.upperBP = 32;
alphaSettings.taperType = 'hanning';
alphaSettings.smoothFreq = 2;
alphaSettings.baselineWin =... |
8162ce03f3802ee3b1d82fbb919e6f787739dc239513622408cd1f5348a97ab4 | MATLAB | 6,395 | 207 | function benchmarking_analysis(corrmat,FDparams,distmat,varargin)
% benchmarking_analysis(corrmat,FDparams,atlas,varargin)
% Script to run benchmarking calculations
% example call:
%
% Inputs
% corrmat = roi X roi X subject correlation matrix (fisher transformed)
% FDparams = structure with filtered and unfiltered FD i... |
ea0a3574084c10bdfb4a1bebc6a1e43b29cee51252425e3be85837345a7a7e21 | MATLAB | 6,396 | 178 | function DrawHC_WAIC_Set3()
%% ==============================================================================
% Draw HC WAIC Comparison Only (Set3) - Baseline Marker Added
% Data: Set3_data.csv
% Mapping: M9->M3c, M12->M4b, M19->M5c, M21->M5d
% Ref: M3c (raw M9) is set as baseline (0).
%
% Style:
% - Arial 9pt, ... |
17f2b298f5725f80dae1342e9d56d801fbc9ddc350d0eef7dd0e7ad55ed04cc1 | MATLAB | 6,407 | 192 | %jds_compareNREMCA1SuppressionSWRReactivationREMCofiring
%For CA1 cells with both a noncoordinated-ripple suppression index and a
%coordinated-SWR reactivation index in NREM, relates each cell's REM
%chain-ripple cofiring with PFC to those NREM modulation indices
%(high/low cofiring rank-sum, quartile plot).
clear all... |
cb6a37bd1e6449ee224d94ac1eb64fdfb4dc9d35e1be243e2bb825d3bcd97cd4 | MATLAB | 6,420 | 205 | function BCCT_MatrixGCshow_res_GUI(RESshow,outdir,enhanind,Coltype,PVALT,Pvalused,orders)
% load(indir);
[mpat,mnam,mext] = fileparts(which('BCCT_MatrixGCshow_res_GUI.m'));
load(fullfile(mpat,'gray.mat'));
load(fullfile(mpat,'MatColormap','mycolormap.mat'));
X2Y = RESshow.GCA_res_x2y;
Y2X = RESshow.GCA_res_y2... |
99591c5cf88542ac574b32ef5d09dc71bd39adbdc8489c95d0ddf430e0261fa6 | MATLAB | 6,430 | 172 | function gazeStats = analyzeGazeData(version, elevation, varargin)
% ANALYZEGAZEDATA Analyzes gaze data to detect and characterize saccades and fixations
%
% gazeStats = analyzeGazeData(version, elevation)
% Analyzes gaze position data to detect and characterize saccadic and fixation
% events based on veloc... |
bcf2bb56e96275e19031947347b198deb54b27e9b0e16c68cc88340d559e656f | MATLAB | 6,432 | 171 | %% SFig2D - Activation density: Control vs Behavioral at 5 µA (800 µm truncation)
if ~exist('DATA_ROOT','var'), run(fullfile(pwd, 'matlab', 'config.m')); end
load(FIG2_DATA);
fontsize = 8;
set(groot,'DefaultTextInterpreter','tex', ...
'DefaultAxesTickLabelInterpreter','tex', ...
'DefaultLegendInter... |
d417cb11f7b836fd77f2223427b2024ccd9830f5cad13362636e34f3acfbbafa | MATLAB | 6,437 | 149 | %jds_chainIsolatedCofiring
%Pairwise cofiring (z-scored coactivity) of PFC (or CA1) cells within chain
%vs isolated cortical ripples during REM. Compares the two distributions
%(rank-sum, dip tests) and plots boxplot and histograms.
%Set 'area' below to 'PFC' or 'CA1'.
clear all
close all
animalprefixlist = {'ZT2','JS... |
3a081c2725ccb51e0e842df9dfecb6ba8a75984a422154317ef124b6bb4f328a | MATLAB | 6,441 | 151 | %FIX_LINES Improves the line style of eps files generated by print
%
% Examples:
% fix_lines fname
% fix_lines fname fname2
% fstrm_out = fixlines(fstrm_in)
%
% This function improves the style of lines in eps files generated by
% MATLAB's print function, making them more similar to those seen on
% scre... |
82b1688963c21e5566d63d2d2ff136fe3fa1d2b81eb0a73ee971728b8b17168c | MATLAB | 6,444 | 228 | function CBH = cbhandle(varargin)
%CBHANDLE Gets the handle of current colorbar or its peer axes.
%
% SYNTAX:
% CBH = cbhandle;
% CBH = cbhandle(H,...);
% CBH = cbhandle(...,'force');
% CBH = cbhandle(...,'unhide');
% PAH = cbhandle(...,'peer');
%
% INPUTS:
% 'force' - Forces t... |
c3df50cb82d9c794f3ac2a42d0056972a515659b1623f7ba7ab5ac8faf2717d2 | MATLAB | 6,445 | 274 | function [num_images,rect,mask,im,I,boundaries,camopt,frame1,fluoim,rois,n,tstack] = OMimload(fname,cropchoice,quinnieopt,threshop,threshman,rect,inversion,camopt,fluo_opt,roinum,roisum,tstack)
% Function for taking raw image file and applying thersholding, final
% output - regradless of input, will be uint16 mask.
... |
253b4416ba41add85e4ac8ea344ea694b1863da0adec17cb34127c8e95ab5858 | MATLAB | 6,454 | 151 | %jds_sleepStateCofiring
%Pairwise cofiring (z-scored coactivity) of PFC (or CA1) cells within
%cortical ripples during REM vs NREM. Compares the two distributions
%(rank-sum, dip tests) and plots boxplot and histograms.
%Set 'area' below to 'PFC' or 'CA1'.
clear all
close all
animalprefixlist = {'ZT2','JS17','JS15','J... |
654cc4dc666e4416d82745472813f5f8fa9ee73d1e0df98c8c1cc9c8e9055000 | MATLAB | 6,456 | 105 | %% Export trial-averaged dF/F traces for the INCREASING-SUBSET conditions
% Parallel to export_recruited_traces.m, but the population is Roy's predefined
% increasing subset (allSubset / allChanData), NOT the full-window-recruited pool.
% allChanData{a} cols = [roiRow (tracked roiMap row), channel, current]
% allSu... |
52cc42f56caa6bf670db977a1c2d7c44cd68dc1527e7139431caeaa33cfcfcd4 | MATLAB | 6,459 | 177 | function dFC_project = transition_freq(dFC_project)
transition_threshold = dFC_project.transition_threshold;
comm_sim = dFC_project.comm_sim;
comm_sim_states = zeros(size(comm_sim));
nsub = size(comm_sim,3);
nwin = size(comm_sim,1);
TF = zeros(nsub,1);
fig = uifigure;
progress_bar = uiprogressdlg(fig,'Tit... |
0dcbd1dc3eeb1a576edfabd97a8e8ab903cf10a4efc3109d1115387882a6c7b8 | MATLAB | 6,474 | 102 | function spt_tracks_displacement_histogram_plot(data)
figure()
set(gcf,'name','Tracks Displacement Plot','NumberTitle','off','color','w','units','normalized','position',[0.4 0.3 0.4 0.6],'menubar','none','toolbar','none')
if length(data)>1
slider_step_one=[1/(length(data)-1),1];
slider_one = uicontrol('s... |
5393dc05c53d6fafc91be4d3ff22aaca6000cc7358f36292909dffc90849188a | MATLAB | 6,498 | 153 | function [] = plot_wave_conditions(S)
% It plots waveforms for a set of different conditions, with standard deviations.
% INPUT: -S.data: Data that you want to plot (4D matrix)
% It has the following configuration :
% sensors... |
e16085345680b4fd5194d1d7aaf6e243f075a847d5a3db592ec347daa18184e6 | MATLAB | 6,509 | 163 | function jds_CA1PFCRippleCoactivityAllPairsREM(animalprefixlist)
%JDS_CA1PFCRIPPLECOACTIVITYALLPAIRSREM CA1-PFC pairwise ripple cofiring, REM vs NREM.
% jds_CA1PFCRippleCoactivityAllPairsREM(animalprefixlist) computes z-scored
% ripple cofiring for all CA1-PFC cell pairs within REM chain cortical
% ripples and wi... |
68898fddb13c6f7b807624a0ac65b2f062f1d490f6e1d5ca7439c09baa5c79fa | MATLAB | 6,525 | 215 |
function [map,meann,alll,onedev,vari,SE,gofmap] = tautest3(tstar,tend,framerate,maskedimage,imagestack,avbeat,outs,cmin,cmax,tfilt,rcut)
% Function for calculating relaxation constant
% Chris O'Shea and Ting Yue Yu, University of Birmingham
% Maintained by Chris O'Shea - Email CXO531@bham.ac.uk for any queries
... |
4fc56a5956c76a049446b40f7b985080339ef3591b7b6efc371385d70f884e97 | MATLAB | 6,527 | 177 | clear variables
cd('/Volumes/Samsung_T5/Milan_DA/RGS14_Ephys_da/Data_RGS14_Downsampled_First_Session')
addpath('/Users/kopalagarwal/Samsung_T5/Milan_DA/OS_ephys_da/ADRITOOLS')
rat_folder=getfolder;
prompt = {'Enter the rat index'};
dlgtitle = 'Rat Index';
k = str2double(inputdlg(prompt,dlgtitle));
cd(rat_folder{k})
... |
64713e4f1d416fe69641999dab44bc087140ee517b78c4e1983c8cef5cbeac8d | MATLAB | 6,531 | 137 | % -------------------------------------------------------------------------
% Script: make_figureS5.m
%
% Description:
% This script generates Figure S5 for the manuscript, comparing original
% and corrected binning bar plots when using sum division normalization
% versus not.
%
% The figure contains:
% - Four bar p... |
2e991c878e87fd017841ae398a5cd06cf50bd764e5b8384d8e34e9ce22722a26 | MATLAB | 6,584 | 186 | %% plot_fig2
%
% Reproduces all Fig. 2 panels
%
% Requires:
% filt=0 Fig2_filt0_ga1_pos.mat or Fig2_filt0_ga1_change.mat
% filt=1 Fig2_filt1_ga1_pos.mat or Fig2_filt1_ga2_pos.mat
%
% Author: moh3enparto@gmail.com
% Date: 08.08.2026
clear; close all;
set(groot, 'defaultAxesTickDir', 'out');
set(groot,... |
a03b0a14a3cb33df3db0d3ed3fbfb355c090ffebad4706eff62da07265697197 | MATLAB | 6,584 | 158 | %% Fig3 Statistics Extraction
% Loads Plotter2Results and computes all stats for Fig3 panels
% Outputs to fig3/fig3_stats.csv
if ~exist('DATA_ROOT','var'), run(fullfile(pwd, 'matlab', 'config.m')); end
load(FIG3_DATA);
csvPath = fullfile(fileparts(mfilename('fullpath')), 'fig3_stats.csv');
if exist(csvPath, 'file'), d... |
41b9039f5cf93ef3c3f345cae7adf806d1d7ceb9ceb4a6e3573486f277f9e688 | MATLAB | 6,604 | 214 | function [dFC_project] = dFC_kmeans_app(dFC_project, condition, maxk)
rng_state = rng();
% % Ensure dFC matrix has 5 dimensions
% if numel(d)~=5 && dFC_project.nsub~=1
% disp 'dFC matrix has wrong number of dimensions'
% return
% end
if strcmp(questdlg('Do you want limit k-means clustering to rig... |
8195b10d5ed4a66bbde1f638ff6ef686a008e0f85b67076587becc7945a955a3 | MATLAB | 6,605 | 135 | function O = InducedResponses_Morlet_ROIs_LBPD_D( S )
O = [];
% It computes time-frequency analysis (induced responses) using Morlet
% wavelet.
% It computes Morlet wavelet transform independently on each voxel and each
% trial of the provided data. Then, it averages the results over voxels and trials.
% It does it o... |
86094a66217f5703609a59892551d56e109ce9be65e682ea994c33a9fe92ef9c | MATLAB | 6,613 | 162 | function cluster_stability(data_dir,save_dir,selectedK)
%
% Compute the clustering stability for the selected K using
% the procedure explained in Farinha et al., (2022).
%
% INPUT:
% data_dir directory where the results from K-means are saved
% save_dir directory to save the results, it should correspond
% ... |
1dd2ca9eb8f52d56766c51377569b9872951991bfe65b96dfdbaaebc26835551 | MATLAB | 6,632 | 181 | function DrawHC_WAIC_Set1()
%% ==============================================================================
% Draw HC WAIC Comparison Only (Set1) - Baseline Marker Added
% Data: Set1_data.csv
%
% Style:
% - Arial 9pt, FontWeight 'normal'
% - LineWidth 0.6 (thin axis lines)
% - Canvas: 5.5 cm x 6.0 cm
% - ... |
c4531cdca7b46dba44c2b20772672ea42c159c2c78bc1682b3a45d92cac86711 | MATLAB | 6,637 | 177 | classdef plot_hemispheres < handle
% PLOT_HEMISPHERES Plots data on the cortical surface.
%
% obj = PLOT_HEMISPHERES(data,surface,varargin) plots column vectors of the
% n-by-m data matrix on surfaces provided in one or two element cell
% arary surface. Vertices included in the surfaces must... |
6852f86450599fab7528894030d0414a566dadb92778d0c3e03879c93469b2e8 | MATLAB | 6,643 | 193 | clear
% current working directory needs to be /path/to/scripts
mainpath = pwd;
save_dir = [mainpath filesep '..' filesep 'figs' filesep 't_values_' strrep(strrep(char(datetime), ' ', '-'), ':', '-')];
addpath([mainpath filesep 'fmriRegAnalysis'])
addpath([mainpath filesep 'toolboxes' filesep 'tc_functions'])
addpath([m... |
fd06f92d3bed9e6da9ac6fbaf673c92e1c4d3516044f04f1951b9492ca8e319c | MATLAB | 6,649 | 173 | %%
if ~(exist('mainpath','var'))
clearvars
% currrent working directory needs to be /path/to/scripts
mainpath = pwd;
else
clearvars -except mainpath
end
addpath([mainpath filesep 'fmriRegAnalysis'])
addpath([mainpath filesep 'toolboxes' filesep 'tc_functions'])
addpath([mainpath filesep 'toolboxes' fil... |
0d4d8bc0a7762c393f82244395a0f7c0867a1881d7d8bc6d60846f8159865c6f | MATLAB | 6,666 | 186 | function DrawHC_WAIC_Set2()
%% ==============================================================================
% Draw HC WAIC Comparison Only (Set2) - Baseline Marker Added
% Data: Set2_data.csv
% Mapping: M9->M3c, M10->M4a, M15->M5a, M16->M5b
% Ref: M9 (displayed as M3c) is set as baseline (0).
%
% Style:
% - Ar... |
74934412001cc766930985d79c71c0d5fc3373e59f92ff2722d9f4229c25e71b | MATLAB | 6,671 | 186 | function spindles = FindSpindlesRGS14(filtered,k)
%FindSpindles - Find thalamo-cortical spindles (9-17Hz oscillations).
%
% USAGE
%
% spindles = FindSpindles(filtered,<options>)
%
% filtered spindle-band filtered LFP <a href="matlab:help samples">samples</a> (one channel). This must
% be... |
3f0d5eeedb562706b71927b10be36aa67bfe48cee60eeb16df76a4d17a8d60ea | MATLAB | 6,672 | 159 | % MATCHDISTRIBUTIONS Resample two distributions to match empirical probabilities
%
% [subsample_A, subsample_B, idx2pickA, idx2pickB] = matchDistributions(A, B)
% Resamples two distributions to match their empirical probability distributions
% across bins, implementing the distribution matching procedure fro... |
306eb221663bd875c836d81f9572a2e99fd46aa03bf88ff81bfe3c1c463f4a4b | MATLAB | 6,689 | 207 | function jds_pEMG(animalprefixlist)
%JDS_PEMG Pseudo-EMG from high-frequency LFP correlations.
% jds_pEMG(animalprefixlist) estimates a pseudo-EMG signal as the
% windowed correlation of 300-600 Hz bandpassed LFP between each riptet
% and the CA1 reference tetrode, then compares EMG levels in REM vs wake
% and ... |
58e39043ade7d2ec01b0279e075cce30f099ab49ba3fb3230774f702a3844c04 | MATLAB | 6,726 | 177 | function [rho, beta, theta, p] = vectorCorrelation(x, y, u, v, varargin)
% VECCORRELATION 2D vector correlation between two vector sets
%
% [rho, beta, theta, p] = VECCORRELATION(x, y, u, v)
% Computes the correlation between two paired 2D vector sets [x,y] and
% [u,v] using the approach from Hanson et al.,... |
ee6798c14af873157e321e473f09cd03c2ebe529c76c71e678dd748b75bb6450 | MATLAB | 6,726 | 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)
%
%... |
420b4eeee65d91b9e6979f72118504fe0e833b3124b71af1475fcef179f83373 | MATLAB | 6,760 | 136 | function [ sign_clust ] = oneD_MCS_LBPD_D( P, p, max_lab, permnum, MCS_thresh, time, tvals )
% One-dimensional (1D) Monte Carlo simulation.
% It calculates whether a cluster of significant values in 1 dimension (for
% example a time-course of p-values) is significant or not, assuming that
% random significant values d... |
06bd3a3b23ee0b72eae47c049a3d155b154ca5ef6cdd858a17f201bc24552d9d | MATLAB | 6,763 | 142 | function data_struct = compile_histograms_single_cell(data_struct)
UseEntireTraj = data_struct.UseEntireTraj;
GapsAllowed = data_struct.GapsAllowed;
TimePoints = data_struct.TimePoints;
JumpsToConsider = data_struct.JumpsToConsider;
HistVecJumps = data_struct.HistVecJumps;
HistVecJumpsCDF = data_struct.HistVecJum... |
c24e72c46b8d2d79ef9fd1421d01880102be67c1ea6779738c1a2a7bc970fe90 | MATLAB | 6,769 | 201 | %IM2GIF Convert a multiframe image to an animated GIF file
%
% Examples:
% im2gif infile
% im2gif infile outfile
% im2gif(A, outfile)
% im2gif(..., '-nocrop')
% im2gif(..., '-nodither')
% im2gif(..., '-ncolors', n)
% im2gif(..., '-loops', n)
% im2gif(..., '-delay', n)
%
% This function c... |
f28665ac113c7b1f0ccfb668b4402d65f28808dc8ad862bb1201223d089ebb8b | MATLAB | 6,796 | 128 | function [ p_final_pos, p_final_neg, node_pos_idx, node_neg_idx, diff1 ] = DTI_GT_MCS( S )
% It computes Monte-Carlo simulations (MCS) on distribution of differential
% data (contrasting two groups) derived from graph teorethical measures.
% If you do not want to use all your nodes (brain areas), but only a
% subset o... |
65d04b9831453d5d1bb95f2d81240d80786303c2dd8e7d263ca1e8734a986762 | MATLAB | 6,808 | 198 | % Load NIFTI or ANALYZE dataset. Support both *.nii and *.hdr/*.img
% file extension. If file extension is not provided, *.hdr/*.img will
% be used as default.
%
% A subset of NIFTI transform is included. For non-orthogonal rotation,
% shearing etc., please use 'reslice_nii.m' to reslice the NIFTI file.
% It will... |
a0d20887ed1908a4c8655e0c436ca70feadd0eb629643c2d719f556d7bf900d9 | MATLAB | 6,822 | 182 | function jds_rippleTriggeredWaveletPowerCompareREM(animalprefixlist, days)
%JDS_RIPPLETRIGGEREDWAVELETPOWERCOMPAREREM Wavelet power around chain vs isolated ripples.
% jds_rippleTriggeredWaveletPowerCompareREM(animalprefixlist, days)
% computes session-z-scored Morlet wavelet spectrograms around chain and
% isola... |
1e515a70d9f69f57ba12570492621bdf2cfe4697dbfcd958d318f8ba18308386 | MATLAB | 6,844 | 248 | function [map,meann,alll] = DInt(framerate,maskedimage,imagestack,outs,cmin,cmax,tfilt,before,after,peakdist,frame_1,frame_last,t);
% Function for creating diastolic interval map from an image stack.
% Chris O'Shea and Ting Yue Yu, University of Birmingham
% Maintained by Chris O'Shea - Email CXO531@bham.ac.uk for... |
1755d553750ad3c3f362aa740188d01cc34d1a0e273eec203e9ee6935fad984a | MATLAB | 6,864 | 190 |
cla(app.UIAxes4)
threshold = app.ThresholdSpinner.Value;
node_labels = 0;
% figure('Position',[100,150,300,250])
% mygraph(mygraph<0) = 0;
A = binarize(mygraph,threshold);
mygraph = mygraph - min(mygraph,[],'all');
if ~exist('communities','var') || isempty(communities)
app.UIAxes4.Title.String = 'Community Str... |
5f1a6ea4e83f6cf07327091b92c8dd785e329ba4c4863fdf7cd9cbaca8105b47 | MATLAB | 6,914 | 155 | function [ ] = STC_plottingtimeseries_LBPD( S )
% It plots timeseries for a provided parcellation in a number of datasets.
% This is thought to be used as follows:
% 1)Estimate best parcellation using "FunctionalSpatialClustering_voxels2ROIs_LBPD_D" function on the full dataset.
% 2)Load different part of the above da... |
ca5792be1bd5afd09f8e904a3339b4b277bdb13ef08e4d0b1800603b4edba318 | MATLAB | 6,914 | 200 | function varargout = process_nst_merge_montage( varargin )
% @=============================================================================
% This function is part of the Brainstorm software:
% http://neuroimage.usc.edu/brainstorm
%
% Copyright (c)2000-2016 University of Southern California & McGill University
% This... |
be599b47e28005e8d321b6802860cd08ee66f7e512283967f87d5911bbab6f36 | MATLAB | 6,995 | 220 | %%% DISCLAIMER %%%
% This file is a modified version of `cp_opt.m` from Tensor Toolbox:
% Brett W. Bader, Tamara G. Kolda and others, Tensor Toolbox for MATLAB, Version 3.1,
% www.tensortoolbox.org, June 2019. https://gitlab.com/tensors/tensor_toolbox.
% It is therefore subject to the following license:
% BSD 2-Clause... |
cec18a4bf302903d20988ad4efc3eae072ec6b154bd9c29cd1b596a74d973dbb | MATLAB | 6,996 | 201 | %--------------------------------------------------------------------------
% Till Habersetzer, 27.06.2025
% Communication Acoustics, CvO University Oldenburg
% till.habersetzer@uol.de
%
% Description:
% Calculates speech envelopes for audiobook stimuli and provides an
% interactive, scrollable plot to visually co... |
a97662cb5cefd152253f20831e5e5344347c40c18bad93a529a96dbeadb8a2f7 | MATLAB | 7,006 | 198 | % Load NIFTI or ANALYZE dataset. Support both *.nii and *.hdr/*.img
% file extension. If file extension is not provided, *.hdr/*.img will
% be used as default.
%
% A subset of NIFTI transform is included. For non-orthogonal rotation,
% shearing etc., please use 'reslice_nii.m' to reslice the NIFTI file.
% I... |
262ab010d971294b6ff7c5344acd5b7100551f8fc748190546b7f9c4d0d106b9 | MATLAB | 7,018 | 186 | function [stats] = bootstrap_within_permutation_paired_samples(data,design,niter,nboot,pthr)
% PERMUTATION_HTEST2_NP - A "non parametric" two-sample hypotesis test that, instead of
% relying on the test-type standard distribution, uses permutations of group labels to
% estimate the null distribution. The null distribut... |
fc9a2828429a857ed3d1359fa639acdf3290376ce9d426e8947edd86e1be0176 | MATLAB | 7,018 | 182 | function BCCT_CaSCN_matrixcomputemain(Parameter)
pathfiles = which('BCCT.m');
[path nam ext] = fileparts(pathfiles);
Outputdir = Parameter.Outputdir;
RealCompPara.Outputdir = Outputdir;
Inputdir = Parameter.Inputdir;
RealCompPara.Inputdir = Inputdir;
SeedROItype = Parameter.SeedROItype;
RealCompPara.SeedROItype... |
239052aff60ccb72413c06063679a03c25c088735f058c1b662ec4c3e5d793b5 | MATLAB | 7,026 | 167 | function ftable = nst_filter_table(table_in, filters)
table_cols = table_in.Properties.VariableNames;
if ismember('entry__', table_cols) % Are you that twisted??
throw(MException('Nirstorm:UnsupportedTableWithEntry__', ...
'"Entry__" cannot be a table column'));
end
if isempty(fieldnames(filt... |
b8dead2514b3f0fb0d56690a63cc8c27b96e8b0469c10586b121329ac518f9f5 | MATLAB | 7,030 | 161 | function spt_simulate_brownian_motion()
global stop_simulation_val diffusion_coefficient_val num_of_particles_val data listbox
index = listdlg('ListString',{'Simulate Random Brownian Motion','Simulate Directed Brownian Motion','Simulate Confined Brownian Motion'},'SelectionMode','single','ListSize',[400 300] );
if... |
1ff4da97f700c6f0d367fa47e565a8d791f479d6783933c2d30839dc0a8e36cb | MATLAB | 7,034 | 166 | function plotSDF(obj, neus2consider, conds2consider, window, binWidth, order, displayErrorFactor, varargin)
% PLOTSDF - Plot spike density function with condition comparison
%
% SYNTAX
% obj.plotSDF(neus2consider, conds2consider, window, binWidth, order, displayErrorFactor)
% obj.plotSDF(..., 'm... |
8c1371a5468f68d55a06752cf67da93a1307326818adc1b389e830a2ae2a28e4 | MATLAB | 7,038 | 260 | % Collapse multiple single-scan NIFTI files into a multiple-scan NIFTI file
%
% Usage: collapse_nii_scan(scan_file_pattern, [collapsed_fileprefix], [scan_file_folder])
%
% Here, scan_file_pattern should look like: 'myscan_0*.img'
% If collapsed_fileprefix is omit, 'multi_scan' will be used
% If scan_file_fol... |
d23f925fc2de69f087870d13befec60686f4d845637191027ed840b115de7184 | MATLAB | 7,047 | 196 | % Use like: h = rm_raincloud2(data, colours, plot_top_to_bottom, density_type, bandwidth)
% Where 'data' is an M x N cell array of N data series and M measurements
% And 'colours' is an N x 3 array defining the colour to plot each data series
% plot_top_to_bottom: Default plots left-to-right, set to 1 to rotate.
% dens... |
4cfc4027747bc896fc855fa783c3e779321b9156bdba965c96a5932225e52b1a | MATLAB | 7,076 | 174 | %% Radius that encloses 50%
% Activation density
% Count # of activation radii which is # of neurons and
% then divide by sphere of radius r50
if ~exist('DATA_ROOT','var'), run(fullfile(pwd, 'matlab', 'config.m')); end
load(FIG2_DATA);
dDiv = 7;
curCurr = 5;
min_neurons = 1;
% collectors (one row per observation: sit... |
c447f6b18c77b263bbe9fbcf30147438e8a8c2ecc8d4a589238ab4354f320996 | MATLAB | 7,080 | 149 | function [cnn_feature_model,layer_get,train_x_feature_label_norm1,vaild_x_feature_label_norm1,test_x_feature_label_norm1]=CNN_feature_extract(num_feature,train_x_feature_label_norm,train_y_feature_label_norm,vaild_x_feature_label_norm,test_x_feature_label_norm,augment_feature_method)
% CNN 回归特征提取
epoch_set=120; ... |
89150b91271264b747987e45979775533a7fdc5ce7d287ad8d85e8342f6f535f | MATLAB | 7,096 | 191 | %% Build weekDensityData from populationDistances
dDiv = 7; % days per week
targetCurrents = [1,2,3,4,5,6];
C = numel(targetCurrents);
min_neurons = 1;
num_shells = 20;
shell_width = 0.05; % mm (50 µm)
num_shells = 8;
shell_width = 0.1; % mm (100 µm)
% Collectors: one cell per (current, week, shell), wil... |
bfa360cd14fcdae3f8cf37776e17967f766339fb3d2c837885e302d892ae7109 | MATLAB | 7,103 | 191 | function [S, Serr, per, tau, exctn, lambda] = armode(A, C, th)
%ARMODE Eigendecomposition of AR model.
%
% [S,Serr,per,tau,exctn]=ARMODE(A,C,th) computes the
% eigendecomposition of an AR(p) model that has been fitted using
% ARFIT. The input arguments of ARMODE are output of ARFIT.
%
% The columns of the output ma... |
e47478d06561bc95603d7d9a563af5e2134be7009555adc2ba22aad8682888f9 | MATLAB | 7,105 | 256 | % Make NIfTI structure specified by an N-D matrix. Usually, N is 3 for
% 3D matrix [x y z], or 4 for 4D matrix with time series [x y z t].
% Optional parameters can also be included, such as: voxel_size,
% origin, datatype, and description.
%
% Once the NIfTI structure is made, it can be saved into NIfT... |
21a6d61304408e2d375d8b8abe75022a5d4dad83184d8b3bef03d256febcd199 | MATLAB | 7,114 | 198 | function BCCT_CON_matrixcomputemain(Parameter)
pathfiles = which('BCCT.m');
RealCompPara.mod = 'volroi';
[path nam ext] = fileparts(pathfiles);
Outputdir = Parameter.Outputdir;
RealCompPara.Outputdir = Outputdir;
Inputdir = Parameter.Inputdir;
RealCompPara.Inputdir = Inputdir;
SeedROItype = Parameter.SeedROItyp... |
d5da8bc3b892b868b5f7f0e7836a14c52802987267a274f50bae2b5be446b4af | MATLAB | 7,127 | 213 | function OCDdraw_m12_plot26()
%% =========================================
% M12: beta distribution plot (OCD data, blue theme, 70 x 35 mm)
% Features:
% 1. Data: read OCD group data (M12_f2_drawsocd.csv)
% 2. Color: switch to OCD blue theme
% 3. Size: total figure width = 70 mm, height = 35 mm
% 4. Layout: short... |
3fe950fdaa6b5d892e3f2d527298b16f7872295786ef2bd6f7301bbe1ee3f471 | MATLAB | 7,129 | 136 |
%%
addpath('/projects/MINDLAB2017_MEG-LearningBach/scripts/osl/osl-core'); %this add the path (not necessary being in the osl-core directory if you have this one)
osl_startup
addpath('/projects/MINDLAB2017_MEG-LearningBach/scripts/scripts_osl_learningbach/Cluster')
%%
datadir = '/scratch5/MINDLAB2017_MEG-Learni... |
3d0f4af191e4f229f1cb88af944d1e2fbf823a9d2f644b3c30a6311e7de71802 | MATLAB | 7,138 | 180 | function O = waveplot_groups_server_LBPD(S)
O = [];
% It plots waveform for multiple groups of participants. Typically used for
% plotting time series of MEG source ROIs according to different groups.
% INPUTS:
% -S.data: Data that you want to plot
% ... |
3e5971351bcb8aa981bcec135463b3775898f910fea1233b6825e59d350b4a64 | MATLAB | 7,155 | 155 | function data_to_fit = ModelFitting_main(data_to_fit,j)
%ModelFitting_main The is the master function for model fitting
% All model-fitting is performed within this function and its dependent
% functions
% Define global variables
UseWeights = data_to_fit.UseWeights;
ModelFit = data_to_fit.ModelFit;
FitLocError = d... |
34e3d7753e12bb2e4b9bb99541163186e4ddf893aac3d3221f88c2e93a5af83e | MATLAB | 7,177 | 201 | %jds_compareNREMCA1SuppressionREMCofiring
%Relates each CA1 cell's suppression by noncoordinated NREM cortical
%ripples (modulation index from CA1nrempfcindripmodsigdata.mat) to its
%mean cofiring with PFC cells in REM chain cortical ripples. Compares
%suppression for high vs low cofiring cells (rank-sum), plots
%rippl... |
52cfc3d27632aabd3628b601c59267beb5fd92fee4c8e37655ee66230a67343b | MATLAB | 7,194 | 126 | classdef NetworkTestResultTestCase < matlab.unittest.TestCase
properties
number_of_networks
test_data
test_options
test
end
methods (TestMethodSetup)
function loadInputData(testCase)
import nla.TriMatrix nla.TriMatrixDiag nla.net.test.WilcoxonTest nla.ne... |
32409820ef5301ac1babfcc1c51ea676c432e0857988f82183103478fb6cc7dd | MATLAB | 7,201 | 173 | classdef optimizationProblem
%OPTIMIZATIONPROBLEM Store all properties needed to run NOW.
% Parameters not specified by the user are default-initialized as follows:
%
% Max gradient = 80 milliTesla/m
% Max slew rate = 100 milliTesla/m/milliSecond = 100 T/m/s
% Eta (heat dissipation param... |
97ba8395d3a9ff888e50d6f14deb7b934c8969098937f76791d317afd9e17f2a | MATLAB | 7,201 | 176 | function spt_linear_fit(data)
input_values = inputdlg({'percentage of data to fit:'},'',1,{'25'});
if isempty(input_values)==1
return
else
percentage=str2double(input_values{1});
for i=1:length(data)
[data{i}.a,data{i}.b,data{i}.r2] = msd_fit_linear_msd_inside(data{i}.msd,percentage); ... |
d29eca6a7785f08c328677595c933efd810bf4ce5bb379d379af85a3b83d38af | MATLAB | 7,236 | 214 | function varargout = process_nst_merge_metrics( varargin )
% PROCESS_NST_MERGE_METRICS: Fusionne plusieurs tableaux de métriques
% et sauvegarde le tableau unique résultant dans un dossier 'metrics' du sujet.
% Utilise la convention officielle 2D Description de Brainstorm (Commit c3b18b5).
%
% @========================... |
deab49268088632182fe1065de5c1fe55cfd3e3c64fbaca843badcff96c52a12 | MATLAB | 7,248 | 186 | function data_out = tc_get_layer_signal(subject, varargin)
%tc_get_layer_signal Returns layer signal for one subject.
%
% data_out = tc_get_layer_signal(subject) outputs entire area V 1
%
% data_out = tc_get_layer_signal(subject,...,'tval',TVAL) thresholds data
% at TVAL.
%
% data_out = tc_get_layer_signal(subj... |
540e688adbbccee1e824968305d453f5d384d80d6f96bf73c1dbc23aa7b67d31 | MATLAB | 7,250 | 181 | function jds_CA1PFCRippleCoactivityREMCA1RipAlignedMUA(animalprefixlist)
%JDS_CA1PFCRIPPLECOACTIVITYREMCA1RIPALIGNEDMUA Ripple-aligned CA1 activity by cofiring level.
% jds_CA1PFCRippleCoactivityREMCA1RipAlignedMUA(animalprefixlist) computes,
% for each CA1 cell, its mean z-scored cofiring with PFC cells within REM... |
742b5b7fba81d358daa482d6de4536e071a7e84d6181adaf6325fb88196e31a0 | MATLAB | 7,255 | 187 | % Load NIfTI / Analyze header without applying any appropriate affine
% geometric transform or voxel intensity scaling. It is equivalent to
% hdr field when using load_untouch_nii to load dataset. Support both
% *.nii and *.hdr file extension. If file extension is not provided,
% *.hdr will be used as default.... |
7c6fb827c56fd2cf7f92a0fdb51ede6015146b1d14208ea813dd2d206e4991bc | MATLAB | 7,258 | 189 | function O = waveplot_groups_local(S)
O = [];
% It plots waveform for multiple groups of participants. Typically used for
% plotting time series of MEG source ROIs according to different groups.
% OBS!! FUNCTION TO BE RUN ON LOCAL COMPUTERS (NOT ON AARHUS SERVER)
% THE DIFFERENCE IS THAT AVERAGING (AND STD) IS ... |
27d328e9d1f51cd081af5d786ee80cf9734065f0659ffc4d10caf3be35f6ae95 | MATLAB | 7,262 | 192 | function varargout = process_nst_project_volumes( varargin )
% @=============================================================================
% This software is part of the Brainstorm software:
% http://neuroimage.usc.edu/brainstorm
%
% Copyright (c)2000-2013 Brainstorm by the University of Southern California
% This ... |
f125c9427894a640b44f05e2769303bbbe07c77b79f9e74c91c32613cf6a1ce0 | MATLAB | 7,272 | 200 | %%Choosing working directory
cd ~/surfstat
clear all; close all;
%Load surfs
surf = SurfStatReadSurf({'~/surfstat/CIVET_2.0_icbm_avg_mid_sym_mc_left.obj' '~/surfstat/CIVET_2.0_icbm_avg_mid_sym_mc_right.obj'});
%Adding the midline mask
mask_left = SurfStatReadData({'~/surfstat/CIVET_2.0_mask_left.txt'});
mask_left =... |
2e4eb0fe3ba833778b709bb3e98ec07f30817876c3cb30969705c95718f9cfba | MATLAB | 7,283 | 162 | %% plot_fig1_4
%
% Plots example LFP trials, ERP, across-trial variability (ATV), and
% intra-trial variability (ITV). Also examines how power and its
% coefficient of variation (CV) change when stimulus amplitude is scaled.
% Used to reproduce Figs. 1 and 4 of the associated publication.
%
% Requires:
% - Fig1_4_dat... |
49ff4bffd416af7513ae2d195a6b5bac1a293cd9e29b3a2c8f43d2b11db5742f | MATLAB | 7,291 | 211 | function DrawOCD_WAIC_Set2right()
%% ==============================================================================
% Draw OCD WAIC Comparison Only (Set2) - Baseline Marker Added
% Data: Set2_dataOCD.csv
% Mapping: M5->M3c (Baseline), M10->M4a, M15->M5a, M16->M5b
% Ref: M5 (displayed as M3c) is set as baseline (0).... |
6b1478135cfd58364d4b9c3e7966fce8d8cdeec3048b5df674be0b5279499382 | MATLAB | 7,299 | 209 | function DrawOCD_WAIC_Set3right()
%% ==============================================================================
% Draw OCD WAIC Comparison Only (Set3) - Baseline Marker Added
% Data: Set3_dataOCD.csv
% Mapping: M5->M3c (Baseline), M12->M4b, M19->M5c, M21->M5d
% Ref: M5 (displayed as M3c) is set as baseline (0).... |
80ecc8f720bda5dc0699a836ba67ac4a23528eeb54878494786c0292c9abf088 | MATLAB | 7,336 | 202 | function jds_rippleThetaPhaseLockingREM(animalprefixlist)
%JDS_RIPPLETHETAPHASELOCKINGREM Theta phase locking of chain vs isolated REM ripples.
% jds_rippleThetaPhaseLockingREM(animalprefixlist) extracts the theta
% phase (from the CA1 tetrode with the most ripples) at the midpoint of
% each chain and isolated co... |
5cf5ee15cd794e5cd214101124f13d6a6e6eae689f7dab3b6dc4e16e657b6ea3 | MATLAB | 7,377 | 211 | % Compute the the regression ERPs
% Other m-files required:
% EEGLAB toolbox: https://github.com/sccn/eeglab
% Unfold toolbox: https://github.com/unfoldtoolbox/unfold
% Author: Cameron Hassall, Department of Psychology, MacEwan University
% email address: hassallc@macewan.ca
% Website: http://www.cameronhass... |
11f4d60c6b190fb05b2ae7b35d8f1759587ac9457e020eaec58748af356904dd | MATLAB | 7,383 | 209 | function shape_classification_gravitational_clustering(data)
input_values =inputdlg({'Number of Clusters:','Gamma:'},'',1,{'100','0.001'});
if isempty(input_values)~=1
k = str2double(input_values{1});
gamma = str2double(input_values{2});
r = shape_classification_normalized_parameters(data.classes); ... |
87e74bd02cf5fdfe7c4d9a2015abf0545709dd75743ae022417eeaae667b0e95 | MATLAB | 7,386 | 204 | function names = schaefer_roi_names_200()
names = {
'17Networks_LH_VisCent_ExStr_1'
'17Networks_LH_VisCent_ExStr_2'
'17Networks_LH_VisCent_Striate_1'
'17Networks_LH_VisCent_ExStr_3'
'17Networks_LH_VisCent_ExStr_4'
'17Networks_LH_VisCent_ExStr_5'
'17Networks_LH_VisPeri_ExStrInf_1'
... |
d287fbf84a4843e2fb1f05eb8db2b9e17bc0794db4bb553ef722e0a6db6a8eee | MATLAB | 7,428 | 161 | %% OSL and varius paths
addpath('/projects/MINDLAB2017_MEG-LearningBach/scripts/osl/osl-core'); %this add the path (not necessary being in the osl-core directory if you have this one)
osl_startup
addpath('/projects/MINDLAB2017_MEG-LearningBach/scripts/scripts_osl_learningbach/LEiDA'); %path to LEiDA_MEG_leonardo funct... |
e6433d0c02ec2bd43338e7aaada158c00be7e7386eb3928900d57ec31f37b746 | MATLAB | 7,484 | 226 | %% plot_fig3_6
%
% Main analysis script for LFP variability and power across cortical areas.
% Reproduces Figs. 3, and 6 of the associated publication.
% Requires:
% - Fig3_6_summary_<monkey><filt><interval><freq>.mat
% - shadedErrorBar.m (Mathworks File Exchange)
%
% Author: moh3enparto@gmail.com
% Date: 08.08.... |
70666e6aff74f3c496d74c68c0ab6c93cbd6991e52e0cc805802ef835bb53d72 | MATLAB | 7,498 | 175 | function [ OUT ] = twoD_MCS_LBPD_D( P, thresh, permut, threshMC, perm_max, t1, t2, T )
% It individuates clusters in a binary 2D matrix and tests their
% significance by Monte Carlo simulations.
% This function is designed to work with binary data.
% INPUT: -P: n x n of values (e.g. p-values obtained
... |
110c09d15eab46eda8d299c66c4044c379f17c95b4c01862ebda2b518f7be88a | MATLAB | 7,515 | 197 | function DrawOCD_WAIC_Set1()
%% ==============================================================================
% Draw OCD WAIC Comparison (Set1) - Final Version
% Data: Set1_dataOCD.csv
% Mapping: M5->M3c (Baseline), M10->M4a, M12->M4b, M13->M4c, M14->M4d
% Ref: M5 (displayed as M3c) is set as baseline (0).
%
% St... |
6d71fab1fcb8b0e88d607a717baa946b4d1294799ca280a71177e80a3306b71e | MATLAB | 7,520 | 200 | function varargout = process_nst_motion_correction( varargin )
% @=============================================================================
% This software is part of the Brainstorm software:
% http://neuroimage.usc.edu/brainstorm
%
% Copyright (c)2000-2013 Brainstorm by the University of Southern California
% Thi... |
8d3c593081d2b298c79e74156cb329198185ec8639ee33c261355f2d66c659df | MATLAB | 7,525 | 322 | %% read files
prot=xlsread('X:\BSA Direct vs. Trad\MC8RProtein.xlsx')
pep=xlsread('X:\BSA Direct vs. Trad\MC8RPeptides.xlsx')
si=xlsread('X:\BSA Direct vs. Trad\MC8RSI.xlsx')
pepwg=xlsread('L:\Qexactive\MohmD\Rat_Liver_MWave_3x30Sec_4Hrs_SequestHt and Mascot.xlsx')
[bsapep1 bsapep2 bsapep3] =xlsread('X:\BSA Di... |
963de96c8211e2ffceda30d02c23f8e8b9c3f2479c7762dd148ccabfe68fcefd | MATLAB | 7,527 | 218 | function varargout = process_nst_sci( varargin )
% process_nst_sci: compute the Scalp Coupling Index
%
% @=============================================================================
% This function is part of the Brainstorm software:
% http://neuroimage.usc.edu/brainstorm
%
% Copyright (c)2000-2017 University of Sout... |
31c822f652c1e4729ea0ee07432b46f0cdb331d7fb01b53310766e7003b05db4 | MATLAB | 7,588 | 199 | %%
clear
TL_avg_1 = zeros(52,3072, 2, 3);
TL_avg_2 = zeros(52,3072, 2, 3);
counter = 0;
for subSel = [1:52]
counter = counter +1;
% current working directory needs to be /path/to/scripts
mainpath= pwd;
thisSubject=['S' num2str(subSel)];
% Preprocessing
rawEEGDataFiles=[mainpath filesep '..' file... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.