sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
04dac53cf96e2481eff18e51342efc03a36962e169fc71e2ed84d1291c8bccd9 | MATLAB | 5,287 | 120 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This script corrects the obtained results for multiple comparisons using%
% the Benjamin and Hochberg approach %
% %
% Author: ana.tr... |
59d34aa03bf66492e7df1314247a3abe08d8864383fda40429728fca083c0aba | MATLAB | 5,287 | 151 | % First-kind integral equation on the unit cube, Laplace single-layer.
%
% This is basically the 3D analogue of IE_SQUARE1.
%
% Inputs (defaults are used if not provided or set empty):
%
% - N: number of discretization points in each dimension (default: N = 32)
% - OCC: tree occupancy parameter (default: OCC = 512)... |
6641c964d137a3597ec2af057e8d4822656908b7e59cad54cb2d0052f0270181 | MATLAB | 5,288 | 153 | % Matlab script for running SPM 1st-level FIR models on CamCAN Phase II
% Sensorimotor task (SMT) fMRI data
%
% Download/clone to "bas_dir" below:
%
% 1. "AgeingHRF" from https://github.com/RikHenson/AgeingHRF/
%
% 2. Request preprocessed data from this website:
% https://camcan-archive.mrc-... |
7c20fd082c3302a24dedbea3ea34b76baad6a4bb38885b2e4ab254b726a70842 | MATLAB | 5,290 | 153 | function CBIG_MFMem_rfMRI_DrawBarchart_I_Desikan68_into_Yeo7_fsaverage5()
%--------------------------------------------------------------------------
% CBIG_MFMem_rfMRI_DrawBarchart_I_Desikan68_into_Yeo7_fsaverage5
%
% show mean value of I in Yeo's 7-network
% what to do?
% 1) give the value of I to each voxel, accord... |
83dc6d83745b4e3b31559dc28ad0865aad481a98cc92cf0b4c1d4c583060893e | MATLAB | 5,291 | 126 | % ========================================================================
% Ruslan Masharipov, June, 2024
% email: ruslan.s.masharipov@gmail.com
% ========================================================================
%
% The impact of amplitude differences on regression coefficients asymmetry.
% EXAMPLE #2: Adding ... |
6f04cdfc30d35c532aff57dd57a5e2ecc3b1b8d656f66eabe01bc8e682e7f8db | MATLAB | 5,292 | 170 | % MF2 Multifrontal factorization for nearest-neighbor interactions on a
% regular mesh in 2D.
%
% This is an optimization of MFX for the special case of nearest-neighbor
% interactions on a regular mesh in 2D. A given mesh node is allowed to
% interact only with itself and its eight immediate neighbors, ... |
966728410f9149f13e400f4e483ac282e18d1e4a8c09c5a891099db8845eb0ee | MATLAB | 5,292 | 131 | function varargout = w_AddSphere_gui(varargin)
% W_ADDSPHERE_GUI MATLAB code for w_AddSphere_gui.fig
% W_ADDSPHERE_GUI, by itself, creates a new W_ADDSPHERE_GUI or raises the existing
% singleton*.
%
% H = W_ADDSPHERE_GUI returns the handle to a new W_ADDSPHERE_GUI or the handle to
% the existing si... |
a6059c87c0157a8727b5fd0fee5a270087bf517c9ee75375fc81d14c4be53510 | MATLAB | 5,295 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = EnsembleBaggedTrees(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. ... |
d0c579a4fc0bf5e7f9c08f286432866031c6aec75580f14f0ebc2deb57f908e7 | MATLAB | 5,295 | 106 | function dataout = ft_examplefunction(cfg, datain)
% FT_EXAMPLEFUNCTION demonstrates to new developers how a FieldTrip function should look like
%
% Use as
% outdata = ft_examplefunction(cfg, indata)
% where indata is <<describe the type of data or where it comes from>>
% and cfg is a configuration structure that sh... |
45eafa7a6930dd4887dd03ed21f8ed9852133306f8b4674c3b1413de6d34a904 | MATLAB | 5,296 | 191 | function [hF,hB,fig] = imoverlay(B,F,climF,climB,cmap,alpha,haxes,nslices,range,title)
% IMOVERLAY(B,F) displays the image F transparently over the image B.
% If the image sizes are unequal, image F will be scaled to the aspect
% ratio of B.
%
% [hF,hB] = imoverlay(B,F,[low,high]) limits the displayed range o... |
dbdff1462bcad32a8a4f90a8b1e1961f7ab83b0f46b439aea42944b8421684f8 | MATLAB | 5,296 | 211 | SkSp = skewness(Fil1d');
SkT = skewness(TrIC');
%% Select GCamp traces
disp('Select traces')
SkSpMin = 2; % 1 for RACE or GCAMP6; 5 for place cells
CompOKtmp = find(abs(SkSp)>SkSpMin & SkT>1);
button = zeros(1,length(CompOKtmp));
figure
Nx=200;
Ny=200;
for i = 1:length(CompOKtmp)
subplot(1,5,1:4)
plot(TrIC(Com... |
9f87af613822c2692e09c2e668ba7744c81acaf929ef24ebdef82d71c68bb377 | MATLAB | 5,297 | 106 | function [dataout] = ft_examplefunction(cfg, datain)
% FT_EXAMPLEFUNCTION demonstrates to new developers how a FieldTrip function should look like
%
% Use as
% outdata = ft_examplefunction(cfg, indata)
% where indata is <<describe the type of data or where it comes from>>
% and cfg is a configuration structure that ... |
153abb86c5ff2c07a247f79fbe13c51b394ddd09ae1c3649e84dc7c18fa27fb7 | MATLAB | 5,298 | 163 | classdef TrackingVisualizerTrackletsModel < TrackingVisualizerModel
% Model layer for TrackingVisualizerTracklets.
%
% Holds non-gobject properties extracted from TrackingVisualizerTracklets:
% ptrx tracklet data, mapping arrays, sub-model references, etc.
properties
lObj % Labeler reference
tvmt % scalar T... |
132d2f082fd7a306c6706bf3ac7690d0ae2a8cf281b42c967eac8f1934c33a99 | MATLAB | 5,299 | 225 | %LBL = 'Larva94A04_CM_al.lbl';
%lbl = load(LBL,'-mat');
%%
IMOV = 2;
mfahe = lObj.movieFilesAllHistEqLUT;
imI = mfahe{IMOV}.ISamp;
imJ = mfahe{IMOV}.JSamp;
%% what is imhist doing
[cntI,bins] = imhist(imI,256);
dbins = unique(diff(bins));
binsE = [bins-128; 2^16];
cntI2 = histcounts(imI(:),binsE);
cntI2 = cntI2(:);
i... |
50eced5586bd4bbe68406b4bcef8a83a5bd08652cc4f6ffbe5f56372b35cefb4 | MATLAB | 5,300 | 132 | %%% Figure 2 - Stability
addpath("HelperFunctions")
load(fullfile(DataPath, 'Stability.mat'))
SetFont('Arial', 9)
SubjectIDs = {'BCI02', 'CRS02', 'CRS07'};
SubjColors = SubjectColors(SubjectIDs);
subj_str = {'C1', 'P2', 'P3'};
%% Supplement
if exist('fig', 'var')
if isgraphics(fig)
close(fig)
end
c... |
6359d2fcd1071e9bda36ba217f0126461dcf44cc216c8a3a24c0f85579bc0c34 | MATLAB | 5,301 | 193 | % :Usage:
% ::
%
% [cl, dat] = iimg_indx2clusters(dat, volInfo, [u], [k])
%
% cl is clusters
% volInfo is vol info, see iimg_read_img
%
% input dat is data from iimg_read_img, or any vectorized image
%
% output dat is vector of voxels in volInfo.xyzlist( in mask )
% whose elements are the cluster in cl they belong ... |
043774f20bdaed8f96bb1a8a62eb89ef60c35792fc2745593f8a5f58dc57c950 | MATLAB | 5,303 | 139 | function [xf, yf, sumres, ysine, bpass]=gradFreqPlot_pulseq(t,y,Fs,axlabel,scanner)
% function [xf, yf, sumres, ysine]=gradFreqPlot(t,y,Fs,axlabel)
% take output from getDSV (t, y, Fs) to plot and
% output the freq samples: xf,
% fft of y normalised to total input length (numel(t)./Fs): yf
% sums of yf^2 in the acous... |
72adc9051471e14e4a67b31cd7e5ab71f61a6282c7d4f990db7fae2cbb6454d5 | MATLAB | 5,306 | 116 | %% This file runs and saves the data used for Figure 3.
% 1000 pairs of D, beta are simulated and fitted for Delta = 19, Delta =
% 49, Delta = 19,49 and Delta = 19,34,49.
%% Machine and simulation parameters
N = 1000; % Number of simulations
NDirs = 64;
SNR = [5,10,20, inf]; % Signal-to-Noise Ratio
Sigma = 1./... |
1b5f956eb34a622a918a741a111d7ce7fc4aa97c9734ee59bf22c9a80d38d0e6 | MATLAB | 5,308 | 270 | function ignore = ignorefields(purpose)
% IGNOREFIELDS returns a list of fields that can be present in the cfg structure that
% should be ignored at various places in the code, e.g. for provenance, history,
% size-checking, etc.
switch purpose
case 'appendtimelock'
ignore = {
'cfg'
'dimord'
'... |
62c2cac7f58dd0abf7df5e8a8205fa13209e311093bcf8014d301f54112b6553 | MATLAB | 5,309 | 142 | function [result] = ft_test(varargin)
% FT_TEST performs selected FieldTrip test scripts or reports on previous test
% results from the dashboard database.
%
% Use as
% ft_test run ...
% ft_test moxunit_run ...
% ft_test report ...
% ft_test compare ...
%
% ========= Running si... |
937570f22e836fb8e47597786cc3ac7146e077df4fe9fed311cc0cf48f4c34a7 | MATLAB | 5,310 | 145 | function tt = co_trial_table(bdf)
% CO_TRIAL_TABLE - returns a table containing the key timestamps for all of
% the center-out trials in BDF
%
% Each row of the table coresponds to a single trial. Columns are as
% follows:
% 1: Start time
% 2: Bump direction -- -1 for none
% ... |
602544b3b0ae203f1e12c9fc512cc24ac0104d517d7dc9b5b0d2d9be6239e0fe | MATLAB | 5,311 | 174 | function [xymax,smax,xymin,smin] = extrema2(xy,varargin)
%EXTREMA2 Gets the extrema points from a surface.
% [XMAX,IMAX,XMIN,IMIN] = EXTREMA2(X) returns the maxima and minima
% elements of the matriz X ignoring NaN's, where
% XMAX - maxima points in descending order (the bigger first and so on)
% IMAX - li... |
86bee2c3d860b815cd935379462051659859801da904aa30008f376b65e0b43b | MATLAB | 5,311 | 135 | function [cfg] = ft_movieplotER(cfg, data)
% FT_MOVIEPLOTER makes a movie of the the event-related potentials, event-related
% fields or oscillatory activity (power or coherence) versus frequency.
%
% Use as
% ft_movieplotER(cfg, timelock)
% where the input data is from FT_TIMELOCKANALYSIS and the configuration
% ca... |
889f87712dd5772c87b0fbbb4fa66c83e320528dc26ad686b378853496843f30 | MATLAB | 5,313 | 154 | function CBIG_AuthorTopic_PreprocessExpDataFromText(textDataPath, ...
dataDir, binarySmoothKernelRad)
% CBIG_AuthorTopic_PreprocessExpDataFromText(textDataPath, ...
% dataDir, binarySmoothKernelRad)
%
% Preprocess data of activation foci's locations in text form: write the
% activation foci into 3D brain images a... |
cf2936e182b9f0ed40f8bda8033f4abda1aa8d096c8d262049ca4d31f883192f | MATLAB | 5,314 | 144 | % Five-point stencil on the unit line, constant-coefficient Poisson equation,
% Dirichlet boundary conditions.
%
% This is basically the same as FD_LINE1X but using a fourth-order approximation
% with stencil radius two. Correspondingly, the nested dissection separators
% have width two.
%
% Inputs (defaults are used i... |
ec39756deb56b02a353d7dc335200f14cc6f3c70f0af7de2faeb2880d3cd0c9b | MATLAB | 5,314 | 215 | function [p,lineas,out] = plot_SL_RL_bigSbigT(s,smooth_win_t,conditions,filter,doPlot,...
legend_str, varargin)
% function [p,Ton,Son,Toff,Soff,filter] = plot_lock_on_off(s,sm,conditions,filter,doPlot)
% INPUTS
% s is a struct:
% s.g_on: spike counts, aligned on dot onset [trials x time steps]
% s... |
f40b776ac2483042ef5588961469b95aea37355ee5a66f4dc0e8438f0c20e740 | MATLAB | 5,315 | 100 | % compute_functional_flow
for init_project = 1
% set directories
GH = '/Users/cpaquola/Documents/GitHub/'; % github repo location
homeDir = [GH '/DMN']; % home directory
bbwDir = [GH '/BigBrainWarp']; % BigBrainWarp location... |
d35e0d74b86530f64c18716369baacb7d79af0171e2153f6d82fa76ff33401e4 | MATLAB | 5,317 | 120 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This script corrects the obtained results for multiple comparisons using%
% the Benjamin and Hochberg approach %
% %
% Author: ana.tr... |
79b5720e6c55c460ff280c625b34af4159a41e90e21ba043599f3e51ca5df7b9 | MATLAB | 5,318 | 180 | % TrioEEG_PlotAllFigures
%
% For each figure in the paper, load up the saved/processed data (source
% files), and plot the figures
%
clc; clear; close all;
set(0, 'DefaultAxesFontSize', 14)
%% code required
% matlab stats:
% ksdensity.m
% ERPLab:
% topoplot.m
% matlib:
% scatterRegress, nancat, permutationOLS... |
76db5bea511bc4ca0f4e9afb74c23a5cf17149a09ba8691d46f49c9a950541a0 | MATLAB | 5,324 | 119 |
clear
% close all
Monkey = ['Monkey2']; % ['Monkey1' or 'Monkey1']
Align = ['PER_ON'] ;
switch Monkey
case 'Monkey1'
load(['TEST_Spettro_SD_base_' Align '_' Align '_B_WRONG_2b.mat'])
case 'Monkey2'
load(['TEST_Spettro_SD_base_' Align '_' Align '_C_WRONG_2b.mat'])
end
swit... |
f0daeeef671c4b2e56ceb22ccf17b339352bea8361731081845e4bfe5774cc54 | MATLAB | 5,324 | 130 | function fuzzy_simplicial_set = fuzzy_simplicial_set(X, n_neighbors, metric, varargin)
%FUZZY_SIMPLICIAL_SET Given a set of data X, a neighborhood size, and a
% measure of distance compute the fuzzy simplicial set (here represented as
% a fuzzy graph in the form of a sparse matrix) associated to the data.
% This is don... |
e22eebf18f44e541327911e414b96f4588b0e3b8fed3425e9712b460349a930c | MATLAB | 5,328 | 93 | function [trainedClassifier2, validationAccuracy,validationPredictions] = EnsembleBoostedTree(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. ... |
f920b3e149889703db3f0e8bb64f3aa8ede46496729958c0cbd1f97faf629abc | MATLAB | 5,328 | 79 | clear all
%%
%Identify optimal SNR Efficiency as function of Gradient Amplitude
%%
%Define Parameters
[optScanner,optSample,optSSFP,optSTE,optSE] = ParameterOptionsSNR();
%%
%Define Gradient amplitude - Note that fitting algorithm will fix the gradient amplitude during the optimisation
GArr=20:20:1000;
%%
%Define b-val... |
138bec776b2ca81e64b7a5e5131b077a994a7056a4f2ebe2b94083de142f0191 | MATLAB | 5,330 | 115 | function [rCorr,Header]=y_Correlation_Image(DependentDirs,SeedSeries,OutputName,MaskFile,CovariateDirs,OtherCovariates,PALMSettings)
% [rCorr,pCorr,Header]=y_Correlation_Image(DependentDir,SeedSeries,OutputName,MaskFile,CovariateDir,OtherCovariate,PALMSettings)
% Perform correlation analysis with or without covariate... |
77c69023d52a852d4bc99b408b1336339a7990d0347f73d672edf496d247eabb | MATLAB | 5,330 | 93 | function [trainedClassifier2, validationAccuracy,validationPredictions] = EnsembleRUSBoostedTrees(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner a... |
0aeec2397dba97ba44a9565734ea1723413443070d2eced1659672b92e18a388 | MATLAB | 5,331 | 161 | %% demo_bayesian_ttest
% this script demonstrates the use of the 'bayesian_ttest' function for 2
% random normal samples of equal variances.
%
% initialize
clear all;
clc;
rng('default'); % reproducible random-number generation
% parameters
sigma = 1;
nsample = [10 30 100];
d = [0.1 0.5 1];
n_iteration = 1e1; % MUST ... |
6c2206200bc795096a63a56abb616a52019293136eb54bd2d995a58863dad3d0 | MATLAB | 5,331 | 170 | function hfig = tightfigadv(hfig)
% tightfigadv (Tight Figure Advanced): Alters a figure so that it has the
% minimum size necessary to enclose all axes in the figure without excess
% space around them.
%
% tightfigadv is inspired ny tightfig and contains improvements and bug
% fixes for HG2, colorbars, legends and man... |
a7c707b2b8ffb7c21e104990a6d8a70191f88d93ea58882c2b2e909fc0ddb7f3 | MATLAB | 5,331 | 137 |
fSiz = 14 ;
% ModularBeh.factors contains factors preprocessed after boxcox correction
% Here, we also normalize the factors between 1 and 100
ModularBeh.factorsNorm = normalize ( ModularBeh.factors , 'range' , [1 100] ) ;
ModularBeh.factorsLong = repmat ( ModularBeh.factorsNorm, NumRest , 1 ) ;
NumFact = size(M... |
d48008177a9a6c9882035a1bf44975bfbb9832e4247142a804925de834c8e907 | MATLAB | 5,332 | 144 | % Seven-point stencil on the unit cube, constant-coefficient Poisson equation,
% Dirichlet boundary conditions.
%
% This is the same as FD_CUBE1 but using MFX.
%
% Inputs (defaults are used if not provided or set empty):
%
% - N: number of points + 1 in each dimension (default: N = 32)
% - OCC: tree occupancy param... |
7c33ec2d3166b1fcf0b74313d0a27a04b1d29d41c82fb25acbfc5cf7166830b6 | MATLAB | 5,335 | 213 | datRoot = '/Volumes/LaCie/Farries recordings/';
rat = 'IM1056';
sesList = dir([datRoot rat '/20*']);
sesList = arrayfun(@(x) x.name, sesList, 'UniformOutput', false)
iSes = [3];
sesDir = [datRoot rat filesep sesList{iSes} filesep]
load([sesDir 'behavior - RL.mat'])
rwd = TrialFilter(tsRL, 'x1', 'L');
fileDat = dir([s... |
616823d85804306d6cb29394e43dc14e8afabdaeaae929d255d80208bb159402 | MATLAB | 5,339 | 175 | %% Examples with spike time (non-binary) data
% Drawn from an inhomogeneous Poisson process with rate lambda
avgRate = 100; % spikes/s
amplitude = 75;
period = 0.1; % seconds
lambdaFcn = @(x) avgRate+amplitude*cos(2*pi*x/period);
maxRate = avgRate+amplitude;
trialLength = 0.201; % seconds
nTrials = 50;
spikeTimes = c... |
60afc396ea5ff4e1d5b4da87fc9508786af04c5cfbb94a64ba74279d0afe11cf | MATLAB | 5,340 | 143 | function brewermap_read(man)
% Read the ColorBrewer Excel file and print formatted code into "brewermap.m".
%
% (c) 2014 Stephen Cobeldick
%
% Due to license restrictions it is not permitted to offer the ColorBrewer
% schemes on MATLAB exchange (ColorBrewer uses an Apache license). This
% function imports an exc... |
1a074f8f82556a3952ccf1c7abfe2cb68b9b47e9145a6b0836b8bc84ba2fbc40 | MATLAB | 5,342 | 172 | function [EventCodes, segHdr, eventData] = read_sbin_events(filename)
% READ_SBIN_EVENTS reads the events information from an EGI segmented simple binary format file
%
% Use as
% [EventCodes, segHdr, eventData] = read_sbin_events(filename)
% with
% EventCodes - if NEvent (from header_array) != 0, then array o... |
637accfe28d06bf851203c39bd648034201c22a8d127517734bec303d45fc911 | MATLAB | 5,343 | 159 | function weight = calculate_convrect_overlap(min_shift,max_shift,offset,boxsz)
% calculates the amplitude weight of the signal that originates from two
% convolved boxes of (mag-1)*led.sz and mag*net.sz:
% max_shift = (mag-1)*led.sz/2+mag*net.sz/2;
% min_shift = (1-mag)*led.sz/2+mag*net.sz/2;
% minshift and maxs... |
8e3b156977f36bc6d8a026092a5c11b249965557be470181ff065493170f0caf | MATLAB | 5,344 | 126 | function [ ] = viewBrain( M, subjstructs, what2view, transp, colix, viewvect )
%VIEWBRAIN Display a brain model and/or electrode grid locations using activateBrain.
%
% CALLING SEQUENCE:
% viewBrain( M )
% viewBrain( M, subjstructs )
% viewBrain( M, subjstructs, what2view, transp )
% v... |
c5487b1434dd4ed00a0f9f56405a9073d8f69b5880cf399c50c5c78807b76640 | MATLAB | 5,347 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = EnsembleSubspaceKNN(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Learner app. ... |
12801a777bff9f07b9d4666c79637eda8de7d9cd2fbb1b4a8bf65fd7caa1b418 | MATLAB | 5,348 | 144 | function write_edf(filename, hdr, data)
% WRITE_EDF(filename, header, data)
%
% Writes a EDF file from the given header (only label, Fs, nChans are of interest)
% and the data (unmodified). Digital and physical limits are derived from the data
% via min and max operators. The EDF file will contain N records of 1 sampl... |
a44c26751e5c9d79b43616d530ddeb1ce2a618bf5fa8111c98c3cc61550f1bb5 | MATLAB | 5,348 | 122 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This script corrects the obtained results for multiple comparisons using%
% the Benjamin and Hochberg approach %
% %
% Author: ana.tr... |
ab4b1896732d0c82311e9b80eb91e142aa007a9a8b590cf3cd0c1c9d3b0f475b | MATLAB | 5,348 | 159 | % Function that computes the mean correlations and covariances, as well as
% the correlations and covariances as a function of distance, within
% network and between networks.
% Code based on Chengcheng Huang's code:
% https://github.com/hcc11/SpatialNeuronNet
% https://github.com/hcc11/FI_SpatialNet
% Modified for m... |
c9c5d697056c1b1243029cc512e3b57f8bc1bb5aa4f45025fd1bef8e889ad4b1 | MATLAB | 5,348 | 113 | function [Vo, Ym, Yc, Ybonemarrow, tismri, Si, Stm, Affine] = ...
boney_segment_fst(Pi, Pc4, job, seg8t, tis, vx_vol)
%boney_segment_fst. Fast bone processing, export and report preparation.
%
% [Vo, Yo, Ym, Yc, Yc4, Ybonemarrow, tismri, Si, St, Sti, Affine] = ...
% boney_segment_fst(Pi, Pc4, job, seg8t, ti... |
065f83029edf28bad50e8784dd653475f72785ca7ce7249fadf41f47854f0b57 | MATLAB | 5,354 | 164 | function whl = Find_RB_LED(file)
% This code tests an approximate median filter for separating out the red
% and blue leds mounted on top of the subjects head
% I was using the DataMax system, which was synced using a red LED. Hence,
% I am tracking the x,y position of the animal as well as when the sync
% light comes... |
d3b377774779a7151d6951b40999eb7ee31b5e05ed08e37a4f463b2b7b59f4f9 | MATLAB | 5,355 | 124 | function [chceind, cntxtind,moinds,colinds,cmap,mrkrface,flp,colorstr] = PlotPSTHsettings(settings)
switch settings
case 1 % motion context, averaged over color, preferred choice and motion direction
chceind = 2;cntxtind = 2;
moinds = 4:6;colinds = zeros(3,1);
cmap = 'redblue';%nc = l... |
721a646118a20fbc1a65a881d409812232b4eb02c540b689f2aac53705331b52 | MATLAB | 5,356 | 141 | function h=tftb_window(N,name,param,param2);
%tftb_window Window generation.
% H=tftb_window(N,NAME,PARAM,PARAM2)
% yields a window of length N with a given shape.
%
% N : length of the window
% NAME : name of the window shape (default : Hamming)
% PARAM : optional parameter
% PARAM2 : second optional parameter... |
b4c035718b1bbf7ca60bc19d496c2387b4b5e4fdfdce80420ba95f37ae5c134c | MATLAB | 5,356 | 180 | function output = read_micromed_trc(filename, begsample, endsample)
%--------------------------------------------------------------------------
% reads Micromed .TRC file into matlab, version Mariska, edited by Romain
% input: filename
% output: datamatrix
%-------------------------------------------------------------... |
5fab1434a78381d6c0e938b28aa590f9807477f6935579cd3d043c1f725bb850 | MATLAB | 5,358 | 79 | clear all
%%
%Identify optimal SNR Efficiency as function of Gradient Amplitude
%%
%Define Parameters
[optScanner,optSample,optSSFP,optSTE,optSE] = ParameterOptionsSNR();
%%
%Define T1 array - Note that fitting algorithm will fix the gradient amplitude to GMax during the fitting (defined in ParameterOptionsSNR)
T1Arr=5... |
7166283fc2b9c9363711ec1f78e93fd73eddf40f10544edea43c124cad20c6e4 | MATLAB | 5,358 | 155 | function Aout = h_executeCalcGelAnalysisRoi3(handles)
% global h_img3
[currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles);
Aout = struct('roiNumber',[],'roi', [], 'bgroi', [], 'median_bg', [], 'avg_intensity', [], 'max_intensity',...
[], 'spine_info', [], 'timestr', '', 'fi... |
7eb0f21aeb0cdc25c931ce0c563498083b19e104a5227fa65976e94834798d3d | MATLAB | 5,358 | 164 | function [stan,rtfr,hat] = tfrrstan(x,t,N,G,h,trace);
%TFRRSTAN Reassigned Stankovic distribution.
% [TFR,RTFR,HAT] = TFRRSTAN(X,T,N,H,TRACE)
% computes the Stankovic distribution and its reassigned version.
%
% X : analysed signal.
% T : the time instant(s) (default : 1:length(X)).
% N : number of f... |
9bf961078fe0b63d0d35ab624218385230294749dfa3437a686e9274d23997e0 | MATLAB | 5,359 | 79 | clear all
%%
%Identify optimal SNR Efficiency as function of Gradient Amplitude
%%
%Define Parameters
[optScanner,optSample,optSSFP,optSTE,optSE] = ParameterOptionsSNR();
%%
%Define T2 array - Note that fitting algorithm will fix the gradient amplitude to GMax during the fitting (defined in ParameterOptionsSNR)
T2Arr=1... |
4a64780b3966316b03646944a844c7034840bcd391cdf1ab20d35564fa1f4654 | MATLAB | 5,360 | 89 |
ind = 1;
data = dir('/DATAPOOL/ERRORMONITORING/SEM_mri_data/P*');
%%
for i = 1:size(data,1)
fprintf(data(i).name);
data_func = dir([data(i).folder, '/', data(i).name, '/mri/SEM_', data(i).name, '/nifti/func/run*']);
for j = 1:size(data_func,1)
fprintf(data_func(j).name);
... |
944f5d5e7d663b7dfb37d0d9aff8b9adbca78b22095b1e093259b9837cff1b30 | MATLAB | 5,361 | 142 | function [e, gMag] = nonmaxSuppress(varargin)
%NONMAXSUPPRESS does non-maximum suppression on 2-D and 3-D arrays
% E = NONMAXSUPPRESS(G, NAME, VALUE, ...) finds directional local maxima
% in a gradient array, as used in the Canny edge detector, but made
% separately accessible here for greater flexibility. Th... |
e8cb7533f7fbd8cbf5089046deaeeb85a45c5cdfa4bdc5ee692eec94f0609992 | MATLAB | 5,361 | 170 | function [posterior,out,theta] = demo_negfeedback(connectivity_model, encoding_region, noise,nRepetition)
%%% ----------------------------------------------------------------------
% Initialise the generative model, simulate data and inverse the model
%
% IN: feedback
%%% -----------------------------------... |
f9e45e04e5ed04ac145032dff52f8fccb002bd1393a285a0f98e343e37e636d8 | MATLAB | 5,364 | 129 | function TScheckconsistency(mode)
% TScheckconsistency( MODE )
% TScheckconsistency checks the consistency of the Experiment structure.
% It recursively loops over all the substructures and checks that those
% that have the same name, e.g. Subject, Session, Trial, etc., have the
% same fields. If not it makes n... |
87c549629b7d6e6670f82865c407adedc0e7a970441f89d8399a2a796a22b154 | MATLAB | 5,365 | 92 | function [trainedClassifier2, validationAccuracy,validationPredictions] = EnsembleSubspaceDiscriminant(trainingData)
% [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
% returns a trained classifier and its accuracy. This code recreates the
% classification model trained in Classification Lear... |
3856af3f2edaa8574bb3d92fc3f409a70e3ccc9e50061301711d91af9ee140e7 | MATLAB | 5,366 | 95 | % GEN_MASS_MATRIX_TR_MOMENTS_CPU Builds sparse matrices representation of
% time-resolved diffusion transport equation for direct calculation of
% moments of the time-resolved curves. Matrices can represent a FEM mesh
% in 2D (triangles) or 3D (tetrahedrons) space. Parallelized for
% multithreading with OpenMP.... |
cd18c5793c4226b0a116b9c632f33981a843bd3462b8620717a91688f795053f | MATLAB | 5,366 | 213 | % IllustrateSaccadeMeasures
% draw some saccades (times vs pos) and illustrate sRT, endptvar, velres,
% depAngle
set(0, 'DefaultAxesFontSize',14)
%%
r = load('TrioEEGBehProcessFiles.mat');
%%
result = r.result(10);
%% get trials starting from bottom, going right
trialInds = result.d.previousTargetPos==2 & result.d... |
02d9bd10a3f976a6f69c4b751f04e2b919eda5f1103ed56fed3561b68003c903 | MATLAB | 5,368 | 164 | % DELCODE-SAME, Figure "FADE SAME gender"
% _
% original paper: Soch*, Richter* et al., HBM, 2022
% Figure: not available
%
% DELCODE paper: Soch et al., medRxiv, 2023
% Figure S2: FADE and SAME scores by diagnostic group and participant gender
%
% written by Joram Soch <Joram.Soch@DZNE.de>, 03/11/2022, 13:52
% ada... |
b357435c87cca5fa5d0153cf9ff2ec2b2d310131cd7b8043de394650279cea42 | MATLAB | 5,368 | 163 |
load(fullfile(saveLoc, 'sig_allSessions'))
load(fullfile(saveLoc, 'par_sess'))
dimms = [31 32 100 101 102];
plotSig = {'MinC', 'MinI'};
sigName = {'S^{left}_{Min} [sp/s]', 'S^{right}_{Min} [sp/s]', 'S^{left}_{Min} - S^{right}_{Min} [sp/s]',...
'Int(S^{left}_{Min} - S^{right}_{Min})',...
'Int(S^{left}... |
6fe8d710eb8b6f0f0c1186ebd124fe5b79773119cbe0b75d57e2862b42cd2849 | MATLAB | 5,371 | 145 | function [varargout] = ft_plot_text(X, Y, str, varargin)
% FT_PLOT_TEXT helper function for plotting text, which can also be used in
% combination with the multiple channel layout display in FieldTrip.
%
% Use as
% ft_plot_text(X, Y, str, ...)
%
% Optional arguments should come in key-value pairs and can include
% ... |
e575ad924ec02fe7a8a5712fb57607bba6846b013f0d073471a47bb1101502f9 | MATLAB | 5,372 | 174 | function [w, sigma, loglikHist]=linregFitSparseEm(X, y, prior, varargin)
% Use EM to fit linear regression with sparsity promoting prior
% See the paper "Sparse Bayesian nonparametric regression"
% by F. Caron and A. Doucet, ICML2008.
% See also "Alternative prior distributions for variable selection
% with very many... |
d1a6ffec569ea1966834c848f7871c5aed85edcfd145b2a48e0339ef629ef546 | MATLAB | 5,377 | 145 | function [varargout] = ft_plot_text(X, Y, str, varargin)
% FT_PLOT_TEXT helper function for plotting text, which can also be used in
% combination with the multiple channel layout display in FieldTrip.
%
% Use as
% ft_plot_text(X, Y, str, ...)
%
% Optional arguments should come in key-value pairs and can include
% ... |
cafb9985780f023d61c4f881ce331826ffeb870aa55a27a16a73759ea98f9768 | MATLAB | 5,379 | 137 | % GaitResampling.m
% Sarah West
% 7/14/23
function [parameters] = GaitResampling(parameters)
data = parameters.data;
resampleLength = parameters.resampleLength;
MessageToUser('Resampling ', parameters);
% Put strides of different instances together on same level
segmentations_together = vertcat(... |
b608e733111bc19f8e612702ec5852b10c3c1c5d1124c69b92afbc5fa91f4d37 | MATLAB | 5,380 | 92 | % GEN_MASS_MATRIX_TR_CPU Builds sparse matrices representation of
% time-resolved diffusion transport equation within FEM mesh in 2D
% (triangles) or 3D (tetrahedrons). Parallelized for multithreading with
% OpenMP. Uses all available CPU power.
%
% SYNTAX:
% [I_INDEX, J_INDEX, S1_VALUE, S2_VALUE] = GEN_MASS_... |
1bbc07f17ae1b3f901807a44b06895ddad7ef19ea308a78892ff0e451f51e437 | MATLAB | 5,382 | 119 | function GonzalezPereyra_etal_Fig_03
newColors=[[80 80 80];[62 146 204];[216 49 91]]./255;
load ([pwd '/Data_GonzalezPereyra_etal_Fig_03.mat']) %#ok<*LOAD>
for ezln=1
AllAnimalsAllZSscores_300ms_PTStim(isnan(AllAnimalsAllZSscores_300ms_PTStim(:,1)),:)=[]; %#ok<*AGROW>
[SortedMatrix,maxIndex]=SortThisMatr... |
efe2875c4a264b2cdca1edecc413bac8fc8562112a12cffe784f47125533229b | MATLAB | 5,384 | 138 | function [s, cfg] = ft_statfun_indepsamplesT(cfg, dat, design)
% FT_STATFUN_INDEPSAMPLEST calculates the independent samples T-statistic on the
% biological data in dat (the dependent variable), using the information on the
% independent variable (ivar) in design.
%
% Use this function by calling one of the high-level... |
03cd1c5ca59104349ae92f2f6a5448eb674ce8d32e749dac0ee63a43931ff56f | MATLAB | 5,385 | 122 | function [ANCOVA_F,Header] = y_ANCOVA1_Repeated_Image(DependentDirs,OutputName,MaskFile,CovariateDirs,OtherCovariates,PALMSettings)
% [ANCOVA_F,Header] = y_ANCOVA1_Repeated_Image(DependentDirs,OutputName,MaskFile,CovariateDirs,OtherCovariates,PALMSettings)
% Perform one-way ANOVA or ANCOVA analysis (Repeated Measures... |
0278effeec5ab60f988613108f97bbd1729f34e9dc6c11602e9a9e55eff52686 | MATLAB | 5,386 | 147 | %% quantify multiple aspects of the late wave after muscimol silencing of M1
% only plots "responsive" trials where there is a detectable LFP
% even number trials are LED ON
clear;clc
%paths to representative animal. Baseline, Saline, Muscimol t=0, Mucimol
%t=2hr
repPath{1} = 'D:\InVivo\M1-Muscimol\2022-01-10... |
537cf96688b6a6cbad4ba39c0314efade2faf8944a8b5fa409b60d5f94ad32ef | MATLAB | 5,388 | 147 | % FieldTrip
% Version unknown www.fieldtriptoolbox.org DD-MM-YYYY
%
% FieldTrip is the MATLAB software toolbox for MEG and EEG analysis that is being
% developed by a team of researchers at the Donders Institute for Brain, Cognition and
% Behaviour in Nijmegen, the Netherlands in close collaboration with collaborating
... |
215d0667047bcf0afcb330256fd91b9c9acecce3172e4cb537e7f841b454b8da | MATLAB | 5,393 | 204 | function S = dtvotinge( E, s, sg, m, v )
% DTVOTINGE Applies dense 2D tensor voting by for edge detection by steerable filters over
% every slice of a tomogram at X, Y and Z axes.
% INPUT:
% E - Input tomogram
% s - Scale factor
% sg - variance for gaussian prefiltering
% m - Mi... |
d8c75eb5593953c368774f71ce8533760685440fb969706c9aded66e0cb77253 | MATLAB | 5,393 | 129 | function [ EEG_out, excl_chans, i ] = ch_iterative_reref ( EEG_in, config )
%% About support function
% Name: ch_iterative_reref
% Version: 1.11
% Christoffer Hatlestad-Hall
% Date created: 24 Nov 2019
% Date last modified: 09 Apr 2020
% --------------------------------------------------------------------------... |
e62a7ccf610140fcbca520ca51235a40ea7fb9acf41e69e3a8dc0dd634f9e32e | MATLAB | 5,394 | 181 | function RT = lan_detect_logothetis(LAN, cfg)
% Logothetis et al., 2012, Hippocampal-cortical interaction during
% periods of subcortical silence, Nature.
%
% label : tag all events with a label. Use * for channel tags.
% WARNING : this script assumes LAN is unsegmented
% UNIMPLEMENTED : RT.OTHER.Amp
RT = [];
if n... |
1749cd126e12ee70381899a62a6bb6f9139b91f394f594c72c566ab1cb2c214c | MATLAB | 5,395 | 127 | function [maps,data,stats] = bz_RippleStats(filtered,timestamps,ripples,varargin)
%RippleStats - Compute descriptive stats for ripples (100~200Hz oscillations).
%
% USAGE
%
% [maps,data,stats] = bz_RippleStats(filtered,timestamps,ripples,<options>)
%
% filtered ripple-band filtered samples (one channel)
%... |
775e148468b350b0d7c614b9c7ee783946a3fa21d619fb3264d872d2b929b0d7 | MATLAB | 5,395 | 165 | function el = ET_setup(ELdummymode,el, subNo, phase, irun)
%% Eyetracking setup cf Dahl
status = Eyelink('IsConnected'); % try to close ET if it is still opened (prior task etc.)
if status ~= 0
try
Eyelink('Shutdown');
end
end
% Disable key output to Matlab window:
ListenChar(2);
% % % Initialize ET
i... |
31798a1d84ccf3ef62520a17eb33252acd95bf3f981d2aac7d841ed1be1926aa | MATLAB | 5,396 | 144 | function vtkwrite_spdlines( filename,dataType,varargin )
% VTKWRITE Writes 3D Matlab pathlines into VTK file format.
% vtkwrite(filename, 'polydata', 'lines', x, y, z) exports a 3D line where
% x,y,z are coordinates of the points that make the line. x, y, z are
% vectors containing the coordinates of points of the ... |
91b3f4baecbeb3d00a8428b23113ad3b29eacb23a70b642af8aa41ca0c6b9cc0 | MATLAB | 5,396 | 204 | function S = dtvotinge( E, s, sg, m, v )
% DTVOTINGE Applies dense 2D tensor voting by for edge detection by steerable filters over
% every slice of a tomogram at X, Y and Z axes.
% INPUT:
% E - Input tomogram
% s - Scale factor
% sg - variance for gaussian prefiltering
% m - Mi... |
296aff2e399f2b6b4762cd96782e03c94272523c20b17c1b8b587d8d765c6b55 | MATLAB | 5,397 | 172 | function bestModel = CBIG_visualizeFactors(initFolders, GMMask, outDir)
% bestModel = CBIG_visualizeFactors(initFolders, GMMask, outDir)
%
% This function selects the best random initilization (that gives the
% highest likelihood) and visualizes the estimated factors as probabilistic
% atrophy maps.
%
% Input:
% -... |
4e85ca4b75cef3ff22aa9dd648cd70eedeaa992a00900d682f53c97a259d69e0 | MATLAB | 5,397 | 158 | function [basis,gradbasis]=legs(x,dir,n,scale)
% usage: [basis,gradbasis]=legs(x,dir,n,scale)
%
% returns the values and directional derivatives of (n+1)^2-1 basis functions
% constructed from spherical harmonics at locations given in x and, for the
% gradients, for (in general non-normalized) directions given in di... |
ee81f3cbd660a86262e073768f360a88403b33519214d4761fde734f65e7e876 | MATLAB | 5,398 | 159 | function [data] = ft_appendspike(cfg, varargin)
% FT_APPENDSPIKE combines continuous data (i.e. LFP) with point-process data
% (i.e. spikes) into a single large dataset. For each spike channel an
% additional continuos channel is inserted in the data that contains
% zeros most of the time, and an occasional one at the... |
3b203d8b6ddb2b17eff629e890d37794a45c2298de2e319104f340f060a189de | MATLAB | 5,399 | 183 | function output = read_micromed_trc(filename, begsample, endsample)
%--------------------------------------------------------------------------
% reads Micromed .TRC file into matlab, version Mariska, edited by Romain
% input: filename
% output: datamatrix
%-------------------------------------------------------------... |
ace81d844ec66683d5fd535f5ff4229a3f0c044ba9850ce46a889af5ad366b77 | MATLAB | 5,404 | 103 | % GET_FIELD_TR_CUDA Solves time derivative of sparse system of linear
% equations using trapezoidal Clark-Nicholson integration method in the
% time dimension and BiCGStab solver with FSAI preconditioning to solve at
% derivative steps. Parallelized for multithreading with NVidia CUDA.
% Uses all available powe... |
beb9362e24256a06ff7cd53c21d7276352d8f35a00fe1741c00b00f76e6acfc9 | MATLAB | 5,404 | 222 | %%% 2024-09-16: construct a dictionary for reconstruction of the T2 data.
%%% This is based on a Bloch simulation performed separately (code not
%%% included for that; details in manuscript).
%%%
%%% This script creates dictionaries and evaluates the effect of including
%%% and excluding T1 in the lookup.
%%% Shaihan M... |
707f958783404c910cd6ff431ff1bdad100d32429536dede1e62273106c0de5d | MATLAB | 5,407 | 184 | function D = pdist2( X, Y, metric )
% Calculates the distance between sets of vectors.
%
% Let X be an m-by-p matrix representing m points in p-dimensional space
% and Y be an n-by-p matrix representing another set of points in the same
% space. This function computes the m-by-n distance matrix D where D(i,j)
% i... |
e900ca1a1c85e41a0cfe22a0d92199a6bbbbf550eb245172cbf78c44bcca4c99 | MATLAB | 5,408 | 160 | function [cfg, Eul] = runEULA(cfg)
% This function runs the Eulerian postprocessing.
addpath('./analyzeFlows','./Inverse','./Sensitivities',genpath('./utilities'));
%%
fprintf('\n =============== Eulerian Post-processing Starts ===============\n')
fprintf('_________________________________________________________\n\n... |
ee977b853ac590bbf021bf50b4de46cde900626ab36881463fab6f741a1a018a | MATLAB | 5,408 | 173 | function str = VBA_summary(out,newlines)
% writes a summary string from standard output of VBA model inversion
% function str = VBA_summary(out)
% IN:
% - out: the 'out' structure of VBA inversion routine
% - newlines: flag for inserting line separators (\n)
% OUT:
% - str: a cell array of strings, which summariz... |
40e5722bb5cd8f75259c5eed9adae02984f90e07d328cd96ddf92a2da3cadc8f | MATLAB | 5,409 | 132 | % this is just to deal with a situation where one drive has the raw data
% and another drive has the spike sort results
% For most situations, "analyze laser.m" is the better choice
rawRoot = '/Volumes/Seagate Backup Plus Drive/Recordings/';
sortRoot = '/Volumes/LaCie/Farries recordings/';
rat = 'IM1261';
sesListRaw = ... |
dd8373f71fdd6924beee4cd5d4d70a3238191b09b399e243f4e8f716c8f90888 | MATLAB | 5,410 | 221 | function m = serialize(v, n)
% Create a string representation S, of a variable v, s.t. eval(S) = v
%
% matcode = SERIALIZE(x) generates matlab code of x
% matcode = SERIALIZE(x, n) generates matlab code of x retaining n digits
% of precision
% SERIALIZE() enters self test mode
%
% SERIALIZE should be able t... |
ed10c304436ce0783f18d093c35aba594cc439050095761f879e90934fc32806 | MATLAB | 5,410 | 175 | clear;
clc;
close all
srate = 400;
n_subjects = 8;
%%
warning('off');
band_labels = {'\delta (<3Hz)','\theta (3-6Hz)','\alpha (7-14Hz)','\beta (15-30Hz)','low \gamma (31-40Hz)'};
band_limits = [3 6 14 30 40];
band_limits_lp = [1 3 6 14 30];
band_limits_up = [3 6 14 30 40];
n_bands = length(band_labels);
... |
09a492c4183b1c9d3269b64c499d6e29932066063e91344d64f0bd059e6e54c3 | MATLAB | 5,412 | 144 | function checkdiff(problem, x, d, force_gradient)
% Checks the consistency of the cost function and directional derivatives.
%
% function checkdiff(problem)
% function checkdiff(problem, x)
% function checkdiff(problem, x, d)
%
% checkdiff performs a numerical test to check that the directional
% derivatives de... |
7eecd6c81f9fc73a6b67d3379c1f3ca4af94b914b6f0558adaaf4aa03523724a | MATLAB | 5,412 | 167 |
clear all; close all; clc;
%% Add path the fieldtrip toolbox (please follow the steps in https://www.fieldtriptoolbox.org/ to download and add FT toolbox)
addpath /opt/fieldtrip_github
ft_defaults
%% Load Mat data
load ('allen_FT.mat')
%% Fieldtrip data Preparation
fsample = double(fsample);
clear data
for tr=... |
af1db7576fb06216377142066f992833246b5de710ef04eec3114eee21b1bb35 | MATLAB | 5,413 | 153 | function source = loreta2fieldtrip(filename, varargin)
% LORETA2FIELDTRIP reads and converts a LORETA source reconstruction into a
% FieldTrip data structure, which subsequently can be used for statistical
% analysis or other analysis methods implemented in Fieldtrip.
%
% Use as
% [source] = loreta2fieldtrip(filen... |
d39aaee9001914e5eca2c0aec0e1c60b171666559629ac52f702c9db9c2c48b4 | MATLAB | 5,413 | 119 | function [ titlestr, settings, results ] = normalizeFeatures( dataview, settings )
% Create coordinates that are normalized per datapoint.
%
% See also dspace_features.NormalizedDerivedFeatures
%
%
%
%<PRE>
% This file is part of dspace-core.
%
% Copyright (C) 2020 Universi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.