sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
4c5a893dc047364422da41e642b26bc70638be7c624134ca0f9b8740a1ec1d9f | MATLAB | 6,856 | 198 | % AverageByNode.m
% Sarah West
% 7/25/22
% Takes correlation-type data and finds an average of that data by node.
% Uses RunAnalysis.
% Inputs:
% parameters.data -- correlation values (correlation matrix or lower triangle of a
% correlation matrix only). Matrices must be put in with number_of_sources
% x number_of_so... |
d58e85dd5cd7b76c0542840622234c5a6c52b72be702fa1857493181aa69bfbc | MATLAB | 6,856 | 237 | function [fit,x1] = NLF_HRF(S);
% Non-linear fitting of HRF based on zero and first-order expansions of
% amplitude and latency (based on code by Darren Price)
%
% yt is the template
% y is the data
% yt is modified to fit y
% pst is the reference timecourse
% t0 = centre of stretch. Points will be stretched outwards ... |
f117ac8bcdc940025ad8d8fae150d8268e58e505cd5e9c8c75198f489096c836 | MATLAB | 6,858 | 199 | %% This function compares surface ephys w/ dednritic dF/F onset times
clear;clc
%% paths to analyzed dendritic data
dendritePath{1} = 'E:\DendriteImaging\2022-10-08\FOV5\';
dendritePath{2} = 'E:\DendriteImaging\2022-10-08\FOV6\';
dendritePath{3} = 'E:\DendriteImaging\2022-10-08\FOV7\';
dendritePath{4} = 'E:... |
fe6795b575f2435815c9d6deb61b4e106f1767f9337a54c654031ab899242036 | MATLAB | 6,858 | 288 | function [d_shap,f_shap] = plot_logistic_regression(ratto,dataset,index_type,plot_flag,feature_type,plot_type,plot_errorbars,plot_markers)
%%% plots and compute statistics of psych. kernels
%%% input arguments:
%%% ratto : e.g. 'P100'
%%% dataset : 'all_trials', 'half1', 'half2'
%%% index_type : 'slope', 'ratio'
... |
406e6f0cde437b3dc45feac339000893f550dce352f142c55113c8d0c0c16a54 | MATLAB | 6,859 | 104 | function out = calculate_replay_detection_performance_backup(data,epoch_index,segment_id,log_pval,p_val_threshold,session_index,event_index,total_number,option)
% multi_event_index = find(log_odd_compare{nshuffle}.multi_track == 1);
out = [];
log_odd_difference = [];
percent_multi_events = [];
percent_s... |
0d7b4c2e8e7da3d3a4d4d68ace625d3ac58f1b8b32873ff8e0d6cb02eceb590e | MATLAB | 6,862 | 235 | function CBH = cbunits(varargin)
%CBUNITS Adds units to the colorbar ticklabels.
%
% SYNTAX:
% cbunits(UNITS)
% cbunits(UNITS,SPACE)
% cbunits -clear
% cbunits(H,...)
% CBH = cbunits(...);
%
% INPUT:
% UNITS - String (or cell of strings) with the colorbar(s) units o... |
6b452f0b776df30fff86dc90e144949ec4e74036d6aa2626c9c3b0a3e6417442 | MATLAB | 6,866 | 209 | % HIFDE_DIAG Extract diagonal using hierarchical interpolative factorization
% for differential equations via matrix unfolding.
%
% This algorithm exploits the fact that only a small subset of all matrix
% entries need to be reconstructed from the top-level skeletons in order to
% compute the diag... |
0a85dc68866751502b4155e6e5030b8163f4dc16c9ea84a5a6bc6e9528f8aef9 | MATLAB | 6,869 | 148 | function [cfg, artifact] = ft_artifact_jump(cfg, data)
% FT_ARTIFACT_JUMP reads the data segments of interest from file and identifies
% SQUID jump artifacts.
%
% Use as
% [cfg, artifact] = ft_artifact_jump(cfg)
% with the configuration options
% cfg.dataset = string with the filename
% or
% cfg.headerfile ... |
80deb966a0d761573845fd605298a449f052080439bfe32c687409d8ad0152a7 | MATLAB | 6,869 | 257 | function TrihexyVasAnalysis()
% TrihexyVasAnalysis()
% Load up VAS and FinalVAS data, extract the ratings for each question, and
% plot means and individuals
% Would be good to split by condition A or B later
%%
% func to do regexpi on cell and convert to matrix of logicals
cellRegexpi = @(cellArray, pattern) ~cellf... |
c8e5119abb510f99b67f7cdfd3a2ba70f84f187fa21a7a95d8574d8bf3f1c336 | MATLAB | 6,869 | 190 | 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... |
8d59a9c375ff67f234efd4bf15e2dc8f61ab38cd6c1950ac618370140e13d5d9 | MATLAB | 6,870 | 176 | function inspecting_results(paths, name, type)
% type.viz == 1 for imagesc plots by AAL region
% type.viz == 2 for plot of relative power over time in specific band
% need also:
% type.ppts = 'single', 'by_group', 'all'
% if by_group chosen, need
% type.des_mat = matrix of participant breakdow... |
3623b26650f8b4e56e5bbfdc1b10cbffdb855cbab84bdf752c2095e7e6bc4e05 | MATLAB | 6,874 | 199 | classdef FrameSetVariable < FrameSet
properties
prettyStringHook % fcn with sig str = fcn(labeler)
prettyCompactStringHook % fcn with sig str = fcn(labeler)
id % id for testing for special cases
% fcn with sig frms = fcn(labeler,mIdx,nfrm,iTgt). Returns "base"
% frames. nfrm is number of fram... |
335aaa7275a29320242bb2e169c2ed9581e5d7bfd9fb99bbaf80edd40cb36fe7 | MATLAB | 6,877 | 178 | %% Generate frequency band-specific directories
addpath C:\code\spm12
% addpath C:\Users\ICN_guest\Charité - Universitätsmedizin Berlin\Interventional Cognitive Neuromodulation - PROJECT ECoG Atlas Connectomics (1)\functions;
addpath C:\code\wjn_toolbox
spm('defaults','eeg')
%% Load table
run('ECoG_Atlas_data.m')
run... |
de5f76fcc4476fccb7c210280a5ade6751ab85809b17c79afae55a3481cd3210 | MATLAB | 6,877 | 210 | function tblMF = labelAddLabelsMFTableStc(tblMF,lbls,varargin)
% Add label/trx information to an MFTable
%
% tblMF (output): Same rows as tblMF, but with addnl label-related
% fields as in labelGetMFTableLabeledStc
%
% tblMF: MFTable with flds MFTable.FLDSID. tblMF.mov are
% MovieIndices. tblMF.mov.g... |
ed764db499f9707f8dfcc6f6dff477b4d0ed12082ee1a960a63a655397080e5e | MATLAB | 6,878 | 170 | function [ResultBrain, TimeSeries, Header] = y_DualRegression(AllVolume, SeedMap, OutputName, MaskData, IsNeedDetrend, Band, TR, TemporalMask, ScrubbingMethod, ScrubbingTiming, Header, CUTNUMBER)
% [ResultBrain, TimeSeries, Header] = y_DualRegression(AllVolume, SeedMap, OutputName, MaskData, IsNeedDetrend, Band, TR, Te... |
1acadee7d553dc088e9f2c4b6e1033419c551f175fd0e33304f2aace5db6b8dc | MATLAB | 6,880 | 123 | %% Description
% This example is another illustration of MC simulations inside a for loop,
% this time simulating a pencil beam incident on a 100 µm slab of scattering
% medium with a variable (parametrically sweeped) scattering anisotropy g.
% g is passed in through the mediaPropParams field and used within
% mediaPro... |
a155831c9f0acfdc39b8d386317e89c60bf8e31940dc499d0c30a5a2d17ae696 | MATLAB | 6,881 | 198 | % AverageByNode.m
% Sarah West
% 7/25/22
% Takes correlation-type data and finds an average of that data by node.
% Uses RunAnalysis.
% Inputs:
% parameters.data -- correlation values (correlation matrix or lower triangle of a
% correlation matrix only). Matrices must be put in with number_of_sources
% x number_of_so... |
91b927f096a6cff9c8e837df6091ac5a85caa5c8682e40b3b6e38d896dfadd51 | MATLAB | 6,882 | 195 | function [a, reg] = gsmoothn(a, sigmas, varargin)
%GSMOOTHN Gaussian N-dimensional array smoothing
% [SMOOTH, REGION] = GSMOOTHN(A, SIGMAS) carries out Gaussian
% smoothing on an N-dimensional array.
%
% A must be an array of class double or single. Its dimensionality D is
% given by NDIMS(A) unless A is... |
99dc6423ace93d300d77e873ed969b3fdd7e32d4ced6c0b2075162ce3a172999 | MATLAB | 6,884 | 273 | function bayesRiskDemo()
% draw_bayesrisk.m
% Illustrates the symmetry of Bayesian and Frequentist Decision Theory.
%
%PMTKauthor Gabriel Goh.
% 10 Jan 2010
range = 10;
res = 0.1;
[theta, x_bar] = meshgrid(-range:res:range,-range:res:range);
% Number of observations. Note that as n increases, both the ... |
ecb2594304cf5faafab54196a69cce37af0469063e6abb4273bfd8b275c6ffb3 | MATLAB | 6,884 | 189 | function [map,lo,hi] = cubehelix(N,start,rots,sat,gamma,irange,domain)
% Generate an RGB colormap of Dave Green's Cubehelix colorscheme. With range and domain control.
%
% (c) 2017 Stephen Cobeldick
%
% Returns a colormap with colors defined by Dave Green's Cubehelix colorscheme.
% The colormap nodes are selected along... |
bf00c6fb77415e828bf3b2dc402ef281065552c9694ff7a3b4b55bd54333f40f | MATLAB | 6,886 | 227 | function [IX,SigmaX,deltaMuX,suffStat] = VBA_IX_lagged_binomial(X,y,posterior,suffStat,dim,u,options)
% lagged Laplace-EKF (Gauss-Newton update of hidden states)
% Look-up which hidden states to update
indIn = options.params2update.x;
% Get precision parameters
alphaHat = posterior.a_alpha./posterior.b_alpha;
iQx =... |
da82800bcd89c6bbb36daa0cdf642bf504b489cee238e3d0166524c40eb5fc82 | MATLAB | 6,886 | 152 | %% Figure 4 :
close all; clear; clc;
inputdatastruct_path = pwd; %location of the data structure is assumed to be in current folder
datastruct_name = 'data_photometry'; %name of DATA structure with ALL experiments,
cd(inputdatastruct_path)
data = load(datastruct_name);
tempstr = data.data;
clearvars -except te... |
3702fa2c8bf58257dbe43d58bd44577359509dc19a5fa266c054d39040606f41 | MATLAB | 6,887 | 173 | function [hmnrnc,hmBestTrajPQ,acBestTrajUV,acCtrPQ,totalcost] = ...
ChooseBestTrajectory_grid(hmfcn,n,varargin)
% Grid Viterbi
%
% hmfcn: fcn handle with sig: hm = hmfcn(i) for i in 1..n
% n: run from frames 1..n
%
% hmnrnc: [hmnr hmnc] heatmap size
% hmBestTraj: [nx2] p,q indices into heatm... |
ce8c688055b4e9fcd849a8624b053bed02327f662345d7a56b2c536ce898214e | MATLAB | 6,891 | 189 | % Underdetermined least squares on the unit circle, Laplace kernel.
%
% This example solves an underdetermined least squares system arising from
% applying the method of fundamental solutions to the Dirichlet Laplace problem
% on the unit disk. The solution is represented as a single-layer potential on
% an exterior ci... |
d4a86148f91204825fb4fd04fdb557fdf2a8e12ac888a74cf86e7a3b6bb6c9bf | MATLAB | 6,892 | 188 | function [event] = read_nex_event(filename)
% READ_NEX_EVENT for Plexon *.nex file, supports NEX variable types:
% marker, interval, and event
%
% Use as
% [event] = read_nex_event(filename)
%
% The event.type used to select events in ft_trialfun_general is the
% variable name from the NEX file (hdr.varheader.name... |
0ad0ac36faf9d7860eaf825ca0667c5a7d48316cff6329a959e7949b93b0843b | MATLAB | 6,894 | 222 | %% (plot) ArraySig
%
% Plot the elementwise significance of the SDO relative to the shuffles.
% Plot the CDF of the cumulative magnitude of responses relative to
% shuffles. For use within the SDO Analysis Toolkit.
%
% PREREQUISITES:
% computeSDO()
% INPUT PARAMETERS
% sdo: 'sdo' structure
% XT_SDO_CH_NO: Row i... |
419d07a7b362dd1ec7462941e64312624d720175e757e8d0d0bd3fb84ac4c708 | MATLAB | 6,896 | 234 | function CBIG_DrawSurfaceMapsWithBoundary(lh_data, rh_data, ...
lh_labels, rh_labels, mesh_name, surf_type, min_thresh, max_thresh, colors)
% CBIG_DrawSurfaceMapsWithBoundary(lh_data, rh_data, ...
% lh_labels, rh_labels, mesh_name, surf_type, min_thresh, max_thresh, colors)
%
% This function visualizes lh_data... |
b4092275d0fcded0f4dd868058a12e5a571d6731cdcf8ace6db9c9a7723600fd | MATLAB | 6,897 | 160 | function writePLXFile(filename, data, h)
% writePLXFile - Write data to a PLX file.
%
% writePLXFile(filename, data, headers)
%
% writePLXFile is designed to generate a new PLX file using spiking data
% and header information. The header data can be taken from an existing PLX
% file using the companion function readPLX... |
52cce293f43a3172297bd35d2ec3db0f581353ef424f03d4598580432b8e1e16 | MATLAB | 6,898 | 187 | function histDataStruct = getHistogramData(hImage)
% GETHISTOGRAMDATA Returns data needed to create the image histogram.
% The fields inside of HISTDATASTRUCT are:
% histRange Histogram Range
% finalBins Bin locations
% counts Histogram counts
% nBins Number of bins
%
%
% ... |
a373fea72559845a25e9febff7e64e3eb264e48f1a54626f219dfdbaf0fb5391 | MATLAB | 6,898 | 177 | function varargout = jbm_dendriteSkeletonGUI3(varargin)
% JBM_DENDRITESKELETONGUI3 M-file for jbm_dendriteSkeletonGUI3.fig
% JBM_DENDRITESKELETONGUI3, by itself, creates a new JBM_DENDRITESKELETONGUI3 or raises the existing
% singleton*.
%
% H = JBM_DENDRITESKELETONGUI3 returns the handle to a new J... |
7de39f28037b71a87b27b28bda0fc7711e154dd43153e82290862f2d0e355c4c | MATLAB | 6,899 | 205 | % This demo simulates learning agents playing against each other
% This demo considers the following types of learning agents:
% - k-ToM: Bayesian mentalizing agents (cooperative or competitive)
% - Inf: influence learners (cooperative or competitive)
% - k-BSL: Bayesian Sequence Learners
% - RB: Random Biased policy
%... |
65007c705ca65a9e2ae0c7f5052ca5b27a8c6972beca6555fb54396f6215dc47 | MATLAB | 6,901 | 151 | clear all
%%
addpath '/SCRATCH/software/toolboxes/conn21a';
% Parameters
NSUBJECTS=21;
nsessions=7;
TR=1; % Repetition time
% Files
cd '/DATAPOOL/ERRORMONITORING/CONN_data/';
conn_dir('s7.5_wrarun1_biasfield_topup_4D.nii');
% Functional files
func_files_run1=cellstr(conn_dir('s7.5_wrarun1_biasfield_topup_4D.nii'));... |
a16e1f7706dd0decf96e73d53f8b4679c0b9ec97efe8c548257f4fa4e0720e95 | MATLAB | 6,901 | 121 | %
%
% B01_raster_psth_timeDiscrim_SAligned_BSep_NWB( nwbData, timestampsOfCell, channelid, cellNr, brainAreaOfCell, bin_width_raster, bin_width_fr, plot_flag)
%
%History
%12/7/21: This file is forked from original B01_raster_psth_timeDiscrim_BAligned_BSep.m by JZ.
%
function [] = B01_raster_psth_timeDiscrim_RAligned_... |
60338742370e802f9e870d9794d6f6ead7d1303a68ffa1f0a51c38fcd2d7f937 | MATLAB | 6,907 | 189 | function SlidingTimeDecodeAction(AllTrialData,Labels,DecodeLabels,TimeWindow,TimeStep,StepSize,OutDir,Tag,varargin)
% Plots confusion matrix (decode analysis) for decoding each (relevant)
% condition.
% [~,PThresh] = Utilities.ProcVarargin(varargin,'PThresh',0.001);
[~,PThresh] = Utilities.ProcVarargin(varargin... |
c4be61172e7bebeed88fd2a1e06c7f829b372727e96968bb97c3bc451448ad3a | MATLAB | 6,908 | 277 | function icaBasisDemo()
% Apply ICA to natural image patches and visualize basis functions
% This file is from pmtk3.googlecode.com
% Extracted from figures.m which is the file that
% accompanies
%"Natural Image Statistics" by Hyvarinen, Hurri, and Hoyer.
% Used with permission of Aapo Hyvarinen
%PMTKauthor Aapo ... |
b54b6a2d45c11f5d53d1e929d8e527f68659fb97dceb2182897a857f3aae18b8 | MATLAB | 6,922 | 130 | function example_neuron_raw_data(varargin)
% cell 1058 looks nice
% cell 3063
% 1037 + 1107
p=inputParser;
addParameter(p,'cell_id',[]);
addParameter(p,'method','wcorr');
parse(p,varargin{:});
load('.\Tables\subsets_of_cells.mat');
load(['rate_remapping_analysis_TRACK_PAIRS_' p.Results.method '.mat']);
load('folders_... |
c3ffb1204753bd563ca9ed4a184daa453ab0923b2c167a6dbccd55c039cc9c0e | MATLAB | 6,923 | 190 | function [logReg_wMeanStd, num_pVal] = CBIG_ASDf_logReg_compareSex(k, sub_id, ...
sub_info_file, factorLoading_file, factor_order, output_name)
% [logReg_wMeanStd, num_pVal] = CBIG_ASDf_logReg_compareSex(k, sub_id,
% sub_info_file, factorLoading_file, factor_order, output_name)
%
% This function performs logistic reg... |
d309f91d26cf911197d0c05e4f095fa6439a9d271237c141b025d817d82be685 | MATLAB | 6,924 | 178 | % Seven-point stencil on the unit cube, variable-coefficient Poisson equation,
% Dirichlet boundary conditions.
%
% This is basically the 3D analogue of FD_SQUARE2.
%
% Inputs (defaults are used if not provided or set empty):
%
% - N: number of discretization points in each dimension (default: N = 32)
% - OCC: tree... |
45f180a88ced0d66c78ee1018433d3eec85ed525a053cdef8a46ab6207ea5151 | MATLAB | 6,926 | 189 | function CBIG_brain2doc(vol4D, concatOrder, mask, refListOrParams, nuisanceVars, outDir, varargin)
% CBIG_brain2doc(vol4D, concatOrder, mask, refListOrParams, nuisanceVars, outDir, varargin)
%
% This function converts registered, modulated GM images into documents
% that can be analyzed by LDA. It will first take log1... |
36ae6ffe6fbd4f1feed4c3e6d655e80e37c57beb98aa2472d9ff85fcc20d207b | MATLAB | 6,929 | 206 | function [y, dsdx, dsdp] = VBA_sigmoid(x, varargin)
% // VBA toolbox //////////////////////////////////////////////////////////
%
% [y, dsdx, dsdp] = VBA_sigmoid(x, [name, value, ...])
% Apply a sigmoid transformation to x
%
% By default, the canonical sigmoid is used:
%
% y = 1 / (1 + exp(- x))
%
% However, this fun... |
83fc8a1421b035fe49bfb3bc09ba2d6b0dbf308c96b5bc76ca4834d64cbc22e2 | MATLAB | 6,929 | 167 | function [U, S, V, info] = truncated_svd(A, p)
% Returns an SVD decomposition of A truncated to rank p.
%
% function [U, S, V, info] = truncated_svd(A, p)
%
% Input: A real matrix A of size mxn and an integer p <= min(m, n).
% Output: An orthonormal matrix U of size mxp, an orthonormal matrix Y of
% size... |
5e17b1ab9af95add0ab734541f5f1ddb4fe16f1355dd920cd6c3b576d1562b89 | MATLAB | 6,934 | 205 | %% Enrichment and Mcnemar
% This code runs enrichment on 2 independent groups.
% McNemar chi-square is used to compare network pairs between groups.
%% Load data
% load IM structure
load('filepath to IM structure');
% load connectivity data
rmat1=load('filepath to fc dataset 1');
rmat2=load('filepath to fc dataset... |
8aa8fe47d22aa105760ede8edfe29435e96f8dd8bb43f84f5209d35c05767cb6 | MATLAB | 6,934 | 193 | function [volume] = ft_datatype_volume(volume, varargin)
% FT_DATATYPE_VOLUME describes the FieldTrip MATLAB structure for volumetric data.
%
% The volume data structure represents data on a regular volumetric
% 3-D grid, like an anatomical MRI, a functional MRI, etc. It can
% also represent a source reconstructed est... |
ec79519db82ac32f742dc9353419b6de2287bc563618b16978c1024233b60b3c | MATLAB | 6,934 | 167 | function [reactionTimeTable] = reactionTimes(paths)
% Decription:
% reactionTimes is a function that extracts participant reaction
% times. That is, the time between stimulus presentation and button press.
% Currently this function is used for the Speed of Thinking TP & EL
% dataset.
% How to use:
% After running fc... |
e43dbfcee58329bd009544c7adab4d9e24a5ee49921446227d00577fea012407 | MATLAB | 6,936 | 207 | function [timelock] = ft_timelocksimulation(cfg)
% FT_TIMELOCKSIMULATION computes a simulated signal that resembles an
% event-related potential or field
%
% Use as
% timelock = ft_timelockstatistics(cfg)
% which will return a datastructure that resembles the output of
% FT_TIMELOCKANALYSIS.
%
% cfg.fsample = s... |
462c1bd6f883bcad07dfad65d8044bfaf5a17f7f1bd8fc2235a8839f27cee4b4 | MATLAB | 6,937 | 189 | function headmodel = ft_headmodel_bemcp(mesh, varargin)
% FT_HEADMODEL_BEMCP creates a volume conduction model of the head
% using the boundary element method (BEM) for EEG. This function
% takes as input the triangulated surfaces that describe the boundaries
% and returns as output a volume conduction model which can... |
302e52f348bc6ef498b94408316559bf99abf9cf62a17f5cfc7f44be61c07a9e | MATLAB | 6,938 | 193 | function [volume] = ft_datatype_volume(volume, varargin)
% FT_DATATYPE_VOLUME describes the FieldTrip MATLAB structure for volumetric data.
%
% The volume data structure represents data on a regular volumetric
% 3-D grid, like an anatomical MRI, a functional MRI, etc. It can
% also represent a source reconstructed est... |
dce2e6687593a9aa8eb835cc5556407d13a5ccf81a2d1e25ceb8b27752365731 | MATLAB | 6,938 | 239 | function [L, DL, R] = px_maxmin(varargin)
%PX_MAXMIN -- select landmark points by greedy optimisation
%
% Given a set of N points, PX_MAXMIN selects a subset of n points called
% 'landmark' points by an interative greedy optimisation. Specifically,
% when j landmark points have been chosen, the (j+1)-st landmark point... |
3075e1121ee59688606391ac2947772d0a8395b24dc904b5a3b5a19813944b12 | MATLAB | 6,945 | 264 | function Intan2PLX(parameterSets,tet,varargin)
% function converts an Intan file to a plx file that can be read by Offline
% Sorter etc..http://www.plexon.com/software-downloads
%
% calls read_intan_data available at http://www.intantech.com/downloads.html
% requires spike detection software package from http://urut... |
1765e1f9048609f620c1ec8c2fb5779f6d8185d15955505f3f5b184151a3f66c | MATLAB | 6,949 | 227 | function VBA_getSubplots (ha, style)
% // VBA toolbox //////////////////////////////////////////////////////////
%
% VBA_getSubplots (ha, style)
% adds contextmenu to axes for whole window display of subplots
%
% IN:
% - ha: optional axis handle. If left empty, equips all axes of the
% current figure
% - s... |
161a9f02f4a31e58eefc2cf5d323ba338f697bbd42c36668b1bd2b27f96c27c6 | MATLAB | 6,953 | 194 |
% Calculating Correspondences in CUDA
% This is the code that calculates the keypoints and descriptors at
% varying scale levels
%
% INPUTS:
% moving_run: which expeirment do you want to warp accordingly?
% OUTPUTS:
% no variables. All outputs saved to params.registeredImagesDir
%
% Author: Daniel Goodwin dgoodwin208@... |
36c5bd5e16030fa6b1722ce32419f8240d749493041b609654082270f6dc5d8a | MATLAB | 6,953 | 171 | % Five-point stencil on the unit square, constant-coefficient Poisson equation,
% Dirichlet-Neumann boundary conditions.
%
% This is basically the same as FD_SQUARE1 but with Dirichlet boundary
% conditions along the top and bottom sides of the domain, and Neumann boundary
% conditions along the left and right sides. T... |
12fb5926f020d62eb03b83cff560ee3d84962ebfb6de43bcd3868954f4f704d9 | MATLAB | 6,955 | 183 | function [ s ] = readXMLotb( file )
%Convert xml file into a MATLAB structure
% [ s ] = xml2struct( file )
%
% A file containing:
% <XMLname attrib1="Some value">
% <Element>Some text</Element>
% <DifferentElement attrib2="2">Some more text</Element>
% <DifferentElement attrib3="2" attrib4="1">Even more t... |
deff61c5602bb1a1eb40f76e21dd0c5e5928fe477bc26a18c7018c8f8bc84af1 | MATLAB | 6,957 | 210 | % MATLAB code provided by Seyed Mohammad Ali Rahmati
% Affiliation: Biomechanics and Motor Control Lab, School of Biological Sciences, Georgia Institute of Technology, Atlanta, GA.
%
% Description:
% This script computes a spinal map of the activities of motor neurons and sensory neurons (Ia, Ib, II) of forelimb muscle... |
d08564fee995753c6035d9013d126491a26affed10da294960c8ec1f5d6eda39 | MATLAB | 6,960 | 273 | function [out,dout]=rodrigues(in)
% RODRIGUES Transform rotation matrix into rotation vector and viceversa.
%
% Sintax: [OUT]=RODRIGUES(IN)
% If IN is a 3x3 rotation matrix then OUT is the
% corresponding 3x1 rotation vector
% if IN is a rotation 3-vector then OUT is the
% corresponding 3x3 rotation matrix
... |
5e4e9e3b16a83bde2ff86d44f2ce8d6dc101c18881a5139fb481b6b7c9da8992 | MATLAB | 6,962 | 168 | function [] = makeAnalysisVideo(genotype,observables,obsLabels,folders,closestPlaneNdx,params,directory)
d_side = directory{1};
idVid = 'side.avi';
id2Vid = 'bot.avi';
analysisFold = folders.analysisFold;
sideFold = folders.sideFolder;
botFold = folders.botFolder;
nVid = params.nVid;
fs = params.fs;
gender = params.g... |
8b502bd03f73f97aebd8013730595a58197914436755ae63e7f48edf1a11d0d5 | MATLAB | 6,962 | 192 | function [posterior,out] = VBA_UNL0(y,u,g_fname,dim,options,in)
% VB inversion of generative models with unnormalized likelihoods
% function [posterior,out] = VBA_UNL0(y,u,g_fname,dim,options,in)
% This function inherits its i/o format from the main VBA model inversion
% routine VBA_NLStateSpaceModel.m, but focuses on... |
f465e1e0162166b577f3e98002aedd64f99c3a6363684fefd69ca65242fc1a64 | MATLAB | 6,966 | 159 | clear all
trialCOUNT = 39;
path = '';
experiment = 0; %0: full net;
stdp_rule = 1; % 1: asym with larger tau and same amplitude;
for cases = 1:3
if cases == 1
external_stimulation = 1; %0: neither CS nor US; 1: only CS; 2: only US; 3: US+CS
condition = 0; % pre FC
filename = 'h... |
ac438a5f4e51670c0c242ee445dfe4d3c174011025b614f13c5f5614d97ad7f4 | MATLAB | 6,968 | 210 | function headmodel = ft_headmodel_openmeeg(bnd, varargin)
% FT_HEADMODEL_OPENMEEG creates a volume conduction model of the
% head using the boundary element method (BEM). This function takes
% as input the triangulated surfaces that describe the boundaries and
% returns as output a volume conduction model which can be... |
05af890a46531353db982b0795210ba55fbabe07caa7064c1741ffcb78987ed3 | MATLAB | 6,972 | 202 | function [hdr] = read_ctf_res4(fname)
% READ_CTF_RES4 reads the header in RES4 format from a CTF dataset
%
% Use as
% [hdr] = read_ctf_res4(filename)
%
% See also READ_CTF_MEG4
% "VSM MedTech Ltd. authorizes the release into public domain under the
% GPL licence of the Matlab source code files "read_ctf_res4.m" and... |
95d0c4aae290d76cf50e4e4412efade2ef5d33feb5e7162e1f06b4d0820ec5a9 | MATLAB | 6,972 | 211 | classdef RoiUtil < 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
% License: BSD... |
e8b39d7dc67a6bd4c438c829bd28e346c12c1091eeb1885b0870dd40233451da | MATLAB | 6,975 | 240 | function delay = PETHTransition(psth,timeBins,varargin)
%PETHTransition - Find a transition point in a peri-event time histogram.
%
% Find a transition point in a peri-stimulus time histogram using the maximum
% likelihood or mean square error algorithm of Friedman and Priebe (1998), or
% piecewise linear fit.
%
% US... |
76912b7b23b9a1d61e941e4fb057de940d123170fc30e216946e65ac86641bd0 | MATLAB | 6,982 | 230 | function [ws warned] = print_once(varargin)
% PRINT_ONCE will print a message for every unique point in the
% stacktrace only, e.g. in a for-loop a warning is thrown only once.
%
% Use as one of the following
% print_once(string)
% print_once(id, string)
% Alternatively, you can use ft_warning using a timeout
% ... |
858cd6c496f3e89e572d33f7e5a23466c2bf88b9bc3ba16779daf4dfcd9ec134 | MATLAB | 6,984 | 153 | function [cfg, artifact] = ft_artifact_muscle(cfg, data)
% FT_ARTIFACT_MUSCLE reads the data segments of interest from file and
% identifies muscle artifacts.
%
% Use as
% [cfg, artifact] = ft_artifact_muscle(cfg)
% with the configuration options
% cfg.dataset = string with the filename
% or
% cfg.headerfile... |
bcaf77993ddef6e3c18e5cd777801a447edc2eeb178985e35dbe640ec6c2f803 | MATLAB | 6,985 | 154 | function [cfg, artifact] = ft_artifact_muscle(cfg, data)
% FT_ARTIFACT_MUSCLE reads the data segments of interest from file and
% identifies muscle artifacts.
%
% Use as
% [cfg, artifact] = ft_artifact_muscle(cfg)
% with the configuration options
% cfg.dataset = string with the filename
% or
% cfg.headerfile... |
e8bbb4c5c7efc5fc3e208b240c2bcbfc36ca4f415801267c09fcfc283f0fba3f | MATLAB | 6,989 | 180 | % Seven-point stencil on the unit cube, variable-coefficient Poisson equation,
% Dirichlet boundary conditions.
%
% This is the same as FD_CUBE2 but using HIFDE3X.
%
% Inputs (defaults are used if not provided or set empty):
%
% - N: number of discretization points in each dimension (default: N = 32)
% - OCC: tree ... |
722d450678615eb6289d232e6156e2aa780cde27e6a355d895471b95da7b0fdd | MATLAB | 6,992 | 208 | function [ ] = makeConnectivityMovie( savePath, adjmat, varargin )
%MAKECONNECTIVITYMOVIE Make a movie of the connectivity matrix over time,
% along with mean connectivity plot.
%
% Simeon Wong
% 2014 June 10
%
%%% Optional Arguments %%%
% timeWindow - The start and end samples of the a... |
83d86ecf27ed0733765772c6426e01f8ac90502efa79e757aa6e3a8f5b9e598a | MATLAB | 6,993 | 192 | function [newpupil, newblinksmp, nanIdx, dat] = blink_interpolate(data, blinksmp, plotme)
% interpolates blinks and missing data
% Anne Urai, 2016
% get the stuff we need
dat.time = data.time{1};
dat.pupil = data.trial{1}(~cellfun(@isempty, strfind(lower(data.label), 'eyepupil')),:);
dat.gazex = dat... |
0cca19eafdb9d2e9f461b3bfa682ce6c4b4d50b2a0c8945b6e0422390560ae24 | MATLAB | 6,995 | 189 |
function headers = checkPLXData(data, headers)
% checkPLXData - Check that PLX data and update/create PLX file headers.
%
% headers = checkPLXData(data, headers)
%
% checkPLXData is designed as a companion function to writePLXFile and
% readPLXHeaders. It takes spiking data that is destined for a PLX file,
% and (opti... |
00b605e373f0f7963bd21b780a0c68d1d7413c877f1bbd3ef2132494a44775d6 | MATLAB | 6,998 | 237 | function [A,node,link] = Skel2Graph3D(skel,THR)
% SKEL2GRAPH3D Calculate the network graph of a 3D voxel skeleton
%
% [A,node,link] = SKEL2GRAPH3D(skel,THR)
%
% where "skel" is the input 3D binary image, and "THR" is a threshold for
% the minimum length of branches. A is the adjacency matrix, and node/link
% are struct... |
9d2c1cce1b21fa0c9071bacb473996c549e7b6f8763ad9afd3fe74fea38d1a75 | MATLAB | 7,007 | 204 | function [hdr] = read_ctf_res4(fname)
% READ_CTF_RES4 reads the header in RES4 format from a CTF dataset
%
% Use as
% [hdr] = read_ctf_res4(filename)
%
% See also READ_CTF_MEG4
% "VSM MedTech Ltd. authorizes the release into public domain under the
% GPL licence of the Matlab source code files "read_ctf_res4.m" and... |
108588931973599aa104314bda0ef7fb8376a334111f164e1a8d320c306f9a21 | MATLAB | 7,010 | 233 | function [A,fH,figNames] = meg_plotITPCavg(data,sessionDir,p,selectedChannels,selectedFreq)
% MEG_PLOTITPCavg(data,sessionDir,p,selectedChannels,selectedFreq)
%
% INPUT
% data
% structure of condition cells containing
% data matrix, time x channels (see meg_plotITPC for trial by trial anal)
% sessionDir
% eg: '... |
b3dce1c58f0a22b2248f12072c389d8a21f9d267d9ea1cb50fa7dc73c5d8514f | MATLAB | 7,011 | 161 | loadParameters;
filename_centroids = fullfile(params.punctaSubvolumeDir,sprintf('%s_centroids+pixels.mat',params.FILE_BASENAME));
load(filename_centroids,'puncta_centroids','puncta_voxels','crop_dims')
%% Collect the subvolumes we started this with, but now only with the pixels from the puncta!
num_insitu_transcripts ... |
d61de58e5eaefea9a4d92cfddfb9327f4456a62a7aaa204cf3c6f9d860f2840e | MATLAB | 7,012 | 206 | % Usage: strvec = vect2colon(vec, options)
%
% Converts a vector into a string using MATLAB colon notation (single resolution).
%
% Options are:
%
% 'Delimiter' - 'on','yes','off','no' {default on} : Including square brackets []
% (or curly brackets {} when output's dime... |
58214909492b37a37438d682244588a9d6e160a72111aff07551366676170a43 | MATLAB | 7,013 | 267 | %takes fluoro data, finds the max, finds the baseline region as x
%images before the max, calculates the average fluorescence over that
%region, calculates max deltaF/F
% TODO: should change this figure to display time and not images
function [bf, maxF, df, sds, maxFSmooth, dfSmooth, sdsSmooth, bdps, window] = get_de... |
9514ee6465e78a6612647e5be16a74da28268e0a8685eb6c534d44edd88c2a4b | MATLAB | 7,014 | 230 | % Author: Birgit Nierula
% nierula@cbs.mpg.de
function eeg_prepro_loop8(subject, condition, srmr_nr, sampling_rate)
debug_mode = false;
%% set variables
subject_id = sprintf('sub-%03i', subject);
analysis_path = [getenv('ANADIR') subject_id '/eeg/prepro/'];
if ~isfolder(analysis_path)
mkdir(analysis_path);
end
... |
98f91963025c0f9310e9c8935b18ba2bf6283e6eb093c94486e29f1d39f03d03 | MATLAB | 7,014 | 165 | % This script computes the induced surface charge density for an
% inhomogeneous multi-tissue object given the primary excitation, with
% accurate neighbor integration
%
% SNM 2022
%% load bem-fmm engine
addpath(fullfile('../engines/bem_fmm_engine'));
% attempt to avoid repeated crashes in the parallel pool
%... |
cfde06da61dac0f99f9ebe378c28ac368d2a1402f9c63a5fc8a9e71726b63c10 | MATLAB | 7,016 | 273 | function [hh,hii]=showmri(mri,para,source);
data=mri.data;
scales=diag(mri.scales);
nnn=size(data);
x0=(0:(nnn(1)-1))*scales(1);
y0=(0:(nnn(2)-1))*scales(2);
z0=(0:(nnn(3)-1))*scales(3);
limits_within=[];
limits_slice=[];
if isfield(mri,'limits_within');
limits_within=mri.limits_within;
end
if isfield(mri,'limits_... |
a2fb67b336093cb1407360d50b87011293d8b47c0fcc3af9d6c411b19eeddde6 | MATLAB | 7,017 | 206 | function this = read_gifti_file(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'.
%__________________________________________________________________________
% Cop... |
40c5a8344f76243183e41911a718d6973f7583fce4020097dd8d6bf52f459441 | MATLAB | 7,018 | 194 | function stimsNew = InsertSaccadesAsTriggers(result, stimsOld, minSaccSize, blinksToo)
% InsertSaccadesAsTriggers(result, stimsOld, minSaccSize, blinksToo)
% detects saccades and blinks from the edf file for each trial, inserts the
% starts and ends as triggers, based on time since ITI. Also inserts a
% trigger for the... |
250358d38d83b685a818b4e7356a6e0e27468c30d874990697014eddbe643519 | MATLAB | 7,021 | 195 | function [timelock] = ft_timelockbaseline(cfg, timelock)
% FT_TIMELOCKBASELINE performs baseline correction for ERF and ERP data
%
% Use as
% [timelock] = ft_timelockbaseline(cfg, timelock)
% where the timelock data comes from FT_TIMELOCKANALYSIS and the
% configuration should contain
% cfg.baseline = [begin ... |
a57dd81ac1da77bcfea9df4ce3e0db68b5252e5246d7a8cf3dd0732a8988d4a9 | MATLAB | 7,021 | 195 | function [timelock] = ft_timelockbaseline(cfg, timelock)
% FT_TIMELOCKBASELINE performs baseline correction for ERF and ERP data
%
% Use as
% [timelock] = ft_timelockbaseline(cfg, timelock)
% where the timelock data comes from FT_TIMELOCKANALYSIS and the
% configuration should contain
% cfg.baseline = [begin ... |
affcd7bca403e5c55f3eacfe4e4f6de2364caf196d4b8bbf3e821e98f401ff19 | MATLAB | 7,022 | 210 | function [wavespec] = bz_WaveSpec(lfp,varargin)
%[wavespec] = bz_WaveSpec(lfp) calculates the
%wavelet transform of a signal with nfreqs frequencies in the range frange
%[fmin fmax]. Spacing between frequencies can be 'lin' or 'log'.
%Time-frequency resolution is defined by ncyc, the number of cycles in each
%wavelet... |
fe63b760d44a81961ff64ae594bd22debfa6fd04db32aa92e0e6bbf421d96621 | MATLAB | 7,022 | 119 | %% Description
% This example shows how to use one of the "deposition criteria" to
% calculate and plot the fluence rate (and the other outputs) of only that
% light which ends up on the light collector. The geometry is a block of
% standard tissue, into which we launch a Gaussian beam. We have a light
% collector look... |
667ebff1b3cf6ee96ad0c0a1bf5ba3e51eb1fa5865bde34f05e2c214b7b2e023 | MATLAB | 7,024 | 192 | function varargout = w_ThrdCoverage(varargin)
% W_THRDCOVERAGE MATLAB code for w_ThrdCoverage.fig
% W_THRDCOVERAGE, by itself, creates a new W_THRDCOVERAGE or raises the existing
% singleton*.
%
% H = W_THRDCOVERAGE returns the handle to a new W_THRDCOVERAGE or the handle to
% the existing singleton... |
db09f1be488a6b94723a248f94629d00fc69c910fb0980f32849b73ac645ae9f | MATLAB | 7,028 | 193 | classdef LinearDerivedFeatures < dspace_features.AbstractDerivedFeatures & dspace_features.AbstractHeavyFeatures
% These coordinates are computed from the parent coordinates as
% X_new = (X_old - Xmean_pre) * TM + Xmean_post
%
%
%
%
%<PRE>
% This file is part of dspace-core.
%... |
f6c0ca7282fd18eb4d0bb78884c7ac2da8603776dcff6b3f5eaac0cd1d1af546 | MATLAB | 7,028 | 133 | function [DegreeCentrality_PositiveWeightedSum_AllWindow, DegreeCentrality_PositiveBinarizedSum_AllWindow, GHeader] = y_DegreeCentrality_Surf_Window(WindowSize, WindowStep, WindowType, InFile, rThreshold, OutputName, AMaskFilename, CUTNUMBER)
% [DegreeCentrality_PositiveWeightedSum_AllWindow, DegreeCentrality_Positive... |
929a330615c7d387fb0d88bfc4f8d41a9bb26301ea833a580ec6e2e4414a026c | MATLAB | 7,029 | 126 | %% paths
% addpath /groups/branson/bransonlab/mayank/JAABA/filehandling;
% addpath /groups/branson/bransonlab/mayank/JAABA/misc;
addpath ~bransonk/behavioranalysis/code/Jdetect/Jdetect/filehandling;
addpath ~bransonk/behavioranalysis/code/Jdetect/Jdetect/misc;
addpath /groups/branson/bransonlab/projects/flyHeadTracki... |
fdaeb9ba8ec76daa9c46c746f5a4972fb319b94a6bd2d561c860977953090caa | MATLAB | 7,030 | 177 | function varargout = w_Percentage(varargin)
% W_PERCENTAGE MATLAB code for w_Percentage.fig
% W_PERCENTAGE, by itself, creates a new W_PERCENTAGE or raises the existing
% singleton*.
%
% H = W_PERCENTAGE returns the handle to a new W_PERCENTAGE or the handle to
% the existing singleton*.
%
% W_... |
6d9e42ed1cfff3aff9dd1c85f78910c46a0c4c137099d5b2deb29ddc3a6e7ce9 | MATLAB | 7,032 | 181 | function [dap] = read_mpi_dap(filename)
% READ_MPI_DAP read the analog channels from a DAP file
% and returns the values in microvolt (uV)
%
% Use as
% [dap] = read_mpi_dap(filename)
% Copyright (C) 2005-2007, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the docume... |
6bfa2ddfdb44711c1deed9c18b2db8507752ddbae875433d7b0c0a7e3a719fda | MATLAB | 7,033 | 188 | function varargout = DPABI_ConcordanceSelect(varargin)
% DPABI_CONCORDANCESELECT MATLAB code for DPABI_ConcordanceSelect.fig
% DPABI_CONCORDANCESELECT, by itself, creates a new DPABI_CONCORDANCESELECT or raises the existing
% singleton*.
%
% H = DPABI_CONCORDANCESELECT returns the handle to a new DPABI_C... |
105f518f751e3499de64f1a8291033f95b0a20672e2fc0f9b542dc4ac6720ecc | MATLAB | 7,037 | 202 | function ConvertKilosort2Neurosuite(basepath,basename,rez)
% 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... |
a16d2ccd50da14d1e9cacfaf70a92c3949bb975877725b78971deb0f4064b491 | MATLAB | 7,039 | 256 | function draw_figure6AB(p)
%
% This code is for drawing figure 6AB
% Umap analysis (umap_on_brain_activity_distance.ipynb) must be finished before executing this script.
%
%
%% settings
mapPath = [p.rootPath,'res/umap_on_brain_activity_distance/'];
% color preparation
load([p.featdir,'category.mat']);
ck27from34 = [1:... |
015ab21ae575fe396ec9aae92df9d1940120a78bbb734dcc927e8adbdc66ac67 | MATLAB | 7,040 | 167 | function lan_master_gui_sthe(LAN_var, mainfig, parent_)
LAN = LAN_var;
if nargin < 2
mainfig = figure;
end
figure(mainfig);
cfg_control(1) = uicontrol('style', 'text', 'units', 'norm',...
'position', [.04 .92 .6 .05], 'string', 'channel : ',...
'horizontalalignment', 'right');
cfg_control(2) = uicontrol('... |
0f779251af3783759fe61e4e79848e8319f0c2b22ba1823b0428edcdc4f92a70 | MATLAB | 7,040 | 206 | function xsol = radio_interferometric_calibration(N, K)
% Returns the gain matrices of N stations with K receivers.
%
% function xsol = radio_interferometric_calibration(N, K)
%
% N >= K is always assumed.
%
% The example considers calibration of an array of N stations.
% We simulate a system with N stations, e... |
e15cadf0a41999f6dffc25ab06274254d0e38a4b4f17a81c7ccd3058fbb310bc | MATLAB | 7,041 | 139 | function params = getParams(varargin)
% this function get the suitable parameters for analysis. call this
% function before implementing the analysis and pass the output struct as
% an argument to functions that need it. if you are to change any of the
% parameters, change them here, not within functions. The only opti... |
214ae518e26d5dc2cf6a44f417ca5495433201312ba1964a7044d598f3b3280a | MATLAB | 7,043 | 200 | % Second-kind integral equation on the unit square, Helmholtz single-layer.
%
% This example solves the Lippmann-Schwinger equation for Helmholtz scattering
% on the unit square, which can be ill-conditioned even though it is formally
% second-kind. The problem is discretized as in IE_SQUARE1. We assume that the
% pote... |
5032dd29975d274b359550542f8a170a86e0c11d3c184bf41c77470d1d28777e | MATLAB | 7,046 | 268 | %%%%%%%%%%
%%% Create montage images of all maps
%%% Sort the data by age
%%%
%%% Shaihan Malik & Aiman Mahmoud, King's College London, 2024
%% Load in data structure
addpath('lib');
load data/cohort_data.mat
%% T1 maps
sub_n = (1:length(pmas))';
% Find indices of empty cells in t1dataie
t1_empty = cellfun(@isempty... |
63ac85f66790753b5215fa3e30cbb474b4c34fd42878c818a9300a2a126a4f66 | MATLAB | 7,047 | 160 | function [str,errMsg] = vec2str(vec,format,numericFlag,encloseFlag)
%vec2str Convert a vector/array/matrix of values into a comma-separated string
% [str,errMsg] = vec2str(vec,format,numericFlag,encloseFlag)
%
% Converts an input of unknown size/type into a compact single-line
% comma-delimited string which ... |
c8b29b75ef4fc4a538af8a61c4d5e4ef75d332d21b1e5e67f0d4e227a0158d6e | MATLAB | 7,048 | 147 | classdef fluorescenceMonteCarloSimulation
%FLUORESCENCEMONTECARLOSIMULATION This class includes all properties and methods
%related to the fluorescence Monte Carlo simulation in an MCmatlab.model.
properties
%% Input properties
silentMode (1,1) logical = false % Disables command window text and progress ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.