sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
abd2701e6c947e4a539951aa51707a36ff187243ffa455e9750d22d984346436 | MATLAB | 7,778 | 186 | function Wmat = tess_interp_cortex_LAN(destSurf, srcSurf, isSameSubject, nbNeighbors)
% TESS_INTERP_CORTEX: 3D nearest-neighbor interpolation between two cortex surfaces,hemisphere by hemisphere
%
% USAGE: Wmat = tess_interp_cortex(destSurf, srcSurf, isSameSubject, nbNeighbors)
% Wmat = tess_interp_cortex(... |
a2a8cefc2538d1ca282cbee751e44299e9bffc3a4ca2795700e30a88d0f5548d | MATLAB | 7,780 | 220 | function [options] = VBA_displayMFX(p_sub,o_sub,p_group,o_group,init,within)
% displays VBA_MFX inversion results
options = o_group.options;
try;init;catch;init=0;end
if ~options.DisplayWin
return
end
try;within;catch;within='on';end
if init
pos0 = get(0,'screenSize');
pos = [0.51*pos0(3),0.05*pos0(4),... |
d4b585567bb5837b79986c0dfc3d2164eb2efd107ed1b4d93d05ef29f369d542 | MATLAB | 7,780 | 211 | % This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,... |
92a016a6fc21a5f3289c3a87b3937b8066823b2ffc57e54b4c71ac5ffbbba7e7 | MATLAB | 7,783 | 167 | function varargout = DPABISurf_Install(varargin)
% DPABISURF_INSTALL MATLAB code for DPABISurf_Install.fig
% DPABISURF_INSTALL, by itself, creates a new DPABISURF_INSTALL or raises the existing
% singleton*.
%
% H = DPABISURF_INSTALL returns the handle to a new DPABISURF_INSTALL or the handle to
% t... |
2e79a8aed332dfb285ca16076cc4a5c1c266dad713edac6082cd5558938826c1 | MATLAB | 7,784 | 213 | function [freq] = ft_freqbaseline(cfg, freq)
% FT_FREQBASELINE performs baseline normalization for time-frequency data
%
% Use as
% [freq] = ft_freqbaseline(cfg, freq)
% where the freq data comes from FT_FREQANALYSIS and the configuration
% should contain
% cfg.baseline = [begin end] (default = 'no'), alterna... |
160c2a189b43e4dd31e1a3021f0b54413c85213dc16b66b2e65e33dfb3d2642b | MATLAB | 7,785 | 185 | function [fp_structs, D_fps] = find_all_fps(net, nfps, starting_points, init_radius, max_radius, tolq, varargin)
% Front end to finding fixed points for the Hessian Free optimization code.
%
% net - the matlab structure of the network being analyzed.
%
% nfps - the number of fixed points to find.
%
% starting_points - ... |
4ff3423264cf7cce7e9391a5a47ff48442523cf5b7250e6a0ed8393992bff720 | MATLAB | 7,791 | 226 | function varargout = dirwalk(topPath, visitor, recursionLimit, varargin)
%DIRWALK Generate the file names in a directory tree by walking the tree
%
% Description:
% Function DIRWALK generates the file names in a directory tree by walking the tree
% top-down. For each directory in the tree rooted at directory topPa... |
08f4a2bb5c4fa0d4a807c060262daed906c89522976b610a6d7ca196d13e87a0 | MATLAB | 7,793 | 230 | % calc_ramp_dim
% Adaptend from AZ 2022
% Compute weights for ramp direction
% Includes weights computed with and without lasso regularization and with
% and without Tin neurons included in the population
global par_sess
save_fig = 1;
save_weights_flag = 1;
plot_fig = 0;
for use_lasso_flag = 0 : 1
if use_lasso_fl... |
0f52327b23b5be93d7440dff99883d3e41de616d72e5fcf9c591df62a75e8949 | MATLAB | 7,797 | 285 | function LAN = syn_hilbert_lan_old(LAN, freq, win_cycles)
% V.1.9
% 9.06.2009
%
%
%
%
% Calculate -> syncrony between electrodes througth hilbert transforms
% example:
% LAN = syn_hilbert_lan(LAN, 25, 6);
%
% parameters:
% LAN % matrix 2d elec x time
% freq = 25; ... |
258735a6bc11f99f6e6242786b8cfa42a4e914424027de91b076c6dc091e46a0 | MATLAB | 7,798 | 234 | function [assignment, cost] = assignmentoptimal(distMatrix)
%ASSIGNMENTOPTIMAL Compute optimal assignment by Munkres algorithm
% ASSIGNMENTOPTIMAL(DISTMATRIX) computes the optimal assignment for the
% given rectangular distance (or weight) matrix, for example the assignment
% of tracks (in rows) to observations ... |
44c57446ff1766bccdc288f0e8a28f2a8b1fd934776611154a00ecf9082ed23b | MATLAB | 7,799 | 213 | function [sens] = ft_fetch_sens(cfg, data)
% FT_FETCH_SENS mimics the behaviour of FT_READ_SENS, but for a FieldTrip
% data structure or a FieldTrip configuration instead of a file on disk.
%
% Use as
% [sens] = ft_fetch_sens(cfg)
% or as
% [sens] = ft_fetch_sens(cfg, data)
%
% The sensor configuration can be pass... |
18fe5df176f64d94ecd7d50f5ac14de58fee8c7323baf6d2b41dbcaf5d84f5b0 | MATLAB | 7,800 | 212 | function [O_trans,Spacing,Xreg]=point_registration(sizeI,Xmoving,Xstatic,Options)
% This function creates a 2D or 3D b-spline grid, which transform space to
% fit a set of points Xmoving to set of corresponding points in Xstatic.
% Usefull for:
% - For image-registration based on corresponding landmarks like in
... |
1d2594c3954f1e76ecbdaa65362699343387e8ca98744aa2f8569917edeafbd9 | MATLAB | 7,803 | 268 | % script for simulating networks with other connectivity and
% nonlinearities, and plotting the results shown in ED Fig 5
%% 1d simulations
clear
p = []; %parameter structure
p.n = 8; %number of neurons
p.tau = 1; %single neuron time constant
p.T = 500; %simulation duration
p... |
951503d7f90be29a17c8bbedb72204196a0a555dfc5dd78910bfd3f46d3d7ecc | MATLAB | 7,804 | 233 | % [succeeded,outmatname,trx] = cadabra2ctrax(featname,roiname,moviename,[outmatname],[doflipup],[dofliplr],[rot])
% inputs cadabra mat file output names, loads in the trajectories, and
% converts to ctrax trx format. these trx will be saved to the file
% outmatname (user will be prompted for this name if none given).
... |
72721e1b2a80899e0b9c2b5397bd8d38391314f9ed218c22afa78c7799add40a | MATLAB | 7,806 | 215 | function [Raa,Rab,Rba,Rbb] = get_enrichment_3dMatrix_final(A1, B1, pixel, rmax, xyzshift, distance, step, flag)
% function [xyzshift, d, 0, g] = get_enrichment_3dMatrix(A, B, pixel, rmax, xyzshift,distance,flag)
% calculates enrichment between two 3d Matrix
% For two clusters supposed to be overlaped, set xyzshi... |
d29ef3c5ff65fab49b46a7976335a24acba009c2050dadc561cf35f4e238aab6 | MATLAB | 7,806 | 278 | %%
addpath(genpath('utilites/'))
%% Suppose one has run Part 1 ~ part 4 to get cfg and Eul, then use the following for dynamic visualization
%%
% load in image data
clear imgs;
imgs.im = cfg.vol;
imgs.speed = Eul.Es;%reshape(Eul.Es,[cfg.true_size,length(ti:tj:tf)*nt]);
imgs.flux = Eul.Es.*Eul.Eintp(:,1:end-1);
imgs.Pe... |
ffb6dd87c9171b3359814b56a7992e085c3caf1d02fbae5b66a9318b8b4e35ff | MATLAB | 7,813 | 167 | function varargout = DPABIFiber_Install(varargin)
% DPABIFIBER_INSTALL MATLAB code for DPABIFiber_Install.fig
% DPABIFIBER_INSTALL, by itself, creates a new DPABIFIBER_INSTALL or raises the existing
% singleton*.
%
% H = DPABIFIBER_INSTALL returns the handle to a new DPABIFIBER_INSTALL or the handle to
%... |
09d85bc5178bd5916a00f915351b1a10c3f5d6c31a16654786665f6d6dcc8b79 | MATLAB | 7,814 | 206 | function write_bioimage_mgrid(filename, elec)
% --------------------------------------------------------
% WRITE_BIOIMAGE_MGRID writes BioImage Suite .mgrid files from a FieldTrip
% elec datatype structure
%
% Use as:
% write_bioimage_mgrid(filename, elec)
% where filename has an .mgrid file extension and elec has... |
19403c5f565109999a545b82bb1bcbd62528226fc6bf1037df0cf13fe0567943 | MATLAB | 7,815 | 251 | function [obj] = convert_event(obj, target, varargin)
% CONVERT_EVENT converts between the different representations of events,
% which can be
% 1) event structure, see FT_READ_EVENT
% 2) matrix representation as in trl (Nx3), see FT_DEFINETRIAL
% 3) matrix representation as in artifact (Nx2), see FT_ARTIFACT_x... |
29d0a0665fc99dafcbeec716f7fec65b11451289802a7b1df1f4097bdbb4090a | MATLAB | 7,815 | 251 | function [obj] = convert_event(obj, target, varargin)
% CONVERT_EVENT converts between the different representations of events,
% which can be
% 1) event structure, see FT_READ_EVENT
% 2) matrix representation as in trl (Nx3), see FT_DEFINETRIAL
% 3) matrix representation as in artifact (Nx2), see FT_ARTIFACT_x... |
1a9e5a2da63f033ffd9a6c02ffbcb6be0733e01245866a1a8bec6e1ac5d6f147 | MATLAB | 7,817 | 176 | function data = chanscale_common(cfg, data)
% CHANSCALE_COMMON applies a scaling to specific channel types
%
% Use as
% data = chanscale_common(cfg, data)
% where the configuration contains
% cfg.parameter
%
% For specific channel groups you can use
% cfg.eegscale = number, scaling to apply to the... |
413668d1ee0086e5b17bdcf35e50520b039435ea3a5caa3eb98fb085ae8e42a6 | MATLAB | 7,820 | 114 | if EventDetectionSettings.DetectionMethod==1
elseif EventDetectionSettings.DetectionMethod==2
fprintf(['Making: ',FigName,'...'])
%%%%%%%%%%%%%%%%%%%%
set(gcf,'position',[0,50,1200,600])
%%%%%%%%%%%%%%%%%%%%
ax(1)=subplot(2,3,1);
... |
d33ebebef2093a2d68a5558a3b03f49197679c2820ca749fcdefd1cb214f4430 | MATLAB | 7,820 | 202 | function varargout = showcs3(varargin)
% Function showcs3(V) will display x,y,z cross sections of the volume V
% The planes can be rotated with the mouse, and slice number with the
% sliders.
%
% Example,
% load mri; D=squeeze(D);
% scales=[1 1 0.5];
% showcs3(D,scales);
%
% Function is written by D.Kroon Univers... |
2bfc5b00317af1e350bf2de563ca985afc4c118015714c70da1d34d2ed320e2b | MATLAB | 7,821 | 243 | function passed = ft_test_run(varargin)
% FT_TEST_RUN
% Copyright (C) 2017, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
%
% FieldTrip is free software: you can redistribute it and/or modify
% it under the terms of the GNU General... |
44689f20ca5af9e98c9b37176209b18b62af737d4cf00331867ce09113bc561a | MATLAB | 7,823 | 208 | function model = dgmCreate(G, CPDs, varargin)
%% Create a directed graphical model
%
%% Inputs
%
% G - a directed acyclic graph in topological order reprsented as an
% adjacency matrix.
%
% CPDs - a cell array of conditional probability distributions. Each CPD
% is a struct as created by e... |
6e90e2d4ea1ea2b4deed0615902d527cf32bfc359af6f0812de32fff2cf57560 | MATLAB | 7,825 | 197 | function varargout = VBA_spm_check_version(tbx,chk)
% Check a version number against a Toolbox version
%
% FORMAT tbx = spm_check_version
% tbx - toolbox name {'matlab','octave',...}
%
% FORMAT v = spm_check_version(tbx)
% tbx - toolbox name {'matlab','octave','signal',...}
%
% v - version number {string}
%
... |
3cb8d9799eaa4e5393a2e09315df3e0dc8e02a70aed179205c4ea7c74fe5c9f2 | MATLAB | 7,826 | 258 | function LAN = lan_interp(LAN, cfg)
% <*LAN)<]
% v.0.0.3
%
% Realiza interpolación de canales en ensayos, que estan etiquedados con
% la etiqueta señalada en cfg.type
%
% cfg.type % tag of channnel/trials to interpolate
% cfg.iftypec=0 %
% cfg.bad_elec
% cfg.bad_trial
% cf... |
203df3bc11b255338c015a1583335a5faa1941864fabac1c73afb8ae0f70d8ce | MATLAB | 7,827 | 220 | function savePath = generate_training_set(boxPath, varargin)
%GENERATE_TRAINING_SET Creates a dataset for training.
% Usage: generate_training_set(boxPath, ...)
t0_all = stic;
%% Setup
defaults = struct();
defaults.savePath = [];
defaults.scale = 1;
defaults.mirroring = true; % flip images and adjust confidence maps t... |
e1d34361ee4f2c125d1ed57c4313bd688015b97bf499725a47edcc2ee7e671c9 | MATLAB | 7,828 | 211 | % pop_selectcomps_MARA() - Display components with checkbox to label
% them for artifact rejection
%
% Usage:
% >> EEG = pop_selectcomps_MARA(EEG, gcompreject_old);
%
% Inputs:
% EEG - Input dataset with rejected components (saved in
% EEG.reject.gcompr... |
039376f88a9df93b62dfe60fc1dfd71cca75d727d5a4c17df845114b2463f92f | MATLAB | 7,830 | 232 | function [newdata, events] = ...
wlSynth_traceAddBursts(olddata, samprate, deflist)
% function [newdata, events] = ...
% wlSynth_traceAddBursts(olddata, samprate, deflist)
%
% This function adds a series of oscillatory bursts to a data stream.
%
% "olddata" is the signal to add bursts to.
% "samprate" is the numbe... |
c6faee0cbccab23922afe1cbc89418f25c74e9458feb03a4e6c36a8293e3a06e | MATLAB | 7,832 | 131 | %% Decription
% This is a test to see if enabling all possible FR, FD and T dependences
% works.
%% Geometry definition
model = MCmatlab.model;
model.G.nx = 100; % Number of bins in the x direction
model.G.ny = 100; % Number of bins in the y direction
model.G.nz = 100; % N... |
c4df62dba12b6b58fd17a605d856575d877921ce57230c2fba5403cc1d0bd7ea | MATLAB | 7,833 | 155 | function [Theader,Tline,Tavg, Cheader, MA, matm, mmatm] = ...
boney_segment_prepare_print(P,job)
%prepare_print. Create table elements for the in-line report and fst print.
%
% [Theader,Tline,Tavg, Cheader, MAfn0, MAfn, matm, mmatm] = ...
% boney_segment_prepare_print(P,job)
%
% P .. input files
% job ... |
93af39659962d3a5fd2c5164d21922c42d4ae5766db7225daad787f0ffffe485 | MATLAB | 7,842 | 214 | function ConvertMountainsort2Neurosuite(basepath,basename)
% Converts .kwik/kwx files from Klusta into klusters-compatible
% fet,res,clu,spk files. Works on a single shank of a recording, assumes a
% 16bit .dat and an .xml file is present in "basepath" (home folder) and
% that they are named basename.dat and basename... |
b19eb7f15e0fd3ae1523dc16259a82d5c5538ae7b623bd2adebf5cafe741488e | MATLAB | 7,847 | 193 | function cocos = ConvertTrnPackLocToCOCO(locs,packdir,varargin)
% cocos = ConvertTrnPackLocToCOCO(locs,packdir,...)
% Convert from the original format for json data to the COCO format
% Inputs:
% locs: struct that is created as part of genWriteTrnPack()
% Required to have the following fields:
% movies:... |
20e937253dbb683870c9ea022481e8ca90c1cd44e2377a0f0214891e064f71f5 | MATLAB | 7,848 | 298 | function [C,time,g,s,k, phi, sta, stb] = minTimeGradientRIV(C,g0, gfin, gmax, smax,T, ds, show)
% [C,time,g,s,k] = minTimeGradient(C, g0, gfin, gmax, smax,T,ds, show)
%
% Given a k-space trajectory C(n), gradient and slew constraints. This
% function will return a new parametrization that will meet these
% constraint ... |
4f8d713a9cddde6185aac3f089ec8595d391e0beede4b0ecae07464ea59ad895 | MATLAB | 7,848 | 196 | classdef FileLinkPropertyDefinition < dspace_data.PropertyDefinition
% File-Link properties harbour a list of filenames and a rootpath.
% The rootpath serves to adapt to new environments when data is copied.
%
% Filenames are stored in three parts to save memory: a fixed rootpath,
% a varying s... |
dd2c367c6dd2d8f78a68a4c3892bffa8e9ac6fb69d0b52b0fb5d842aca3c93fe | MATLAB | 7,848 | 265 | clear all;
%close all;
% Showing that PV neurons do not exhibit TI properties
% High frequency case
disp('0.29 * [307, -307] and 3000;3080 Hz frequencies achieve TI with square waves');
disp('0.1*[307; -307] and 800; 820 Hz leads to small amplitude current imbalances that add up');
freq = [1600;1633];
amp1 = 0.61*[307... |
2b7f02bf4743a5838d2f8125fac7308975cc22d2bb0e2ff5b9117e2e2dfd021a | MATLAB | 7,851 | 135 | %% Decription
% This example demonstrates simulations in which the absorption coefficient
% is dependent on temperature, such as in a thermochromic material. For a
% introduction to how fluence rate or temperature dependent optical or
% thermal properties are binned, see example 12.
%
% The geometry is a wedge of therm... |
47f22da7c82568af5b51be3528024146625cf8ec38bd75612163c1f53d3460a5 | MATLAB | 7,860 | 221 | function [dataout] = ft_respiration(cfg, datain)
% FT_RESPIRATION estimates the respiration rate from a respiration belt, temperature
% sensor, movement sensor or from the heart rate. It returns a new data structure
% with a continuous representation of the rate and phase.
%
% Use as
% dataout = ft_respiration(cfg, ... |
5cc3342f6019e8251cbacb8cd0957c80b4d810cf4fe6c21e6fee7905ca052ae4 | MATLAB | 7,860 | 195 | function [headmodel] = ft_datatype_headmodel(headmodel, varargin)
% FT_DATATYPE_HEADMODEL describes the FieldTrip MATLAB structure for a volume
% conduction model of the head that can be used for forward computations of
% the EEG potentials or the MEG fields. The volume conduction model represents
% the geometrical an... |
0b93435625862b6329ac550a3150359340b7fc6fc15771e15f0127799a95d7ca | MATLAB | 7,862 | 223 | function H = w_Call_DPABI_VIEW(BrainVolume,NMin,PMin,ClusterSize,ConnectivityCriterion,UnderlayFileName,ColorMap,NMax,PMax,H,Transparency,Position,BrainHeader)
% function H = w_Call_DPABI_VIEW(BrainVolume,NMin,PMin,ClusterSize,ConnectivityCriterion,UnderlayFileName,ColorMap,NMax,PMax,BrainHeader)
% Function to call y_s... |
28ce8f295a16e95ae2fead5be081eaf013f9eb458d8d766608141b0ed29da953 | MATLAB | 7,865 | 253 | classdef LabelCoreSeqAddModel < LabelCoreSeqModel
% Sequential adding of new landmarks - model
%
% Extends LabelCoreSeqModel for the case where some landmarks already
% exist (nold) and only new ones (nadd) are being added. Old landmarks
% are frozen and cannot be moved.
properties (Transient)
nadd_ ... |
663c10591a34fbbf060bad9c155a2da531519020df9196ad7c4bcf4f35ffc60e | MATLAB | 7,867 | 227 | % This script shows how to run urOMT algorithm and Eulerian & Lagrangian post-processing on a breast cancer dataset
% All personal information in this dataset is anonymous.
% Parameters of urOMT are defined in getPamams.m
% Parameters of Eulerian post-processing are defined in paramInitEULApar.m
% Parameters of Lagrang... |
949b09079815882cb383dcf24caf15b0681044ceb1a96398b6daf258a75db3c2 | MATLAB | 7,870 | 175 | %% NeVRo BHI modeling - C_Brain-HRV computation within ROI
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Script to compute Brain-heart couplings, using the model
% developped by Catrambone et al. (2019).
% All the couplings are averaged with an EEG ROI.
% All timepoints corresponding ... |
3487400ce686ef7634fa0d13aef74bf4d51c66427dba255197ad4ff23e4e7a99 | MATLAB | 7,872 | 259 | classdef SuhPredictions < handle
% AUTHORSHIP
% Primary Developer: Stephen Meehan <swmeehan@stanford.edu>
% Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com>
% Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu>
% Provided by the Herzenberg Lab at Stanford University
% ... |
0db88967193802716d1263fffd9e3483b1775bca7c21c911e55fc6bbefb7b33a | MATLAB | 7,873 | 228 | function [varargout]=errorbarxy_ZN(varargin)
MarkerSizePoint=20;
MarkerSizeCircle=6;
MarkerSize=20;
LineWidth=2;
% 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... |
e9deefb872f158176bacc1e1e394932c8d6f5c2840f102df09183dbd4c5992e3 | MATLAB | 7,876 | 216 | <<<<<<< HEAD
% This script quantifies the effect of filter BW on freq-demod Gerbil data
clear;
clc;
%%
% 'FMFR_GER36_unfilt' is a really good/clean example to look at the effect of filter BW
doSaveFig= 0;
addpath('..\');
all_files= dir(['GrandAvg' filesep '*.mat']);
all_filt_halfBW= [2:20 30 40 50];
print_freq= 12;
... |
287bc55728dbee4141291f974e84e4fcb132165fd3e3eeb047df99eb6ee6fdb3 | MATLAB | 7,879 | 182 | classdef PrecomputedGraph < dspace_graphs.AbstractGraph & dspace_graphs.AbstractHeavyGraph
% This class defines a bidirectional unweighted graph. Connections are stored as a
% (possibly sparse)matrix containing the ids of all connected (target) nodes for each
% (source) node. This representation is well ... |
62fa30aa81d93d185bbeed260acf359b0de043fd5d989f2ef256b7af33e397e5 | MATLAB | 7,882 | 195 | function [headmodel] = ft_datatype_headmodel(headmodel, varargin)
% FT_DATATYPE_HEADMODEL describes the FieldTrip MATLAB structure for a volume
% conduction model of the head that can be used for forward computations of
% the EEG potentials or the MEG fields. The volume conduction model represents
% the geometrical an... |
6e67815d296940a34c5e70665a1daed8e2569b47febd261aca5a51f46771721e | MATLAB | 7,883 | 201 | function [response, timing, quitProg] = showScanStimulus(display,...
stimulus, t0, timeFromT0)
% [response, timing, quitProg] = showStimulus(display,stimulus, ...
% [time0 = GetSecs], [timeFromT0 = true])
%
% Inputs
% display: vistaisp display structure
% stimulus: vistadisp stimulus struc... |
d02130b7e9af68a5fbda20e1016d1b0edaf9fc370ec6c927a8d46e7b87e47871 | MATLAB | 7,890 | 194 | function [ResultBrain_AllWindow, TimeSeries, Header] = y_DualRegression_Window(WindowSize, WindowStep, WindowType, AllVolume, SeedMap, OutputName, MaskData, IsNeedDetrend, Band, TR, TemporalMask, ScrubbingMethod, ScrubbingTiming, Header, CUTNUMBER)
% [ResultBrain, TimeSeries, Header] = y_DualRegression(AllVolume, SeedM... |
581a418bf318bc3fc0f1290741a7a03949d90744d331cb42f9acc07a672698fc | MATLAB | 7,891 | 266 | % TrioEEGBehHists
% histogram depangle + others
clc; clear all; close all;
%% hist vars
load('TrioEEGBehAnalysis.mat','vars','varNames','ylabels','labels');
varNames = varNames([1 2 3]);
nVars = 3; % remove endptvar
vars.srt = exp(vars.srt);
drugNames = {'placebo','drug'};
condNames = {'targLo','targHi','distLo','dist... |
006b4f361ed72152667f3406b840685b1ff507f2f895564e1cb2fbc18d3b24a1 | MATLAB | 7,893 | 209 | function generators = generatorsFixationMovie(modelparams, ...
imEnsemble, runningfixations, xmar, ymar)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
%--------------------------------------------------------------------------
% let's figure out the model type
if isfield(mo... |
d3c6632dde8c1d620678e547354e1662168d27f2d23c8f0d435c04af34fadd52 | MATLAB | 7,898 | 283 | %%cell count
clear all
close all
for i = 1:2
for f = 1:2
cd Example_images/
filename1 = ['220311_8020_1_cs' num2str(f) '_20X_' num2str(i) '_DAPI.tif'];
filename = extractBefore(filename1,'DAPI');
dapi = imread(filename1);
[px, py] = size(dapi);
% figur... |
b7b87daede382622e73c218cd9e20522f6045c016d9c6aac7e1c4abb81f98d01 | MATLAB | 7,899 | 218 | function bnd = prepare_mesh_segmentation(cfg, mri)
% PREPARE_MESH_SEGMENTATION
%
% The following configuration options can be specified if cfg.method = iso2mesh:
% cfg.maxsurf = 1 = only use the largest disjointed surface
% 0 = use all surfaces for that levelset
% cfg.radbound = a scalar... |
0335c22dc5e3ef3f7b631ecd3f444fe37e301b17095d1da97d2a0e6fb20a45bf | MATLAB | 7,901 | 247 | %% Phase locking value for ripple band
mkdir([DIRresultsRipple, '/PLV']);
set(0,'DefaultFigureVisible','on');
for z = 1:num_groups
clear LowGammaData_70_100 smooth_envelope_70_100
%the_channels = good_chan(big_list_indexes{z});
the_channels = (big_list_indexes{z});
size_list = length(the_channels)... |
b444aebf81c28b9c07ee956968118f582d0c647afba85f2a6042f0f8cdbc4a27 | MATLAB | 7,901 | 244 | if strcmp(par1_name,'Eleak')||strcmp(par2_name,'Eleak')
str = 'EL-VARIED';
else
str = strcat('EL=',mat2str(Eleak));
end
strALL = str;
if strcmp(par1_name,'gL')||strcmp(par2_name,'gL')
str = '; gL-VARIED';
else
str = strcat('; gL=',mat2str(gL));
end
strALL = strcat(strALL,str);
if NaF > 0
if st... |
1c3c9053b26e73fe6b0fa2d4beb8a82473609fd4a7996a850b3fa3b640a0a2f4 | MATLAB | 7,902 | 296 | function [hfig,savename,sortederrs] = PlotFracInliers(varargin)
[sortederrs,gtdata,nets,legendnames,colors,exptype,...
conddata,labeltypes,datatypes,statname,...
maxerr,minerr,...
hfig,figpos,savedir,savename,dosavefig,prcs,maxprc,...
annoterrdata,annotcolor,annoterrprc,plotannfracinliers,APthresh,xscale,...
... |
d25775cfdba0ff1c9ed880cdba9707e940db1cab09b9580b1e0cf5cb698f9e2d | MATLAB | 7,914 | 302 | %epa_bias_trans Correlation between guessing bias and accuracy in transition
%
% This script analyzes the performance of all the participants during
% the guessing (i.e., short-rPT) trials of the endogenously driven
% pro/antisaccade (EPA) task and compares it to their performance
% during the transition window, ... |
5f2f9998b4df12fac664dc5882ff0b621a9720c1e7f4e2d9c289baa4bd98414f | MATLAB | 7,915 | 188 | function [RPD, uEpochs, uSubEpochs] = percentiles(NNids, epochs, subEpochs, varargin)
% PERCENTILES This function computes repertoire dating percentiles.
%
% Inputs
% ------
% NNids: N x #Neighbours (integer)
% - defines the k-NN graph
% - entires of this matrix of indices must be in 1... |
ada81d079685acc4e1e00619da64c206875764e6d5378d1e6ab0e6b57571f7b5 | MATLAB | 7,918 | 210 | function [qh,ph,food_start_ph,ax,X,Y,G] = plot_prob_gradient(ax,sites,simParam,use_grid_visits_as_color,colorMap,quiverArgs,pcolorArgs,startArgs,targetArgs,showPreviousTarget,prevTargetArgs,showGradientMagnitude,sites_jackknife,show_jk_avg,calc_significant_path_args,use_color_quiver)
% [h_sites,h_steps,food_start_ph] =... |
e566072b6afeeb76a468ffe82b29f70512a44fe3bda4364e62c7ceebbf71c1e4 | MATLAB | 7,923 | 149 | classdef TimeIndicatorPanel < TimelinePanel
methods
function obj = TimeIndicatorPanel(controller, varargin)
obj = obj@TimelinePanel(controller, varargin{:});
end
function h = hasTitleBarControls(obj) %#ok<MANU>
h = false;
end
function cr... |
9f8e523db95dbea5f2a3decbe03bdefb86b9d7a825cf16d6ce9ab61710eb63cb | MATLAB | 7,924 | 292 | %ScriptGTDataSetParameters
% info is nlabels x 1 x 3, where last 3 indices correspond to
% movie, frm and trx_id
assert(exist('exptype','var')>0);
nets = {'openpose','leap','leap_orig','deeplabcut','deeplabcut_orig',...
'dpk','unet','resnet_unet','mdn_joint_fpn','mdn_joint','mdn','mdn_unet','cpropt'};
legendnames... |
8324115b6d9ad768e4974ec2a57e6c8d2a953e915e208d479230c9bca8fb0789 | MATLAB | 7,927 | 209 |
ROUNDS = 1:params.NUM_ROUNDS;
for roundnum = ROUNDS
summed_norm = load3DImage_uint16(fullfile(params.registeredImagesDir,sprintf('%s_round%.03i_%s_%s.%s',params.FILE_BASENAME,roundnum,params.PUNCTA_CHANNEL_SEG,regparams.REGISTRATION_TYPE,params.IMAGE_EXT)));
%Add a clamping step
summed_norm(summed_norm>p... |
7a4b6b63eff1078ef483d88d2fd08796dbe2593af3e42b361e1de896f1b75407 | MATLAB | 7,933 | 277 | function [A,fH,figNames] = meg_plotTF(data,p,selectedChannels,selectedFreq)
% MEG_PLOTTF(data,p,selectedChannels,selectedFreq)
%
% INPUT
% data
% structure of condition cells containing
% data matrix, time x channels x trials
% selectedChannels
% vector of meg channels to inspect
% selectedFreq
% vector of ... |
4f1f1166b4e696c286291a0bf4dc9be0ecd6ed82c9669268c49072f293d40c6f | MATLAB | 7,940 | 182 | function Iout = image_interpolation(Iin,Tlocalx,Tlocaly,Interpolation,Boundary,ImageSize)
% This function is used to transform an 2D image, in a backwards way with an
% transformation image.
%
% Iout = image_interpolation(Iin,Tlocalx,Tlocaly,Interpolation,Boundary,ImageSize)
%
% inputs,
% Iin : 2D greyscale... |
2bf4c592fee288dbadd5bd395ae217d55327f8b06cc78fd2461da5f1d9688ec0 | MATLAB | 7,941 | 216 |
function rhdInfo = ReadRhdInfo(rhdFile)
% 3/24/2017 M. Farries
% Adapted from read_Intan_RHD2000_file, Version 1.3, 10 December 2013
% Reads Intan Technologies RHD2000 data file generated by evaluation board
% GUI.
s = dir(rhdFile);
filesize = s.bytes;
fid = fopen(rhdFile, 'r');
% Check 'magic number... |
aa2488c5db0ff7b4f2d0f1d32a69aa1821938a58aa22d167d82dd661d3e1c261 | MATLAB | 7,941 | 132 | %% Test correlation between popularity in network and strength of relations
s = 1;
subj = subject_names(s).name;
disp(s)
% Defining subject-specific directories
current_subject_dir = fullfile(all_subjects_files_dir, subj);
current_subject_RDM_dir = fullfile(RDMs_output_files_dir, subj);
% Reading the subject... |
fac695acb3133e81dd2307d30ca596e57fdaf1624021c3daa9d139936a8a3a51 | MATLAB | 7,942 | 162 | function results = predict_kernels(datadir, kerneldir, resultsdir, HMM_name, varN, iterN, Fn, Kn)
% results = predict_kernels(datadir, kerneldir, resultsdir, HMM_name, varN, iterN, Fn, Kn)
%
% runs kernel ridge regression to predict behavioural variables (here age
% and intelligence in HCP dataset) using different embe... |
dcdfec944972e5ac29bafd150e1491348c98a0707f0c7679e135f34c5a4073c1 | MATLAB | 7,955 | 199 | function M = sympositivedefinitefactory(n)
% Manifold of n-by-n symmetric positive definite matrices with
% the bi-invariant geometry.
%
% function M = sympositivedefinitefactory(n)
%
% A point X on the manifold is represented as a symmetric positive definite
% matrix X (nxn). Tangent vectors are symmetric matri... |
35cf59bfd8a5604103ddb90f3f04e5e101332c0ccd916621a6d634bc40a1abe9 | MATLAB | 7,967 | 177 | function bbs = bbNms( bbs, varargin )
% Bounding box (bb) non-maximal suppression (nms).
%
% type=='max': nms of bbs using area of overlap criteria. For each pair of
% bbs, if their overlap, defined by:
% overlap(bb1,bb2) = area(intersect(bb1,bb2))/area(union(bb1,bb2))
% is greater than overlap, then the bb with the l... |
062c3e0a0c068a73edc5313b2554a2a145616a6a5e69f45101856beeeb3063a2 | MATLAB | 7,968 | 244 | % Plots preplay decoding results from shuffling cell identities
%
% The script runShuffledDecoding.m generates the files this script plots.
%% Choose which varied decode parameter result to analyze
shuffleToPlot = "singleClusterCells";
%% Load results
switch shuffleToPlot
case "clusterIndependent"
var... |
28e789ba0947edca25ffdfa32a3ec1af407029ee1efea8ffb9c6f12061077d1e | MATLAB | 7,969 | 218 | classdef GridViterbi < handle
% Coordinate notes
%
% Heatmaps are indexed by coords (p,q). Heatmaps are typically "big". The
% heatmap location may move relative to the original/raw movie so that
% hm(1,1) in general represents a different raw movie location in each
% frame.
%
% AC-windows are squa... |
535bb2a499635781cc30cd790fa0bfb30fc87bf11c1503f96525eb625f1059d9 | MATLAB | 7,979 | 179 | %% Harmonization report html
function ReportHarmonization(SiteInfo,HarMethod,PicPath,Data_beforeHarmonization, Data_afterHarmonization)
%
% Inputs:
% SiteInfo - Vector containing site information for each sample
% HarMethod - String specifying the harmonization method used
% PicPa... |
3262aa958c72d0c7e85d956efbae12cdee68db14f13b6f1a914623b6c36e04ad | MATLAB | 7,983 | 155 | clear all
clc
tmp=pwd;
cd ..
addpath(genpath(fullfile(pwd, 'utils/')));
addpath(genpath(fullfile(pwd, 'spmutils/')));
cd(tmp);
% threshold to binarize individual gray matter mask
gmthre=0.5;
% define outputdir of csv files
csv_outdir=nc_GetFullPath('../4_R_LOESS_curve/');
mraseg_dir=nc_GetFullPath('./com... |
432b5baddfcf74a508ba39ddf4d7155d858beccaf4838c9424be7f626a4b060a | MATLAB | 7,985 | 219 | function bnd = prepare_mesh_segmentation(cfg, mri)
% PREPARE_MESH_SEGMENTATION
%
% The following configuration options can be specified if cfg.method = iso2mesh:
% cfg.maxsurf = 1 = only use the largest disjointed surface
% 0 = use all surfaces for that levelset
% cfg.radbound = a scalar... |
c98839021b2b08518e3053fc1adb708a41526ffd351db251f16e742904646ae2 | MATLAB | 7,985 | 196 | %%SpikeFinder
function [posspikes,negspikes,posspikes_narrow,negspikes_narrow,posspikes_wide,negspikes_wide]=SpikeFinder(data,fs,Settings,DoDisplay)
%Find the location and width of all spikes in the data that adhere to the spike-settings
%
%Input: 'data' Row vector containing data, sampled at rat... |
b9747b9594f66a7b99dd9a3e2211bc6ff9aa1a0b18b18b7a5916416b8e956643 | MATLAB | 7,990 | 332 | function samples = ars(func, a, b, domain, nSamples, varargin)
% ARS - Adaptive Rejection Sampling
% sample perfectly & efficiently from a univariate log-concave
% function
%
% func a function handle to the log of a log-concave function.
% evaluated as: func(x, varargin... |
c64370d2af2144f795fb6b729c73ced0550cf0483f6f64feb6b2f4227e7d8e68 | MATLAB | 7,992 | 193 | % tf = 0 means IIR Butterworth
% tf = 1 means FIR
% tf = 2 means notch
% order = any positive integer
% valuel = low-pass filter cutoff (same as highest bandpass cuttoff)
% valueh = high-pass filter cutoff (same as lowest bandpass cuttoff)
%
% Author: Javier Lopez-Calderon & Steven Luck
% Center for Mind and Brain
%... |
bc8b28f8044794f1e0699942cfb7cd52b244c3763b9486ad525fe6dae2be8bfd | MATLAB | 7,997 | 218 | function ft_compile_mex(force)
% FT_COMPILE_MEX can be used for compiling most of the FieldTrip MEX files Note that
% this function does not put the MEX files in the correct location in the private
% folders, this is managed by a Bash script. In case you are not working with Git and
% you want to recompile the mex fil... |
94beeaba0ebe7a9a777cbba9e74549479223a16ed868da9308f39bcdb3e7921c | MATLAB | 8,001 | 284 | function CompressBigLblFiles(varargin)
if exist('get_readframe_fcn','file') == 0,
p = fileparts(mfilename('fullpath'));
addpath(fullfile(p,'..'));
APT.setpath;
end
[matfile,outfile,lObj,i0,i1,DEBUG,doexit,newprojectfile,isgrayscale,sourceinfoonly] = ...
myparse(varargin,'matfile','','outfile','','lObj',[],.... |
71a61dd4020ed18bd60dbadedcebd8de0654bd3b8b8d438b05d6b24dbcc1b63a | MATLAB | 8,003 | 225 | function H_BrainNet = y_CallBrainNetViewer_NodeEdge(NodeCoordinates,EdgeMatrix,EdgeThreshold,NodeWeight,IsAutoAdjustNodeWeight,NodeNetwork,NodeColorMap,NodeLabel,NetworkIndex,viewtype,SurfFileName)
% function H_BrainNet = y_CallBrainNetViewer_NodeEdge(NodeCoordinates,EdgeMatrix,EdgeThreshold,NodeWeight,NodeNetwork,Node... |
0d9816905566861951d70321f859f0002c8f7499c0f999a935526f167beea421 | MATLAB | 8,005 | 150 | function [all_themes, all_colors] = GetColors()
%c_string{1}={'#575757','#575757', '#64bf5d','#66d35e','#6bfa60','#aaf05c','#aaf05c','#aaf05c','#aaf05c','#dbe859','#dbe859','#e2e759','#ece558','#ece558','#ece558' ,'#f5e357','#a0e782','#68ea9f','#68ea9f','#68ea9f','#68ea9f','#39ecb7','#39ecb7','#39ecb7','#39ecb7','#1de... |
92e863aa24cf919c75706e783e8d6d13d7124c0f6d0f515afe2bba47cbd61e31 | MATLAB | 8,005 | 242 | function [assignment, cost] = assignmentoptimal(distMatrix)
% Compute optimal assignment by Munkres algorithm
% ASSIGNMENTOPTIMAL(DISTMATRIX) computes the optimal assignment (minimum
% overall costs) for the given rectangular distance or cost matrix, for
% example the assignment of tracks (in rows) to observations (... |
dd293a612590bf86250693d3f56e04840716109cdfc6ab5acdb7ea2d65f2640c | MATLAB | 8,006 | 254 | function meg_msFigs_bootstrappedFFT
% function meg_manuscriptFigs_bootstrappedFFT
%% Figure settings
user = 'kantian'; % kantian (personal), karen (lab)
titleVis = 0; % if title vis off, then will plot for appropriate manuscript size
showN = 1; % show n = X annotation
figFormat = 'svg'; % svg
annotateStats = 1;
... |
46dcc200d5eebe11c8e31ff778b234a372ac7d0ad1e92a50d8b9dedeeda7c2d8 | MATLAB | 8,007 | 182 |
%% Descriptive Analysis of Visual Experience of Male during Courtship
% Load workspace with calibration,tracks, and features from FlyTracker:
%load('melanogaster_flytrackeroutput.mat');
load('melanogaster_courtshipdyads_flytrackeroutput.mat');
%% Generate Visual Feature in pre-copulation frames for each assay at 40 ... |
8ff739d10bf83677b2db5e8728218cb01b27d3f99aba8deb759fa16296a7e3f5 | MATLAB | 8,007 | 291 | classdef Coco < handle
properties
j
fname
end
methods
function obj = Coco(jsonfname)
if exist(jsonfname,'file')==0
jsonfname = fullfile(pwd,jsonfname);
end
if exist(jsonfname,'file')==0
error('Cannot find file: %s',jsonfname);
end
txt = readtxtfile(jsonfn... |
39d1adaca22bb69cc7c7d7f187cbe3e15e1d790734b0eed18f1a79d490607784 | MATLAB | 8,012 | 183 | % FT_PREAMBLE_INIT is a helper script that is used at the start of all FieldTrip main
% functions. It checks whether the user specified at lease one input arguments (i.e.
% the cfg) or shows the help of the calling function. It merges the global defaults
% with the cfg. It checks whether the output file already exists ... |
c9d0b4653657116b6d91f7dc7c74111e34e9c53508e74f2323ba71dd848b8ae8 | MATLAB | 8,012 | 273 | %% paths
addpath /groups/branson/home/bransonk/behavioranalysis/code/Jdetect/Jdetect/misc;
addpath /groups/branson/home/bransonk/behavioranalysis/code/Jdetect/Jdetect/filehandling;
rootdatadir = '/groups/branson/bransonlab/mayank/stephenCV/results';
lblfile = '/groups/branson/bransonlab/mayank/PoseTF/headTracking/Fly... |
f35f44b13c55174c4778dde40ecc6f564cd514787f1f7cedd7a056d3150ba391 | MATLAB | 8,012 | 244 | % Seizure Imaging Using FATS-IRES
% 3D - Rotational Dipole
% Abbas Sohrabpour
% 17/7/2018
clear all; close all; clc
cd('../Grid Location and Defined Parameters')
load('UnconstCentLFD.mat')
Norm_K = svds(K,1)^2;
load('Gradient.mat')
load('Laplacian.mat')
load('NewMesh.mat')
load('LFD_Fxd_Vertices.mat')
l... |
39d8481e31f0ba8eefe75f760773f93845c81bfcdd4c1eeadc608449ae327005 | MATLAB | 8,014 | 309 | function Results = run_simulation(varargin)
%% Stochastically simulates synaptic vesicles for given scenario
%
% Syntax: Results = run_simulation(varargin)
%
% Inputs:
% varargin::cell Name-value pairs of parameters (see README.md)
%
% Outputs:
% Results::struct Aggregated results of simulations (see README... |
977b4af0c9014338f758f7fe4c109d5856e6c9d28ec1257fd7e173f61e22dacc | MATLAB | 8,014 | 248 | function [ output_args ] = CorrAnalysisActionMod(TaskLabel,varargin )
%SPECIFICITYANALYSIS Summary of this function goes here
% Detailed explanation goes here
% [varargin,PThresh]=Utilities.ProcVarargin(varargin,'PThresh',.001);
[varargin,saveFig]=Utilities.ProcVarargin(varargin,'saveFig');
[varargin,Labels]=U... |
dca6ed24e78999b45aefe66240baa2e14c0513fe98b6f4a52fbc7b11c3b68988 | MATLAB | 8,016 | 350 | % EMD.M
%
% G. Rilling, July 2002
%
% computes EMD (Empirical Mode Decomposition) according to:
%
% N. E. Huang et al., "The empirical mode decomposition and the
% Hilbert spectrum for non-linear and non stationary time series analysis,"
% Proc. Royal Soc. London A, Vol. 454, pp. 903-995, 1998
%
% with variations r... |
5d1c818a450a23c653562c15340f33e4f98a0944c7020f6fb321a99fdd7cb2fa | MATLAB | 8,018 | 187 | % Get location data from dataset, in dewar coordinates, in millimeters.
% Get trial classification information from dataset.
function handles = GetData(handles)
% Set mouse pointer as busy.
if isfield(handles, 'figure_HeadMotion') && ...
ishandle(handles.figure_HeadMotion) && handles.figure_HeadMotion ~= 0
... |
69f765a948d1bc18b32a3d359d4bcebaf1873c0f8b38c327079b31d1332b894d | MATLAB | 8,018 | 167 | %%
% ================= PROTOCOL DEFINITION =================
%%
clear all; close all; clc;
%%
idx = 1;
mean_rt = load('F:\SEM_mri_rawdata\mean_rt.mat');
mean_rt = mean_rt.mean_rt_table;
%%
for s = 1:21
if s < 10
sub = strcat("P0",num2str(s));
else
sub = strcat("P",num2str... |
3e6e6c47e5068e9634e76f2780e2be264587178d85c6b527e298a06c486c726b | MATLAB | 8,027 | 223 | function [cfg] = ft_layoutplot(cfg, data)
% FT_LAYOUTPLOT makes a figure with the 2-D layout of the channel positions
% for topoplotting and the individual channel axes (i.e. width and height
% of the subfigures) for multiplotting. A correct 2-D layout is a
% prerequisite for plotting the topographical distribution o... |
3cf8c727f48a19cbaba53af88daba481869a65cc219f9ddfb66b96645a01eb15 | MATLAB | 8,033 | 288 | function [A,fH,figNames] = meg_plotFFT_wholeTrial(data,p,selectedChannels,selectedFreq)
% MEG_PLOTERP(data,selectedChannels,plotSingleTrial,plotAvgTrial)
%
% INPUT
% data
% structure of condition cells containing
% data matrix, time x channels x trials
% selectedChannels
% vector of meg channels to inspect
% se... |
84313e4164a6172d8cbda04f4542484edd4187c1b5e863c6826f6eb6a436119e | MATLAB | 8,045 | 212 | function [sens] = ft_fetch_sens(cfg, data)
% FT_FETCH_SENS mimics the behavior of FT_READ_SENS, but for a FieldTrip
% data structure or a FieldTrip configuration instead of a file on disk.
%
% Use as
% [sens] = ft_fetch_sens(cfg)
% or as
% [sens] = ft_fetch_sens(cfg, data)
%
% The sensor configuration can be passe... |
0c1b6da0c11592ffacae13db86501bf2d92f6f019902379aa5a057dd1d376903 | MATLAB | 8,046 | 180 | function stratMM = stratifiedMixingMatrices(data, epochs, subEpochs, repertoireTimes, varargin)
% STRATIFIEDMIXINGMATRIX This function computes an average stratified mixing
% matrix based on the given k-NN graph and labels.
%
% Inputs
% ------
% data: N x D
% - data matrix (rows ar... |
cc9e48ec07af13c8f0623c5b430ea54645076dc0850fcabb9d1e94b09a89cfc6 | MATLAB | 8,046 | 245 | function CrossCorr(OutDir,Tag,varargin)
% Plots confusion matrix (decode analysis) for decoding each (relevant)
% condition.
% [~,PThresh] = Utilities.ProcVarargin(varargin,'PThresh',0.001);
[~,Pmethod] = Utilities.ProcVarargin(varargin,'Pmethod','fdr');
[varargin,saveFig]=Utilities.ProcVarargin(varargin,'save... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.