sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
39082e3c92043b17adc8257db523dfd977a1d9a19030f8907986141532c19408 | MATLAB | 1,653 | 63 | classdef Reshape < dagnn_bc.ElementWise
properties
size = [0 0 0]
end
properties (Transient)
inputSizes = {}
end
methods
function outputs = forward(obj, inputs, params)
outputs{1} = vl_nnreshape(inputs{1}, obj.size) ;
% obj.inputSizes = cellfun(@size, inputs, 'UniformOutput', false) ... |
774a015ccea2188a41af8c02e22d42e8c78cbaf1e4c77e14c0ab0df6bc24cab9 | MATLAB | 1,653 | 50 | function plotFOVsAllenCCF(locsM1, locsS1, rotations)
% Load data and make plot
load('allenDorsalMap.mat');
bregmaRef = [228.5 205] * dorsalMaps.allenPixelSize / dorsalMaps.desiredPixelSize;
onemm = 1000 / dorsalMaps.desiredPixelSize;
allenMapPolyCentered(dorsalMaps, bregmaRef, '', 1);
plot(0, 0, 'k+', 'MarkerSize', 10... |
8d26fe51cddde6d410dcbbfb642ed489793031be4ea71c71a508148d493bbec7 | MATLAB | 1,654 | 61 | function R=corrw(W,D)
%function R=corrw(W,D)
%
%PURPOSE
%
%To compute mutual linear correlation coefficients between M
%independent component estimates using the demixing matrix W and
%the dewhitening matrix D of the original data.
%
% R=W*D*D'*W';
%
%INPUT
%
% W (field W in Icasso struct: demixing matrices)
% D (fi... |
e2d1c4af73ac474279ee36c0912c9e676942a53912cfe327a162f8170e56f70a | MATLAB | 1,654 | 42 | function [ sequences_corr, sequences_lag ] = xcorr_sequences( Pools_coords, Spikes,xcs_lag )
%LC July 14, encuentra la correlacion entre todas las celulas que pertenecen
%a todas las combinaciones entre dos estados diferentes.
%Las variables de salida son la media de la
%correlacion para cada par de estados y el tiemp... |
e48770a2a75bc4583a2a704f05337b280e75f8f11e6008baa22b998eb726aa5f | MATLAB | 1,654 | 48 | function [node,elem]=meshresample(v,f,keepratio)
%
% [node,elem]=meshresample(v,f,keepratio)
%
% resample mesh using CGAL mesh simplification utility
%
% author: Qianqian Fang, <q.fang at neu.edu>
% date: 2007/11/12
%
% input:
% v: list of nodes
% f: list of surface elements (each row for each triangle)
% keep... |
30110c837066285bf52b61d10979cd0cfad2e87836a8467c34ba2cb59bc289bc | MATLAB | 1,655 | 47 | function [v,x] = burt_profile(burt2,nms,n,varargin)
% [v,x] = burt_profile(burt2,nms,n)
%
% v = values plotted
% x = scaled burt matrix
%
% given a matrix of cross-correspondences in two sets, with the first n
% variables being the first set, this function makes a line plot in which
% the correspondences between the f... |
5501fa806ad728bfe02fb7410d8e3e1ec0f824ddf0442a236bd9b8e3c150c8a4 | MATLAB | 1,655 | 61 | function nsd_savemgz(data,file0,fsdir,numdepth)
% function nsd_savemgz(data,file0,fsdir,numdepth)
%
% <data> is V x D (where D >= 1) with surface data for one or more datasets.
% Can also be V x DEPTH x D where DEPTH > 1. In this case, <numdepth> should
% be supplied. No matter what format <data> is in, it appears... |
9b06fcebf538f5c40827ff81db4f4b70d4a3544938406ab3080de95b88550b1a | MATLAB | 1,655 | 57 | % VL_BENCH_IMREADJPEG Evaluates the speed of imreadjpeg
numThreads = 4 ;
base = 'data/bench-imreadjpeg' ;
files = {} ;
files = dir(fullfile(base,'*.jpg')) ;
files = fullfile(base, {files.name}) ;
if numel(files) > 256, files = files(1:256) ; end
for preallocate = [true, false]
opts={'verbose','verbose', 'preallo... |
8be1b916982dd916ed92b47600b3b31e12dfe835de254e79874e8ce548c07e9f | MATLAB | 1,656 | 67 | function firingRateElectrodeDistribution(File, Ephys, Params, Info, figFolder, oneFigureHandle)
%
% Plots the firing rate distribution across electrodes
% Parameters
% ----------
% File :
% Ephys :
% Params :
% Info :
%
% Returns
% -------
% None
%% Create a half violin plot of the firing rate for i... |
6f117dc0c26f1a1ee0b44f98c5af61c8ae03937a6c4ec142055d0507e8fa58d6 | MATLAB | 1,658 | 61 | %% h = sepia_handle_panel_qsm_xQSM(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global structure contains all new and other handl... |
872be3f0e608be734673e2566b88c3ce6ecac6a53c453204de734d592c53e203 | MATLAB | 1,659 | 66 | function TMSSloverSPM(imgs,outfilename,slices);
% % % % imgs{1} : 'struct imgage';
% % % % imgs{2} : 'overlay imgage';
% e.g. imgs = {'/Users/guorongwu/Downloads/spm12/canonical/avg152T1.nii';
% '/Users/guorongwu/Downloads/spm12/tpm/TPM.nii,2'}
% % % --------------------------------------------------------------------... |
d2d0e4a50f40a645aefbf8bb230d381499a2fae4600c003d68ed8e8e51b6691d | MATLAB | 1,659 | 63 | function [ccmf_out,gmm] = ccmf_detector(hsi_img,tgt_sig,mask,n_comp,gmm)
%
%function [ccmf_out,gmm] = ccmf_detector(hsi_img,tgt_sig,mask,n_comp,gmm)
%
% Class Conditional Matched Filters
%
% inputs:
% hsi_image - n_row x n_col x n_band hyperspectral image
% tgt_sig - target signature (n_band x 1 - column vector)
% m... |
3a85aa6247c1ef5681ccd759eb329e41e61151baaf08b1fe6bdb6ef2c1c31c71 | MATLAB | 1,660 | 42 | function [ts] = loadTSfromHdf5(pathName,fileName,cellOp)
% Load timestamps on ts matrix of N x max(num_ts)
%
% INPUTS
% pathName = path to the folder where the hdf5 file is. Ends with '/' or
% '\'.
% fileName = name of the file to load with extension
% cellOp = logic operator for cell array or matrix. If cellOp = 0, th... |
5fa033278b8551e68f4dd09bce22dcff45b27a52329392677481c9f7c8c06937 | MATLAB | 1,660 | 54 | function [pos, tri, tissue] = bnd2tri(bnd)
% BND2TRI takes a struct array with one triangulated surface mesh per
% tissue and converts it into a single triangulated surface mesh
% represented as one long list of triangles with per triangle a tissue or
% region type.
%
% Use as
% [pos, tri, tissue] = bnd2tri(bnd)
%
%... |
96266b07ac9a8ae1262dd58b055075045695e9028246ac047331b5002aaed9db | MATLAB | 1,660 | 31 | %{
# Arguments used to demix and deconvolve the scan with CNMF
-> preprocess.ExtractRaw
---
num_components : smallint # estimated number of components
ar_order : tinyint # order of the autoregressive process for impulse function response
merge_t... |
5e8ca243a0611d137c7e53da23f54d0c472e5f6302617c2396f08f88bbb98e0e | MATLAB | 1,661 | 48 | function ax = drawPETH(unit, TIMEWINDOW, ax_raster, ax_histo, normalize)
%% Draw PETH
% input :
% unit : cell array : Each cell represent one trial and it has n x 1 matrix.
% n represent total spikes in that window.
% Each element of the n x 1 matrix is the time point in millisecond.
% Eve... |
ec3880d8e5b56a8c326b31e45aee88138046550d47a54940757841b508ba0370 | MATLAB | 1,661 | 43 | function [w, g_sqr] = adagrad(w, g_sqr, grad, opts, lr)
%ADAGRAD
% Example AdaGrad solver, for use with CNN_TRAIN and CNN_TRAIN_DAG.
%
% Set the initial learning rate for AdaGrad in the options for
% CNN_TRAIN and CNN_TRAIN_DAG. Note that a learning rate that works for
% SGD may be inappropriate for AdaGrad; th... |
a9eb23b4a744681a05ac5b9c3c94cdf225480bacf8d3951cbe509672dbdc0491 | MATLAB | 1,662 | 52 | <<<<<<< HEAD
function [rez] = remove_cluster(rez,SpkThr,ChC,NccThr,RefrThr)
del = [];
PETH = rez.PETH;
for i = 1:length(unique(rez.st(:,end)))
ViolRefr = (100*mean(PETH(51,i)))/mean(PETH(:,i));
=======
function [rez] = remove_cluster(rez,SpkThr,ChC,NccThr)
del = [];
for i = 1:length(unique(rez.st(:,end)))
>>... |
1dd0a06974f35edfa69accabe247e27380638767674e2f56c395e4ad40c2b7de | MATLAB | 1,663 | 52 | function ft_vasa_calibration(img_input, contrast_input, spm_mat_input)
% VASA estimation
%
% ft_vasa_calibration(img_input, contrast_input, spm_mat_input)
%
% Inputs:
% img_input - cell array of filenames of input time series.
% contrast_input - cell array of SPM contrasts.
% spm_mat_input - filename of SP... |
6c656fd665a40ed89cc836bf8acb6edfa6adc94b7bb8d0f17762d111198b0c54 | MATLAB | 1,663 | 58 | function dat = read_buffer_offline_data(datafile, hdr, range)
% function dat = read_buffer_offline_data(datafile, header, range)
%
% This function reads FCDC buffer-type data from a binary file.
% (C) 2010 S. Klanke
type2type = [hdr.orig.data_type '=>' hdr.orig.data_type];
nStart = range(1)-1; % 0-based offset in sam... |
ae11081f809b8d1bb0e12d17281887ef05f7f91110faf0628166046ba54940b0 | MATLAB | 1,663 | 60 | files = dir('/archival/projects/SPLaT/data/beh/**/sub-*_task-naturalistic_beh_*.csv');
animals = {'dog','cat','frog','spider'}; loom = {'none' 'loom'};
for f = 1:length(files);
t = readtable([files(f).folder filesep files(f).name]);
for a=1:length(animals)
for l=0:1
wh_rows = strcmp(t.anim... |
b0e361002d9baa024451c99d94305e332544c2705cb50f518f3b5b92105ce974 | MATLAB | 1,663 | 63 | function [dothandle linehandle cfg] = plotDotsWith2DErrors(y,dotcolor,cfg)
%[dothandle linehandle cfg] = plotDotsWithErrors(y,dotcolor,cfg)
nsubs = size(y,1);
ncond = size(y,3);
if ndims(y) > 3
error('plotDotsWithErrors: Input Data Matrix has too many dimensions!');
end
if nargin < 3
cfg = [];
end
... |
b68a5e4b572cf15f29b144124ee55cf3e445be567c7f3bb315c50be75487a33a | MATLAB | 1,663 | 51 | function s = db_select_blob(tablename, fieldname, sel)
% DB_SELECT_BLOB selects a binary blob from a database table and converts
% it back into a Matlab variable. The variable can be of an arbitrary type.
%
% Use as
% s = db_select_blob(tablename, fieldname)
% s = db_select_blob(tablename, fieldname, num)
%
% The ... |
53480622a5325bcf02eb43df9bf8a4292ad5360b80fe1f206736f2476473a721 | MATLAB | 1,664 | 49 | function P = tapas_uniqc_spm_imatrix(M)
% Return the parameters for creating an affine transformation matrix
% copy of spm_imatrix from Version 6906 (SPM12) 20-Oct-16
% FORMAT P = spm_imatrix(M)
% M - Affine transformation matrix
% P - Parameters (see spm_matrix for definitions)
%___________________________________... |
663f20c63c7b3d89db8db08ce15917327e5c54eee0a2adb467b24c4cb0d04fcc | MATLAB | 1,664 | 63 | %% function chi = qsmTKD(localField,mask,matrixSize,voxelSize,thre_tkd)
%
% Description: compute QSM based on threshol-based k-space division (TKD)
% Ref : Wharton et al. MRM 63:1292-1304(2010)
%
% Input
% -----
% localField : local field perturbatios
% mask : user-defined mask
% matrixSize... |
13ef726b0a0050ff149140e884e1fc254c89d0190869a86224a2f89180114b95 | MATLAB | 1,665 | 53 | clear all %#ok<CLALL>
close all
% Create figure and axes.
fig = figure('Name', 'Flexible dt Tone Control (No Callbacks)', 'NumberTitle', 'off');
ax = axes('Parent', fig);
xlim(ax, [0 1]); % x-axis range that maps to frequency
ylim(ax, [0 1]); % Dummy y-axis range
title(ax, 'Move mouse horizontally to change freq... |
b24aed8e5d23c3882c5915c2d003de22e435049b85651e53bbc92bc58408fbdd | MATLAB | 1,665 | 46 | %{
aod_monet.VonMises (computed) # directional tuning
-> aod_monet.DriftResponseSet
-> aodpre.Spikes
-----
von_r2 : float # r-squared explaned by vonMises fit
von_pref : float # preferred directions
von_base : float # von mises base value
von_amp1 : float # amplitude of first peak
von_amp2 : float #... |
b9088fea67198aaec849575c33886446cfa085682f4a38a935b1663c1058bff0 | MATLAB | 1,665 | 65 | %% load data
load(fullfile('.', 'data', 'doseResponseData.mat'));
%% plot the average activity vs concentration figure
[r, c, z] = size(dffHm);
odorConc = concHm;
% meanodorConc
actAveEachOdor = mean(dffHm, 2);
actAveEachOdor = reshape(actAveEachOdor, [r, z]);
actAveEachORN = mean(dffHm, 1);
actAveEachORN = reshape(... |
c2d24de79c84303fc4fe75260a06972b3ed13e10dbf0b0b9e67866ba398c2294 | MATLAB | 1,665 | 63 | function s = print_diff(obj, input_obj, verbose)
% Prints differing property names along with their values
%
% Y = MrCopyData()
% Y.print_diff(inputs)
%
% This is a method of class MrCopyData.
%
% IN
% verbose {true} or false; if false, only the string is created, but no output to the command window
%
% OUT
% s ... |
4852b3bd770050759c1c493d9600b35fc9f2f2f79004df3035d15aee6fd23a8f | MATLAB | 1,666 | 81 | clear all;
warning off all
% %number of inputs
N = 1;
% sine wave target function
L = 3; %duration in seconds
dt = 0.001;
time = 0:dt:L;
A = 100; %amplitude
w = 5; %frequency
s = scaledata(A .* sin(2.*pi.*w.*time),0,1);
T = length(s);
X = repmat(s,N,1);
%gain of activity
g = 1;
%number of reservo... |
95d4e66a606d1139bfe11a9314689595ce55942bfdc9c435d3d7ecbee48a8352 | MATLAB | 1,666 | 43 | %% AnalyzeAutoEncoderData
basePath_autoencoder = 'D:\Data\Lobster\AutoEncoderResult';
basePath_other = 'D:\Data\Lobster\FineDistanceResult_speed';
filelist = dir(basePath_autoencoder);
sessionPaths = regexp({filelist.name},'^#\S*.mat','match');
sessionPaths = sessionPaths(~cellfun('isempty',sessionPaths));
load("Appa... |
129d69b3315979ff802b140f1f3a4d3a6cc87c27a6b9745f1d0de32c58f0060f | MATLAB | 1,667 | 47 | function metadata = importLVmetadata(filename, dataLines)
%IMPORTFILE Import data from a text file
% METADATA = IMPORTFILE(FILENAME) reads data from text file FILENAME
% for the default selection. Returns the data as a string array.
%
% METADATA = IMPORTFILE(FILE, DATALINES) reads data for the specified
% row in... |
5e02c462868fe87fdd3d5825b28c5d2abcbf53ea865eda3acb515f348b6b051f | MATLAB | 1,667 | 47 | function relRoi = sphericalRelativeRoi(rad_mm, voxelSize_mm);
% USAGE: sphereRelRoi = sphericalRelativeRoi(rad)
%
% FUNCTION: create a solid sphere of voxels of radius rad.
%
% ARGUMENTS:
% rad_mm the sphere's radius in millimeters
%
% voxelSize_mm a triple specifying the voxel size along the three
... |
ad9a64f11550e5619dba898d71292ef495f6b17c4123035a6b7605cd8862d792 | MATLAB | 1,669 | 81 | %CROP_BORDERS Crop the borders of an image or stack of images
%
% [B, v] = crop_borders(A, bcol, [padding])
%
%IN:
% A - HxWxCxN stack of images.
% bcol - Cx1 background colour vector.
% padding - scalar indicating how many pixels padding to have. Default: 0.
%
%OUT:
% B - JxKxCxN cropped stack of images.
% ... |
0010e0be9db00ef950a4214846b53d96015e1e32c960244767c613fc7a126b90 | MATLAB | 1,670 | 50 | function [logp, yhat, res] = tapas_condhalluc_obs3(r, infStates, ptrans)
% Calculates the log-probability of response y=1 under the unit-square sigmoid model
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2020 Christoph Mathys, TNU, UZH & ETHZ
%
% ... |
5ca0d268ea733a2c90b3bdefa5aa022fd5e4cb7503ad929371c80888e8841350 | MATLAB | 1,670 | 58 | % a cell with filenames for testing
% for now these are all niml ascii files
fns=afni_niml_gettestfiles();
n=numel(fns);
for k=1:n %number 3 did not work as it's an ROI dataset
fn=fns{k};
[p,s]=afni_niml_read(fn);
% print a few lines
fprintf('%s\n', s(1:1000));
% switch a... |
ce00268fa14b535c8ae5a696a4f09450df8fe8ac044d090907f7979e4126c21f | MATLAB | 1,671 | 41 | %% =============================
% PALM Analysis: Acquisition CS
% =============================
% --- Locate repo root (relative to this script)
thisfile = mfilename('fullpath');
[scriptdir, ~, ~] = fileparts(thisfile);
cd(scriptdir); % Ensure consistent working dir
% Navigate up to FEARTUS root
repo_root = fullfi... |
0f10d9cc13bbbd1682b1822dfe9aad75e64bb5538017f4bdd548651db0bf8cc0 | MATLAB | 1,672 | 48 | function emptyImage = create_empty_image(this, varargin)
% Creates all-zeroes image with the same geometry as defined by this and
% the select option.
%
% Y = MrImageGeometry()
% Y.create_empty_image('t', 1:10)
%
% This is a method of class MrImageGeometry.
%
% IN MrImageGeomtry object and optional select par/va... |
35b7045fbea17e93f53fb6eb3661ce328683fdce8d35fdfc8bad7122302c7190 | MATLAB | 1,672 | 33 | % deprecated function to install plugin - use plugin_menu instead
% Copyright (C) 2012- Arnaud Delorme
%
% This file is part of EEGLAB, see http://www.eeglab.org
% for the documentation and details.
%
% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the f... |
f538febb858c291c85cc31d7b7387e76c8fbf2ed832ff2174629b10ddcf926fd | MATLAB | 1,672 | 29 | % Example to export NWB-formated iEEG data to BIDS
% The data is not included here because it is too large, but it
% can be downloaded from https://dandiarchive.org/dandiset/000576
%
% Arnaud Delorme - April 2024
folder = '/System/Volumes/Data/data/data/nwb000576/';
if ~exist(folder, 'dir')
error([ 'Data folder ... |
aa56e190041469f44f18458dd598f9daef8320d5e6fbe1359ca65fd18c232e5d | MATLAB | 1,673 | 63 | function [M, z, sliceThick] = sero_pulseq_sliceProfile(rf_wf, rf_t, flipAngle, gSlice, sliceThick, do_rewind)
% function [M, z, sliceThick] = sero_pulseq_sliceProfile(rf_wf, rf_t, flipAngle, gSlice, sliceThick, do_rewind)
%
% By Filip Sz but very inspired by https://larsonlab.github.io/MRI-education-resources/
%
% rf_w... |
7be2478f6d8cc30ed11271f2bb30b94415e9ac8970801d90ecbab497e7ab305f | MATLAB | 1,674 | 54 | function fh = tapas_physio_plot_traces(pulset, rsampint, rout, resp_max, ...
cumsumh, sumh, h, npulse, dpulse, rphase)
nsamples = length(pulset);
t = (0:nsamples-1)*rsampint;
feqht = cumsumh/sumh*pi;
fh = tapas_physio_get_default_fig_params();
set(fh, 'Name', ...
'Preproc: get_respiratory_phase: histogram for ... |
384befc03b2988dff011e8f7cb179c8ec053226d681d48f024471a0346f773be | MATLAB | 1,677 | 68 | function [simC, simM] = simWTcurves(ratTrial, simType)
%Simulate wait times using the behavioral model
%INPUTS:
% ratTrial = example rat trial data containing reward volumes, trial
% number, etc
% simType = string indicating model manipulation to use (e.g. 'lapse')
%OUTPUTS:
% simC = simulated control wai... |
8114d460c809e8e991ba4deb6a9610d39b3213840f368badb08cdd895a98ad48 | MATLAB | 1,677 | 44 | %% tf = qsm_method_uses_mask_in_inversion(qsmMethod, solver)
%
% Input
% --------------
% qsmMethod : QSM dipole-inversion method name (algorParam.qsm.method /
% methodQSMName entry)
% solver : (optional) method-specific solver name, for methods with
% multiple solvers (e.g. the "MRI Suscep. ... |
d1c06a4a31e451edaba6c58df33acd04f0363c7ea6dd2cc0c6f7c5bcd29b2881 | MATLAB | 1,677 | 45 | % osp_extract_image_montage.m
% Helge Zoellner, Johns Hopkins University 2021.
%
% USAGE:
% [three_plane_image] = osp_extract_image_montage(ImageFile, MaskFile);
%
% DESCRIPTION:
% Creates a SPM volume containing a voxel mask with the same dimensions
% as the SPM volume containing a structural image. The voxel mask wil... |
f8ba597780d59354d444d3aa56cb3e1b95f3b6cd5f88aa50d387cd960ac6dc7e | MATLAB | 1,677 | 60 | function [arr_names,sz]=Dir2Arr(srcpth,extns,omit,silentFlag)
%Author: Eve LoCastro, Weill Cornell Medical College, Department of Radiology, IDEAL Imaging Lab, November 2011
%Dir2Arr sends dir search filenames to matlab array variable (like its pre-
%decessor, DirToArr), but with extended functionality. srcpth, ex... |
75abd36fe3ea623664e55c030ed20982958587dbbc6fe0290fa2f3ce5691d63d | MATLAB | 1,678 | 67 | function test14()
% Test for complexcircle geometry (Z2 synchronization)
%
% This file is part of Manopt: www.manopt.org.
% Original author: Nicolas Boumal, Dec. 30, 2012.
% Contributors:
% Change log:
n = 1000;
z = 2*randi(2, n, 1)-3;
% Exact data matrix
H = z*z' - eye(n);
% Add ... |
b8487160306e356f2d8eb4bdcc4bb1e964130ec4584361de04a36e2d2fbeb40c | MATLAB | 1,678 | 53 | %FindInInterval - Find values that fall in a given interval.
%
% The equivalent Matlab code is trivial
%
% i = find(values(:,1)>=interval(1)&values(:,1)<=interval(2));
% indices = [i(1),i(end)];
%
% but becomes extremely slow when dealing with very large lists.
% This function can dramatically speed up thi... |
e16bff225e2cc10e4f147c5357f967fb6485201c7b8e5eb274e929ce03684e96 | MATLAB | 1,678 | 49 | function osp_onListSelection( src, ~,gui)
%% osp_onListSelection
% This function is triggered when a file is selected in the listbox. It refreshes
% the figure.
%
%
% USAGE:
% osp_onListSelection(src,~,gui);
%
% INPUT: src = handle of the fit tabs
% gui = gui class containing all hand... |
f44d817ed7a9eace4191b7a4e69c0b284e336f0150b730733605b05558a774b6 | MATLAB | 1,678 | 35 | % STD_PLOT - This function is outdated. Use STD_PLOTTF to plot time/
% frequency decompositions and function STD_PLOTCURVE to
% plot erp and spectrum.
% Copyright (C) 2006 Arnaud Delorme
%
% This file is part of EEGLAB, see http://www.eeglab.org
% for the documentation and details.
%
% Redist... |
2612b016b1928715a1c18b7b28d536d6f28b1f877b21ee2dd82d689b3f4d4cf8 | MATLAB | 1,679 | 47 | function [pks,locs] = tapas_physio_findpeaks(X,varargin)
% Finds local peaks in the data. Wrapper for Matlab's findpeaks,
% with compatibility alternative, if no signal processing toolbox available
%
% [pks,locs] = tapas_physio_findpeaks(X,varargin)
%
% IN
% X input data vector
% varargin property name/valu... |
9a577ed68028684c8206079aa59b22051a03d9a4aba9290e4394b93e87a787b4 | MATLAB | 1,679 | 65 | function varargout = hist(this, nBins, varargin)
% Computes and plots histogram of image intensities
%
% Y = MrImage()
% [pixelsPerBin, figureHandle] = ...
% Y.hist(nBins, 'ParameterName1', 'ParameterValue1', ...)
%
% This is a method of class MrImage.
%
% IN
% nBins number of histogram bins; default:... |
ebb5919a96a3eb716a7bcaa5a0dde821c6d377a37af254261dd137bcd6bad1e6 | MATLAB | 1,679 | 55 | function tapas_fit_plotResidualDiagnostics(r)
% Plots residual autocorrelation and residuals against predictions
%
% USAGE:
% est = tapas_fitModel(responses, inputs);
% tapas_fit_plotResidualDiagnostics(est)
%
% --------------------------------------------------------------------------------------------------
%... |
f15f5c3a2ecead6cc73d6a973299248f673ee2a46237eba5e40cea65a23f8b0a | MATLAB | 1,679 | 50 |
function pa_overall_threshold(studynames,allconditions,xyz,radius_mm,normby,mask)
%
% gets uncorrected and corrected p-values for prob of activation
%
% [allconditions,pointcounts,studynames,allcondindic,allcondnames] =
% dbcluster2indic(DB,DB,{testfield});
%
%
for i = 1:length(studynames)
wh = find(strc... |
442362919e3258fb3dd6193307ce8b4eced9ac04f187a1c91fa9a1da6784f539 | MATLAB | 1,680 | 57 | function [answer, anstime]=get_key(keys, wait, t0, trialstart);
%[answer, anstime]=get_key(keys, wait);
%
%Get keyboard-input from user - waits for a key press as defined in input variable 'keys' OR just checks once
%
%INPUTS
%keys key numbers we are looking for. scalar for one key, or row vector of key n... |
5c404f9d47bb9290727fbf9710003ba06be338dd324cacb86cde5d82edc14151 | MATLAB | 1,680 | 62 | %% h = sepia_handle_panel_qsm_TKD(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global structure contains all new and other handle... |
d9a38fb8271b4d2ff4ddeda9dde21fe081ad9b005aaad7c12f093b1820c4f9a9 | MATLAB | 1,680 | 53 | function [pVals, hVals] = getSignificance(trials, labels, alphaVal)
% determines if data in 'trials' are statistically significantly different
% based on their 'labels'
% trials: 3D = samples x channels x trials
% labels: 1D = trials labels
% (c) Jiri, Mar16
if nargin < 3
alphaVal = 0.01; % significance le... |
fe3a4e275a9aaed76263eb2cb7c55afbd51ae98fc151b7a096a71584d8e53e93 | MATLAB | 1,681 | 37 | % check folder
cd ..
path2eeglab = 'eeglab';
addpath(fullfile(path2eeglab, '/functions/guifunc'))
addpath(fullfile(path2eeglab, '/functions/popfunc'))
addpath(fullfile(path2eeglab, '/functions/adminfunc'))
addpath(fullfile(path2eeglab, '/plugins/firfilt'))
addpath(fullfile(path2eeglab, '/functions/sigprocfunc'))
addpa... |
2d8f288dc8b95acfc1663e0be5ade067dcd2092511bad88bd9497e6c91764dab | MATLAB | 1,682 | 52 | function sample_points = tapas_physio_get_sample_points(ons_secs, sqpar, slicenum)
% gets times of slice scan events of a particular slice number in every
% volume acquired
%
% USAGE
% sample_points = tapas_physio_get_sample_points(ons_secs, sqpar, slicenum)
%
% INPUTS:
% ons_secs
% sqpar
% slicenum - slice ... |
c9189aef74b1d352cf771533030b2d8425843a4966118a3885570b43bd1862d7 | MATLAB | 1,682 | 51 | function [funcs,PB,sizing,borders,myelin] = Setup_Simulation
%% Setup oligos
myelin.oligo_dim = 5; % dimension of oligo block
if myelin.oligo_dim == 5 || myelin.oligo_dim == 10
sizing.myelinwidth = 100;
sizing.domainheight = 300;
elseif myelin.oligo_dim == 3
sizing.myelinwidth = 99;
sizing.dom... |
db07c4c24e76140b1b1e54f7cf069bf7767671d7e41c7cfa6f80fc5184b6581d | MATLAB | 1,683 | 62 | %% h = sepia_handle_panel_qsm_myQSM(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global structure contains all new and other hand... |
3b383cbfb81fa1ee1281cb3c44e0ba909096d5660e7ca1ebd91e63382a36e4c7 | MATLAB | 1,684 | 100 | function [ EEGOUT, command ] = pop_check_logs( EEG, varargin)
command='';
EEGOUT = EEG;
logs = EEG.cwregression.cfg.cwregression.logging;
check_logs_ui(EEG, logs);
% so make here a nice diagnostical GUI that allows you to make figures
% for checking weights, variance explained, etc etc... that you can track
% f... |
c725b85ea90b855bcc8edea36912bbd23978079bc5adf813f1bea87929019b27 | MATLAB | 1,684 | 48 | function [event] = read_brainstorm_event(filename)
% READ_BRAINSTORM_EVENT reads the event information from .EEG files
% that have been generated by the Nihon Kohden system. The function
% constitutes a wrapper around BrainStorm3 functionalities
%
% Use as
% [event] = read_brainstorm_event(filename)
%
% See also R... |
ee059be89abf4634d62a63c7af2e23e6f0797669bb4908f9f8922bd8f168f525 | MATLAB | 1,684 | 47 | classdef nnconcat < nntest
methods (Test)
function basic(test)
pick = @(i,x) x{i} ;
sz = [4,5,10,3] ;
for dim = 1:3
sz1 = sz ; sz1(dim) = 3 ;
sz2 = sz ; sz2(dim) = 7 ;
sz3 = sz ; sz3(dim) = 2 ;
x1 = test.randn(sz1) ;
x2 = test.randn(sz2) ;
x3 = tes... |
53dd3006ed5397f1330d2446a0e74e14faca9655cd07496e5f7cb11b4c1dff40 | MATLAB | 1,685 | 71 | function [time] = tapas_sem_plot_responses(y, u, time)
%% Plot the data from a subject
%
% Input
% y -- Structrue with fields t and a, where t is a vector
% of reaction times and a the action (either zero or
% or 1.
% u -- Structure with fields tt. tt is a vector of integer... |
49033691dadd0115ea5667fb6075747394a2b7a2dae8f1cc1d976570f7215874 | MATLAB | 1,687 | 42 | %% =============================
% PALM Analysis: EXT CS×TUS×EXP
% =============================
% --- Locate repo root (relative to this script)
thisfile = mfilename('fullpath');
[scriptdir, ~, ~] = fileparts(thisfile);
cd(scriptdir); % Ensure consistent working dir
% stats/permutation_tests/palm_code/<thisfile>
%... |
72b9338d1fcc20925066bbd9e4d6bf92ae14b1b76a535d4e7549a1e9e6f2d6d3 | MATLAB | 1,687 | 46 | function [rez]=probability(rez)
Nrank = 3;
M_clust = length(unique(rez.st(:,end)));
h = waitbar(0, 'Computing joint probabilities...');
rez.PDF =cell(M_clust,1,1);
for i = 1:M_clust
Channel = rez.Merge_cluster{i,5};
Nchan = length(Channel);
PC = rez.PC{i};
if(length(PC)>500)
for k = 1:Nchan
... |
f9ec3e50c0e51e3a2e0dd4e3a6d021e81567212e791d1371f9e5e328ec83afb7 | MATLAB | 1,687 | 59 | %islvector - Test if parameter is a (pseudo) logical vector satisfying an optional list of tests.
%
% USAGE
%
% test = islvector(x,test1,test2,...)
%
% x parameter to test
% test1... optional list of additional tests (see examples below)
%
% EXAMPLES
%
% % Test if x is a logical vector
... |
4722e69574b85eff232d089c728806ace38e62b0c4f0c372ce907251f8106d14 | MATLAB | 1,689 | 69 | function output = ppint(pp,a,b)
%PPINT Integrate piecewise polynomial.
% QQ = PPINT(PP,A) returns the indefinite integral from A to X of a
% piecewise polynomial PP. PP must be on the form evaluated by PPVAL.
% QQ is a piecewise polynomial on the same form. Default value for A is
% the leftmost break of PP... |
fa5ded22aa985ffaae92def06045ddf3fc8300d223c1351c0004f69863f19db1 | MATLAB | 1,689 | 43 | function ProcessData_ExtendedData3(datadir, savedir, codedir)
%ProcessData_ExtendedData3 - Process raw data saved under datadir such that it can be plotted by PlotExtendedData3.
% INPUTS:
% datadir - Local directory where 'Golden_Nature/RawData_Figure1.mat' from Zenodo was saved
% codedir - Local directory where co... |
f4a93839d5c281cce14e1a241887a75f0b9b7995a66082ee2f0407c06ba55ee1 | MATLAB | 1,690 | 48 | function multicenter_nodal_stats(NodalStr,Age_gender,Brainsz,Pathnewxsl,opthub,Pathnewplot,Scalev1,Nname,netname,indall_select,betainitial,plotornot,fdrbon,Site_info);
% %sort
Strsort=[];indstr=[];indstrre=[];re=[];
roi_num=size(NodalStr,2);
indminNodalStr=[];
indminNodalStrmdall=[];
for i=1:roi_num%60
%for i=... |
0752b8d062917e2ee5afeb2db0669914f8bb9d7b94f51f9e33356c9164b39455 | MATLAB | 1,691 | 39 | %function [ output_args ] = ComputeVN(cleandtseries,bias,ICAtcs,ICANoise,OutputVN,wbcommand)
function ComputeVN(cleandtseries,bias,ICAtcs,ICANoise,OutputVN,wbcommand)
%Compute CIFTI variance normalization based on ICA+FIX outputs
%This function regresses the structured signal out of the data
%to create a dense timeseri... |
7f43b042ad802658c28ad6af891e7a4ff35935a079f40b4b8597814d042c1c92 | MATLAB | 1,691 | 62 | function label = syntheticLabeledImage(isize, nlabel, objsize)
%
% label = syntheticLabeledImage(size, nlabel. objsize)
%
% description:
% generates a test labeled image
%
label = zeros(isize);
dim = length(isize);
if nargin < 3
objsize = 10 * ones(1, dim);
else
objsize = padright(objsize, dim, 'circular');... |
a58b5f495987dcf5d2adc148f42efec080a737e022c6c06e96c2d1e03ebb9bc1 | MATLAB | 1,691 | 60 | function interactiveConductance3Dslice(fa, dim_size, potentials, mask_index, dim, slice)
% Interactive conductance map from 3D data, computing one slice
%
% Author: Aina Frau-Pascual
% Conductance map
if dim==3
fa2 = squeeze(fa(:,:,slice));
dimx_size = dim_size([1,2]);
elseif dim==2
fa2 = squeeze(fa(:,sli... |
4f96531d10e935d2c86d59bf86bcdcb947bf7c5fbdcbb9dcedc4f9c816f70c7c | MATLAB | 1,692 | 48 | function [Mdl] = run_svmC(params)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% run_svmC returns Mdl structure including function handles of
% builtin fit, predict and score functions for support vector
% classification.
%
% Arguments:
% params: Structure including following hyperpara... |
83351fd52a9f4906d78df69ddbe4933f076f5a3c9a421958dd92a2ccd74fb60f | MATLAB | 1,692 | 63 | function this = MrDimInfo_get_add_remove(this)
% Unit test for MrDimInfo get, add and remove method
%
% Y = MrUnitTest()
% run(Y, 'MrDimInfo_get_add_remove')
%
% This is a method of class MrUnitTest.
%
% IN
%
% OUT
%
% EXAMPLE
% MrDimInfo_methods
%
% See also MrUnitTest
% Author: Saskia Bollmann
% Created: ... |
2e3d10610311e3ed1b521adcc095ca5fc320e93d400ef607928aaa0086e2b246 | MATLAB | 1,693 | 51 | function [pVals, hVals] = getSignificance_trials_baseline(trials, time, labels, baseline_period)
% determines if data in 'trials' are statistically significantly different from baseline
% based on their 'labels'
% trials: 3D = samples x channels x trials
% time: 1D = samples
% labels: 1D = trials labels
% pVals, hVals:... |
7927d5f00f867c6364d2f38e91b51472c91fba4a684fc3875899125264145f70 | MATLAB | 1,693 | 59 | function [itau] = tapas_ceode_compute_itau(P, M, U)
% [itau] = tapas_ceode_compute_itau(P, M, U)
%
% Computation of delays (in samples).
%
% iD = delay matrix / sampling Rate
%
% The resulting sample-delay matrix is read FROM (column) TO (row)
%
%
% INPUT
% P struct parameter structure
% M ... |
02bd8aea2bad4f853b9479197889b3c32ab9127564492a3713c107d6ef536f98 | MATLAB | 1,694 | 37 | % shiftImage2D - shift image in 2 dimensions, given an x and y shift (units in indices)
%
% behaves like circshift, but without any wrapping (any new pixels are given a value of 0)
%
% helpfully, this deals with the indexing garbage that is soooo annoying to deal with under the hood
%
% you do not have to worry abou... |
40690ea4a05e9747b5e6c5525770fc400429f5fce375efc02b567e5e76e3d9dd | MATLAB | 1,694 | 52 | function plotTrajectoryApertureEvents(kinematics)
% Plots centroid trajectories with annotated aperture events
% Figure
fig;
hA = gca;
axis off
hold on;
hA.View = [-12,8];
axis(hA, 'equal');
% Params
tracecol = [0.5,0.5,0.5, 0.5];
liftCol = [130, 235, 118]/255;
collectCol = [72, 188, 255]/255;
extendCol = [230, 40, 1... |
5ab93bd8a3b95f34b08bf64e31d7574565989ae2fdb122c868b74be705228f3a | MATLAB | 1,694 | 61 | function [Genotypes] = get_best_genotypes(saveGenotypes)
% Returns a structure with the best genotype of the best population for
% each combination of ctype-env-criterion.
%
% Parameters:
% -----------
% saveGenotypes (bool): if true, saves output to classes directory
%
% Returns:
% --------
% Genotypes (struct): po... |
d4c361a62f1bd3a712a05fcfd94a50ff47100775bec198aaf9c60d852e2bcaa6 | MATLAB | 1,694 | 42 | function [f,xx,yy,zz] = makegaussian3d(matrixsize,mn,sd,xx,yy,zz,n)
% function [f,xx,yy,zz] = makegaussian3d(matrixsize,mn,sd,xx,yy,zz,n)
%
% <matrixsize> is [X Y Z] with the number of voxels along the three dimensions
% <mn> is [A B C] with the peak of the Gaussian. a value of 0 means center of
% the first voxel. ... |
dcd4298035f081ec16058707563ea55e15b3227bb3382f0cce046a1b2fec7794 | MATLAB | 1,694 | 38 | % script to convert MP2RAGE images into T1 (R1) map estimates as suggested in:
% MP2RAGE, a self bias-field corrected sequence for improved segmentation and T 1-mapping at high field
% JP Marques, T Kober, G Krueger, W van der Zwaag, PF Van de Moortele, R.
% Gruetter, Neuroimage 49 (2), 1271-1281, 2010
% additionally i... |
176f616e747b7e1829183fbbe0483790ce7740c5228edc7cd23eefffef35efc8 | MATLAB | 1,695 | 52 | %% get_set_bfr_lbv(h,mode,input)
%
% Input
% --------------
% h : structure contains all handles of SEPIA
% mode : 'set' - extract information from GUI to config file
% 'get' - extract information from config file to GUI
% input : if mode is 'set' then input should be fid
% ... |
c066d0f430c90ff8d26f427661d70a9983b310e3cd6cf1f165754cd92eee2ac3 | MATLAB | 1,695 | 52 | function [] = plotGenes(populations)
% plot gene distributions
% get some parameters for convenience
geneNames = populations{1}.GeneNames;
numGenes = populations{1}.NumGenes;
numPops = length(populations);
%numBins = round(populations{1}.Size/4);
% identify the fittest the best solution across all population... |
da3e62d18cf1463eae9e50dd06dcb26b1e272a7e4b7347b6b73380e171e43286 | MATLAB | 1,695 | 50 | %{
# Area Masks for visualization
-> anatomy.Area
---
mask : mediumblob # area mask
%}
classdef Masks < dj.Lookup
methods
function plotMask(obj,color,n,varargin)
params.fontsize = 10;
params.outline = [];
params = ne... |
30aa2c9c26355c60be1ecd99c1fd88f910ac72d4957a8b348094c3f536da8729 | MATLAB | 1,700 | 43 | function TellMeAboutClassification(cfnParams)
% TellMeAboutClassification Gives some user-interpretable information about the
% classification settings
%
%-------------------------------------------------------------------------------
% Copyright (C) 2013-2026, Ben D. Fulcher <ben.d.fulcher@g... |
db79988bc5769b5d674e42688f8f5174e8abde4a13fa9866ba9726cd6fe44b1e | MATLAB | 1,700 | 41 | function verboseFlag = TISEANVerbose(newValue)
% TISEANVerbose Get/set whether TISEAN-calling operations print their
% informational logging (temp file paths written, per-call timings).
%
%---USAGE:
% TISEANVerbose() -- returns the current setting (default: false)
% TISEANVerbose(true) -- turn TISEAN informat... |
226de806824d64c3e815b54d5d3909435578928b8578d1455e88ed0d44e41033 | MATLAB | 1,701 | 50 | function C2 = mahiemFunc(dat,theta,thetabasis)
if nargin < 3
thetabasis = -pi:pi/8:(pi-pi/8);
end
thetabasis = thetabasis(:); %make sure the basis set locations are in a column vector
nChan = length(thetabasis); %number of virtual channels of output
nsens = size(dat,1); %number of M/EEG sensors
ntrl = size(dat,2... |
9c940c5dbdc893d6cc934a26fd144a98fb90a3d2b687b14d68a2907724740e73 | MATLAB | 1,701 | 40 | % compile mex file
mex mex/perform_front_propagation_2d.cpp mex/perform_front_propagation_2d_mex.cpp mex/fheap/fib.cpp
mex mex/perform_front_propagation_3d.cpp mex/perform_front_propagation_3d_mex.cpp mex/fheap/fib.cpp
mex mex/perform_circular_front_propagation_2d.cpp mex/perform_front_propagation_2d.cpp mex/fheap/f... |
c982676a119e70a69a84ac2ae82ddb72d69810d8c9a4833f08b2799dfb76755f | MATLAB | 1,701 | 48 | function map = PhaseCurve(samples,phases,varargin)
%PhaseCurve - Compute spatial phase curve.
%
% Compute phase curve, as well as occupancy and count curves.
%
% USAGE
%
% curve = PhaseCurve(samples,phases,<options>)
%
% samples <a href="matlab:help samples">samples</a>, e.g. angles or linear positions ... |
76d49cb94b9d2111f73b742fd9fbf36cba06383ba40a4efe65a1214a413e4653 | MATLAB | 1,702 | 37 | %% sepiatest.assume_toolbox_available(testCase, toolboxes, key, label)
%
% Description: shared assumeTrue/assumeFail gate used by every Tier-2
% matrix test before it runs a method. `key` is one of:
% 'none' - method needs no external toolbox, always proceeds
% 'unavailable' - method has no model/checkpoint ... |
8ca853cdc1fcf4c0cd43004f24b0bf1ec16933e4c26338b5f2cf39a35a923e75 | MATLAB | 1,702 | 61 | function cnn_imagenet_camdemo()
%CNN_IMAGENET_CAMDEMO Realtime classification with a webcam
% Download the pre-trained models from
% http://www.vlfeat.org/matconvnet/pretrained/
%
% Download MATLAB's webcam support from:
% http://mathworks.com/hardware-support/matlab-webcam.html
run(fullfile(fileparts(mfilenam... |
acb07ebe914d1ddb4907140e30447c02c81966379187bd907a7d68c2d9b8c65b | MATLAB | 1,702 | 80 | %% [r2s,t2s,m0] = R2star_GS(img,te,m0mode)
%
% Input
% --------------
% img : multiecho images, time in last dimension
% te : echo times
% m0mode : method to compute m0, 'default','weighted','average'
%
% Output
% --------------
% r2s : R2* map
% t2s : T2* map
% m0 ... |
d7fed19c3b2e899ddf78500fd240bfd146293e15839f469751f869b10ab2f4b3 | MATLAB | 1,702 | 45 | function [Nens,ensId,centInd,haloInd,delta,rho,predbounds]=find_ens_by_density(dist,percNeigh,clusmet,ishalo,plt)
% [Nens,ensId,centInd,delta]=find_ens_by_density(dist,percNeigh,sdfact)
%
% Search for ensembles on the 'dist' distance matrix using the density
% peaks clustering methods by Rodriguez and Laio 2014.
%
% IN... |
8f4a7be0816fbaaf977544d4883eb35d0c4750935f38083b15a0ca784d1cc6be | MATLAB | 1,703 | 58 | function h = visChanRej(EEG, newChanlocs)
% document
% identify removed channels:
rejChanMask = ismember({EEG.chanlocs.labels}, {newChanlocs.labels});
if all(rejChanMask)
plotRej = 0;
else
plotRej = 1;
end
nbChan = EEG.nbchan;
figure(); set(gcf, 'position', [0 0 600 450])
subplot(211); hold on
... |
49c8fa3e1df58fea6d0729fd48028ed8b39dddbdc00db1c742c15caa1e1d71ed | MATLAB | 1,704 | 74 |
function [data, varargout] = read_AP_from_bin(data_file, varargin)
FS = 30000;
if nargin>1
start_point = varargin{1};
else
start_point = false;
end
if nargin>2
end_point = varargin{2};
else
end_point = false;
end
[filepath,binName,~] = fileparts(data_file);
try % if meta file exist (spikeGLX reco... |
4ac9595d697e16be39eaf562dd8492be868d6a1b5b224f76af6bccc08ea6df60 | MATLAB | 1,704 | 56 | function [nbc, data] = Meta_NBC_from_mkda(DB, MC_Setup, fieldname, names_cell)
% Take output from Meta_Setup and Meta_Activation_FWE (DB and MC_Setup) and
% run Naive Bayes classifier, on labels of your choice.
%
% [nbc, data] = meta_nbc_from_mkda(MC_Setup, DB, fieldname, names_cell)
%
% If MC_Setup is empty, will run... |
546704033311e03e6b0316893d31c57fe49f9e4342487d974dad7cf71d295bae | MATLAB | 1,704 | 59 | function this = MrDimInfo_permute(this)
% Unit test for MrDimInfo permute
%
% Y = MrUnitTest()
% run(Y, 'MrDimInfo_permute')
%
% This is a method of class MrUnitTest.
%
% IN
%
% OUT
%
% EXAMPLE
% MrDimInfo_permute
%
% See also MrUnitTest
% Author: Saskia Bollmann
% Created: 2018-01-15
% Copyright (C) 2018 I... |
59311be63366bb0660a404a4e1ed69aa6f58d241782d07a1c58b19ca8b73cebc | MATLAB | 1,704 | 74 |
function [data, varargout] = read_LFP_from_bin(data_file, varargin)
FS = 2500;
if nargin>1
start_point = varargin{1};
else
start_point = false;
end
if nargin>2
end_point = varargin{2};
else
end_point = false;
end
[filepath,binName,~] = fileparts(data_file);
try % if meta file exist (spikeGLX reco... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.