sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
328a325614291830c72d32957d8f0bbe88232b64477de02454a98a4d072e7937 | MATLAB | 8,248 | 203 | function[fluordata,fluordata_red,fluordata_diff,ROIs,redtemps]= pooldirections4(headpath,fileexpnum,imskip,expskip,deltamode,FrameRate)
% USE FOR EXP2 SLIPS
% point towards wherever the experiment data for matlab
%control is and then pool across experiments for all ROIs
%then will be able to average across indivi... |
ca0c3488054b5ae7fe430228e7f00d6e9f4a721c14c6585fbd1483e72eaac01c | MATLAB | 8,248 | 223 | function [CellClass] = bz_CellClassification (basePath, varargin)
% Loads cell spike waveforms from the local folder, characterizes them and
% separates them into E vs I cells. Manual verification based on clickable
% gui from Shige.
%
%INPUTS
% baseName - basename of files in the local folder (default: pwd)
% 'know... |
523e89ead99705220881c1bc71e1e4574c11276fe96d416c97f867719908989c | MATLAB | 8,249 | 162 | function spikes = ss_dejitter(spikes, maxshift)
% SS_DEJITTER Aligns waveform peaks.
% SPIKES = SS_DEJITTER(SPIKES) takes and returns a spike-sorting object
% SPIKES and dejitters the spike waveforms using a 'center-of-mass'
% method with a maximum shift of 3 (see below).
%
% 'Dejittering' refers to t... |
693a47be9abffbf6d70c1d3c0ff7a39ece4078ce0934910779c0acd81c82c1d5 | MATLAB | 8,252 | 191 | function varargout = impexp_run_nifti2DTDstruct(cmd, varargin)
% Template function to implement callbacks for an cfg_exbranch. The calling
% syntax is
% varargout = impexp_run_nifti2maskstruct(cmd, varargin)
% where cmd is one of
% 'run' - out = impexp_run_nifti2maskstruct('run', job)
% Run a job, and... |
99696953492a6729704cdb6b02dbd6bc80ca7bba3cd7d534f3a9fe70bea9accf | MATLAB | 8,253 | 208 | % pop_export() - export EEG dataset
%
% Usage:
% >> com = pop_export(EEG); % a window pops up
% >> com = pop_export(EEG, filename, 'key', 'val', ... );
%
% Inputs:
% EEG - eeglab dataset
% filename - file name
%
% Optional inputs:
% 'ica' - ['on'|'off'] export ICA activities (or ER... |
7f16399e6c49beb6525d26ee1f7f9a1fe4b68ff8a00b4fd1dd4ad1971638f91c | MATLAB | 8,256 | 171 | % Help for file Nlx2MatTS
% Version 4.1.1
%
% Purpsose
% The purpose of this program is to extract Neuralynx data from a file and load it into the matlab environment with any combination of fields
% from the file within a time or record range or using a time or record list.
%
% Composition
% This program is a matlab ... |
c9a8c02518d4c64cb3ef21def2b28200695cab376191f578ebcfdf641916ae7e | MATLAB | 8,256 | 212 | % Name: Robert Kim
% Date: 05-13-2023
% Email: robert.f.kim@gmail.com
% two_modality_one_layer_lesion_across_models_task.m
% Description: Synaptic-lesion sweep on the one-layer two-modality (instr2)
% RNNs with the CUE/attention held fixed (modality 2), comparing anti vs. pro
% performance. Companion file: two_modality... |
edd8b81df7d8fcece1a24ace2901227a60c7b0bfbf09d13ebad3a8f9f13bc551 | MATLAB | 8,257 | 221 | function CB_movieplayer(handle, events)
%CB_MOVIEPLAYER Callback for UImyfunc.
persistent running direction renderer;
if (isempty(running)), running = 0; end;
if (isempty(direction)), direction = 1; end;
info = guidata(handle); % get data & associated info
% Constants
fpsupdate = 8;
switch(handle),
case {in... |
be391fbc4337dc59fd24f61355d9b663fc21c896d180cb5620499dec817f4f61 | MATLAB | 8,274 | 223 | function hdr = read_yokogawa_header(filename)
% READ_YOKOGAWA_HEADER reads the header information from continuous,
% epoched or averaged MEG data that has been generated by the Yokogawa
% MEG system and software and allows that data to be used in combination
% with FieldTrip.
%
% Use as
% [hdr] = read_yokogawa_heade... |
91fdeea8cc7087d342f8b068b2c89cb515d2625602520de32e491c4bbad7c113 | MATLAB | 8,277 | 316 | function varargout=notBoxPlot(y,x,jitter,style,plotSEM)
% notBoxPlot - Doesn't plot box plots!
%
% function notBoxPlot(y,x,jitter,style)
%
%
% Purpose
% An alternative to a box plot, where the focus is on showing raw
% data. Plots columns of y as different groups located at points
% along the x axis defined by the opti... |
4c2b3685ff18d720a14e7940cb6b3a333a83ef0da613f1314b76621c63b2a9cb | MATLAB | 8,281 | 267 | function [mrStruct, errStr] = nifti_to_mrstruct(mrType, fNameCell, targetMR, tmpDir,resliceFlags)
%
% Import NifTI images into mrstruct
% FORMAT [mrStruct, errStr] = nifti_to_mrstruct(mrType, fNameCell, targetMR, tmpDir)
% ======
% Input arguments
% mrType - a valid mrstruct type (all image, volume, series types
... |
aa82af819c5e634b88e37cddd862923df9056c59f7ac6ef38034fbc75f595f37 | MATLAB | 8,286 | 214 | function plotstrongestdir(avgfluor,redtemps,ROIs,Xpix,Ypix,framerate,maxvec)
%plot the data averaged for each ROI
%show the ROI?
fn=fieldnames(avgfluor);
[numROIs,triallength]=size(avgfluor.(fn{1}));
fig=figure('Position',[1 1 509 458]);
hold on;
subone=subplot(211);
subtwo=subplot(212);
fig2=figure('Position',[509, 1... |
b531c57ace457466bd349ef409f425a1a32ad506e684a6ccfe99b0544cce8840 | MATLAB | 8,288 | 223 | % compsort() - reorder ICA components, first largest to smallest by the size
% of their maximum variance in the single-component projections,
% then (if specified) the nlargest component projections are
% reordered by the (within-epoch) time point at which they reach
% ... |
12972a39eb0d238f6c770665096d051c78d7199fc0e798bac592d8d0be7b79b1 | MATLAB | 8,297 | 214 | function [newnode,newelem,newelem0]=surfboolean(node,elem,varargin)
%
% [newnode,newelem,newelem0]=surfboolean(node1,elem1,op2,node2,elem2,op3,node3,elem3,...)
%
% merge two or more triangular meshes and resolve intersecting elements
%
% author: Qianqian Fang <fangq at nmr.mgh.harvard.edu>
%
% input:
% node: node ... |
7af4dc9adf192a0988dda96fc5f9873f4f8c215830c7ed6cb27140de26d7d657 | MATLAB | 8,298 | 211 | %%*****************************************************************************
%% sqlpcheckconvg: check convergence.
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************************
func... |
575111d150d2558ffdedea7fb28b3babf49c1be4110d8d3eca06e82f62c8a708 | MATLAB | 8,304 | 243 | function [data,stats] = SurveyPhasePrecession(group,clusters,channel,subsessions,varargin)
%SurveyPhasePrecession - Compute and plot phase precession plots for all subsessions.
%
% USAGE
%
% [data,stats] = SurveyPhasePrecession(group,clusters,channel,subsessions,<options>)
%
% group electrode group (e.... |
4b366ffb4ab58c796da4040bddf6fe5e8e4d901f78b7b4fdeae64a46488b08b3 | MATLAB | 8,315 | 210 | % Name: Robert Kim
% Date: 05-13-2023
% Email: robert.f.kim@gmail.com
% two_modality_one_layer_lesion_across_models_cue.m
% Description: Synaptic-lesion sweep on the one-layer two-modality (instr2)
% RNNs with the TASK held fixed (anti-DMS), comparing cued vs. uncued modality
% performance. Same 16-connection lesion gr... |
9662a4ecf4781d40f3ba058f3d59cfdb750a5c39400454f61a0d4e91de5efbcd | MATLAB | 8,318 | 262 | %%% Supplementary Figure 2
ccc;
%% Settings
monkeyCodes = ["XX", "CC"];
monkeyLabels = ["X", "C" ];
panelIDs = ["A", "B" ];
alphaVal = 0.05;
windowOnset = [0, 300]; % ms
windowBase = [-200, 0]; % ms
ncmb = 20;
%% Paths and config
run("private\plotConfig.m");
pdfDir = "..\Docs\Figures\pdf\single";
zenod... |
25ff5ca71b30e708e25d00db22e8da8e2ef488361a40ab310e695cb00c38074a | MATLAB | 8,328 | 355 | function X=ea_linsolve(A,B)
% not a generalized replacement for linsolve but one that omits shearing.
X=ea_absor(A(:,1:3)',B(:,1:3)','dotrans',1);
X=X.M;
X=X';
function [regParams,Bfit,ErrorStats]=ea_absor(A,B,varargin)
%ABSOR is a tool for finding the rotation -- and optionally also the
%scaling and translation ... |
6e6cd9d4decf3758e02a879cb97f2454a6dc5b09be1105bc07a0d5f2414bf124 | MATLAB | 8,334 | 251 | function [pdf, sigma] = circ_ksdensity(T, ti, method, sigma)
%CIRC_KSDENSITY Probability density function of circular data.
%
% -------------
% INPUT
% -------------
% T - circular data values, n-by-1 vector
% ti - vector location in angles of even-spaced points where
% the pdf is to be computed (1:360 for... |
5b9b0b78964d81100234042e2bec3ceeca0dff101d7fc05f97df764a7ee0a2d6 | MATLAB | 8,336 | 180 | % pop_writelocs() - load a EGI EEG file (pop out window if no arguments).
%
% Usage:
% >> EEG = pop_writelocs(chanstruct); % a window pops up
% >> EEG = pop_writelocs(chanstruct, filename, 'key', val, ...);
%
% Inputs:
% chanstruct - channel structure. See readlocs()
% filename - Electrode... |
6ba105031a526862d70ae4058f97a4e7e5445d232e56cb7e4614ad8ae8be7800 | MATLAB | 8,336 | 256 | %MRSTRUCT_ISTYPE assess validity or type of mrStruct.
% truth = mrstruct_istype(mrStruct,typeStr)
%
% If nargin==1 the function checks if mrStruct is a valid MR-Structure.
% If typeStr is provided, the given mrStruct is checked for beeing a
% mrStruct of the given type (image,volume....).
% For performan... |
8823b84e9af3f156a12a2bcab522270a369859a303c507c7dee75517f914ebac | MATLAB | 8,342 | 260 | function [ A ] = PhiIDFull(varargin)
%%PHIIDFULL Computes full PhiID decomposition of input data, assuming it
% follows a multivariate Gaussian distribution and using the MMI PhiID.
%
% A = PHIIDFULL(X, TAU), where X is a D-by-T data matrix of D dimensions for
% T timesteps, and TAU is an integer integration timesc... |
a219aed71dc8b9fc391fdbe0002d2974bcfdd971955e4f85c5ebb7a1ffc3948c | MATLAB | 8,342 | 190 | function [hc] = read_ctf_hc(filename)
% READ_CTF_HC reads the MEG headcoil marker positions from an ascii file
% and computes the coordinate transformation required to get from from
% dewar to head-coordinates
%
% the definition of head coordinates is according to CTF standard:
% - the origin is exactly between LPA an... |
e2c780cd25214386dcf6f3aa37db4fe05fd967b3a365ee181487fc255e3ade4b | MATLAB | 8,351 | 164 | %% Step 2 Tiny Dancers: Epoching and artefact rejection
clear all
clc
group='12m';
cd(['D:\MUSICOM_EEG\PROC\Step1_processeddatamastoidreref\' group]);
%% access preprocessed files
FileNames = {dir(['*' '_PROC.mat']).name} ;
for k=1:1:length(FileNames)
% load data
load(FileNames{k});
baby_name = era... |
42231235c345101a5e39c131940212a79a105792200e91a68fc3395982ac2dd3 | MATLAB | 8,354 | 206 | % std_propplot() - Command line function to plot component cluster
% properties for a STUDY set.
% Displays mean cluster scalp map, ERP, ERSP;
% dipole model, spectrum, and ITC in one figure
% per cluster. Only meaasures computed during
% ... |
9d2a7a90aee1504f856c48d05fbdf9ce87ed067e1c6fae0dc52a9c3eaaf1732f | MATLAB | 8,373 | 196 | 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 ... |
6fe48d1fa6c597faa4bc988b36bcabc2f62f87f61242897a97ab9e02ddd35ddd | MATLAB | 8,379 | 253 | function varargout=wtc(x,y,varargin)
%% Wavelet coherence
%
% USAGE: [Rsq,period,scale,coi,sig95]=wtc(x,y,[,settings])
%
%
% Settings: Pad: pad the time series with zeros?
% . Dj: Octaves per scale (default: '1/12')
% . S0: Minimum scale
% . J1: Total number of scales
% . Mot... |
c0b454040ac70baec03216e2a5030e83cee51c1f93bf80086f11a3df2c1405ec | MATLAB | 8,382 | 257 | function smoothed = Smooth(data,smooth,varargin)
%Smooth - Smooth using a Gaussian kernel.
%
% USAGE
%
% smoothed = Smooth(data,smooth,<options>)
%
% data data to smooth
% smooth vertical and horizontal kernel size:
% - gaussian: standard deviations [Sv Sh]
% ... |
35e48a611263ce9b2608bb9ebb561201b4a30dfe42c186e07f20b73de4080210 | MATLAB | 8,385 | 209 | % This code Create three susceptibility phantoms ( total, positive, and negative) (see README.md
% for more details).
%%%%%%%%%%%%%%%%%%%%% VARIABLES %%%%%%%%%%%%%%%%%%%%%%%%
%%% Inputs: %%%
%
% R1map_file- 3D R1 map (1/T1).
% R2starmap_file- 3D R2star map (1/T2star).
% M0map_file- 3D Net magnetization map (... |
4709378b7df9f99d27243a20b4a570b2368df8bcbd6a001333e2d9482ed0afe9 | MATLAB | 8,390 | 167 | function perm_id = rotate_parcellation(coord_l,coord_r,nrot)
% Function to generate a permutation map from a set of cortical regions of interest to itself,
% while (approximately) preserving contiguity and hemispheric symmetry.
% The function is based on a rotation of the FreeSurfer projection of coordinates
% of a s... |
7eed7e80b9bff0f229aafe336db96e86a0465e1e7cfd33d52a493ef5cda1852b | MATLAB | 8,390 | 270 | % Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions
%
%=========================================================================
%
% Copyright (c) 2008 Thomas Yeo and Mert Sabuncu
% All rights reserved.
%
%Redistribution and use in source and binary forms, with or without
%modification, a... |
be931f791d96ed80d43b31a0f0054c310ea565886f850940a8f338e4b141bfdc | MATLAB | 8,392 | 200 | function [elrender,ellabel]=ea_showcorticalstrip(resultfig,elstruct,pt,options)
% This function renders the electrode as defined by options.elspec and
% coords_mm.
% __________________________________________________________________________________
% Copyright (C) 2014 Charite University Medicine Berlin, Movement Disor... |
4577212d1d8ffd5ad2b27c5dbc6834c740e57a88f406eb3b0b1ca2d4a4ea8c34 | MATLAB | 8,396 | 302 | function [dip,xl,xu, ifault, gcm, lcm, mn, mj] = hartigansdiptest_ss(xpdf)
% function [dip,xl,xu, ifault, gcm, lcm, mn, mj]=HartigansDipTest(xpdf)
%
% This is a direct translation by F. Mechler (August 27 2002)
% into MATLAB from the original FORTRAN code of Hartigan's Subroutine DIPTST algorithm
% Ref: Algorit... |
ff339a307c815019256192eeb0691d99e4fa403bce44d09630f267332b78be12 | MATLAB | 8,406 | 256 | % Check for required DAT fields. Skip analysis and print warnings if missing.
% ---------------------------------------------------------------------
% List required fields in DAT, in cell array:
required_fields = {'conditions', 'colors', 'EMO_CAT_SIG_conditions'};
ok_to_run = plugin_check_required_fields(DAT, require... |
eb1028e7905cf7bae1e5d65132139bb8a50ec5a76065c004fb7f74c72ffd7308 | MATLAB | 8,408 | 278 | function mri = MRIread(fstring,headeronly)
% mri = MRIread(fstring,headeronly)
%
% Reads in a volume based on the fstring. fstring can be:
% 1. A stem, in which case the format and full file name is determined
% by finding a file on disk called fstring.ext, where ext can be
% either mgh, mgz, img, bhdr, nii, o... |
34e37eb1d51cad38e2d7cabe16d951f8631d19f186582890e3987c94a99304fc | MATLAB | 8,409 | 224 | classdef source < iosr.dsp.audio
%SOURCE Class of sound source separation source.
%
% iosr.bss.source objects contain information about a sound source
% (including its spatial location). iosr.bss.source objects are passed to
% iosr.bss.mixture objects in order to create a mixture.
%
% IOSR.BSS.SOURCE is a sub... |
e4795d24fa8ed46f727962784957b16177801d6a9187b833f5940a4f0cb437c9 | MATLAB | 8,420 | 266 | %%*******************************************************************
%% randinfsdp.m : creates random infeasible SDP problems with various block
%% diagonal structures.
%%
%% [blk,Avec,C,b,X0,y0,Z0] =
%% randinfsdp(dense_blk,sparse_blk,diag_blk,m,infeas,solve);
%%
%% E.g.
%% randinfsdp([32 2... |
b50bf5a6bd0aae003dcbeb4e249b6277be76a9dcf6de5df2349ca8825419cdce | MATLAB | 8,434 | 223 | function [str, tag, cind] = ea_gencode(item, tag, tagctx)
% GENCODE Generate code to recreate any MATLAB struct/cell variable.
% For any MATLAB variable, this function generates a .m file that
% can be run to recreate it. Classes can implement their class specific
% equivalent of gencode with the same calling syntax.... |
fbac33fc77632e1856eef439da703a511bb760e1bddab3826a4fb5fef023baf5 | MATLAB | 8,435 | 215 | % loc_subsets() - Separate channels into maximally evenly-spaced subsets.
% This is achieved by exchanging channels between subsets so as to
% increase the sum of average of distances within each channel subset.
% Usage:
% >> subset = loc_subsets(chanlocs, nchans); % select an eve... |
b420fc9f7cee21d1ab6db9840798e369c53116dc4d303282561d00eb55e47c78 | MATLAB | 8,436 | 150 | % pop_erpimparams() - Set plotting and statistics parameters for
% computing and plotting STUDY mean ERPimages and measure
% statistics. Settings are stored within the STUDY
% structure (STUDY.etc.erpimparams) which is used
% whenever plotti... |
dd4a238e2a35b9efdd59bf15e477de22f0314791184b0416ec9d2a3d2f2f02e3 | MATLAB | 8,440 | 293 | function varargout=ea_genvat_maedler(varargin)
% This function generates a volume of activated tissue around for each
% electrode.
% Usage: VAT=ea_genvat(coords_mm,stimparams,options).
% ? stimparams is a struct variable with fields U (8*1 with voltage
% entries) and Im (8*1 with Impedance measurements).
%
% This funct... |
c10a4ed644f9ede042eb105c3e6df917591ca530f214281196d98bc4d549aa47 | MATLAB | 8,445 | 251 | %%% Supplementary Figure 6A-B
% Sorted channel-by-time F-value maps for deviance-related responses.
% Structure:
% 1) Load and compute all panel data
% 2) Plot SFigure 6A-B
% 3) Save one MAT file per panel for Zenodo
%
% Notes:
% - No local functions.
% - No mixed upload MAT files.
% - Only final panel-leve... |
3a093755b5ca4fc69edf1d88daaa35691e70f03c73a5608205ac2ab4b9548520 | MATLAB | 8,447 | 311 | function [dip,xl,xu, ifault, gcm, lcm, mn, mj] = bz_hartigansdiptest(xpdf)
% USAGE
% [dip,xl,xu, ifault, gcm, lcm, mn, mj]=HartigansDipTest(xpdf)
%
% INPUTS
%
%
%
%
% OUTPUTS
%
%
% DESCRIPTION
%
% This is a direct translation by F. Mechler (August 27 2002)
% into MATLAB from the original FORTRAN code of ... |
e26d3f316cb646f4b698ed7520a6e316e807d245d0cca727cabf9cd31bafc6f8 | MATLAB | 8,456 | 311 | function ea_generate_probmaps(varargin)
% function that will generate atlas maps from an image based on single
% points.
%
% inputs: pts in mm space or image defining a probability map
% labels for each point as a cellstring
% src images to use as a cellstring
% c 2016 Andreas Horn
% parameters:
othresh=0.9;
numpasses... |
4118c462ef7e2f101267dfb41c8f91c3e621ce25075f69fb28bb5cc80406d9d5 | MATLAB | 8,458 | 234 | % 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, locutoff, hicutoff, filtorder,
% revfilt, usefft, plotfreqz, minphase);
%
% Inputs:
% EEG ... |
881bc05316661d60d3875b28795c7fa53167aab448003d468539fcfc8078cc47 | MATLAB | 8,460 | 184 | %%% extact MUA - THINGS
% v.2-Gemini
% 2024 P. Papale fecit
clear all
addpath(genpath('\_code\code_utils_v2\'));
% constants
monkey = 'monkeyF';
datadir_gen = '\';
temp_folder = '\_temps\';
dates = {'20240112','20240115','20240116','20240118'};
instances = 1:2;
hubs = 1:2;
trial_length = .3;
pre_trial ... |
5d0a6bff2c720fd0e72efbcc3f54f943806e58d322dde1b351058268fbe8a179 | MATLAB | 8,461 | 309 | function generate_maps_refined(varargin)
% function that will generate atlas maps from an image based on single
% points.
%
% inputs: pts in mm space or image defining a probability map
% labels for each point as a cellstring
% src images to use as a cellstring
% c 2016 Andreas Horn
% parameters:
othresh=0.9;
numpasse... |
23daa46723f0fd0adc6061bc9418bd0e789cb90023e7068c7b6ce55a873c3c4a | MATLAB | 8,478 | 282 | function f = vector_plot(velo_data,ch_inx_map,ch_image,scale_factor, iv)
%UNTITLED この関数の概要をここに記述
velo_map = nan(11,15,2);
for jch = 1:116
[x_c, y_c] = find(ch_inx_map ==jch);
velo_map(x_c,y_c,1) = velo_data(jch,1);
velo_map(x_c,y_c,2) = velo_data(jch,2);
... |
323b52bedee9cf14093ec0f8842a87baedab7d86facaf6d8eec26df6298e908e | MATLAB | 8,483 | 221 | function test_stat=NBSglm(varargin)
%NBSglm Permutation-based non-parametric inference using the general
%linear model (GLM). Vectorial implementation, in the sense that a for loop
%is not used for each seperate GLM.
%
% Test_Stat=NBSglm(GLM) operates on each GLM defined by the structure
% GLM.
%
% Te... |
160b208f7c060f18ba1d9ef3244714fee976208cc13e23638948584ba65e4532 | MATLAB | 8,489 | 241 | %% d10_signature_riverplots.m
%
%
% *USAGE*
%
% This script generates riverplots (cosine similarity) for selected
% signature responses against condition and contrast images in DAT. It
%
% # calls a_set_up_paths_always_run_first, then loads DAT/DATA_OBJ*/DATA_OBJ_CON*
% if not already in the workspace
% # loads signa... |
a877b841c9d450344c8efa20dbdcc31287db273a790559f27d83a695a790b31f | MATLAB | 8,490 | 155 | function c = othercolor(n,m)
% OTHERCOLOR alternative colormaps from various sources
%
% OTHERCOLOR(N,M) returns a M-by-3 matrix contaning a colormap given by
% the name N. OTHERCOLOR, by itself, is the same length as the current
% figure's colormap. If no figure exists, MATLAB creates one.
%
% Supported colo... |
7de101c82ec5f51c56e3b71a5ddc5859544828bd43f8eab75f76c0a9ab8746e2 | MATLAB | 8,496 | 180 | function [pval ClusNum] = Clinc_permtest(DATtemp1,DATtemp2,NUM1,NUM2,Lab,V,VoxelDirPermcluster)
% Lab: 1 voxel, 2 ROI
pths = which('Clinc_permtest.m');
[pth,fil,nam] = fileparts(pths);
if Lab==1 %
if isempty(dir([pth,filesep,'permtest_clust']))
mkdir([pth,filesep,'permtest_clust']);
else
rmdir(... |
e97ee63c652c7c93d5a8f3feacce3a1802d1442f42b6c7dfdca280923f08044d | MATLAB | 8,504 | 208 | function varargout = ghostscript(cmd)
%GHOSTSCRIPT Calls a local GhostScript executable with the input command
%
% Example:
% [status result] = ghostscript(cmd)
%
% Attempts to locate a ghostscript executable, finally asking the user to
% specify the directory ghostcript was installed into. The resulting path... |
d5c51e9036bd2772a6cb7a6512dbdc99a51c37df7c9b82a78a9063bbf4980a46 | MATLAB | 8,513 | 137 |
clear all
close all
do_save=1;
do_detrend=1;
varnames={{'dyn1l1p0a','nk1r',[11 12 13 14 15],[-5 -1 36 39]},
{'dyn1l1p0b','nk1r',[11 12 13 14 15],[-5 -1 36 39]},
{'dyn1l1p0c','nk1r',[11 12 13 14 15],[-5 -1 36 39]},
{'dyn2l1p0b','nk1r',[11 12 13 14 15],[-5 -1 36 39]},
... |
0789a70858a21288a43a3eaf070a2be4dba54763a8889803a3fbaef944448f14 | MATLAB | 8,514 | 207 | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function save_nii_hdr(hdr, fid)
if ~isequal(hdr.hk.sizeof_hdr,348),
error('hdr.hk.sizeof_hdr must be 348.');
end
write_header(hdr, fid);
return; % save_nii_hdr
%---------------------------------------------------------------... |
11f96703695736ca4ccfab5c559e3077ce8083a257da871757077165bc5490ad | MATLAB | 8,515 | 141 | function p = makeGBVSParams()
p = {};
%%%%%%%%%%%%% general %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
p.salmapmaxsize = 32; % size of output saliency maps (maximum dimension)
% don't set this too high (e.g., >60)
% if you wa... |
0db8f7f8e5f7e3880dbde1b5db866f8f3ae365d813524dcee2afacf5d9673559 | MATLAB | 8,516 | 218 | function Y = FiltFiltM(b, a, X, Dim)
% FiltFiltM - zero phase-shift digital filter
% The signal is filtered in forward and reverse direction for a zero phase
% distortion. This is equivalent to FILTFILT of Matlab's Signal Processing
% Toolbox, but the direct processing of arrays let this function run 10% to 90%
% faste... |
c5bfd6f5dca5b79b11f93e35802305b085b6b0f01e761a11d29cdb731534a354 | MATLAB | 8,522 | 217 | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function hdr = load_nii_hdr(fileprefix, machine, filetype)
if filetype == 2
fn = sprintf('%s.nii',fileprefix);
if ~exist(fn)
msg = sprintf('Cannot find file "%s.nii".', fileprefix);
error(msg);
end
else
... |
b85030a3c511af1accc595cfa1d0ae2f25efb9e074873e20c265c5454927cf2e | MATLAB | 8,523 | 278 | function uTest_FiltFiltM(doSpeed)
% Unit test: FiltFiltM
% This is a routine for automatic testing. It is not needed for processing and
% can be deleted or moved to a folder, where it does not bother.
%
% uTest_FiltFiltM(doSpeed)
% INPUT:
% doSpeed: If ANY(doSpeed) is TRUE, the speed is measured. Optional.
% OUTPUT:
... |
064fe58080acfeb93730d202d98f9236d991b0028705fce825f94c356d9576c2 | MATLAB | 8,524 | 191 | %% Step 3 Tiny Dancers: ERP analyses
clear all
clc
addpath(genpath('C:\Users\tnguyen\OneDrive - Fondazione Istituto Italiano Tecnologia\Documenti\MATLAB\toolboxes\Giac_ToolBox'));
% load names of all files
group={'3m','6m','12m'};
for g=1:length(group)
cd(['D:\TinyDancers_Movement\fieldtrip_velo\AE_PROC\... |
ab0d579965fbba239f8e4336e61c3a50b1a69ab60dccae14ad41128ecf61578e | MATLAB | 8,524 | 191 | % configure file for operations on streamline trackings results
%
% for BATCH EDITOR system (Volkmar Glauche)
%
% File created by Susanne Schnell
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function roiop = dti_cfg_roiop
% --------------------------------------------------------------... |
325c2782f663af4e2baf354dad3c0d8216fc82b02ac760048d20e7db60ddb295 | MATLAB | 8,530 | 235 | % anova2_cell() - compute F-values in cell array using ANOVA.
%
% Usage:
% >> [FC FR FI dfc dfr dfi] = anova2_cell( data );
%
% Inputs:
% data = data consisting of PAIRED arrays to be compared. The last
% dimension of the data array is used to compute ANOVA.
% Outputs:
% FC - F-value for... |
382833a012b4761afb09d4a0cf9749c8eb7029810ef6bbeaa822affd7bc0bb7a | MATLAB | 8,531 | 201 | function [AllX] = ea_unified_nm_calcvals(vatlist,cfile)
%% Run Lead Mapper:
% --------------------------------------
options = getoptslocal;
options.lcm.seeds = vatlist(:);
%%
% determine whether connectome of use is structural or functional:
[mdl,sf]=ea_genmodlist;
[~,ix]=ismember(cfile,mdl);
options.lcm.seeddef = '... |
7769d5498afefa646d3c8fdf21e7e6cb347db763bddd9913e1b8d1704c929c94 | MATLAB | 8,534 | 249 | function this = gifti_read(filename, this)
% Low level reader of GIfTI 1.0 files
% FORMAT this = read_gifti_file(filename, this)
% filename - XML GIfTI filename
% this - structure with fields 'metaData', 'label' and 'data'.
%__________________________________________________________________________
% Copyrigh... |
a6fd1834056613e702ac735094d5d034b90e6c9499d3a1fc8341fad42d87f4bf | MATLAB | 8,535 | 201 | function [AllX] = ea_networkmapping_calcvals(vatlist,cfile)
%% Run Lead Mapper:
% --------------------------------------
options = getoptslocal;
options.lcm.seeds = vatlist(:);
%%
% determine whether connectome of use is structural or functional:
[mdl,sf]=ea_genmodlist;
[~,ix]=ismember(cfile,mdl);
options.lcm.seeddef... |
1cf9e1bbdde404dc3baa21aa43412a91c7f3f400f8239c57f2e22c27108d4e4b | MATLAB | 8,536 | 239 | function ea_subcorticalsegmentation(options)
directory=[options.root,options.patientname,filesep];
if exist([directory,'mmprocessed.mat'],'file');
return
end
%% find multi files
if ~exist([directory,'mmpreprocessed.mat'],'file');
ea_preparesubcorticalsegmentation(options);
end
[options,mults]=ea_assignpret... |
b03b637abed5da97b5c83afe4f8b85940c32745513fe805c7887e6401e52c6ad | MATLAB | 8,538 | 235 | function [out,LyE] = lye_w(X,Fs,tau,dim,evolve,varargin)
%% [out,LyE] = LyE_W(X,Fs,tau,dim,evolve)
% inputs - X, time series
% - Fs, sampling frequency (Hz)
% - tau, time lag
% - dim, embedding dimension
% - evolve, parameter of the same name from Wolf's 1985 paper. This
% cod... |
5fca91362af4cd1abc1fb4a3b92852e2db3776eecfd54adb2689dee442a5470d | MATLAB | 8,539 | 309 | function [] = Two_attarctors_model()
%% Plot for Fig4
clear;close all
%% create vector filed for the model
Ystart = 1.5; % starting Y value
Ythr = 15; % goal
% Define attractor positions
attractor1 = [Ystart/5, Ystart/5];
attractor2 = [Ythr/5, Ythr/5];
% Define grid
[x, y] = meshgrid(linspace(0.1, 8, 40), linspa... |
72bea1e609996a022b6aad76ecbfabf94a03cc44e59d186a76671b2a06d99a57 | MATLAB | 8,543 | 260 | function CBIG_pMFM_step1_generate_TC_desikan()
% This function is the wrapper to generate parcellated time serises and FCD
% for Desikan parcellation
%
% There is no input for this function as it can automatically get the
% output file from previous step.
% There is no output for this function as it will generate the ... |
f88c7eb2c8b2abf6a5e30c1d928fdea79d46cf29e1ac2a636a3fb6a9c2770395 | MATLAB | 8,552 | 261 | function blks_mean = CBIG_ASDf_Plot400Schaefer19Subcor17Networks_NetworksOnly(corr_mat_row, ...
scalelim, filename_prefix, is_sum)
% blks_mean = CBIG_ASDf_Plot400Schaefer19Subcor17Networks_NetworksOnly(corr_mat_row,
% scalelim, filename_prefix, is_sum)
%
% Plots 18x18 matrix by averaging/summing within/between netw... |
7b65a3b1fc6cb954361331686f1d8d25290a63cb555ce89ea19cb294b91cec0f | MATLAB | 8,558 | 202 | function options = ea_read_bids(options,bids_subject_folder,run)
%% get prefs
if ~exist('options','var') || isempty(options)
options.prefs = ea_prefs('');
end
%% Choose the BIDS subject folder to be imported and read folder structure
if ~exist('bids_subject_folder','var')
bids_subject_folder = uigetdir;
end
... |
1600604144d2757a90c152e0d7a1f90e4412a4f67ddf9f6c80f3488c8704f35e | MATLAB | 8,559 | 203 | function [] = ea_command_line_run(varargin)
% This function is called when lead has multiple inputs. These inputs are
% the patient directories and leadfigure handles with their values. Then,
% the specified command is executed via ea_run without a UI.
%
% For example, to run Segment normalization:
% lead dbs -normaliz... |
ce51b55c5eb11a83084b97cee87d64ce29bf421b7e68dba6827ac7dbbde4f626 | MATLAB | 8,572 | 275 | % This functions computes the SNR based on adjacent frequency bins for the
% power. To do so data is first log tranfomed
%
% INPUTS
% PS input data (channels, frequecies, trials)
% freq second dimention values for the data (frequecies)
% OPTIONAL INPUTS:
% fband range of frequecies to use for... |
afd3a3ef2e966f9cef3455784c1bd04e3722c6901412f855e9f2876bb5db106a | MATLAB | 8,574 | 227 | function fig = video_surface_activity(surface_to_plot, data_to_plot, hemisphere, t, t_interest, ...
is_time_ms, medial_wall, with_medial, cmap, show_colorbar, output_filename, save_video)
% video_surface_activity.m
%
% Draw and save (optional) video of activity data on surface
%
% ... |
4554efd0f63263ea5ea0e6eb390ad0bb7ee4692d67192ce0b4ac6b9598887d75 | MATLAB | 8,577 | 229 | function [cfile, map_list, pathway_list] = ea_discfibers_merge_pathways(obj)
% merges pathways from different .mat files and stores them in the
% LeadGroup folder as "merged_pathways.mat"
% also returns global indices of the first fibers in pathways and the
% corresponding list of pathways' names
myDir = [ea_getconne... |
ec65c84ecf6dc4639df142340fb10e51f301c558373e9f001a8db3c5e122d191 | MATLAB | 8,579 | 247 | function [rate_map, xdim, ydim, occupancy, no_occupancy, spk_locs, pos_locs] = sRateMap(self, varargin)
% [rate_map, xs, ys] = root.plot_rate_map(cel, varargin)
%
% Plots spatial rate map for cell cel = [ tetrode, cell ]
%
% Returns matrix rate_map with x and y dimensions in vectors xs and ys.
%
% ARGUMENTS
% cel ... |
693d36dba6730c0dd67e1267d353fec0f72c2fcb7f411a5b6cc88af556c74607 | MATLAB | 8,583 | 243 | function data = LoadBinary(filename,varargin)
%LoadBinary - Load data from a multiplexed binary file.
%
% Reading a subset of the data can be done in two different manners: either
% by specifying start time and duration (more intuitive), or by indicating
% the position and size of the subset in terms of number of s... |
1f9dfc387bdd03bd48e3c171e73a18f18defb82ae157f5d2e8cef1c546b7b128 | MATLAB | 8,585 | 166 | classdef poisson_naive_bayes_CL
% poisson_naive_bayes_CL is a classifier (CL) object that implements a
% Poisson Naive Bayes classifier. For each class, the expected number of occurances
% (denoted lambda) is calculated separately for each feature/neuron, by taking the mean
% values from the training data for... |
89e3e2ee77d144a1a6f37bc2a2a319fe57249487b216633da9a7d56e72374f63 | MATLAB | 8,585 | 223 | function [y,b] = matchEQ(x,fs,mag,f,varargin)
%MATCHEQ Match the LTAS of a signal to an arbitrary spectral magnitude
%
% Y = IOSR.DSP.MATCHEQ(X,FS,MAG,F) matches the long-term average spectrum
% of X, sampled at FS Hz, to the spectral magnitudes contained in vector
% MAG sampled at frequencies in vector F. X can... |
7836508e992fc98d13232b291a6dee16814afb854bb625d4ae37e8839ad5b277 | MATLAB | 8,591 | 211 | % pop_readegi() - load a EGI EEG file (pop out window if no arguments).
%
% Usage:
% >> EEG = pop_readegi; % a window pops up
% >> EEG = pop_readegi( filename );
% >> EEG = pop_readegi( filename, datachunks, forceversion, fileloc);
%
% Inputs:
% filename - EGI file name
% datachunks - de... |
7c072dc39786df71c5fb1a33e4c2b3c94f2f0dbb9b102682701c02787c05cead | MATLAB | 8,591 | 202 | function varargout = impexp_run_maskstruct2nifti(cmd, varargin)
% Template function to implement callbacks for an cfg_exbranch. The calling
% syntax is
% varargout = impexp_run_maskstruct2nifti(cmd, varargin)
% where cmd is one of
% 'run' - out = impexp_run_maskstruct2nifti('run', job)
% Run a job, an... |
345f902c31207b69d62751f9264e5a21579815d8647b70cb365bdcb43846ccb0 | MATLAB | 8,594 | 219 | % internal function
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
function save_nii_hdr(hdr, fid)
if ~isequal(hdr.hk.sizeof_hdr,348),
error('hdr.hk.sizeof_hdr must be 348.');
end
write_header(hdr, fid);
return; % save_nii_hdr
%---------------------------------------------------------------... |
a1b5b350077dd41ba1789eed6fc69f5eb828fbda32f89581b6c5c6ba29b84183 | MATLAB | 8,595 | 135 | %% Step 2 Tiny Dancers: Epoching and artefact rejection
clear all
clc
%% access preprocessed files
group={'adults'};
for g=1:length(group)
cd(['D:\MUSICOM_EEG\PROC\Step1_processeddatamastoidreref\' group{g}]);
FileNames = {dir(['*' '_PROC.mat']).name} ;
for k=1:1:length(FileNames)
% l... |
daa27b0d15e7eb4b53526a9ab89bcfeed915097c8a89b9d33bf9cf1b28d7ebd3 | MATLAB | 8,600 | 208 | % Batch script: Extracts networks from grey matter segmentations.
% Network analyses is done with other scripts.
%
% Depends on:
% - the matlab nifti toolbox, download from: www/mathworks.com/matlabcentral/fileexchange/8797-tools-for-nifti-and-analyze-image
% - the output created with the 'create_cube_template.m script... |
ebe3a44dbc6e237a5c6aad84c4cb82de7665f37423d9f0aaca13c0505f4af21b | MATLAB | 8,601 | 186 | % function [oneAnimalOutput,barPlot] = plotOneAnimalPkPTresp(anmlROIbyStim,inputF,PTsOnset,treatment,sigPkSDthresh,respFrameWindow,traceDim)
function oneAnimalOutput = oneAnimalPkPTresp(anmlROIbyStim,inputF,PTsOnset,treatment,sigPkSDthresh,respFrameWindow,traceDim)
%% initialize vars
[colors,contrastID] = getContr... |
0ad64748978facebea3cea3b6b86f219063cffa1dd648218dda7f35e0aa40a86 | MATLAB | 8,604 | 241 | function cuts=ea_add_overlay(boundboxmm,cuts,tracor,options)
% This function overlays atlas data over 2d-slice views to be exported by
% LEAD-DBS. The function is called from ea_writeplanes.m
% __________________________________________________________________________________
% Copyright (C) 2014 Charite University Med... |
265d359786feaefc4a33d84344650e092f05bed8b804d021f8e683d8cd19a502 | MATLAB | 8,614 | 289 | function [Bset,nB,mtr] = palm_shuffree(varargin)
% A single function to generate a set of permutations and/or
% sign-flips. This function is a faster replacement to
% palm_shuftree.m when all observations are freely exchangeable,
% i.e., when there are no block restrictions and no tree needs
% to be constructed.
%
% U... |
aeb10701652de8c602bdc385cdd00a570cc5da49381a482a6abd6f6cb2af30e7 | MATLAB | 8,627 | 220 | % Aditch - Loads LabChart's adicht file.
%
% information = LabChart.Aditch.information(filename)
% [time, data] = LabChart.Aditch.load(filename)
% 2020-02-10. Leonardo Molina.
% 2023-11-09. Last modified.
classdef Aditch
methods (Static)
function [time, data] = load(filename)
fileP... |
e618ee5a5bf2d217f3f53094d21521272c0adedbce068a1aa827b9f90f98bfb5 | MATLAB | 8,632 | 188 | function ea_get_fiberstate_from_axonstate(ConnectomeName,ID_no_sub,stimdir,side,stimSetMode,native,convert_to_MNI,prob_PAM)
options.subj.subjID = ID_no_sub;
options.native = native;
%settings.connectome = ConnectomeName;
settings.connectome = ['Multi-Tract: ', ConnectomeName];
settings.stimSetMode ... |
4279493b4f0f95c97009ccef51f63875241c36614b286a429b8d54fd32369c27 | MATLAB | 8,633 | 169 | %% extractElectrodePointclouds - Preprocess CT Data for Electrode Artifacts
%
% Andreas Husch
% Centre Hospitalier de Luxembourg, Dep. of Neurosurgery /
% University of Luxembourg - Luxembourg Centre for Systems Biomedicne
% 2014 - 2017
% mail@andreashusch.de, husch.andreas@chl.lu
function [elecsPointcloudStruct, brai... |
4bbe144dfbf5d210fe87debc99d2fa2e56c246840392fb923d256a3080f6ccf4 | MATLAB | 8,634 | 181 | function pm = mvpa_reg_cov_predictive_model(mvpa_dat, fold_labels, varargin)
% mvpa_reg_cov_predictive_model MVPA regression on a covariate via @predictive_model.
%
% Drop-in replacement for the hand-rolled predict()/permutation/bootstrap code
% in prep_3a's domvpa_reg_cov branch and c2a's MVPA bootstrap branch. Every... |
c8dc6cdce31b444eef27ce2d6070f2c75c5efac95462b9cd85c41f420cc4548e | MATLAB | 8,639 | 164 | function smPropPerTimeIntByBoxClass = stratifySmTrackletByBoxClass(smPropPerTimeInterval, boxClass, boxClassCondition, smTrackletIdPerBox)
%STRATIFYSMTRACKLETBYBOXCLASS: split the SM data into groups based on their box classification
%
%SYNOPSIS: smPropPerTimeIntByBoxClass = stratifySmTrackletByBoxClass(smPropPerTimeIn... |
a02fd284770ccf2a456ce33d5e8ca5d9e0f663a9370ce7ab41609a15deafd12b | MATLAB | 8,647 | 294 | function varargout=ea_genvat_dembek(varargin)
% This function generates a volume of activated tissue around for each
% electrode.
% Usage: VAT=ea_genvat(coords_mm,stimparams,options).
% ? stimparams is a struct variable with fields U (8*1 with voltage
% entries) and Im (8*1 with Impedance measurements).
%
% This functi... |
41c1375ad5e2c8dfcb0b5ece7f313ca5ef2957467bcd54d5e23ad958e01c8178 | MATLAB | 8,649 | 196 | % pop_dipplot() - plot dipoles.
%
% Usage:
% >> pop_dipplot( EEG ); % pop up interactive window
% >> pop_dipplot( EEG, comps, 'key1', 'val1', 'key2', 'val2', ...);
%
% Graphic interface:
% "Components" - [edit box] enter component number to plot. By
% all the localized components are plotted. Comma... |
7a6d760355e9aa6392b637c7b66ebdb34e86719624339680e307a692ae4800ad | MATLAB | 8,653 | 207 | function accel = bz_getIntanAccel(varargin)
% bz_getIntanAccel - Get accelerometer data from Intan-generated auxiliary.dat file
%
% USAGE
%
% acc = bz_getIntanAccel(varargin)
%
% INPUTS
%
% basepath -path to recording (where .dat/.clu/etc files are)
% lowpass -numeric value to low-pass filter ac... |
7bb77a7a2e1b2de60f38a40a0082bbd68f5a7eca630635966845bb33031aa63a | MATLAB | 8,654 | 204 | function sout = cvx_solver_settings( varargin )
%CVX_SOLVER_SETTINGS CVX solver settings adjustment.
% CVX_SOLVER_SETTINGS is used to adjust the advaned settings of the
% current solver being used by CVX. Before using this function, please
% read the IMPORTANT NOTE below.
%
% CVX_SOLVER_SETTINGS( <name1>,... |
43daefcf2588c6c88f7768c79f6b1e48942344c0bd0d6e8a79412faf7e94cac7 | MATLAB | 8,655 | 244 | % eeg_checkchanlocs() - Check the consistency of the channel locations structure
% of an EEGLAB dataset.
%
% Usage:
% >> EEG = eeg_checkchanlocs( EEG, 'key1', value1, 'key2', value2, ... );
% >> [chanlocs chaninfo] = eeg_checkchanlocs( chanlocs, chaninfo, 'key1', value1, 'key2', value2, ... );
%
%... |
6469cbaa2f4549668b2712620c161cf200ce9bf189b735188b7a9a8f17a47ee5 | MATLAB | 8,658 | 253 | function corr_mat_parcelOrder = CBIG_ASDf_Plot400Schaefer19Subcor17Networks_thresholded(corr_mat_row, ...
scalelim, filename_prefix, blk_indices)
% corr_mat_parcelOrder = CBIG_ASDf_Plot400Schaefer19Subcor17Networks_thresholded(corr_mat_row,
% scalelim, filename_prefix, blk_indices)
%
% Plots thresholded 419x419 mat... |
b3db30ba88f411073bb692e85a73adf90ad3e0604273a67e09b60cccd5765aa1 | MATLAB | 8,668 | 274 | function map = turbo(m)
%TURBO Turbo colormap.
% TURBO(M) returns an M-by-3 matrix containing the turbo colormap, a
% variant of the jet colormap that is more perceptually uniform.
%
% See also JET, COLORMAP.
if nargin < 1
f = get(groot,'CurrentFigure');
if isempty(f)
m = size(get(groot,'DefaultFigu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.