sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
9dbb11a34b881e1b8da8b46b23a809d91606bce780c29fee3fdec8b89cd1c22a | MATLAB | 7,246 | 218 | function get_rDCM_parameter_estimates_fixed_MainExperiment(dataset,model,scale)
% Get the individual parameter estimates from the whole-brain Dynamic Causal
% Models (DCMs) for the resting state dataset of the HCP and MICS dataset.
% Parameter estimates have been computed using regression DCM (rDCM).
%
% This functio... |
61d929d5b8c3cbdae0f88cb006659213388aae491cf7158a677c689bb8182867 | MATLAB | 7,247 | 198 | classdef AudioRecording < Recording
properties (Constant)
bufferSize = 16 * 1024 * 1024; % The maximum number of samples to load at any time.
end
properties (Transient)
dataStartSample = -Inf
end
properties
maxAmp
channel
end
properties(Tr... |
0028e9fdd2f60caee2773b3bc7994b65ed70d838740ca4f97e060eb45d799dfc | MATLAB | 7,248 | 214 | % Covariance matrix on the unit line, squared exponential kernel.
%
% This example considers the covariance matrix between equispaced points on the
% unit line with squared exponential covariance function. The matrix is square,
% real, positive definite, and Toeplitz.
%
% We remark on a few key departures from the PDE ... |
00e37ba93b5044936d376f56bc0da16a0393d16703c27439b83ece6291a8b7ae | MATLAB | 7,258 | 237 | %% SDO (7)
% SDO matrix constrained optimization
%
% This is an alternative, slower, direct optimization of the SDO estimation,
% which uses MATLAB's Optimization Toolbox to try to find the (SDO)
% matrix which maps the dpx from px0, given the 4 SDO constraints; 1)
% Nonpositive diagonal; 2) non-negative off-diagonal,... |
00c38c94f3f1db0e006affc362c12841e135e0dae9ac1d213c29aed0b6c602cb | MATLAB | 7,262 | 180 | function [blockOrder, attBlockOrder, targetBlockOrder, cueBlockOrder, targetTypeBlockOrder] = ...
block_gen(blockNames, attBlockNames, targetBlockNames, cueBlockNames, run, catchTrials)
% Random block generator for makeTADetectStim: one run (32 trials in one
% repetition = 4 trials for each target (4) x cue (2)... |
60e308d78a3b0e42208dc7126a8036ade84386ca30773f3c60b6fcee585062c4 | MATLAB | 7,263 | 225 | exptype = 'FlyBubbleAnnotator';
savedir = '/groups/branson/bransonlab/apt/experiments/res/gt/20190523';
cprdir = '/groups/branson/bransonlab/apt/experiments/res/cprgt20190407';
if ~exist(savedir,'dir'),
mkdir(savedir);
end
dosavefig = false;
%% parameters
nets = {'openpose','leap','deeplabcut','unet','resnet_unet'... |
7d76aec7440c51d234f42fbdc17d2a1b04fbb87c9a36ead2ca135deb2418188f | MATLAB | 7,264 | 208 | function [bestModel, postMean, condMean, postModelProb, supports, out, condCov] = ...
fbmpCore(A, y, varargin)
% Fast Bayesian Matching Pursuit
%PMTKauthor Schniter, Ziniel
%PMTKurl http://www.ece.osu.edu/~zinielj/fbmp/pubs.html
%PMTKmodified Kevin Murphy
% This file is from pmtk3.googlecode.com
%
% [bestModel, ... |
d7922bb4e36fb0f05464d64e9c22137959955501d306cda9fdaf682ff6d8c8ee | MATLAB | 7,267 | 107 | function prec_cat(input_fn,pkg_dir)
matlabbatch{1}.spm.tools.cat.estwrite.data = input_fn;
matlabbatch{1}.spm.tools.cat.estwrite.data_wmh = {''};
matlabbatch{1}.spm.tools.cat.estwrite.nproc = 2;
matlabbatch{1}.spm.tools.cat.estwrite.useprior = '';
matlabbatch{1}.spm.tools.cat.estwrite.opts.tpm = {fullfile(pkg_dir,... |
8769882c603a30e4f8d428a17608b8021d6e6794af0350ac34461f86519ea9b1 | MATLAB | 7,270 | 272 | %% Compare different classification algorithms on a number of data sets
% Based on table 2 of
% ""Learning sparse Bayesian classifiers: multi-class formulation, fast
% algorithms, and generalization bounds", Krishnapuram et al, PAMI 2005
%%
% This file is from pmtk3.googlecode.com
function results = classificationSh... |
01492eb80ddeb8f015b953d76cb96d96266169a952aac3d9bce53d96e31c1fba | MATLAB | 7,271 | 194 | function [mri] = align_ctf2acpc(mri, opt, template)
% ALIGN_CTF2ACPC performs an approximate rigid body alignment of the anatomical
% volume from CTF towards ACPC coordinates. Only the homogeneous transformation
% matrix is modified and the coordsys-field is updated.
%
% Use as
% mri = align_ctf2acpc(mri)
% mri = ... |
a1beecae26dd8ebadc9accd5a6e72cdf8279d230fcea969ecbc4400a076856f0 | MATLAB | 7,271 | 184 | % SignificanceCalculation.m
% Sarah West
% 6/20/22
% Takes the "real" sample values and compares it to a null distribution of
% values to calculate p-values. Run with RunAnalysis.
% Inputs:
% parameters.test_values
% parameters.null_distribution
% parameters.shufflesDim
% parameters.alphaValue -- the statistical alpha... |
226ef586eb4eb724e07b9d9006526172d5cda4ae3562b6f4ad8a7874221f7258 | MATLAB | 7,273 | 306 | function show_vc_tri(vc,para,varargin);
% usage show_vc_tri(vc,points,para);
% plots dipoles in volume conductor
if nargin<3
para.normalize=1;
else
if ~isfield(para,'normalize')
para.normalize=1;
end
end
myviewdir=[-1 0 0 ];
numsubplots=4;
mymarkersize=30;
mylinewidth=2;
fsv=0;
if nargin>2
... |
aa1fa1986f5660e836528479ca5f8f4ad2330038d8eb3fe236f32d01aa6b67c9 | MATLAB | 7,276 | 193 | function extractHaematocrit(fname)
% created by Kira, February 2020
% analyses RBC density (as a %) from binarised line scan data
% input: fname
% fname is the experimental directory
% this directory should contain a tif file called 'RBCV_binary.tif' (user creates)
% this is just the velocity trace binarise... |
5e2e4df84d6389d60c888751edfc6f9c68b844ea144b44c1a6f7e16ff20d8b41 | MATLAB | 7,278 | 201 | function imData=bigread2_partial(path_to_file, indices_i, indices_j, sframe, num2read)
% reads tiff files in Matlab bigger than 4GB, allows reading from sframe to sframe+num2read-1 frames of the tiff - in other words, you can read page 200-300 without rading in from page 1.
% based on a partial solution posted on Matla... |
ad680d51de553e472cbf1021273fc8a15c8d0b89dd52fcdc4f6ef9787ef977cc | MATLAB | 7,282 | 188 | function D = IBWread(FN);
% IBWread - read Igor wave from IBW file
% D = IBWread('Foo.ibw') reads Igor file Foo.ibw into struct D.
if exist('fullfilename', 'file'), FFN = fullfilename(FN, cd, '.ibw');
else, FFN = FN;
end
% read headers
[D.binHeader, D.waveHeader, FFN] = readIBWheaders(FN);
fid = fopen(FFN... |
f71964d77fe9de098a4371c00e3b4df46c878b39b985f225bf9d8298bde8278d | MATLAB | 7,285 | 272 | function estimate_rDCM_fixed_MainExperiment(dataset,subject,model,scale)
% Infer whole-brain effective connectivity for the resting-state dataset of
% the HCP and MICS dataset using regression DCM.
%
% This function prepares the respective DCM model. Futher, it applies rDCM
% to the model, which means assuming a full... |
0896e5a900451ce4d4270720939414a5b09cc0fec61feebdb8be210d1e44e16e | MATLAB | 7,286 | 196 | function [event] = read_yokogawa_event(filename, varargin)
% READ_YOKOGAWA_EVENT reads event information from continuous,
% epoched or averaged MEG data that has been generated by the Yokogawa
% MEG system and software and allows those events to be used in
% combination with FieldTrip.
%
% Use as
% [event] = read_yo... |
f2a69c8a366eafdfcd446b769bfa8c903fcce8b47768df59952fd67fd7df0ab7 | MATLAB | 7,289 | 185 | function lan_master_gui_spec(LAN_var, mainfig, parent_)
LAN = LAN_var;
current = 1;
sel = 1;
holdon = false;
logx = true;
if nargin < 2
mainfig = figure;
end
figure(mainfig);
cfg_control(1) = uicontrol('style', 'text', 'units', 'norm',...
'position', [.04 .92 .6 .05], 'string', 'channel(s) : ',...
'horiz... |
27ade821a82a19a67252ce81fbb989948bb04946d2a90796cc9048c27c92e06b | MATLAB | 7,290 | 217 | function M = grassmannfactory(n, p, k)
% Returns a manifold struct to optimize over the space of vector subspaces.
%
% function M = grassmannfactory(n, p)
% function M = grassmannfactory(n, p, k)
%
% Grassmann manifold: each point on this manifold is a collection of k
% vector subspaces of dimension p embedded i... |
3333d7cc6fd2455419eb495cd6f127867144651a9d195f34f2310a18603f62d7 | MATLAB | 7,294 | 246 | function CBH = cbfit(varargin)
%CBFIT Changes COLORMAP and CAXIS to fit between colorbar's ticks.
%
% SYNTAX:
% cbfit
% cbfit(NBANDS) % Or LBANDS
% cbfit(NBANDS,CENTER)
% cbfit(...,'force')
% cbfit(H,...)
% CBH = cbfit(...);
%
% INPUTS... |
d0d3d18b74aaee18a9d6ba8c53808e4cfa5b66a479983ef21cd124e4fe0a4f18 | MATLAB | 7,294 | 220 | function VBA_spm_dcm_display(varargin)
% Region and anatomical graph display
% FORMAT spm_dcm_display(xY,a,c,h)
% xY - cell of region structures (see spm_regions)
% a - connections of directed graph a(i,j,1) = p value;
% a(i,j,2) = MAP estimate value
% c - node-specific... |
f6966f0e63ce7c3e86b45a6ad31c073233a125c4fe503ba128117adab5b541f4 | MATLAB | 7,295 | 196 | function [event] = read_yokogawa_event(filename, varargin)
% READ_YOKOGAWA_EVENT reads event information from continuous,
% epoched or averaged MEG data that has been generated by the Yokogawa
% MEG system and software and allows those events to be used in
% combination with FieldTrip.
%
% Use as
% [event] = read_yo... |
0b329fa389972efe1ccf227513c1bb2670242b4f571c28d9e576ae44bda929f4 | MATLAB | 7,296 | 219 | %% plotSDO_quiverSDO
%
% Plots the Quiver SDO, a representation of the coarse transition SDO in a
% 1D fashion. For use within the SDO Analysis Toolkit.
% The Diagonal component of the SDO is now treated as a linear
% component, with directional components coming off for transitions
% above/below diagonal (trans... |
19a91f98a09406ddd7efbc619027a79ff3bc1d68e4ac85aef9aa9081cdcaa8b7 | MATLAB | 7,296 | 155 | function BSC_FRR(stat_path,sots_path,exp_folder,N,TR,q_level,ground_truth)
% ========================================================================
% Ruslan Masharipov, July, 2024
% email: ruslan.s.masharipov@gmail.com
% ========================================================================
tic
% Number of *.nii... |
b861cfd17fee652cee583642a7d94b0a47c3b584c582a5e1e849db5e4e5fa529 | MATLAB | 7,296 | 326 | clear
clc
close all
%%% Compute mTDR using macaque FEF data from Mante et al., 2013
addpath('mbtdr/functionFiles')
addpath('mbtdr/functionFiles/tools_kron')
addpath('mbtdr/minFunc')
addpath('mbtdr')
%% plotMarinoResults
%%% load macaque dataset
fileDir = 'Arrays_Mante/';
load(['data/' fileDir 'dataT'])
param... |
7320cace8cf7b7064e347d9d48cfdfa5bbe3bbf45703aa5a69c2343c09648b48 | MATLAB | 7,297 | 220 | function meg_msFigs_TE_byPrecue_mdlFit_2Hz_bars
% function meg_manuscriptFigs_TE_byPrecue_mdlFit_2Hz_bars
% Plot 2 Hz model fit
%% Load data
user = 'kantian';
% Model fit data
filename = sprintf('/Users/%s/Dropbox/github/ta-meg-analysis-model/model_anticipatory/ITPCfit_separate1_2Hz/231213/ModelFit_SeparatePrecueT1... |
e1ca4dd80c36875fa8c96b09588ff29783fd65af1889bef7b901ee00ab0d4022 | MATLAB | 7,297 | 181 | function varargout = h_utilityGUI3(varargin)
% H_UTILITYGUI3 MATLAB code for h_utilityGUI3.fig
% H_UTILITYGUI3, by itself, creates a new H_UTILITYGUI3 or raises the existing
% singleton*.
%
% H = H_UTILITYGUI3 returns the handle to a new H_UTILITYGUI3 or the handle to
% the existing singleton*.
%
% ... |
db2d29b5ea1324ef73922774e6024ebefcb28f89008efbc9498fadf00b7c67a8 | MATLAB | 7,298 | 172 | function varargout = NodeLabelDirection(varargin)
% NODELABELDIRECTION MATLAB code for NodeLabelDirection.fig
% NODELABELDIRECTION, by itself, creates a new NODELABELDIRECTION or raises the existing
% singleton*.
%
% H = NODELABELDIRECTION returns the handle to a new NODELABELDIRECTION or the handle to
%... |
9080a4d395078b1476e542c127adcdcd8ceec7da3b016404c5d0ae712763a357 | MATLAB | 7,302 | 272 | function [s_all,vmax_all,imax_all,dips_mom_all,dips_loc_all]=SMusic_v1(patt,V,ns,grid,para);
% calculates two distributions from a given pattern;
% Each distribution is calcutaled as a Music-scan with
% best dipole from other distribution projected out.
% This is solved by an iteration with details subject to modific... |
1039ffa46a283293ac750dabe660a2fa8d3a16a2524a7647e15ff2199f858985 | MATLAB | 7,303 | 197 | function [trl,eventslist]= taskTrialVarFun(cfg)
% Defines trials with t = 0 at a stimulus onset marker, based on
% response
% Sonya Bells
% Based on Simeon Wong's code (includesBasedTrialFun)
%%Required Inputs %%%
% cfg.dataset - path to CTF dataset
% cfg.trialdef.t0marker - defines the t = 0 of each tr... |
b5a32d853c07bc6df771abfc8418f3f01c017ac4617eeb103ba379b386983331 | MATLAB | 7,303 | 199 | function flytrack_stats_fn(file_list, assayTime, framerateSet, noflyBool, noflyPos, ...
topHeight, bottomHeight, diameter)
%% initialize settings
% This script loads output data from the flytrack_video script, collapses
% data from multiple replicates, and performs a bit of visualization.
% Jeff Stafford
% Fil... |
e1acd9aa7bd872a65abdb04ced7c7f11fefc94a595e9b0314fe5e7595c7b2321 | MATLAB | 7,303 | 220 | function M = fixedrankfactory_2factors(m, n, k)
% Manifold of m-by-n matrices of rank k with balanced quotient geometry.
%
% function M = fixedrankfactory_2factors(m, n, k)
%
% The first-order geometry follows the balanced quotient geometry described
% in the paper,
% "Linear regression under fixed-rank constr... |
e8c0f3c0139e16369754c1dcebb08429980315517a724d842353ead12eb78b6a | MATLAB | 7,308 | 235 | function [X_train, Y_train, X_test, Y_test] = getCrabsData()
%
% First column: true label
% 0 = Blue male
% 1 = Blue female
% 2 = Orange Male
% 3 = Orange Female
%
crabs = [...
0 1 8.1 6.7 16.1 19.0 7.0;
0 2 8.8 7.7 18.1 20.8 7.4;
0 3 9.2 7.8 19.0 22.4 7.7;
0 4 9.6 7.9 20.1 23.1 8.2;
0 5 9.8 8.0 20.3... |
d9742b1b1867c8d0c7f7503d3844f2b6cde2503f8080b7a88dbae255b3f5df7d | MATLAB | 7,309 | 195 | %% Bins data into time and position bins
%Chad Heer; Sheffield lab
%INPUTS
%data = data array to be binned
%behavior = single plane behavior data
%trackLength = length of track in cms
%frames = frame numbers to be binned
%normalize = 0 or 1 if data should be normalized
%good behavior = single plane output of remove ... |
8f05849c9e83e3a836e8563ac2e8437b122f31b736fb782703852ee522551ef7 | MATLAB | 7,310 | 240 | function showsurface(vc,para,varargin);
% plots volume conductor/cortex as surfaces
% eventually plus sources/dipoles
% usage: showsurface(vc,para,source1,source2,....);
%
%
% vc is a structure with two fields:
% vc.tri is Nx3 matrix of integers where each
% column denotes the indices of three points
% ... |
3823847bf2ed46d5847369ba853e6f26893a55b7a9756ed8989575c7e52b419e | MATLAB | 7,311 | 134 | function [MuscleLength, MuscleVelocity, MuscleMomentArmProximal, MuscleMomentArmDistal] = ...
MuscleTwoJoints_JointAngles(a1,a2,phi1,phi2,R1,R2,f1,f2,n1,n2,ls,alpha1,alpha2,alpha1_dot,alpha2_dot,handrule)
% MATLAB code provided by Seyed Mohammad Ali Rahmati
% Affiliation: Biomechanics and Motor Control Lab, ... |
77931ba4b4a3ba6fee250d3847ddefc1abbd11067f6b5445685d280e88fc23b3 | MATLAB | 7,315 | 228 | function ft_plot_topo3d(pos, val, varargin)
% FT_PLOT_TOPO3D makes a 3-D topographic representation of the electric
% potential or field at the sensor locations
%
% Use as
% ft_plot_topo3d(pos, val, ...)
% where the channel positions are given as a Nx3 matrix and the values are
% given as Nx1 vector.
%
% Optional in... |
cae1f5d39970f175702d3ddf7d2c2d343fba512873048d34e4a4cbdd8c53bd53 | MATLAB | 7,317 | 228 | function ft_plot_topo3d(pos, val, varargin)
% FT_PLOT_TOPO3D makes a 3-D topographic representation of the electric
% potential or field at the sensor locations
%
% Use as
% ft_plot_topo3d(pos, val, ...);
% where the channel positions are given as a Nx3 matrix and the values are
% given as Nx1 vector.
%
% Optional i... |
8d6543e5e1d7bd611ad57381a2c91a38ef1d6e2801d842758bdd0f1cd257def5 | MATLAB | 7,320 | 193 | function hdr = read_ricoh_header(filename)
%% READ_RICOH_HEADER reads the header information from continuous
%% or averaged MEG data generated by the Ricoh MEG system and software
%% and allows the data to be used in FieldTrip.
%%
%% Use as
%% [hdr] = read_ricoh_header(filename)
%%
%% This is a wrapper function aroun... |
3b24281f88fa18e3e6667341c4a9a6ee8587e1e9958f18ff45eb3c9f4d55c1bf | MATLAB | 7,321 | 214 | function COR = modelr(COR,cfg)
% <*LAN)<]
% v.0.0.11
%
%
%
% Realiza modelos usando R
% COR estructura de datos
% .cfg configuraciones
% .model = formula del modelo segun R
% 'rt ~ BETA'
% .command = comando a utilizar
% 'lme' linwae mixed effect model
% ... |
7d9afa12b4c5c041e9f55af1a4c853003fdd35c31c0e4e4a84d7db2581a5bb49 | MATLAB | 7,330 | 259 | % this script displays the voltage trace from the .wcp file from a patched
% cell.
% It imports the first five (V input, I input, light TTL output,
% camera frame input, blue light activation TTL input) channels
% Applies a gaussian filter to data.
% Returns dummy data for ALL the returned (and thus required) variab... |
7dc9edcb1be584ae87e82a349faff5afbde1fbda3075275f34d532e48012c3ea | MATLAB | 7,331 | 181 | function [] = CBIG_gwMRF_check_unit_test_result(output_dir)
% [] = CBIG_gwMRF_check_unit_test_result(output_dir)
%
% This function compares the output of unit test with the ref output
% on our HPC server to make sure the codes work fine.
%
% '[FAILED]' message indicates something wrong with the codes, the
% unit test ... |
9db56aa8691a8654ac1fe1ce889505303d6f8c60de6d52b005bb271e679a3f0a | MATLAB | 7,332 | 195 | classdef (Abstract) surfaceDetector < handle_light
% Extract a surface point cloud from a data stack
%
% This is an abstract handle class that needs to be implemented for
% specific cases such as the wing disc.
%---------------------------------------------------------------------
% l... |
2dc34b2fab638286ec2c4ccb76dc5eafced17d9d901e3710d3ce31bf0be1afff | MATLAB | 7,333 | 183 | function spkDat = UnitToSpkDat(unit, baseDir, varargin)
%% in progress--incomplete!
unitInfo = arrayfun(@(u) strsplit(u.name, ' '), unit, 'UniformOutput', false);
rat = cellfun(@(u) u{1}, unitInfo, 'UniformOutput', false);
date = cellfun(@(u) u{2}, unitInfo, 'UniformOutput', false);
trode = cellfun(@(u) u{3}, unitInf... |
137621305094e10f5d5fc47aed98ab01487b2bbb39abde648095a9ee296ae49a | MATLAB | 7,337 | 186 | function varargout = jbm_synapseAnalysisGUI3(varargin)
% JBM_SYNAPSEANALYSISGUI3 M-file for jbm_synapseAnalysisGUI3.fig
% JBM_SYNAPSEANALYSISGUI3, by itself, creates a new JBM_SYNAPSEANALYSISGUI3 or raises the existing
% singleton*.
%
% H = JBM_SYNAPSEANALYSISGUI3 returns the handle to a new JBM_SYN... |
141e309e12aa3513b528fcf09e95ffa114d852006a57410ffbb3334875206838 | MATLAB | 7,338 | 190 | function [header_array, CateNames, CatLengths, preBaseline] = read_sbin_header(filename)
% READ_SBIN_HEADER reads the header information from an EGI segmented simple binary format file
%
% Use as
% [header_array, CateNames, CatLengths, preBaseline] = read_sbin_header(filename)
% with
% header_array - differs b... |
96cb7e8b2eaf199b1783a9dfa82e9dcc181fd9262428effe309157cc173cf058 | MATLAB | 7,338 | 218 | function [muX,SigmaX,suffStat] = VBA_EKF(y,u,posterior,dim,options,flag)
% standard EKF & computation of the predictive density
% function [muX,SigmaX,suffStat] = VBA_EKF(y,u,posterior,dim,options,flag)
%
% This function inverts any nonlinear state-space model of the form:
% y_t = g( x_t,u_t,phi ) + e_t
% x_t+1 = f... |
5c5ebdca7968ca591505f5064806b62f295227c91abf7ea88264f987cf12c4cf | MATLAB | 7,339 | 274 | function [s_all,vmax_all,imax_all,dips_mom_all,dips_loc_all]=SMusic_v1(patt,V,grid,para);
% calculates two distributions from a given pattern;
% Each distribution is calcutaled as a Music-scan with
% best dipole from other distribution projected out.
% This is solved by an iteration with details subject to modificati... |
2b76995aab51cde2ddb03049f1f01aabfdf01d3796735fcaa92d9690732e99f3 | MATLAB | 7,340 | 243 | % rd_plotTADetectDiscrimContrast.m
% plot performance and contrast by run
%% initial analysis
subject = 'rdnoise_sf1pt5_contrast60';
runs = 13:16;
date = '';
plotLevel = 1;
saveFile = 0;
saveFigs = 0;
[acc, ~, responseData_all, responseData_labels, io] = TADetectDiscrim_analysis(subject, runs, date, plotLevel, saveF... |
49ff71de64048e7005026c8d4709b45a9f09d561dc20c53f774d8d8d925d26d6 | MATLAB | 7,341 | 190 | function [sorted_features ANOVA_pvals] = rank_features_using_an_ANOVA(X_data, Y_labels)
% A helper function that does a one-way ANOVA on each feature and returns a p-value
% for each feature and a ranking of the features based on their p-values.
% Essentially this is a the same as running anova1 separately on each f... |
46620f964c3cba005092736e1e75c6c6ba683e852c3f8cafe3a5d268ef524b62 | MATLAB | 7,343 | 202 | function [filename, headerfile, datafile] = dataset2files(filename, format)
% DATASET2FILES manages the filenames for the dataset, headerfile, datafile and eventfile
% and tries to maintain a consistent mapping between them for each of the known fileformats
%
% Use as
% [filename, headerfile, datafile] = dataset2fil... |
e48afc544ffb123806c37e7a06f86fe1883c04ccb32e61e8efa7536cbc6312f1 | MATLAB | 7,343 | 158 | function [S] = initSettings(S)
%Initialise parameters for the social error monitoring fmri protocol.
% Usage: [S] = initSettings(S);
%
% Inputs:
% : S - struct containing very important info (subject, trigger,
% response box, eyetracker)
% Outputs:
% : S - same as input, with a lot more info (screen, te... |
4ba777f2c63db0056f7e2572fb17340f1f5bf66fdd2d5900cd907530eb470170 | MATLAB | 7,347 | 129 | function best_channels = determine_best_channel(varargin)
% determines best channel for theta, gamma, etc. based on the peak response of the PSD (relative to nearby channels)
%INPUTS:
% - 'all','hpc', 'ofc' or 'vc'
load PSD_data
parameters= list_of_parameters;
if ~isempty(varargin)
switch varargin{1}
ca... |
d2394c7180931a04800033a2ba3e6ce8d5b9206d4b07ee13a587e50d188ba82d | MATLAB | 7,347 | 159 | function Cfg = y_RemoveFirstTimePoints(Cfg,WorkingDir,SubjectListFile,StartingDirName,RemoveFirstTimePoints,FunctionalSessionNumber)
% function Cfg = y_RemoveFirstTimePoints(Cfg,WorkingDir,SubjectListFile,StartingDirName,RemoveFirstTimePoints,FunctionalSessionNumber)
% Remove First Time Points
% Input:
% Cfg - ... |
7a6e605e02257856941a036d854602a0a7251cf6a8f607c1410e2aeafe3e2531 | MATLAB | 7,349 | 124 | %% Decription
% This example showcases the option of letting the thermal media properties
% depend on temperature. A medium is defined that has a volumetric heat
% capacity (VHC) that increases drastically when the temperature is around
% 40°C. Such a medium is not particularly realistic, but serves to
% showcase the f... |
d2467fc1a4c5873f7b967a135b68309308598cd64f593b9cd92bc48fe4f55795 | MATLAB | 7,349 | 203 | function trim_dat(basepath,varargin)
% trim_dat removes parts of the dat file that does not contain neural data,
% either from unplugs.
% Dependenies: one signal per channel dat files from intan RHD recording
% system.
%
% inputs:
% basepath: path to SNLab data directory for a given session.
%
% optional:
% video_... |
3de168db7eb379a8d86ce007f18efcfd5706a487ef2afd611c57d1dca703e486 | MATLAB | 7,350 | 238 | function M = obliquefactory(n, m, transposed)
% Returns a manifold struct to optimize over matrices w/ unit-norm columns.
%
% function M = obliquefactory(n, m)
% function M = obliquefactory(n, m, transposed)
%
% Oblique manifold: deals with matrices of size n x m such that each column
% has unit 2-norm, i.e., is... |
c8b3130570e8288c6cd6a737333226f539c0d1fdb3b53ab3c7d610c2873ab05b | MATLAB | 7,351 | 289 | function showcs(data,locs,pars);
% usage showcs(data,locs,pars);
% makes head-in-head plots e.g. to show cross-spectra
% data is an NxN matrix where N is the number of channels
% locs is (ideally) an Nx5 matrix:
% 1st column: a channel i gets a circle only if locs(i,1)>.5
% if locs is an Mx5 matr... |
acf5f3b67e771cf605500806a7225fe4a861320627c66dd88f2e3ae9aea7cbfd | MATLAB | 7,353 | 200 |
function [pulses] = bz_getAnalogPulses(varargin)
% [pul, val, dur] = bz_getAnalogPulses(varargin)
%
% Find square pulses. If not argument it provided it tries to find pulses
% in intan analog in file.
%
% <OPTIONALS>
% analogCh List of analog channels with pulses to be detected (it support Intan Buzsaki Edition).... |
edc9c7870ed977c995c1710970e7eb800f0d65f98e5db66103306c2e7153f101 | MATLAB | 7,359 | 234 |
%%%%%%%%%%%%%%%%%%%% SHOW EXTRINSIC RESULTS %%%%%%%%%%%%%%%%%%%%%%%%
if ~exist('show_camera'),
show_camera = 1;
end;
if ~exist('n_ima')|~exist('fc'),
fprintf(1,'No calibration data available.\n');
return;
end;
check_active_images;
if ~exist(['omc_' num2str(ind_active(1))]),
fprintf(1,'No calibratio... |
f0492e5934de7684492e526f6621ebb8df402ae6373bac0d38b7e761c48db4c1 | MATLAB | 7,360 | 212 | function [data] = fixdimord(data)
% FIXDIMORD ensures consistency between the dimord string and the axes
% that describe the data dimensions. The main purpose of this function
% is to ensure backward compatibility of all functions with data that has
% been processed by older FieldTrip versions
%
% Use as
% [data] = ... |
2d776b9fa32822946f4f87962b247f2f0d764c1cd2f0911bf1c6080441fe8abe | MATLAB | 7,364 | 186 | classdef SquareMatPatch < diffgeometry.ComponentPatch
% ComponentPatch that is a square matrix
% We can then calculate trace, determinant, matrix inverse etc.
%---------------------------------------------------------------------
% license
%---------------------------------------------------... |
47316be1fcb31a8628a5fa1375fcd3ee7e5e198577401737fbc97b88fe99801f | MATLAB | 7,365 | 200 | function [mri, seg, hdr] = read_asa_mri(fn)
% READ_ASA_MRI reads an ASA format MRI file
%
% Use as
% [mri, seg, hdr] = read_asa_mri(filename)
%
% The raw image data is returned, together with the position of the
% external head markers in raw image coordinates.
%
% In the ASA default PAN (pre-auricular/nasion) coord... |
1ac595611af839caf760abebe55a3604bb65a7c35b39a8ad27d0be1eb8bf365d | MATLAB | 7,367 | 189 | function [hx, hy, hz] = ft_plot_ortho(dat, varargin)
% FT_PLOT_ORTHO plots 3 orthographic slices through a 3-D volume and interpolates if needed
%
% Use as
% ft_plot_ortho(dat, ...)
% or
% ft_plot_ortho(dat, mask, ...)
% where dat and mask are equal-sized 3-D arrays.
%
% Additional options should be specified in k... |
97aaba402418a8cc325a3e99e7a8b2386b51df0e1a14466b4d772e0b6bfb7a2e | MATLAB | 7,368 | 182 | % note: change current folder to figure "number"
clear all;close all;clc;
rawPath=pwd; %displays the current working directory - set it to the figure "number"
savePath=rawPath;
addpath Panels/
addpath Functions/
load("StaticBars_width900_VS_width300_basedOnRF_Population_All")
load("MovingBars_width900_speed600_width3... |
030c9c15dff9fbb404425c79374ce7c7e91153fba4b1123e1fc51101a9ff2464 | MATLAB | 7,371 | 251 | function [f_fname_multi,g_fname_multi,dim_multi,options,u_multi] = VBA_multisession_expand(f_fname,g_fname,dim,options,u)
% [f_fname_multi,g_fname_multi,dim_multi,options,u_multi] = VBA_multisession_expand(f_fname,g_fname,dim,options,u)
% prepare model to be fitted to multisession data. In particular, it:
% - duplicate... |
d105eb1b787f4290ec1e160a9eeff7b401803f6804a6c527ca470356b5782a19 | MATLAB | 7,375 | 193 | function [header_array, CateNames, CatLengths, preBaseline] = read_sbin_header(filename)
% READ_SBIN_HEADER reads the header information from an EGI segmented simple binary format file
%
% Use as
% [header_array, CateNames, CatLengths, preBaseline] = read_sbin_header(filename)
% with
% header_array - differs b... |
46df2c3cd0de15ded4ef0541c22f0ced83f6f1dd72af2bb8874842f85c3099f1 | MATLAB | 7,377 | 208 | function ft_standalone(varargin)
% FT_STANDALONE is the entry function of the compiled FieldTrip application.
% The compiled application can be used to execute FieldTrip data analysis
% scripts.
%
% This function can be started on the interactive MATLAB command line as
% ft_standalone script.m
% ft_standalone scri... |
3affa253785e282b6c5b73ac30d027d136f795f101be2a3d60aaadf6091680e9 | MATLAB | 7,383 | 200 | function [mri, seg, hdr] = read_asa_mri(fn)
% READ_ASA_MRI reads an ASA format MRI file
%
% Use as
% [mri, seg, hdr] = read_asa_mri(filename)
%
% The raw image data is returned, together with the position of the
% external head markers in raw image coordinates.
%
% In the ASA default PAN (pre-auricular/nasion) coord... |
ff6eed4bbbf176727ad35d763ea2963725f70870f9c158af1e667ab739f9ed46 | MATLAB | 7,383 | 213 | function [varargout]=errorbarxy(varargin)
% ERRORBARXY is a function to generate errorbars on both x and y axes
% with specified errors modified from codes written by Nils Sjöberg
% (http://www.mathworks.com/matlabcentral/fileexchange/5444-xyerrorbar)
%
% errorbarxy(x, y, lerrx, uerrx, lerry, uerry) plots t... |
9743e5c886fec26fbd7a01bbf1d48fdd9011544b8c8f631193c904a294e8752f | MATLAB | 7,384 | 142 | function parallel_BSC_LSS(stat_path,sots_path,exp_folder,N,TR,model,q_level,ground_truth)
% ========================================================================
% Ruslan Masharipov, October, 2023
% email: ruslan.s.masharipov@gmail.com
% ========================================================================
tic
... |
df83b723cc39e0d5f9f5304f89d4c18be879f75cf7498c0a50ec4d87123221aa | MATLAB | 7,384 | 243 | %%
% Redux of the function meant to be used with the 'predictError' class
% generated by the 'sdoMat' and 'sdoMultiMat' classes
% This is the first attempt to separate hypothesis generation from the
% plotting of the significance
% TODO: Add a simple 'isSig' or something.
%testSig(se.errorStruct, se.error_fields, s... |
fd32226e58921a39435fdd71a625146b487805de6f1199149827add3b9e86888 | MATLAB | 7,385 | 164 | function ga_latencyTable(subjects, conditions, srmr_nr)
%% all latecies in one table (for each potential: subject x condition)
% set paths
savepath_ga = getenv('GADIR');
clearvars -except subjects conditions srmr_nr savepath_ga
for icondition = conditions
% get condition info
[cond_info] = get_conditionInf... |
22226d754420a8c6386cbc1219c238a70ebe4aa3fd874424abca7fd3f547a048 | MATLAB | 7,386 | 165 | function [Vx,Vy,reliab] = opticalFlow( I1, I2, varargin )
% Coarse-to-fine optical flow using Lucas&Kanade or Horn&Schunck.
%
% Implemented 'type' of optical flow estimation:
% LK: http://en.wikipedia.org/wiki/Lucas-Kanade_method
% HS: http://en.wikipedia.org/wiki/Horn-Schunck_method
% SD: Simple block-based sum of ... |
fa608cef043494d574608a6f666852cec458dd73ac1fb61162b8ff2fd1184258 | MATLAB | 7,386 | 285 | % Field Trip-related test scripts - Initialization.
% Paths.
addpath('lib-wl-synth');
addpath('lib-wl-proc');
addpath('lib-wl-ft');
addpath('lib-wl-aux');
addpath('lib-wl-plot');
% Colours.
% Mostly cribbed from get(gca,'colororder') (the defaults).
cblu = [ 0.0 0.4 0.7 ];
cbrn = [ 0.8 0.4 0.1 ]; % Tweaked; origin... |
51968053e82d253a35105fecbf2897d680f933fce1f0ef056b8e65abdacb7214 | MATLAB | 7,393 | 168 | %% -------------------------------------------------------
%% Step 1: Initialize model parameters
% Parameters below are consensus parameters for each photoreceptor type.
% see https://github.com/chrischen2/coneLinearization.wiki.git for mathematical details on
% the biophysical model
%% -------------------------------... |
5150e24d34525409b7d700ea8d22767f3c5de45b7b20daa0c647674d4fa65bcb | MATLAB | 7,401 | 191 | function fo=rdir(name,opt)
%RDIR Recursive list directory.
% F = RDIR(NAME) returns a cell array of file names matching NAME.
% NAME may be a cell array of strings, and may contain cascading
% pathnames separated by '/' (or '\') followed by a filename. Wildcards
% (*) may be used both in the final filename, as ... |
5d6f2f853eca271fb68bfd2e9c3faa1fa6e3804bff03bf0e97fd7ee5542a069d | MATLAB | 7,401 | 146 | function CBIG_preproc_FCmetrics( lh_cortical_ROIs_file, rh_cortical_ROIs_file, subcortical_ROIs_file, lh_cortical_data_list, ...
rh_cortical_data_list, subcortical_data_list, discard_frames_list, metric_type, output_dir, output_prefix )
% CBIG_preproc_FCmetrics( lh_cortical_ROIs_file, rh_cortical_ROIs_file, subcor... |
dc5a373ec53be0932a3008f67cd1c996768dc3abb08ce74fc51eb9b210c458d2 | MATLAB | 7,403 | 273 | function [hfig,savename,sortederrs] = PlotFracInliersPerGroup_AR(varargin)
[gtdata,net,pttypes,colors,exptype,...
conddata,labeltypes,datatypes,statname,...
maxerr,minerr,...
hfig,figpos,savedir,savename,dosavefig,prcs,maxprc,...
annoterrdata,annotcolor,annoterrprc,plotannfracinliers,...
APthresh,someallonly... |
a1d93e727f97ae5532af27e97d70eb3dd6e41005d9f4eed83a0734fcb2c54d94 | MATLAB | 7,409 | 155 | function BSC_FRR_FIR(stat_path,sots_path,exp_folder,N,TR,q_level,ground_truth)
% ========================================================================
% Ruslan Masharipov, July, 2024
% email: ruslan.s.masharipov@gmail.com
% ========================================================================
tic
% Number of *... |
61c021cc103e3b6355bd8dbcf1a2cbd9057411ca7e5760dc17488bb6f893f4c5 | MATLAB | 7,412 | 184 | function [R,V] = PhaseSpaceQRS(X,Fs,Period,gr)
%% ==== Phase Space Reconstruction for QRS detection ====== %%
%% Inputs
% X : Input ECG signal (vector)
% Fs : Sampling rate
% gr : Plot or not
%% Outputs:
% R : Index and Amplitude of the R Peaks
% Resp : Reconstructed respiratory signal from the area under the Phase
% S... |
e690cabd2891849016dda24abd08da436deacc4a773603fdd876355876432f47 | MATLAB | 7,418 | 195 | classdef (Abstract) planarDetector < surfaceDetection.surfaceDetector
% planarDetector Extract a surface point cloud from a planar data stack
%
% As opposed to other detectors, the detected surface is
% represented not only by a PointCloud object but also by an image
% surfaceMatrix, containing z va... |
51349c3d0e7e7ee9812460ad08b642570abb99f9c28a5be04f8d76323cef01fa | MATLAB | 7,421 | 191 | function varargout = w_ApplyFDR(varargin)
% W_APPLYFDR MATLAB code for w_ApplyFDR.fig
% W_APPLYFDR, by itself, creates a new W_APPLYFDR or raises the existing
% singleton*.
%
% H = W_APPLYFDR returns the handle to a new W_APPLYFDR or the handle to
% the existing singleton*.
%
% W_APPLYFDR('CALL... |
9d25a33d353427f0fffaac1e34988183d1ef45a08f136139c0b4e745fa4e1ec7 | MATLAB | 7,421 | 178 | function [varargout] = bivariate_common(cfg, varargin)
% BIVARIATE_COMMON makes a selection for a specific reference channel from a
% bivariate (i.e. connectivity) dataset and returns that selection as a univariate
% dataset. This is used in singleplot/multiplot/topoplot for both ER and TFR data.
%
% Use as
% [varar... |
7b95d023e82500893b11e31023fdc4473f0718916c952ac909794b3102b2a55a | MATLAB | 7,427 | 167 | function [CheckingPass]=y_CheckDataOrganization(WorkingDir,StartingDirName)
% FORMAT [CheckingPass]=y_CheckDataOrganization(WorkingDir,StartingDirName)
% WorkingDir - Define the working directory
% StartingDirName (optional) - Define the StartingDirName
% Output:
% CheckingPass - if passed checking
%_______... |
495857b11d30722d88d2d93d7dd890de8532920fafac37eab04a9bca56763da2 | MATLAB | 7,429 | 208 | function mask = meshtovoxels(varargin)
% meshtovoxels Voxelize a closed mesh
%
% Syntax
% ------
% mask = meshtovoxels('Faces', F, 'Vertices', V, 'XGridVector', X, 'YGridVector', Y, 'ZGridVector', Z)
% mask = meshtovoxels('f', F, 'v', V, 'x', X, 'y', Y, 'z', Z)
%
% Desc... |
ac9dfc881aa48f967d1472050c7a614489fe6f68b093a63e3c6f171367a28d56 | MATLAB | 7,430 | 191 | function [mri] = align_neuromag2acpc(mri, opt, template)
% ALIGN_NEUROMAG2ACPC performs an approximate alignment of the anatomical
% volume from NEUROMAG towards ACPC coordinates. Only the homogenous transformation
% matrix is modified and the coordsys-field is updated.
%
% Use as
% mri = align_neuromag2acpc(mri)
% ... |
bc1d68cb6747a8c9a926e7fc7ce7ed4e3ae2f5c7e49cd41d76ba3dfd04a67a58 | MATLAB | 7,432 | 283 | function [EJEX, EJEF] = plot32(DATA, CHAN_LAB, EJEX, EJEF,normal,CAXIS,title)
%
% e.g. plot32(controles, chanlocs, EjeX,EjeF,1,[-4 4])
%
% DATA = signal in matrix 3d
% CHAN_LAB = estructure with channel labels (CHAN_LAB(x).labels) eeglab.
% EJEX = times
% EJEF =
% normal = 1 -> z-score
%
% Big Induced TFs charts plot... |
138fb5e6cc1ea2c78f012d92105e0c885413df0db345157517ca0c3caff8c33e | MATLAB | 7,436 | 123 |
useDims = unique([mainDim compDims]);
sc= 1;
for sess = 1 : 8
for dim = useDims
par = par_sess{sess};
cohs = unique(par.dataMat(:, par.idx.sig_coh));
% Create residuals
for sc = 1% : size(allDim_sl{dim}, 1)
dMat = allDim_sl{dim}{sc, sess};
if size(... |
0d7eb0079b4d57f83a3c4552a7f1124d7a92488d51d669bf3bed1e862b71c6d6 | MATLAB | 7,437 | 161 | function metaInfoFigure(filebase)
% no inputs, assumes you're in directory with .dat, .meta, .tsp and .mpg files
%% get filebase if doesn't exist, save
if ~exist('filebase','var')
choice = questdlg('No basename entered, use current directory name as file basename?','No Basename','Yes','Cancel','Yes');
if strma... |
5df4e0ca0b1853cb2ca5d10ea99cea3d942499d4b6887c42fd886624971b6902 | MATLAB | 7,439 | 228 | function [Mean_MMT_Wrist] = Muscle_Moment_G6(x)
% MATLAB code provided by Seyed Mohammad Ali Rahmati
% Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA.
% This script computes the maximum muscle moment averaged over the cycle as a function... |
e3d5ce3dcf8b82b12de4dfaf94411cb4a6d7aa7f69d04875e1c1176039ff8537 | MATLAB | 7,439 | 162 | function CBIG_AuthorTopicEM_VisualizeComponentsOnBrainSurface(params_path, ...
output_dir, discretization_res, min_thresh, max_thresh, ...
colorscale_name, do_remove_small_clusters)
% CBIG_AuthorTopicEM_VisualizeComponentsOnBrainSurface(params_path, ...
% output_dir, discretization_res, min_thresh, max_thresh... |
aada049b04b55b4aba93422f3e673d6d7f0a11659847016e93ec8f307b54707f | MATLAB | 7,445 | 181 | function [trl, eventslist] = searchTaskTrialFun(cfg)
% SEARCHTASKTRIALFUN is the function that filters and organizes trials by
% the designated markers. This function is called by:
% main > fcp_1_taskepoching > ft_definetrial
%
% INPUTS:
% cfg.dataset - path to CTF dataset
% cfg.trialdef.t0marker ... |
5156277f5df2f66c8282f4fb49eba26961c957d613e9c0078e00af1a65b56775 | MATLAB | 7,447 | 194 | function [trl,eventslist]= taskTrialFun(cfg)
% Defines trials with t = 0 at a stimulus onset marker, based on motor
% response
% Sonya Bells
% Based on Simeon Wong's code (includesBasedTrialFun)
%%Required Inputs %%%
% cfg.dataset - path to CTF dataset
% cfg.trialdef.t0marker - defines the t = 0 of each ... |
73b156778c3625801f37fecb1b2d892076e17c48d60e55eea4f9dc51271314bd | MATLAB | 7,447 | 274 | function [ newevents avglongestprobe avgendtotal convergefrac ] = ...
wlProc_doEvAnnealAmplitudeHilbert( ...
oldevents, samprate, hilmag, hilfreq, hilphase, ...
comparefunc, maxprobes, maxtotal)
% function [ newevents avglongestprobe avgendtotal convergefrac ] = ...
% wlProc_doEvAnnealAmplitudeHilbert( ...... |
2b152ab3b02d6cfcf8cd12a81283a45991f81e13e7c9f4da99b98a0f3356cd68 | MATLAB | 7,448 | 259 | function vesselness = vesselness3D(I, sigmas, spacing, tau, whiteondark)
% calculates vesselness probability map (local tubularity) of a 3D input
% image
%
% vesselness = vesselness3D(V, sigmas, spacing, tau, whiteondark)
%
% inputs,
% I : 3D image
% sigmas : vector of scales on which the vesselness is computed
... |
49619814347cbad287aa61efc874052ccbedbdb03786f69c84f1747069dfbb84 | MATLAB | 7,448 | 173 |
%%% center_points tiling_info read_file_name
xxx_min = floor(min(center_points.xxx + min(center_points.xxx_shift,[],2)) - tiling_info.x_pixel./2) -1 ;
xxx_max = ceil(max(center_points.xxx + max(center_points.xxx_shift,[],2)) + tiling_info.x_pixel./2) +1;
yyy_min = floor(min(center_points.yyy + min(center... |
9a59dbae812dd965cf4fee9e41c5e6d56e098420296a17a447954e002ed8d1ba | MATLAB | 7,448 | 314 | function [XO, YO, XI, YI, XP1, YP1, XP2, YP2, XP3, YP3, XP4, YP4, XP5, YP5, theta1, theta2, theta1_m, theta2_m, theta1_FK,theta2_FK, ...
alpha1, alpha2, gamma1, gamma2, beta1, beta2, h1, h2, h3, rho1, rho2, rho1_m, rho2_m, MuscleLength] = ...
MuscleTwoJoints_SegmentAngles(a1,a2,phi1,phi2,R1,R2,f1,f2,... |
113a84ea558e0038b86077f057ac6a197934c4c94118b0452b3ca35d559f3c55 | MATLAB | 7,449 | 202 | %% add fieldtrip to your path
% addpath /Users/liusirui/Documents/MATLAB/fieldtrip-20150506
% ft_defaults
% remember, these channel numbers use one indexing
megChannels = 1:157;
refChannels = 158:160;
triggerChannels = 161:168;
eyeChannels = 177:178;
photodiodeChannel = 192;
%% setup paths
exptDir = me... |
44eaa67fcbaafa9619ce5e7ef682dc5c0fab5bb17d75d8befcff25d16f29d64f | MATLAB | 7,449 | 194 | function [] = visualizeStratifiedMixingMatrix(avgStratMM, stratMM, varargin)
% VISUALIZESTRATIFIEDMIXINGMATRIX This function visualizes a stratified mixing
% matrix using MDS
%
% Inputs
% ------
% stratMM: structure returned by repertoireDating.stratifiedMixingMatrices
% avgStratMM... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.