sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
be685e115ff051f12c1480599fcfb45a038bbffdf0a823eaedf0c1b8d5c4d678 | MATLAB | 12,661 | 343 | function [stat,p,ci,stats,dist] = permucorr(x,varargin)
%PERMUCORR Permutation-based linear or rank correlation coefficient.
% STAT = PERMUCORR(X) returns a matrix containing the pairwise linear
% correlation coefficients between every pair of columns in X based on
% Pearson's r. X must have at least two columns... |
c8f32e730a558c50aa86fe3241e91aed5244408cc246eee2d0b0b61f31bf184a | MATLAB | 12,661 | 299 | function [data_clean, data_artifacts, SENSAI_score, SENSAI_score_per_band, artifact_threshold_per_band] = ft_denoise_gedai(cfg, data)
% ft_denoise_gedai FieldTrip wrapper for the GEDAI plugin.
%
% Usage:
% [data_clean, data_artifacts, SENSAI_score, SENSAI_score_per_band, artifact_threshold_per_band] = ft_denoise_ged... |
aa18c932bd3c82c3221f0af3422d609ffc402ce8e9dc06ed4c686f0143bb2ae0 | MATLAB | 12,671 | 347 | %% Contrastive Variational Autoencoder for Fluorescence Detection in
%% Fluorescence Guided Neurosurgery Imaging - Main
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Script Name : fgsFluorescenceDetection_clVAE_main.m
%
% Description : A training sequence for a contarstive learni... |
8c06ffcf5713883d84c8cfe95b29453cbc6a75d76aef55c88c7b4e15e38a3194 | MATLAB | 12,686 | 311 | function [h,p,cr,ca] = TestRemapping(control,repeat,test,varargin)
%TestRemapping - Test if firing fields remap (or shift) between two conditions.
%
% To test for random remapping between a control and a test condition, we
% first estimate for each place cell the absolute field shift between the two
% conditions, a... |
e8c41573260f9dbd80bb2d32f1221443722b53fcaf6bdb748016c44a11eb5b0c | MATLAB | 12,689 | 357 | function varargout = TSA(varargin)
% TSA M-file for TSA.fig
% TSA, by itself, creates a new TSA or raises the existing
% singleton*.
%
% H = TSA returns the handle to a new TSA or the handle to
% the existing singleton*.
%
% TSA('CALLBACK',hObject,eventData,handles,...) calls the local
% f... |
21e711e20eaeb6b816f285a72b750f60b96c5cb35e65aa8133e763fcd043862c | MATLAB | 12,698 | 221 | % POP_SPECPARAMS - Set plotting and statistics parameters for computing
% STUDY component spectra.
% Usage:
% >> STUDY = pop_specparams(STUDY, 'key', 'val');
%
% Inputs:
% STUDY - EEGLAB STUDY set
%
% Plot options:
% 'topofreq' - [real] Plot Spectrum scalp maps at one specif... |
0c32a705b70d3282bb2aba8ebe06fdadfda45a18f99e4c407e75dc6b80bd8e14 | MATLAB | 12,701 | 400 | function [ all_subjects ] = nmri_export_metrics_sensor( all_subjects, opt, params )
%[ all_subjects ] = nmri_export_metrics_sensor( all_subjects, opt, params )
% Will save any number of metrics / frequency bands (after scaling /
% dim_reduction/ abs) in a 4D .mgh file. The order will be as in the
% all_subject cell-a... |
45faea7c388e9e68c2fa4fa47e7568704a7b83ee0232dce2aa1609fcc191ec7d | MATLAB | 12,701 | 185 | function osp_iniCoregWindow(gui)
%% osp_iniCoregWindow
% This function creates the initial coregistration window in the gui.
%
%
% USAGE:
% osp_iniCoregWindow(gui);
%
% INPUT: gui = gui class containing all handles and the MRSCont
%
% OUTPUT: Changes in gui parameters and MRSCont are writte... |
dba38087f2c51f2e8788037186cd6991bcb79a582f1229267d7234c34ccf6e67 | MATLAB | 12,707 | 288 | function [ceiling_upperBound, ceiling_lowerBound, bestFitRDM]=ceilingAvgRDMcorr(refRDMestimates,RDMcorrelationType,monitor)
% Given a set of reference RDM estimates (e.g. from multiple subjects) in
% argument refRDMestimates, this function estimates upper and lower bounds
% on the ceiling, i.e. the highest average RDM... |
f15f6713531df61e40d6bcceabf19a52a52d74e15fd0b6881d8d4359265db65e | MATLAB | 12,707 | 381 | function [ output ] = tapas_rdcm_sparse(DCM, X, Y, args)
% [ output ] = tapas_rdcm_sparse(DCM, X, Y, args)
%
% Variational Bayesian inversion of a linear DCM with regression DCM,
% including sparsity constrains on the connectivity parameters. The
% function implements the VB update equations derived in Frässle et al.... |
03eec188ae97879451cb4f953ca8b1d84c3957a88f26316f2bd479b793a05571 | MATLAB | 12,713 | 341 | function [stat,p,ci,stats,dist] = permuvartest2(x,y,varargin)
%PERMUVARTEST2 Permutation-based two-sample test of variance and Conover squared ranks test.
% STAT = PERMUVARTEST2(X,Y) performs a two-sample permutation test based
% on the F-statistic of the null hypothesis that the data in X and Y come
% from dist... |
3a97af9def0f12ed989cd888f2990631f365e89c94986d037308a2bf09ae1b67 | MATLAB | 12,715 | 387 | function coactPaper_figureS05()
labelWeight=true;
labelCase=false;
labelSize=9;
letGapX=5;
letGapY=6;
fontsize=6;
%
close all
fh=initFig('width',18.6,'height',5,'font','Arial','fontsize',fontsize);
x=12;y=3;
panel_01(x,y,fontsize)
panelLetter2(x-letGapX-3,y-letGapY+4,alphabet(1,labelCase),'fontSize',labelSize,'isBold... |
dab9ddec4475be7ec97a5f2409dc3f6321e1f8b61eb9f90ea83f498648bb71c1 | MATLAB | 12,716 | 350 | % POP_SAVESET - save one or more EEG dataset structures
%
% Usage:
% >> pop_saveset( EEG ); % use an interactive pop-up window
% >> EEG = pop_saveset( EEG, 'key', 'val', ...); % no pop-up
%
% Inputs:
% EEG - EEG dataset structure. May only contain one dataset.... |
ee0c46cb3530c612411a9b0c5ee54c45dc15d4e147547ad40a7ab6a8176e286b | MATLAB | 12,728 | 349 | function [fh, dataPlot, allColorMaps, allImageRanges, allImageNames] = ...
plot_overlays(this, overlayImages, varargin)
% Plots this image with other images overlayed
%
% Y = MrImage()
% Y.plot_overlays(overlayImages)
%
% This is a method of class MrImage.
%
% IN
% overlayImages MrImage or cell ... |
2721017bbeef14764c246e048a4dca6e2c57729e57c6edfcb39dbe1178d81ac6 | MATLAB | 12,732 | 308 | function op_out = update_fitting(op, fit_res, Params, x, y)
%update_fitting(op, fit_res, Params, x, y)
% Update fitting parameters according to downsampling
%
% op : fitting options
% fit_res : resampled fitting parameters
% Params : Parameter struct
% x,y : current x and y coordinate
op_out = op... |
1ca812de8a2eb61c89904056bb54c7b04342d9381c3813a82210ff8cf6933bf0 | MATLAB | 12,733 | 376 | function [YX,VU]=tensormap(FN,IN,M,idx,MS,Clim1,sc,imfolder,resfolder,alpha,Xs,Ys,rsq_th,scaleC)
%col=[0,0.9,0.3]; %green
%colli=[0.4,1,0.6]; %green
% col=[0,0.4,1]; %blue
% colli=[0.4,0.9,1]; % ligth blue
%colli=[1,0.6,0.8];
alpha=alpha/100;
%Load Image
im = imread(full... |
ef3d19a1c478035f007f63860db96e1ca293f0f8102754be0f370f7e8c55fe19 | MATLAB | 12,735 | 430 | clear all;
close all;
addpath '/Users/X/MATLAB/k-Wave'
device = 'gpuArray-single';
%% Make Simulation Directories
mkdir tusnet_sims
mkdir tusnet_sims/inputs
mkdir tusnet_sims/pressure
mkdir tusnet_sims/mat
%% Plot Dimensions and Resolution
Lx = 6; % Simulation Height [cm]
Ly = 6; ... |
d1a12a96a97f059660a1dbf45d2d4f1927b3a4c900d215a61e8e8da177e7297e | MATLAB | 12,737 | 342 | function sR = melodicicasso(Dim,concatfmri,concatfmrihp,ConcatFolder,tr,nThreads,nICA,bootMode,vis,seedOffset)
% sR = melodicicasso(Dim,concatfmri,concatfmrihp,ConcatFolder,tr,nThreads,nICA,bootMode,vis,seedOffset)
% This function performs runs melodic ICA decomposition (without mixture modeling) many times
% with diff... |
ad2521032cd78603482eb1a31b0f0465b28492ba972c67ee0250d52b28c737ef | MATLAB | 12,745 | 316 | function [X,ndx,dbg] = natsort(X,xpr,varargin) %#ok<*SPERR>
% Natural-order sort of a cell array of strings, with customizable numeric format.
%
% (c) 2015 Stephen Cobeldick
%
% ### Function ###
%
% Sort a cell array of strings by both character order and the values of
% any numeric substrings that occur within... |
f3d4cfdeffc368ecad83142566a622695e68ef21cc2d9c3c50483c40e6875a43 | MATLAB | 12,745 | 379 | function saveFigure(varargin)
%HF_VIEWSAVE Save the current figure to disk and optionally open it in a viewer.
%
% Syntax (name–value options; recommended)
% HF_viewsave('-name','Fig01','-format','pdf','-view',1, ...
% '-path','./result','-res',400, ...
% '-label','Figure 1','-colorspace'... |
13a49ad5178c7fc5067529b772316fc6fbce72c9440ea81ea56a7d4d8da43e43 | MATLAB | 12,751 | 450 | function coactPaper_figureS10()
labelWeight=true;
labelCase=false;
labelSize=9;
letGapX=5;
letGapY=6;
fontsize=6;
close all
fh=initFig('width',2.54*7.3,'height',7.5,'font','Arial','fontsize',fontsize);
x=7;y=5;
panel_01(x,y,fontsize);
panelLetter2(x-letGapX+1,y-letGapY+2,alphabet(1,labelCase),'fontSize',labelSize,'is... |
5275592ccc10440d9b6e569662733b927c175fb5d120331ccc28506b0d09ffe0 | MATLAB | 12,764 | 285 | %% extract the beta parameters from ROIS
% spherical functional roi
% use subkect masks - lS1, lPC, rPC, lMTt, rMTt, lhMT, rhMT
% VISUAL MOTION LOCALIZER
% take the avg of beta values from the roi
% example (1)lPC- motion_beta and (2) rPC -static_beta
% across two runs
%%
% beta from vml in S1 and MTt
%%
clear
roi... |
c0a9ec577d31b9f406eef1deb9fb4780d4686d6d69c15e9b90ae73902dd7291d | MATLAB | 12,768 | 276 | function tapas_rdcm_visualize(output, DCM, options, plot_regions, plot_mode)
% tapas_rdcm_visualize(output, DCM, options, plot_regions, plot_mode)
%
% Generates a simple graphical output of the rDCM results.
%
% Input:
% output - model inversion results
% DCM - model structure
% ... |
b18c2491aef958ade267fb244633e3a2e69d4a3acde15f9884650fcca16720fb | MATLAB | 12,791 | 426 | function noisevar = estimatenoise(X,varargin)
% estimatenoise: additive noise estimation from a time series
% usage: noisevar = estimatenoise(X)
% usage: noisevar = estimatenoise(X,dim)
% usage: noisevar = estimatenoise(X,t)
% usage: noisevar = estimatenoise(X,t,dim)
%
%
% Assume the time series has additive, Gaussian ... |
1900469da0325a439977b5d4d861953c08fe15732218d438b8f255ebb58e6fa8 | MATLAB | 12,807 | 361 | function data=readfile_fe(filename)
%Read a UTF8 or ANSI (US-ASCII) file
%
% Syntax:
% data=readfile(filename)
% filename: char array with either relative or absolute path
% data: n-by-1 cell (1 cell per line in the file, even empty lines)
%
% This function is aimed at providing a reliable method of re... |
c2312c4ad0d42f45a43aac5aa24a1c8a5094c16375d34f181f3b255b370079b6 | MATLAB | 12,811 | 270 | % This function provides a comprehensive example of using the bids_export
% function. Note that eventually, you may simply use bids_export({file1.set file2.set})
% and that all other parameters are highly recommended but optional.
%
% You need the raw data files to run this script
% These can be downloaded from https:... |
0626e2cd96c0c16b1e5fa8b2ee2794e28d9ca951bc8cf1be73a15474e080921f | MATLAB | 12,818 | 306 | % pop_eegfiltnew() - Filter data using Hamming windowed sinc FIR filter
%
% Usage:
% >> [EEG, com, b] = pop_eegfiltnew(EEG); % pop-up window mode
% >> [EEG, com, b] = pop_eegfiltnew(EEG, 'key', val);
% Legacy call:
% >> [EEG, com, b] = pop_eegfiltnew(EEG, locutoff, hicutoff, filtorder,
% ... |
75d9b76bb561ab78931688a4eccd7d3380c6427b4badc0204f870043577bb51a | MATLAB | 12,831 | 398 | % ENVPROJ - plot envelopes of projections of selected ICA component
% projections against envelope of the original data
%
% Usage: >> [envdata] = envproj(data,weights,compnums);
% >> [envdata] = envproj(data,weights,compnums, ...
% title,limits,chanlist,compnam... |
2e825b9c07a11ab0825ba2c510adf33f914cf3a8820a40a1a61396f8706ffec2 | MATLAB | 12,833 | 282 | function R = BF_pdist(dataMatrix,distMetric,toVector,opts,beSilent,minPropGood)
% BF_pdist Pairwise distances between rows of a data matrix.
%
% Same as pdist but then goes through and fills in NaNs with values
% calculated using only the overlapping range of good values between each
% NaN-affected pair. For the corre... |
b750de201bbbde49a4d74152e3f6bceb1820d95af43578249f298a56b5ae626f | MATLAB | 12,852 | 351 | function SuppFigure_SSN(varargin)
%SUPPFIGURE_SSN Generate supplementary figure for Stabilized Supralinear Network analysis
%
% Purpose:
% Creates a figure showing SSN model analysis including normalization index
% distribution, preferred orientation analysis, and correlation matrices
% for both original and tuni... |
45b03caba240d2be4863d9c91a43c52442e1409a3e75cedc74e820a2242f51c2 | MATLAB | 12,855 | 206 | global sbconfig;
% User dependent settings
sbconfig.objective_type=1; % BV: 0=calibrate new, 1=16x, 2=20x; 3=25x
sbconfig.camerapath_enable=true;
sbconfig.scanbox_com = 'COM5'; % scanbox serial communication port
sbconfig.laser_com = ''; % laser serial communication port
sbconfig.laser_typ... |
6708eec61767537af4747216764f58a968b6cfe45b32efa053e5b2a1d23283d8 | MATLAB | 12,859 | 382 | function [n_signif,index_signif] = fdr(pvals,qlevel,method,adjustment_method,adjustment_args)
% usage (example): qlevel = 0.05, method = general
% Attribution:
%
% Version 0.1.3; May 10, 2004
%
% License: GPL version 2 or later
%
% This program is free software; you can redistribute it and/or
% modify it under t... |
3ff498301e1f6c7f1550f7cf06808e8e28aa208ddda8a82ad7f02a7288f6f709 | MATLAB | 12,881 | 312 | function result = hlp_config(configname, operation, varargin)
% helper function to process human-readable config scripts.
% Result = hlp_config(FileName,Operation,VariableName,Value,NVPs...)
%
% Config scripts consist of assignments of the form name = value; to set configuration options. In
% addition, there may be any... |
268e32fea4360a023e71983a6dad29a70c9ef5152b1ad026e0773af1750af21b | MATLAB | 12,893 | 289 | function [biasFieldCorrected, varargout] = segment(this, varargin)
% Segments brain images using SPM's unified segmentation approach.
% This warps the brain into a standard space and segment it there using tissue
% probability maps in this standard space.
%
% Since good warping and good segmentation are interdependent,... |
906fa525b56d69e1a16c2cdceed6362715aab61e25cda51998e483df85fb590b | MATLAB | 12,900 | 317 | function [summary]=genMFile(filename,varargin)
% genMFile(filename)
% genMFile(filename)
% genMFile(filename,'optionsName',optionsValue,...) - check out below
% OPTIONS section in the main function body to review witch options are
% available to reconfigure this function.
% dialog to create filepaths
% function used to... |
2724a4763dd324e4429d2b4e65a7829d0a076188ccc6962c673ed702c6f16677 | MATLAB | 12,902 | 287 | function GenDilutionPrep
global XdoseRangeR UdoseRangeR
global filename sheetname numFact numComb numDose numChannel wellcodeS
global volDWPtoFP fHeader makeDWP factorNameList wellTotVol run numSetsCP
global CombList Key Stock DilutionPrep
F1000_cutoffvol = 970; F300_cutoffvol = 270; F50_cutoffvol = 40;
volFP... |
b7557e97d89d9db5b154ec5899c8f123c85e6e2bb88a7ad4783b42f4139fe7fe | MATLAB | 12,914 | 348 | function [dprime, sig,goods,dvar,dprime_sig_cells] = vol_dprime(trials,goods,all_S,all_SU,all_index,event,win,varargin)
% compares the d'prime for individual cells, and mean, compares the
% mean to the shuffle data,and shows the mean dprime with the shuffle
% subtracted
%inputs:
% trials - cells x 2 for each cond... |
99e881459e437eb48fcd77c49111493c0e60de9a8f88b50d5b0d42ba9a087b8d | MATLAB | 12,919 | 278 | %% Advanced settings for MEA-NAP (only modify if you know what you are doing)
%% Output folder settings
if any(isnan(Params.outputDataFolder)) || isempty(Params.outputDataFolder)
Params.outputDataFolder = HomeDir;
end
%% Spike detection settings
Params.threshold_calculation_window = [0, 1.0]; % which part of th... |
d5b155f9b176a42a86d63eaa9ebe4b122b36dfac2d953c7fbcb7517259228a15 | MATLAB | 12,921 | 282 | % Angle correction, fixing the tail/head to the origin.
% This code has to be run
% Code written by Sharadhi Nagaraja 18.8.2024
clc
clear
close all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INPUT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
folder = 'Y:\livingmatter\labdata\Sharadhi\3-Symmetry breaking\Ensio\20241218_2\';... |
d5c850415c4ec9fd013287d6e92b700d2851ac1597ed1eb5573c1f9efafa8195 | MATLAB | 12,934 | 333 | function osp_WindowKeyDown(~,EventData,gui)
%% osp_WindowKeyDown
% This function is triggered when key up and down is pressed. It refreshes
% the listbox.
%
%
% USAGE:
% osp_WindowKeyDown(,EventData,gui);
%
% INPUT: EventData = Key press event
% gui = gui class containing all h... |
ccddb3a279849d3ba0a6fab26cb28ffa44801f64adb637db36508b3696840228 | MATLAB | 12,942 | 331 | clear all
close all
clc
% Calculates subspace generalization between simulated voxels.
% Each voxel is an average over simulated grid cells. Fraction of cells are selected
% according to their phase such that grid cells with closer phases are averaged within the same voxels
% and fraction that is selected randomly.
% ... |
b1f82fca031013868250ffc41ee54664a44a11d1a471a89e1fdd09accb82fd6c | MATLAB | 12,949 | 264 | function TOL_fig_gentry1947(config,params,dat)
% TOL_fig_gentry1947, figure of Gentry et al. (1947), Birch and Korn (1958)
% Figure S2 for: Duvelle and Grieves (2026) Tolman's Sunburst Maze 80
% years on: A meta-analysis reveals poor replicability and little evidence for
% shortcutting. European Journal of Neuroscien... |
9aedac30a6d0253fc730ff6c18c190cfad3ab7a8ce7fb2cdfb07aed199343d81 | MATLAB | 12,962 | 425 | function [handles, wh_slice, my_z] = plot_points_on_slice(xyz, varargin)
% [handles, wh_slice, my_coords, texthandles] = plot_points_on_slice(xyz, varargin)
%
% Usage:
% handles = plot_points_on_slice(xyz, 'nodraw', 'color', [0 0 1], 'marker', 'o','close_enough',8);
%
% Optional inputs:
% {'noslice', 'nodraw'},... |
36a9234a238a0724b3814d5b586c65793db9b136a7d3b0968accf691abe6990d | MATLAB | 12,975 | 292 | function [result1,result2,to] = plotsigbrackets(ds,gs,varargin)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ################################################################# %% DESCRIPTION
%FUNCTION short desc.
%
% USAGE:
% out = template(in) process with default settings
%
% ou... |
ef878c12213e91fd3df61096e2ada09b95b544813e209abe77186decc812527f | MATLAB | 12,980 | 419 | %% Figure 4: OFC→CPi encoding heterogeneity supports categorical encoding of blocks from rewards
%load data
datpath = 'C:\Users\mld9131\Documents\GitHub\Papers\MLD\Figure2\Data';
load(fullfile(datpath,'OFC-CPi_projection_neurons_non-Stimulated.mat'));
CPi = 1:length(all_SU_DS);
% initialize
xvec_200 = -4:0.2:8;
xvec... |
9b9c5810511c189e8d3a7e64c05c7ed1ded7e70827752d1769660a0043a60e45 | MATLAB | 12,982 | 372 | function [data] = ft_datatype_raw(data, varargin)
% FT_DATATYPE_RAW describes the FieldTrip MATLAB structure for raw data
%
% The raw datatype represents sensor-level time-domain data typically
% obtained after calling FT_DEFINETRIAL and FT_PREPROCESSING. It contains
% one or multiple segments of data, each represente... |
99a6b5a2f4b79fb4129b8bc04f8169fed97ee3025c2d6cf8da49db21b0fb5d82 | MATLAB | 13,001 | 338 | function create_surface_meshes_cedalion(input_img, numvertices, input_coordsys, ...
output_coordsys)
%
% Input: input_img <string> fullpath to folder, where the results of
% mysegment.m are stored
% numvertices <integer> numbe... |
0ede09c3d4407f2663ead8471ffd2a3f235cb250b3375848b27fb0568256c0cc | MATLAB | 13,010 | 295 | function [acq_codes, verbose] = ...
tapas_physio_create_acq_codes_from_trigger_trace(t, trigger_trace, verbose, ...
thresholdTrigger, triggerEdge, detectionMethod)
% Creates integer acquisition codes (on/off volume/slice start/end events)
% from continuous trigger trace (e.g., TTL trigger spiking from 0 to 5V,
... |
b14a7008139b195541ef52e8ef2f6ad60e2a9bccd3acdbe665065abf47fa9c80 | MATLAB | 13,020 | 262 | function out = SP_Cepstrum(y, maxPeriod, minPeriod)
% SP_Cepstrum Cepstral statistics: harmonic (comb) structure of the power spectrum
%
% Computes the real cepstrum, the inverse Fourier transform of the log
% magnitude spectrum, and summarizes the structure of its dominant peak.
%
% The cepstrum answers a question n... |
0be493e3cc6f127634876f3fa4ee40f85acf4e063bd403a33563702ec3a37690 | MATLAB | 13,056 | 415 | %%
clear;
working_dir = 'G:\CEST-fMRI'; % the actual directory to put the codes
SPM_modified_path = [working_dir,'\scripts\SPM_modified'];
addpath(SPM_modified_path);
ds_dir = [working_dir,'\datasets\exp1']; % directory of datasets
load_dir = [working_dir,'\scripts\loading']; % directory of loading (hrf)
savin... |
0cfc270d510122f5fcc3edbe38b573121a2cf30785351d84073009a9edb175f5 | MATLAB | 13,060 | 408 | function [ subject ] = nmri_processing_sensor(subject, data, params)
%[ subject ] = nmri_processing_sensor(subject, data, params)
%
% This function will do the processing @ sensor level only
% power @sensor level
% connectivity @sensor level
%
% subject = subject structure, see nmri_read_subject
% ... |
fa36290e9d206ab9da4bcbee03fcfc23afdabbae2a324e09552e6d3ff26a691f | MATLAB | 13,066 | 315 | % STD_CHANTOPO - plot ERP/spectral/ERSP topoplot at a specific
% latency/frequency.
% Usage:
% >> std_chantopo( data, 'key', 'val', ...)
% Inputs:
% data - [cell array] mean data for each subject group and/or data
% condition. These arrays are usually returned by function
% ... |
724b343ac2ad6c682c6131ce797c55c90f2407d21ed3d7b759bcd449c94d09a2 | MATLAB | 13,090 | 433 | function [R, e] = PeakFinder(vvec, Opt)
%Example: PeakFinder('Resp*.1D');
% or PeakFinder(v) where v is a column vector
% if v is a matrix, each column is processed separately.
%
%clear all but vvec (useful if I run this function as as script)
keep('vvec', 'Opt');
e = 0;
R = struct([]);
if (nargin < 2) Opt = struct();... |
978f409a35539d4724f7399b143c9b226458f18118a34c01e02e324e9fc1e9c5 | MATLAB | 13,093 | 275 | function out = osp_plotProcessMRSI(MRSCont, kk, which_spec,which_slice, ppmmin, ppmmax,mask, lb,shift_factor,add_text,add_No_MoCo)
%% out = osp_plotProcessMRSI(MRSCont, kk, which, ppmmin, ppmmax)
% Creates a figure showing processed data stored in an Osprey data container,
% ie in the raw fields. This function will... |
fea47c5056def45f0a50fae4249dc652c88da18ce466eb0ac88a928ffbec0309 | MATLAB | 13,100 | 326 | function eeg_diagnostics(EEG,batch_config)
% diagnostics(ALLEEG,type) - Creates figures to aid user in understanding
% the generated marks, and the overal quality of the data.
%
%Copyright (C) 2017 BUCANL
%
%Code originally written by James A. Desjardins with contributions from
%Allan Campopiano and Andrew Lofts, supp... |
3e3817fdf91b058f9f87a4557a94c8ecfc1996c4dcef89038be196b90e7056ea | MATLAB | 13,120 | 351 | function [fixedV,registeredV,summaryRegistration] = registration(fixed, moving,allPaths,varargin)
%% REGMOVIES: Video registration
% [fixedV,registeredV,summary] = regMovies(fixed, moving)
% [fixedV,registeredV,summary] = regMovies(fixed, moving,Parameter,Value,...)
%
% INPUT:
% fixed = The fixed video as a ref... |
11c05b76de3285254d7c4ef4da1b00842f4fd17a891a01dda6caa2b6b14d51c9 | MATLAB | 13,139 | 110 | %Miscellaneous functions not used by EEGLAB graphic interface (miscfunc folder):
% <a href="matlab:helpwin abspeak">abspeak</a> - Find peak amps/latencies in each row of a single-epoch data matrix...
% <a href="matlab:helpwin arrow">arrow</a> - Draw a line with an arrowhead.
% <a href="ma... |
cef0c790800f32b54f6d3fb3b02cb88cea5f2f9e5eb4e372070afb54a00e1371 | MATLAB | 13,147 | 245 | function plot_activity_level
close all
clear all
clc
% Analyze activity levels of individual neurons.
% Select a folder containing data.
folder_name = uigetdir;
cd(folder_name)
low_thresh = 0.024;
% Control.
load('behavior_control.mat')
load('activity_control.mat')
behavior = behavior_control;
activity = activity_c... |
e664a9cc567d7c7681dfb0700d7744fd6044a5ae2e05731f988425717ccfb544 | MATLAB | 13,167 | 423 | function [WT, Lat] = Figure2(datadir, codedir)
%Figure2 - Wait and trial initiation times use distinct estimates of the
% value of the environment.
% datadir = directory of dataset
% codedir = director of code
%% Set up paths
s = pathsep;
pathStr = [s, path, s];
onPath = contains(pathStr,...
codedir, 'Ignor... |
cf0e3c03d9f3137ceafecc652a9e03141ff93ca6099ce43a10cbda32cf0e0507 | MATLAB | 13,174 | 244 | % POP_IMPORTEVENT - Import events into an EEG dataset. If the EEG dataset
% is the only input, a window pops up to ask for the relevant
% parameter values.
%
% Usage: >> EEG = pop_importevent( EEG ); % pop-up window mode
% >> EEG = pop_importevent( EEG, 'key1', 'value1', ...);
%
% Grap... |
0e6e7e9207326ab9c22a285738aeec29f2b4e2ecf43e2faffb0943e64618afc0 | MATLAB | 13,175 | 327 | function [C2,cfg] = mahal_iem_trialwise_xgen(dat,theta,task,cfg)
% [distmat,cfg] = mahal_iem_trialwise_xgen(dat,theta,task,cfg)
if nargin < 3
help mahal_iem_trialwise_xgen
error('missing input arguments!')
end
%set options
if (nargin < 3) || (isempty(cfg))
cfg = struct;
end
ntrl = ... |
5506d650a6f236863ecbc096ec973701da10d5d30f63e221aa6b76512e7f1784 | MATLAB | 13,182 | 330 | function [mante_proj,variance_proj,cfg] = mante_proj_xgen(dat,theta,task,cfg)
% [mante_proj,variance_proj,cfg] = mante_proj_xgen(dat,theta,task,cfg)
if nargin < 3
help mante_proj_xgen
error('missing input arguments!')
end
ntrl = size(dat,1); % number of timepoints
nsens = size(dat,2); % ... |
2face3479a97cbee58d1411a096676b5d25bc5c72978273a0803f4c33f6a69b1 | MATLAB | 13,184 | 300 | % STD_STAT - compute statistics for ERP/spectral traces or ERSP/ITC images
% of a component or channel cluster in a STUDY.
% Usage:
% >> [pcond, pgroup, pinter, statscond, statsgroup, statsinter] = std_stat( data, 'key', 'val', ...)
% Inputs:
% data - [cell array] mean data for each subject gro... |
7d53bef81b6833cdf0fc574ba4c22744334bc6063c1e26c541a1000dd724840b | MATLAB | 13,190 | 283 | % ----------------------------------------------------------------------- %
% Aggregate and group-level analyses of the NSD eye-tracking data.
% M.N. July, 2021
% ----------------------------------------------------------------------- %
% settings
clearvars;
paths2ET = '/System/Volumes/Data/misc/data61/naum2... |
1b870754f1c7a67146d207d2fca678cea90dce16ba3c8532c78e7fed3f5f4700 | MATLAB | 13,198 | 339 | function plot3A()
% PLOT3A Generate Figure 3A: Population SVM-decoding accuracies of context
%
% This function creates boxplots showing context decoding accuracies during
% picture presentations, comparing different contextual questions using
% all neurons versus only context neurons.
%
%
% Required data file: fig3Adat... |
31e9dafd9025dbceaf6c3f90dfd2f38902d0887c80f99b818d06ad932a697229 | MATLAB | 13,198 | 213 | %% Batch script to preprocess fMRI data using SPM12
% Does DICOM conversion, realignment and unwarping (no fieldmap use
% though), normalisation, smoothing, of the specified runs and T1 image
% folders, in all participant folders found in the studyPath data folder.
% Paths
spm( 'defaults', 'fmri' );
spm_jobman( 'init... |
8ea381cdc6fbac41b88f155baa40cc5da0d8c3ff1bf7a677e26fec4fd76187af | MATLAB | 13,198 | 338 | %% ms SEI: DTF fig - connectivity between 2 selected AAs
% (c) Jiri, Oct23
%% settings: v1 - relaxed conditions (p-level, length of significance, ...)
FC_outputFiles = 'DTF_v2_outputFiles';
% FC_outputFiles = 'DTF_outputFiles';
% FC_outputFiles = 'DTF_vRJ_outputFiles';
t_sel = [-1.0, 2.0]; % the true sel time will... |
2dd93311170db62ea96e9811f6cc54334bc6276b98cefbf5e7a89606ae8c44eb | MATLAB | 13,204 | 231 | function analyze_communication_subspace_subspace_similarity_epoch(group, epoch)
close all
clearvars -except group epoch
clc
% Analyze communication subspace similarity in each epoch.
% Select a folder containing data.
folder_name = uigetdir;
cd(folder_name)
switch group
case 'control'
load('behavior_cont... |
b584bddd1cfc580582f658b83b8b288fb5621802320e0a5f51ecb7b82db40b35 | MATLAB | 13,208 | 243 | function [outMRSCont] = osp_processMultiVoxel(MRSCont)
fileID = fopen(fullfile(MRSCont.outputFolder, 'LogFile.txt'),'a+');
outMRSCont= MRSCont;
procMRSCont = MRSCont;
if ~strcmp(MRSCont.opts.MoCo, 'none')
procMRSCont_no_MoCo =MRSCont;
end
%% Get infos to set up a loop to process all voxels
time = tic;
if MRSCon... |
9fee589986e65750227f73975a23245fad7dcf644aa3b2c88a70f30102b37f1f | MATLAB | 13,221 | 262 | % POP_AUTOREJ - perform automatic artifact epoch detection and rejection
%
% Usage:
% >> [EEG, rmepochs] = pop_autorej( EEG, 'key', 'val');
%
% Inputs:
% EEG - input EEG structure where epochs have been extracted.
%
% Optional inputs:
% 'threshold' - [float] Threshold limit for detection of extremely larg... |
42ce8800ee92a881380022b7b723919525ab15c3aea05f64259ff0421c967114 | MATLAB | 13,222 | 326 | clear all
close all
clc
% Calculates subspace generalization between simulated voxels.
% Each voxel is an average over simulated grid cells. Fraction of cells are selected
% according to their phase such that grid cells with closer phases are averaged within the same voxels
% and fraction that is selected randomly.
% ... |
abcfafbc24f85ae2698e07f339a17ea4f27994c96c52e3e2c6454e5ba070add1 | MATLAB | 13,232 | 278 | %% extract the beta parameters from ROIS
% spherical functional roi
% use subkect masks - lS1, lPC, rPC, lMTt, rMTt, lhMT, rhMT
% VISUAL MOTION LOCALIZER
% take the avg of beta values from the roi
% example (1)lPC- motion_beta and (2) rPC -static_beta
% across two runs
clear
roiType = 'subjectSphere';
radiusNb='8'... |
437e1ad7518c1a6fc338ec100d594ddcea25af8575c53a8d711c36e569989169 | MATLAB | 13,235 | 293 | %This script quantifies the extent of light leakage through the white
%cement and black cement on topf of a mouse head. Measured with a power meter for red, orange and
%blue lasers. An optical fiber is implanted in the brain.
%SW0924
clear all;clc
%% LOAD DATA saved in CSV files CHANGE Folder destination ACCORDINGLY!!... |
6b1ae4cc0cedc3254cff82b01b32c48725beb3ab91f1d9972ed585e5d7fde5c4 | MATLAB | 13,243 | 132 | function osp_updateProWindow(gui)
%% osp_updateProWindow
% This function updates the process tab.
%
%
% USAGE:
% osp_updateProWindow(gui);
%
% INPUT:
% gui = gui class containing all handles and the MRSCont
%
%
% AUTHORS:
% Dr. Helge Zoellner (Johns Hopkins University, ... |
44728b0b64746221eaaeab849e67310d5834a52be1d5516f66144fcf80a19962 | MATLAB | 13,250 | 304 | function metrics = SENSAI_visualization(EEGavRef, EEGclean, EEGartifacts, ref_cov, epoch_duration_sec, signal_type, SSI_top_PCs, artifact_threshold_type, smoothing_window_seconds, SENSAI_score)
% SENSAI_VISUALIZATION 2D SENSAI scatter: subspace similarity vs epoch power
%
% Inputs:
% EEGavRef - Original EE... |
1161028d2c45289b707783fa1596c0c3ba6199da008838e0763d85dcc19f09a5 | MATLAB | 13,259 | 304 | function PlotFigure6(datadir, codedir)
%PlotFigure6 - Plots Figure 6.
% INPUTS:
% datadir - Local directory where ProcessData_Figure6.mat was saved after running ProcessData_Figure6
% codedir - Local directory where code (e.g., published/EstrousRPE/) was saved
%% Set up paths
s = pathsep;
pathStr = [s, path, s];
... |
354df1ceb25e0989ca180dbdfc5a4ce51642f09f4f9d22e23d0975e8e31d5751 | MATLAB | 13,260 | 307 | function [indmin mdall notenough]=multimodelnlm_global_novalid(Age_gender,Brainsz,data_r,ylabelname,Plotornot,betarealinitial)
notenough=[];
Age=Age_gender(:,1)./30./12;
Gender=Age_gender(:,2);
BrainSize=Brainsz./1000;
Age2=Age.*Age;
%fitting data using linear model to obtain the initial beta
if(size(Age_gender,... |
b3ea80f147002b5a3d9ebb2d4100125ad53982665502c4bc022372d4e1ae0b4f | MATLAB | 13,273 | 261 | %% extract the beta parameters in each clusters.
% use each mask - mt, mst, hMT on tactile motion Localizer
% take the avg of beta values from the roi
% (1)lmst- motion_beta and (2) lmst -static_beta
% across two runs
clear
subjectList={'sub-001','sub-002','sub-003','sub-004','sub-005','sub-007','sub-008'...
's... |
e73cdad483ca0dcd6a3b570d88d2850be4535acc9b9b5396598d505b9fe38926 | MATLAB | 13,273 | 312 | % inherit from "05d flatgrids.m"
% Note: we assume we already ran "05d flatgrids fsaverage only.m"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This document has steps that have to be routinely performed when doing
% anatomical pre-processing.
%%%%% For each subject, construct patches (based on the fsaverage-defined ROIs)
%%%%% ... |
aa4df928679a15a09f68d4b0dd480fba3fc5d7fd9e941d1ab41e97dea040fe85 | MATLAB | 13,290 | 112 | %EEGLAB signal processing functions (sigprocfunc folder):
% <a href="matlab:helpwin acsobiro">acsobiro</a> - A. Chickocki's robust Second-Order Blind Identification (SOBI)...
% <a href="matlab:helpwin axcopy">axcopy</a> - Copy a Matlab figure axis and its graphic objects to a new pop-up wind... |
9b469535a176bae6d8c05d834ca7ac7ac9a35168fa52a8482343a71e2250fed7 | MATLAB | 13,292 | 398 | %% Script for calibrating multiple cameras in Matlab
% Jesse Marshall 2019
%acquire calibration info
imaqreset
numcams = 3;
vid = cell(1,numcams);
logfile = cell(1,numcams);
%% ENTER PARENT PATH HERE
parentpath = 'C:\RatControl\Matlab_camera_calibrate';
hires =1;
numframes_aq = 100;
logfile_tag = 'videofiles_run1'... |
ab385c3e35adca9529c7b828db82ce9c02d67a167c6ca9a6cf316cebb6fc6d84 | MATLAB | 13,294 | 276 | function lzlab_DAfear(eventFileName, cellFileNames, cscFileNames, analysisOptions)
% Read events
[eventTimestampArray, eventLabelArray] = xlsread(eventFileName, 'eventTimes');
eventTimestampArray = eventTimestampArray'/100;
eventLabelArray = eventLabelArray(:,2)';
nEventTypes = size(analysisOptions.histogramev... |
fe3033bf1756c400a7be2397fd42e1c232ef8ab28d82090fadb245adef8fdfc1 | MATLAB | 13,295 | 379 | function simplenn_caffe_deploy(net, caffeModelBaseName, varargin)
% SIMPLENN_CAFFE_DEPLOY export a simplenn network to Caffe model
% SIMPLENN_CAFFE_DEPLOY(NET, CAFFE_BASE_MODELNAME)
% Export a simplenn network NET to a Caffe model.
% The caffe model is stored in the following files:
%
% [CAFFE_BASE_MODELNAME ... |
ddb5dc6246d40faa2d5242766ca7792a3d56907bfbfb16b8ff2c6969740996e3 | MATLAB | 13,296 | 300 | function fMRIStats(MeanCIFTI, CleanedCIFTITCS, CIFTIOutputName, sICATCS, Signal, varargin)
% fMRIStats(MeanCIFTI, CleanedCIFTITCS, CIFTIOutputName, sICATCS, Signal, varargin)
%
% This function computes several fMRI quality metrics including:
% - Modified TSNR (mTSNR): Mean / UnstructuredNoiseSTD
% - Functional CNR ... |
0fac139765cdd97c2d6979454395168474bef1707c6c6709fde6f257e85b0946 | MATLAB | 13,301 | 284 | classdef McsH5Helper
% A selection of useful helper methods for dealing with HDF5 files
%
% (c) 2017 by Multi Channel Systems MCS GmbH
methods (Static)
function equal = AttributeNameEquals(attribute, str, mode)
% Checks if the name of an attributes equals a given string
%
% f... |
6fe73ca38a21e8011df9eb66916e618921a00a06393160cff9eac312a417e956 | MATLAB | 13,309 | 399 | function [Dat,stim] = loadGlmDat_ofc(ops,datname)
%parses ofc data into Dat structure for glm optimization
%
%for ns trials and nt data points in trial-based, or ns*nt data samples
%with ncov covariates, Dat has required fields:
%
%Dat.y: (1,ns*nt) or (nt,ns) matrix of spike counts
%Dat.trial_idx: (1,ns) set of trial n... |
b1c5432895851b31141eb22eeff5d8b3cab9b01220e07ce53d22b82d4a7edc99 | MATLAB | 13,310 | 426 | function [err,Info, BRIKinfo] = BrikInfo (BrickName)
%
% [err,Info] = BrikInfo (BrickName)
%
%Purpose:
%
% returns some field values in the .HEAD files
%
%Input Parameters:
% Brick filename
% (also works for 1D files but Info has very limited info.
% You should really avoid using BrikInfo on 1D file
% becaus... |
0328ad0fcdbedf1e80292835fc839f2f236492befba9e06d8655b0e93d58d53e | MATLAB | 13,324 | 255 | function ok = compile_tisean()
% compile_tisean Compiles and installs the TISEAN nonlinear time-series toolkit.
%
% This script must be run in the Toolboxes directory (same requirement as
% compile_mex.m, which calls this as part of its own build sequence).
%
% Split out from compile_mex.m into its own function so th... |
325cd4789c3d36003f1df9fa14b7c069fbf7fe17791c3ee91b02bd1f9ddf16eb | MATLAB | 13,326 | 323 | function [jointAngles, posXYZn, n_PIPs] = inverseKinematics_PD_vAF(posXYZ)
% posXYZ input is a single trial of pose data for a set of markers from DLC
% posXYZ shape is Timepoints x XYZ x Markers
% Links, as pairs of markers
phal_dist = [[1, 5]; [2, 6]; [3, 7]; [4, 8]]; % distal phalanges
phal_prox = [[5, 9]; [6, 10];... |
d8e9551e7a0f3623a82a5058d47d1e7e1e351d93b66745e9ce2b7ec2c29bbf17 | MATLAB | 13,333 | 326 | function out = NW_VisibilityGraph(y, meth, maxL)
% NW_VisibilityGraph Visibility graph analysis of a time series.
%
% Constructs a visibility graph of the time series and returns various
% statistics on the properties of the resulting network.
%
% cf.: "From time series to complex networks: The visibility graph"
% L... |
cbdbc8bd0c60d0ac4e6c6448a950da085b2e9931bc44a1ba8c39087354ad00d0 | MATLAB | 13,352 | 457 | function data = loadubjson(fname,varargin)
%
% data=loadubjson(fname,opt)
% or
% data=loadubjson(fname,'param1',value1,'param2',value2,...)
%
% parse a JSON (JavaScript Object Notation) file or string
%
% author: Qianqian Fang, <q.fang at neu.edu>
% created on 2013/08/01
%
% $Id: loadubjson.m 487 2015-05-06 18:19:07... |
d9480eeb51780a07dd5851192a0ba1cc11b51eaad3e2e87aab0457bac6b57d7b | MATLAB | 13,369 | 303 | function out = NL_LyapSpec(y, tauMethod, m, kNN, maxN, theilerWin)
% NL_LyapSpec Spectrum of Lyapunov exponents of a time series.
%
% Estimates the full spectrum of m Lyapunov exponents (not just the
% largest -- cf. NL_LargestLyap, which wraps TISEAN's 'lyap_r', a
% single-nearest-neighbor-tracking method that only ... |
94ee30ec811d9420ab8bfaed08c8a272f04878f749a8328eee36a19d2194dede | MATLAB | 13,378 | 334 | % STD_PAC - Compute or read PAC data (Phase Amplitude Coupling).
%
% Usage:
% >> [X times logfreqs ] = std_pac(EEG, 'key', 'val', ...);
% Inputs:
% EEG - an EEG dataset structure.
%
% Optional inputs:
% 'components1'- [numeric vector] components in the EEG structure used
% for spectr... |
390c0b5eda7a884249dc3971dbf19cd5a82ccf83e7dd8339dfaada3cec2986ea | MATLAB | 13,383 | 274 | % =============== parameters section ===============
% optional arguments
if ~exist('zmat_name', 'var'), zmat_name = ''; end; % re-use univariate GWAS results from previous MOSTest analysis
if ~exist('chunk', 'var'), chunk = 10000; end; % chunk size (ho... |
3d2fb96dd6ecdca0204b02ae624751c2ab64c61c819dc71d59957fcba6f3a5fe | MATLAB | 13,387 | 334 | function update_background_parallel(obj, use_parallel)
%% update the background related variables in CNMF framework
% input:
% use_parallel: boolean, do initialization in patch mode or not.
% default(true); we recommend you to set it false only when you want to debug the code.
%% Author: Pengcheng Zhou, Columb... |
aa020c5bc29fd70c8ebe3a17aaa28d66fb7e5da6ced1966c6d8b00568d6f3c9b | MATLAB | 13,412 | 308 | function M_final = apply_shifts_normcorre(Y,shifts,options,td1,td2,td3,col_shift)
% debugged normcorre file for batch processing on h5 files % - 2020-06-30 11:25:59 - RC
% apply shifts using fft/cubic or linear interpolation
% INPUTS
% Y: Input data, can be already loaded in memory as a 3D
% ... |
29934feddd0ad79f4f9688f0421862a3f96ad30e1c064bdc9dd6ea454d7990fd | MATLAB | 13,440 | 377 | function SuppFigure_FFmodel(varargin)
%SUPPFIGURE_FFMODEL Generate supplementary figure for feedforward model analysis
%
% Purpose:
% Creates a comprehensive figure showing feedforward model analysis including
% firing rate vs total current relationships, normalization index patterns,
% and theoretical prediction... |
406fe2e67161ad4a4e2c1ae603a32695abad3b310e6699d08ebf19526d077d72 | MATLAB | 13,464 | 396 | function [] = plot_plotData(varargin)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% plot_plotData plot simulation results. It requires plotData .mat files
% generated using prep_plotData function.
%
% Argumentss:
% Simulation results generated by sim_testNBSPredict function.
% ... |
a56f3321d414210e93022c503948f6ad93f85f23e0cf98f3d4d20f1155a6db18 | MATLAB | 13,491 | 380 | function [spike] = ft_read_spike(filename, varargin)
% FT_READ_SPIKE reads spike timestamps and waveforms from various data formats.
%
% Use as
% [spike] = ft_read_spike(filename, ...)
%
% Additional options should be specified in key-value pairs and can be
% 'spikeformat' = string, described the fileformat (defaul... |
ea58427f57dd4809671626205739179e7d1d3d4c1988bd599ed4722653f96dad | MATLAB | 13,500 | 340 | %% Get 100s ephys raw signal examples for the six mice
% Before running this, previously precalculate RMS envelopes and spectra's
% with the script "calculate_RMS_spectra_for_Fig_3CD_and_4AB.m".
reorder = reshape((1:32:128)' + (0:31), 1, []);
'Processing iv13wt1'
data_path = 'Y:\Alice\0012_NeuroGI\NeuroGI_ep... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.