sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
0a6960ac62ecc32ef18a16845072d6367b880d82d8dcecf62c105f1970a2e98f | MATLAB | 1,566 | 62 | function s=compute_similarity (x,insFile,gmFile)
% This script computes similarity matrix between each pair of subcortcial
% voxels
% INPUT:
% x: fMRI time series, dimension time x number of all gray matter voxels
% Concatenated fMRI signals of all gray matter voxels
% insFile: binary subcortex mask in NIFTI format (... |
376ba9fe3dc1070281b678cc43480aaf70969e7ba0720e75edf8240775be2ed5 | MATLAB | 1,566 | 67 | function plot_fig6a(datadir)
% Plot z-scored dopamine and acetylcholine responses on contralateral trials
% aligned to when the side LED turns on, averaged across rats. N = 10 DA
% rats, N = 10 ACh rats.
%
% INPUTS
% datadir: file path of data downloaded from Zenodo. Link to download can
% be found in README.
SON_DA =... |
4478b3de32d4e2b43d26c3fe52ee211be470dc20026be6498ee07f95d8419e18 | MATLAB | 1,566 | 58 | function [nstate] = tapas_sampler_dlinear_gibbs_node(data, model, ...
inference, state, node)
%% Samples from a linear model with variance using a gibbs step.
%
% Input
%
% Output
%
% aponteeduardo@gmail.com
% copyright (C) 2016
%
nstate = state;
[np, nc] = size(state.graph{node - 1}.y);
nm = numel(state.graph{n... |
82118062409b7418ad5b7680f4dcc3fd288b554504e9ab715132efe2ee0b467d | MATLAB | 1,566 | 59 | function basis = basis_col(A)
%
% Bases
%
% basis_col(A) produces a basis for the subspace of Eucldiean n-space
% spanned by the vectors {u1,u2,...}, where the matrix A is formed from
% these vectors as its columns. That is, the subspace is the column space
% of A. The columns of the matrix that is returned ... |
04c348cb66e9f3ee6cb46ae1a26b3391b6b6ba885910217d94305a473f84dce5 | MATLAB | 1,567 | 48 | function [b,r,SSE,SSR, T] = rest_regress_ss(y,X)
% [b,r,SSE,SSR, T] = y_regress_ss(y,X)
% Perform regression.
% Revised from MATLAB's regress in order to speed up the calculation.
% Input:
% y - Independent variable.
% X - Dependent variable.
% Output:
% b - beta of regression model.
% r - residual.
%... |
b577e4e4af29784552026685dbae7cae34f6def3b1b1889de8171721867c7529 | MATLAB | 1,567 | 58 | classdef Concat < dagnn_bc.ElementWise
properties
dim = 3
end
properties (Transient)
inputSizes = {}
end
methods
function outputs = forward(obj, inputs, params)
outputs{1} = vl_nnconcat(inputs, obj.dim) ;
obj.inputSizes = cellfun(@size, inputs, 'UniformOutput', false) ;
end
... |
1634c2c872ceffdb1eff5d5f184aeeb7c8584e0dd3d62661a3f8cdaab3ca4049 | MATLAB | 1,568 | 46 | function this = apply_transformation(this, otherGeometry)
% Performs affine transformation on Geometry by multiplying of 4x4 affine matrix
%
% Y = MrAffineTransformation()
% Y.apply_transformation(otherGeometry)
%
% This is a method of class MrAffineTransformation.
%
% IN
% otherGeometry MrAffineTransformation ... |
3c2acad2eec9c43d8858e9b5c74ba6e159d60dea817868767cafc2b5f7b0d97e | MATLAB | 1,568 | 47 | function y = istrue(x)
% ISTRUE converts an input argument like "yes/no", "true/false" or "on/off" into a
% boolean. If the input is boolean, then it will remain like that.
% Copyright (C) 2009-2012, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and ... |
61c4e35f69624a0dc2c5b76806487b8c5d1877adc2d6daa42173aacd8f0ab935 | MATLAB | 1,568 | 47 | clear
res=.001; % for cong greed.
% mconf=[2.4 3 4 4.6]; % mean of confidence vector
mconf=[2.3 3.1 3.9 4.7]; % mean of confidence vector
% this is the objective function to constrain the mean!
f= @(x,c)x.^(1:6)*(1:6)'/sum(x.^(1:6))-c;
%% find lower and uper bound bound for fzero....
% the issue is that f shou... |
0a29d1886c71c280a33c7932c2c1f00b6a4499891976e890be6a9081f594d2ba | MATLAB | 1,569 | 51 | % kaiserbeta() - Estimate Kaiser window beta
%
% Usage:
% >> beta = pop_kaiserbeta(dev);
%
% Inputs:
% dev - scalar maximum passband deviation/ripple
%
% Output:
% beta - scalar Kaiser window beta
%
% References:
% [1] Proakis, J. G., & Manolakis, D. G. (1996). Digital Signal
% Processing: Prin... |
4473c31f2d6771b4cf6d61101cd11192240715cfc300e267f323053bf0ab681e | MATLAB | 1,569 | 51 | function cnn_toy_data_generator(dataDir)
%CNN_TOY_DATA_GENERATOR
% Generates toy data in the given path: random image of triangles,
% squares and circles.
%
% The directory format is: '<dataDir>/<set>/<label>/<sample>.png', where
% <set> is 'train' or 'val', <label> is an integer between 1 and 3, and
% <sampl... |
4e6bd5321191417da4d99eeb79f6c7c131d4ea20a5fc7f6107cc8840b5696759 | MATLAB | 1,569 | 67 | function [err,tasktest] = TaskTest (N_runs, polort, N_basis, N_tasks, Task, N_base)
%
% [err,] = ContrTest ()
%
%Purpose:
%
% Generate matrix for the -glt option in 3dDevolve
%
%Input Parameters:
%
%
%
%Output Parameters:
% err : 0 No Problem
% : 1 Problems
%
%
%
%Key Terms:
%
%More Info :
%
%
%
%
% Auth... |
8dc8111246f99a276dfa48de49f579daded1f249523aba1ded6abb3de7b7a063 | MATLAB | 1,569 | 55 | function c = tapas_condhalluc_obs2_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the response model used to analyze data from conditioned
% hallucination paradigm by Powers & Corlett
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... |
dcba90a6ccdd1a4486018aa708c6b0cbd7d5ec1a81a792f9eaa70e217f338e06 | MATLAB | 1,569 | 58 | function [RHSdiv, RHSdivx, RHSdivy] = ...
divergenceTermCylindrical2D(F)
% This function calculates the divergence of a field using its face
% average value and the vector u, which is a face vector
%
% SYNOPSIS:
% [RHSdiv, RHSdivx, RHSdivy] = divergenceTermCylindrical2D(F)
%
% PARAMETERS:
%
%
% RETURNS:
%... |
ddf8bb06ecd03ac272e2c1703966c77b26d8a9fd74042e979832a8820149954b | MATLAB | 1,570 | 74 | %% batchSpot
% fast, batch-based particle spotter
% batchSpot spots particles in a batch of images
% it assumes that noise, background, etc. are the same in
% all images, and uses this to subtract backgrounds and find objects
% usage:
% batchSpot
function batchSpot(args)
arguments
args.min_size = 10;
args.x_scale =... |
eb9a2aace46d386a72c88f41adf8764a3a2d188000106d5f74b00838424816fb | MATLAB | 1,570 | 34 | % END - last index to memmapdata array
%
% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008
% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD
%
% 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
% mod... |
278f28b779a90c117f4264f72f1b0d6cfbc2336376b4bbd1c9b9391fd5abd65e | MATLAB | 1,571 | 51 | classdef toolsRadius2measureTest < matlab.unittest.TestCase
%TOOLSRADIUS2MEASURETEST Unit tests for petraToCT.tools.radius2measure.
%
% DESCRIPTION:
% Verifies that radius2measure returns the area of a circle for
% dim = 2 and the volume of a sphere for dim = 3 against closed-form
% ... |
56383f81ae24cbe21d0ddc4ecabcd77a2cee026bd542e1fb4bd448a09d5f84d6 | MATLAB | 1,571 | 50 | %This function uses parabolic interpolation to find the lag using the
%extremum of the lagged cross correlation.
%The function first uses the
%sign of the cross correlation at zero to decide whether to find a maximum
%or minmum. Next, we look for the global max/min.
%lcc is the empirical lagged covariance curve, lags... |
1befae2dde43bfaf5dcd12db66048992687b1849b0072bbfb454529e87ac7ce2 | MATLAB | 1,572 | 65 | %% GetVentricleMaskIOWrapper(input, outputDir, maskFullName, TE)
%
% Input
% --------------
% input : full path of mGRE magnitude NIfTI file
% outputDir : output directory to ventricle mask
% maskFullName : full path of mask NIfTI file
% TE : Echo times, in second
%
% Description: Wrapper functi... |
9217977b7820134e9f7acc42f80ac38bd86fff76c73ec4cf43f7ee94921a70ea | MATLAB | 1,572 | 65 | function msSEI_plotband(x, y_avg, y_sem, clz)
% plotband of SEI results
% E->I = b->m
% I->E = r->c
% (c) Jiri, Nov23
%% colors
% clrs = {
% 'b','m';
% 'r','c';
% };
% clrs = {
% 'b','r';
% 'r','b';
% };
% clrs = {
% [0 0 255]./255, [255 0 255]./255; % b -> m
% [255 0 0]./255, [255,1... |
af09d816ee18e805ba9967f8ed9ada4abe624deb1fdc3cc71270ecd0dffbe303 | MATLAB | 1,572 | 52 | function rankMat=rankTransform_equalsStayEqual(mat,scale01)
% transforms the matrix mat by replacing each element by its rank in the
% distribution of all its elements. if scale01 is set the ranked elements
% would be scaled between 0 to 1. One property of this function, as
% indicated by its name, is that equal value... |
b7847a592ce7f14b522a9b04e82c7820564fb1d6e67bc55bac7a9978891b0231 | MATLAB | 1,572 | 51 | %% RDF] = Wrapper_BFR_VSHARPSTI(totalField,mask,matrixSize,voxelSize,algorParam, headerAndExtraData)
%
% Input
% --------------
% totalField : total field map (background + tissue fields), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimen... |
d68a42379210f11ff92521bf7495b2e02eabc7d801070de3ae0c9d9cf61ecc90 | MATLAB | 1,572 | 41 | clear all %#ok<CLALL> % Clear all workspace variables
%% INSERT YOUR CLOOSE DIRECTORY HERE
pth2CLOOSE = 'C:\Users\MysticSocialist\Documents\GitHub\CLOOSE_MS';
%% AND YOUR RECEIVER IPv4 ADDRESS HERE
IPv4 = '127.0.0.1';
%% RUN THE REST
% Load the image stack from the specified .mat file.
pth = [pth2CLOOSE '\Generate_im... |
3d9b7a9fa9750e4735263b8d0fb48cd3f9189798dbd61dadccd693a50ec36e32 | MATLAB | 1,573 | 68 | function [z,mu,sigma] = nanzscore(x,w,dim)
%nanzscore - Compute standardized z-scores, ignoring NaN and Inf values.
%
% USAGE
%
% [z,mu,sigma] = nanzscore(x,flag,dim)
%
% x data to standardize
% w indicator for the standard deviation passed to std(x,w):
% - 0: norma... |
b98b277c8481b7305407d598bf427130a8efe5e6560076e972657dfd9035441d | MATLAB | 1,573 | 42 | function [version, hash] = tapas_version(verbose)
%% Print and returns the release version of the code.
%
% Input
% verbose -- If true prints the instructions to cite different
% parts of the toolbox. Defaults to false.
%
% Output
% version -- Current version of tapa... |
15763c42e0ee7940b1039e48a5a57e68b912a0d1b3e50a7e6148e94576915d22 | MATLAB | 1,574 | 59 | function [imageVol, lastfile] = GE_readVolume(startDir, passnum, volSize, depth, im_offset)
%
%GE_readVolume
%
% [imageVol, lastfile] = GE_readVolume(startDir, passnum, [nX nY nZ], depth, im_offset)
%
% reads the volume for passnum from the series which is stored
% starting in startDir and returns the name of the last ... |
cfa650913ece3b938eb56c16c6268a93fc44ce734a9bc2391f11404fc3c137af | MATLAB | 1,574 | 44 | function isSymmetric = is_symmetric(matrix, tolerance)
% IS_SYMMETRIC Checks if a matrix is symmetric within a given tolerance.
%
% Syntax:
% isSymmetric = is_symmetric(matrix)
% isSymmetric = is_symmetric(matrix, tolerance)
%
% Input Arguments:
% matrix - A numeric matrix to be checked for symmetry.
% toler... |
07dc595a10189f1aff971097d6d42493c45b580d6ac15987b6335c34b850d919 | MATLAB | 1,576 | 53 | function W = AngularVelocity(X,smooth)
%AngularVelocity - Compute instantaneous angular velocity.
%
% Compute angular velocity for a time-varying vector X. This is computed as
% the vector product of X and its derivative DX: W(t) = X(t) ^ DX(t)
%
% USAGE
%
% omega = AngularVelocity(X,smooth)
%
% X ... |
586e304740002bc7f130a68fa7b60f8b2ed16ec9378802324bef8cecced365fe | MATLAB | 1,576 | 68 | function varargout = stdplot(x,y,color,smooth,solid)
%semplot - plot mean (line) +/- standar deviation (std). (shaded area) of a matrix "y"
% stdplot(x,y,color,smooth)
%
% Copyright (C) 2017 by Ralitsa Todorova 2025 Raphael Brito
%
% SEE ALSO shadedErrorBar , semplot
%
% This program is free software; you can redistri... |
5ab3d2932323138bbf09ec248deea4112512670c8679c7198a96f7829424a630 | MATLAB | 1,576 | 55 | function Q = randrot(n, N)
% Generates uniformly random rotation matrices.
%
% function Q = randrot(n, N)
%
% Q is an n-by-n-by-N array such that each slice Q(:, :, i) is a random
% orthogonal matrix of size n of determinant +1 (i.e., a matrix in SO(n)),
% sampled from the Haar measure (uniform distribution).
%
% By de... |
88127066a6f04f4d56a8bf4ce689724c068d373bb3088627cba14eeffe3e8dbf | MATLAB | 1,576 | 57 | %isdscalar - Test if parameter is a scalar (double) satisfying an optional list of tests.
%
% USAGE
%
% test = isdscalar(x,test1,test2,...)
%
% x parameter to test
% test1... optional list of additional tests
%
% EXAMPLES
%
% % Test if x is a scalar (double)
% isdscalar(x)
%
% % T... |
0df6b340160d72f388ef5330e8e0c604120c619834b047294d650cd04903f1f4 | MATLAB | 1,577 | 51 | %% RDF] = Wrapper_BFR_VSHARPSTI(totalField,mask,matrixSize,voxelSize,algorParam, headerAndExtraData)
%
% Input
% --------------
% totalField : total field map (background + tissue fields), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimen... |
15568a9c51da1aababf50b2194219d53be6801c14637029abd93faa037e347cb | MATLAB | 1,577 | 60 | %% h = sepia_handle_panel_qsm_CFS(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... |
7562d134bbd1b7e9f80712bbca35b84d55e2cd25ab87b9ee10e3f955bb11a2fd | MATLAB | 1,577 | 54 | function [ DCM ] = tapas_dcm_euler_make_indices(DCM)
% [ DCM ] = tapas_dcm_euler_make_indices(DCM)
%
% Get the indices for the Euler integration
%
% Input:
% DCM - model structure
%
% Output:
% DCM - model structure with indices
%
% -------------------------------------------... |
3962960b9d2793e8d03ca35397e1b2202af3affdb903de1189d1f1e2db75d11e | MATLAB | 1,578 | 52 | function wavesCreatorAllFreqs(eletrodesLines,output)
nSbj=16;
for ss=1:nSbj
data=load(['\Sbj' int2str(ss) 'theFinalData.mat']);
for bb=1:size(data.theFinalData,2)
[ss bb]
if size(data.theFinalData(bb).data100,3)==size(output(ss).data(bb).typeTrials,2)
[data100(b... |
08f7fa79a4c802563e18fd122b4b8e599dcf0bdf515c4c981fbad28755909964 | MATLAB | 1,579 | 48 | function [logp, yhat, res] = tapas_unitsq_sgm(r, infStates, ptrans)
% Calculates the log-probability of response y=1 under the unit-square sigmoid model
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2012-2013 Christoph Mathys, TNU, UZH & ETHZ
%
% ... |
72129bfe3874b121c38651bd69d835b93875abee13223404dc6580877f737fa5 | MATLAB | 1,579 | 53 | function [x0fit,x0Std,funval] = FitMLE_local(r,concTotal,Astart,AstdStart,...
x0start,x0stdStart,n,nstd,noiseStart)
% r should be a 3d array, rows should be concentration, columns should be odor/neuron pair,
% 3rd dimension is trial. Assumes same number of trials for each odor
% neuron pair.
r = permute(r,[1,3,... |
52d20298e786ecb7fd55680f927e0543103bf7451571be3e3d55c41d11897b58 | MATLAB | 1,580 | 52 | function C2 = iem_mahal(data,angs,angspace,foldvar,sigmaind,verbose)
% C2 = iem_mahal(data,angs,angspace,foldvar,sigmaind,verbose)
nTrial = size(data,1);
nSens = size(data,2);
nTime = size(data,3);
if nargin < 6
verbose = false;
end
if nargin < 5
sigmaind = ones(1,nTime) > 0;
end
if narg... |
98965949f48f347e624103ae537a14ed3ab249771a302deeab1336074d97773b | MATLAB | 1,580 | 37 | %% load libraries
run('set_library_paths.m');
addpath(SPM_PATH); % per spm docs, do not genpath it
addpath(genpath(CANLABTOOLS_PATH));
addpath(genpath(CANLABMASKS_PATH));
%% variables that must be specified before the script is called
% rois: a cell array of 1 or more ROI names in NeuroimagingPatternMasks syntax
% can... |
c97852914ac3e3f1463ac0f25e8375621eb036c8ac45b9e9c89393eafc0b72fb | MATLAB | 1,580 | 39 | % -*- mode: matlab; -*-
% Neurophysiology Analysis Toolkit http://sourceforge.net/projects/nphys/
% Authors : Chris Higginson (original author) and Josh Tasman
% Copyright (C) 2002-2005 by the authors and the Mizumori Lab
% (at the University of Washington, Seattle)
%
% This program is free software; you ca... |
7ed56ee282d3d4852e9b12e19d97448c41a345c9a239b3432538c3b9801140b0 | MATLAB | 1,581 | 53 | function [x,y]=surfing_timeremaining(progress,prefix,postfix)
% Prints a status message of the time elapsed and remaining for set of
% operations/
%
% SURFING_TIMEREMAINING(PROGRESS,PREFIX,POSTFIX)
% INPUTS:
% PROGRESS Scalar between 0 and 1 indicating how many of the
% operations have been complet... |
9fe15530c89d166d78e1195f7f16df15f6dcca210432c515fd471f863d6658f2 | MATLAB | 1,581 | 48 | function y = vl_nnrelu(x,dzdy,varargin)
%VL_NNRELU CNN rectified linear unit.
% Y = VL_NNRELU(X) applies the rectified linear unit to the data
% X. X can have arbitrary size.
%
% DZDX = VL_NNRELU(X, DZDY) computes the derivative of the block
% projected onto DZDY. DZDX and DZDY have the same dimensions as
% X... |
121a84638cf439cefc1c1298dbf89969284eb9536f0fd2e90c9b02e07236bedf | MATLAB | 1,582 | 37 | function res = hlp_split(str,delims)
% Split a string according to some delimiter(s).
% Result = hlp_split(String,Delimiters)
%
% In:
% String : a string (char vector)
%
% Delimiters : a vector of delimiter characters (includes no special support for escape sequences)
%
% Out:
% Result : a cell array of (non-empt... |
4a84c36962dca7d421fc4f0f296f4c1941ca03269bc2328666a396465d3a4b67 | MATLAB | 1,582 | 61 | function Meta_Chisq(DB,whfield,levels)
% Meta_Chisq(DB,whfield)
%
%DB.PP % list of image names
%DB.XYZmm % mm coords for each study
%DB.maskV % mask mapped volume
%DB.radius % in voxels
% -----------------------------------------------------
% across all density images, compute prob(activation), p(a)
%... |
61eb2b6973aa1c790c80a811187456cadd2a84b27dd1aa10840734e7c7e8d8e7 | MATLAB | 1,582 | 34 | % LENGTH - length of memory mapped underlying array
%
% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008
% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD
%
% 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 ... |
f641f528f7eea1e11754c5ac191c25df2f5c9255cf0019411978a4927b0b14c1 | MATLAB | 1,582 | 47 | %BurstFrequency - Compute spike train auto-correlogram and autospectrum
%
% USAGE
%
% [ccg,t] = BurstFrequency(spikes,<options>)
%
% spikes spike spikes
% <options> optional list of property-value pairs (see table below)
%
% =====================================================================... |
88a3f46bed130002f2a4bf450cc8353f66d43b6d5e178e511f66f46803bfd63b | MATLAB | 1,583 | 60 | %% h = sepia_handle_panel_qsm_CFS(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... |
a091312f915389a4c8b7db6ef59346815191322fafb496bf289a407dd211df57 | MATLAB | 1,583 | 30 | function outputStruct = passiveProperties(dataLocation, recordingName, ...
inputStructStr, inputStruct, pulseRange, counter, channel, show_plots)
pulseRangeExtract = str2num(pulseRange{1});
warning('off', 'MATLAB:loadobj')
for wave = pulseRangeExtract
% Load the wave, save in "base" to us... |
b250bd659e880293a2b185bd40804d710da75dba5cedc1cdc28aca51fe5ce77c | MATLAB | 1,583 | 34 | function [fmri_data_allsubjs, subj_indices, subj_nums] = load_fmri_data_for_pls_allsubs(paths_fmri)
n_subjs = length(paths_fmri);
% fencepost for first subject to allow preallocation for all subjects
bold = load(paths_fmri{1});
% assume this is going to be true for every subject. same timeseries durati... |
d1751f5e557b72a434f193b0432295a52b4e6fd6ba7c7fa37584cdf48c65d748 | MATLAB | 1,583 | 71 |
function transition_matrix = transitions(time_series,num_substates)
% Function to compute transition matrix for a time-series
% example
% 4 sub-states, 22 participants, 3 conditions
%{
num_substates = 4;
for cond = 1:3
for sub = 1:22
time_series = randi(num_substates,1,230);
tran... |
43018b8174a5519774b8b4735e32cfc00a05e159429894d3c4dd57b8c17bf521 | MATLAB | 1,584 | 50 | function test_suite = test_setSpeedTargets %#ok<*STOUT>
% (C) Copyright 2021 CPP visual motion localizer developers
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
test_functions = localfunctions(); %#ok<*NASGU>
catch % no problem; early Matlab versions can use initTestSuite fine... |
1d0e5579d3eeca2b9b5ef59383285289a6dba4d7b8117ccd2c116d35f008aff7 | MATLAB | 1,585 | 56 | function [ Y ] = tapas_rdcm_reduce_zeros(X, Y)
% [ Y ] = tapas_rdcm_reduce_zeros(X, Y)
%
% If there are more zero-valued frequencies than informative ones,
% subsamples those frequencies to balance dataset
%
% Input:
% X - design matrix (predictors)
% Y - data
%
% Output:
% Y ... |
2c224c34535d4ddfe69f84ea20322dd57a8cb53375256ad32e262e55cb8aea10 | MATLAB | 1,585 | 42 | % divide T2 by mean EPI, and divide by an automatically determined threshold
% (within brain voxels) such that 1 is meaningful. this "signaldropout"
% volume is useful, showing what voxels have high signal intensities in
% the T2 but are corrupted by signal dropout in the EPI.
% define
reses = {[1 1 1] [1.8 1.8 1.8]};... |
87f6f0661032ee29e567407658347066093d26a763401150e8782992653ac829 | MATLAB | 1,585 | 56 | function ft_baseline_correction(input, TR, cutoff_highpass, prefix)
% Baseline correction
%
% ft_baseline_correction(input, TR, cutoff_highpass, prefix)
%
% Inputs:
% input - file name of time series.
% TR - repetition time in s.
% cutoff_highpass - highpass 1/cutoff frequency in Hz.
% pr... |
f19f1362c327d526728525d41c387224646fc642f302eede3c81cea227cf261d | MATLAB | 1,586 | 51 | %% [RDF] = Wrapper_BFR_iHARPERELLA(totalField,mask,matrixSize,voxelSize,algorParam, headerAndExtraData)
%
% Input
% --------------
% totalField : total field map (background + tissue fields), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each di... |
0186e323d7a67bcdceb24fadd97cb2532c4bb1f82c4633258c5e3b2ddaf6b1b3 | MATLAB | 1,587 | 41 | function snrMat = calculateChannelSNR(nirs, chanIdx, windowInfo, snrMat, nsub, resultIdx, params)
%Calculates SNR for a single channel by excluding motion-affected windows,
% then computing the ratio of signal mean to standard deviation. Returns
% NaN if insufficient valid samples remain.
% Extract channel data... |
30d805149300f099f9326477ae0984d26b914c4a280ff744050240466662114f | MATLAB | 1,587 | 42 |
clear; clc;
addpath(genpath('utilities'));
path = '/scratch/groups/mschnitz/STM_53Z/';
denoisedpath = '/scratch/groups/mschnitz/STM_53Z_denoised/';
filename = '53Z_day56_Z2';
hinfo=h5info([path filename '.h5']);
totalnum = hinfo.Datasets.Dataspace.Size(3);
nx = hinfo.Datasets.Dataspace.Size(1);
ny = hinfo.Datasets.Da... |
40c812658ba0f1080b831122ddd8e5ceb527f2f6fb6b9a94b241c91c3d795037 | MATLAB | 1,587 | 50 | function numbers = ft_poll_buffer(filename, thresholds, timeout)
% FT_POLL_BUFFER is deprecated.
%
% Please use FT_READ_DATA and FT_READ_EVENT with the 'blocking' and
% the 'timeout' options.
% Copyright (C) 2010, Stefan Klanke
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documen... |
64d39e738c4b68249c1216a2a1ec9149eb5dae5b4fcc9abf239b13d31a5e41f4 | MATLAB | 1,587 | 64 | function [img_mag_null,img_pca_null]=gradmNull(savg,roiFile,Null)
% This script generates null data for gradient magnitude
% INPUT
% savg: similarity matrix
% NumNull: Number of randomizations
% roiFile: region to test
% OUTPUT
% img_mag_null: null data of gradient magnitude
% img_pca_null: null data of eigenmap
% ... |
79159b0f34fe66372baf38505958e73335207026067af2429723e88f8df039d3 | MATLAB | 1,587 | 35 | % This script sets the path to include the dependencies subdirectories
% Copyright (C) 2017 Brock University Cognitive and Affective Neuroscience Lab
%
% Code written by Mae Kennedy
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as publis... |
53c0b6a81365690c55915a4b4e60217d6a733b6c94573be898d445a2f7fe1771 | MATLAB | 1,588 | 49 | function [isPhysioOnPath, pathPhysIO] = tapas_physio_check_path()
% Checks whether physio is on path and returns suggested path for adding
%
% [isPhysioOnPath, pathPhysIO] = tapas_physio_check_path()
%
% IN
%
% OUT
%
% EXAMPLE
% tapas_physio_check_path
%
% See also
% Author: Lars Kasper
% Created: 2018-02-17
% Co... |
3f2f368714c9da351a9a9439aaebb5e942d3d6a896f0760157e9aa28ef440715 | MATLAB | 1,589 | 44 | %% Specify input/output folders
input_folder = '/scratch/faces/ORL';
output_folder = '.';
%% Build dataset
file_list = {};
sub = dir(input_folder);
for i=1:numel(sub)
if sub(i).isdir
subsub = dir(fullfile(input_folder, sub(i).name));
for j=1:numel(subsub)
if ~subsub(j).isdir ...
... |
f9430edff9bc4a10852f7ddf50c8e6be17f1e350e20adf3e863a5b7790f5f0a3 | MATLAB | 1,589 | 55 | % Compare basic MatConvNet and Caffe blocks numerically
rootpath = fileparts(fileparts(mfilename('fullpath')));
run(fullfile(rootpath, 'matlab', 'vl_setupnn.m'));
inputScale = 100;
caffemodel = fullfile('data', 'tmp_caffemodels', 'test_model');
[~,~,~] = mkdir('data');
[~,~,~] = mkdir(fileparts(caffemodel));
%%
laye... |
ff72830ee800ccc21f257cae6977346561580dbaee9cd67bfdc98d42a4bf9b1f | MATLAB | 1,589 | 45 | function [C1] = SITE_METHOD(C1,nn,tau)
%SITE_METHOD Introduces new C1 cells (T cells) in the peripheral blood.
mins_per_day = 1440;
steps_per_day = mins_per_day/tau; % number of timesteps in one day
num_weeks = 4; % weeks of relapse
timestep_equiv = num_weeks*7*mins_per_day /tau;
start1 = 1; % day when relapse b... |
c33f0670295d10086b83d9b545aebae45512acd5512d91da588a043eb522ded1 | MATLAB | 1,590 | 48 | % Dec. 16, 2018, NB
% Following up on "Cholesky QR-based retraction on the generalized Stiefel
% manifold" by Sato and Aihara, https://doi.org/10.1007/s10589-018-0046-7
%
clear all; close all; clc;
% The Cholesky baed approach might have numerical issues due to squaring,
% which leads to squaring the condition number... |
7ae4e68d5c74ba40da8d9bbf364cfcae805a52299e89abecbf6186266e8bd0e5 | MATLAB | 1,591 | 57 | %% str = get_num_as_string(A, str_pattern, start_indicator, end_indicator)
%
% Input
% --------------
% A : confige file text
% str_pattern : string for matching in A
%
% Output
% --------------
% str : number as sting following str_pattern
%
% Description: extract parameter from config file to... |
bb5aabe2a118c65e896b1d0e6bca100395e5a5ff20dc4a0604d8f270417224c6 | MATLAB | 1,591 | 68 | function test_examples()
%TEST_EXAMPLES Test some of the examples in the `examples/` directory
addpath examples/mnist ;
addpath examples/cifar ;
trainOpts.gpus = [] ;
trainOpts.continue = true ;
num = 1 ;
exps = {} ;
for networkType = {'dagnn', 'simplenn'}
for index = 1:4
clear ex ;
ex.trainOpts = trainOp... |
205b48c3dd8e46d72cd82cd571674136d47e8ac0e3990313aaa8c6c7c4f3381a | MATLAB | 1,593 | 35 | function [numClust, centInd,predbounds] = cluster_by_pow_fit(delta,rho,pb)
% fits a power law to the rho vs delta plot and uses 'pb' as a threshold
% for detecting cluster centroids.
% Reference paper: Herzog et al. 2020 "Scalable and accurate automated method
% for neuronal ensemble detection in spiking neural networ... |
c4300d1b8f9804bd1b7cc67b99d3186b7c303ef86420bb2a8053a5ea02224974 | MATLAB | 1,593 | 41 | function plotVarianceExplainedOverlay(eta1, eta2, eta3, outDir)
if ~exist(outDir,'dir'), mkdir(outDir); end
edges = linspace(0,0.3,10);
% helper
plot_one = @(name, cells, labels, fname) ...
local_overlay(name, cells, labels, edges, fullfile(outDir, fname));
% RT: usa Age/Group main da eta1
plot_one('Vari... |
d460a73f8440174a5e51035989dfd1055ab8bc47cfa3cf3c36238f8e5bf05316 | MATLAB | 1,593 | 50 | function M = Array2Matrix(A)
%Array2Matrix - Transform an N-dimensional array into a matrix.
%
% Each line in the output matrix lists the subscripts for all dimensions
% (one per column) and the corresponding value in the array.
%
% USAGE
%
% M = Array2Matrix(A)
%
% A N-dimensional array
% Copyr... |
6eecd725b7140c67b703d7468e93ec1af60ec61c27c25a62d13a97ffa8e96679 | MATLAB | 1,594 | 55 | function [logp, yhat, res] = tapas_bayes_optimal_whichworld(r, infStates, ptrans)
% Calculates the log-probability of the inputs given the current predictions
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2013 Christoph Mathys, TNU, UZH & ETHZ
%
%... |
9807664796f3d46a2dd8652db29aa8c935d97970da4a0ccf7d5f9fd6b3d2d9ea | MATLAB | 1,594 | 50 | % use w_ExtractROITC.m in DPABI
function func_Extract_ROI(ImgFiles, MaskFile, MaskInfoFile, ExtractType, OutputCsv)
OutputFile = '.\ROI_temp.txt';
w_ExtractROITC(ImgFiles, MaskFile, ExtractType, OutputFile);
% ¶ÁÈ¡MaskInfo±í¸ñºÍidÁÐ
MaskInfo = readtable(MaskInfoFile);
idCol = MaskInfo.id... |
5dde4fb83e0319b968b386df4fa822d228285436f309e4438240710bde361cff | MATLAB | 1,595 | 39 | function plot_pc_init_two(PC,Nchan,i,id1,id2)
figure;
ki =0;
for k=1:Nchan
subplot(Nchan,3,1+ki)
plot(squeeze(PC(k,1,id1)),squeeze(PC(k,2,id1)),'b.','MarkerSize',2)
hold on;
plot(squeeze(PC(k,1,id2... |
96b46438ce0520cba090ea00e8edd3bead28e2f51e0feb965d259b0bf634a8ac | MATLAB | 1,595 | 58 | function output = jitter(data,l)
% By zandvakili@gmail.com
% Jittering multidemntational logical data where
% 0 means no spikes in that time bin and 1 indicates
% a spike in that time bin.
%
% modified s.t. first dimention should be trial number and second should be the time.
data = data';
data = single(data);... |
80f329915191bb79353bab86dc6efbafbc3ad94bcfcc87f833e9e71bccbb4974 | MATLAB | 1,596 | 66 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Setup to compute tSNR
% tSNR was computed using a shell script
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
currloc="C:\Users\dk818\OneDrive - Imperial College London\NCORE\miFCdFC";
% For ICC, violinplot, and colors
str='\Func... |
d5ba6a494ca0b4da83bc34580188eb8192e57b3a9dcc9882f2d4def65ae93f00 | MATLAB | 1,596 | 82 | function [state] = tapas_mcmc_meta_adaptive(data, model, inference, state, ...
states, si)
%%
%
% Input
%
% Output
%
% aponteeduardo@gmail.com
% copyright (C) 2016
%
if state.nsample > inference.nburnin || mod(si, inference.ndiag)
return;
end
t = floor(state.nsample / inference.ndiag);
t = 3;... |
5cf8140646897dc5c757a943b98fe47f713c6bbf5310bec699b557f79e0dbb4e | MATLAB | 1,597 | 61 | function basis = basis_row(A)
%
% Bases
%
% basis_row(A) produces a basis for the subspace of Eucldiean n-space
% spanned by the vectors {u1,u2,...}, where the matrix A is formed from
% these vectors as its rows. That is, the subspace is the row space of A.
% The rows of the matrix that is returned are the b... |
7515d81c14f37ab822ecf8c5f52ab8596c8d5ab0f807389f23ea48ee4a2dd9fd | MATLAB | 1,597 | 47 | % generateBOLD - Generate BOLD response from neural response
% Convolves neural response with HRF and applies amplitude and baseline scaling.
%
% Syntax
% BOLD = generateBOLD(R, HRF, beta, beta_0)
%
% Input Arguments
% R - Neural response time series [time x 1]
% HRF - Hemodynamic respon... |
c0dc4d45a5b98bf9e9af0cd6fc4cd37bf2e45beb686684576c96a00281f0088e | MATLAB | 1,598 | 49 | function fear_icaReacSig(basename)
% basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115';
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName)
load([basicMetaData.AnalysesName '-icaReacShuffle.mat'])
%%
nShuffle=icaReacShuffle.pa... |
fe78be6ea9859114a8c61c506647237e11db1e518afc4ca48d3a94c6da8c2c4d | MATLAB | 1,598 | 56 | function ft_baseline_correction(input, TR, cutoff_highpass, prefix)
% Baseline correction
%
% ft_baseline_correction(input, TR, cutoff_highpass, prefix)
%
% Inputs:
% input - file name of time series.
% TR - repetition time in s.
% cutoff_highpass - highpass 1/cutoff frequency in Hz.
% pr... |
e6fdaa3cf2838694024f2adf7cc768af30c50d7f746875beaf62f8d11bc9c922 | MATLAB | 1,599 | 44 | function [output] = volumethreshold(input, thresh, str)
% VOLUMETHRESHOLD is a helper function for segmentations. It applies a
% relative threshold and subsequently looks for the largest connected part,
% thereby removing small blobs such as vitamine E capsules.
%
% See also VOLUMEFILLHOLES, VOLUMESMOOTH
% check for ... |
a42cb7d4e725d87b177224d96683f7c6164d3376520284c2a8f6f1114a45ff6b | MATLAB | 1,600 | 52 | function run_default_simulation(params, options)
% RUN_DEFAULT_SIMULATION - Execute standard simulation
%
% H1 Line: Run default spiking network simulation
%
% Syntax:
% run_default_simulation(params, options)
%
% Description:
% Executes the standard simulation without additional noise or
% special connectivity p... |
b568afaaa2b488392afc202a098746b7c1abfa3c281f390e72b3398e1c7fbb44 | MATLAB | 1,600 | 54 | function [volume orientation] = test20(problem)
% function [Xlsq Xhub D] = test4(n, m)
% All intputs are optional.
%
% Compute (an approximation) of the minimal volume Oriented Bounding
% Box (OBB) problem.
%
%
% This file is part of Manopt: www.manopt.org.
% Original author: Pierre Borckmans, Dec. 30, 2012.
% Contri... |
3db2c47adfba4eb3ac1e243e755c8352ccb32c99eaaa73e3e494d6bc00c46945 | MATLAB | 1,601 | 62 | function nsd_savenifti2(data,reffile,file0,tr)
% function nsd_savenifti2(data,reffile,file0,tr)
%
% <data> is X x Y x Z x D (where D >= 1) with volume data
% for one or more datasets. Can be of a specific format:
% 'int16' or 'single' or 'double'.
% <reffile> is the path to an existing NIFTI file (or can
% be t... |
4f12a93cfc23894ac133af6ff09efe610e7a1339c2ee0d130c60a49c1db67656 | MATLAB | 1,601 | 54 | function [ raster , output_args ] = findSignificantFluorescenceTraces( deltaFoF , tauDecay , fps )
%FINDSIGNIFICANTFLUORESCENCETRACES( deltaFoF , tauDecay , fps )
%
% PARAMETERS:
% \_ deltaFoF: dF/F-signal
% \_ tauDecay: calcium-indicator fluorescence decay constant in units of
% seconds
% \_ fps: frame rate in units o... |
592f89d54c28ef691d5e8013ffb33c7785c7724933823c370681113434df0cf4 | MATLAB | 1,601 | 69 | function [mp rho_p mu_p] = circ_moment(alpha, w, p, cent, dim)
% [mp cbar sbar] = circ_moment(alpha, w, p, cent, dim)
% Calculates the complex p-th centred or non-centred moment
% of the angular data in angle.
%
% Input:
% alpha sample of angles
% [w weightings in case of binned angle data]
... |
31040ac9c721d1fb47ead55071143413e6aac3204649c35041c452c2c15c4ff9 | MATLAB | 1,602 | 58 | function [pA,pG,pAG,pD,pAD] = runlmecaregiving(behavior, eigenvalue, toi)
eigenvalue = permute(eigenvalue,[1 3 2 4]);
behavior.Group = categorical(strtrim(string(behavior.Group)));
nt = size(eigenvalue,4);
pA = nan(2,2,nt);
pG = nan(2,2,nt);
pAG = nan(2,2,nt);
pD = nan(2,2,nt);
pAD = nan(2,2,nt);
... |
3d0f171afaba5fcebe7caffa4c0cfaa48b1a2f6d0be09a216dbf578df9c8d47c | MATLAB | 1,602 | 41 | clear all %#ok<CLALL> % Clear all workspace variables
%% INSERT YOUR CLOOSE DIRECTORY HERE
pth2CLOOSE = 'C:\Users\MysticSocialist\Documents\GitHub\CLOOSE_MS';
%% AND YOUR RECEIVER IPv4 ADDRESS HERE
IPv4 = '127.0.0.1';
%% RUN THE REST
% Load the image stack from the specified .mat file.
pth = [pth2CLOOSE '\Generate_im... |
556c3d9c1e30a8df4648b6f21f8d62aa6cdd7e0b6f6191507e710024f133e0c6 | MATLAB | 1,603 | 39 | function out = DN_Unique(x)
% DN_Unique The proportion of the time series that are unique values
%
% ---INPUTS:
%
% x, the input data vector
% ------------------------------------------------------------------------------
% Copyright (C) 2013-2026, Ben D. Fulcher <ben.d.fulcher@gmail.com>,
% <http://www.benfulcher... |
9480cd00c55b0996b58b0c43f343fe7345822c704ba5f8246f9cde175a9f9f85 | MATLAB | 1,603 | 55 | function [ all_subjects ] = nmri_compress_statsfile( all_subjects , params )
%[ all_subjects ] = nmri_compress_statsfile( all_subjects )
% Will shrink the stats-file to save disk space
% will just retrain the power estmates
% check the params struct
if (~exist('params','var'))
if (~exist('analysis_params.m','file... |
99b2beb74c7862f11dbe652f61d689ffff1af37b16ec0363837d8ddedd0aaf99 | MATLAB | 1,603 | 25 | %{
vis.Grating (manual) # drifting gratings with apertures
-> vis.Condition
---
direction : decimal(4,1) # 0-360 degrees
spatial_freq : decimal(4,2) # cycles/degree
temp_freq : decimal(4,2) # Hz
pre_blank=0 ... |
e6f0179b67918efd67cdb0216e9cd73ab781edeef60f627350d0ed380ed05da9 | MATLAB | 1,603 | 30 | function expData = loadExpData(ExpName, Params, usePriorNetMet)
%LOADEXPDATA Summary of this function goes here
% INPUT
% -----
% ExpName : single experiment name (not a cell)
% Detailed explanation goes here
if Params.priorAnalysis==1 && Params.startAnalysisStep==4 && usePriorNetMet
experimentMatFileFol... |
494f64a399f72289e10107a15640ef5b12ef4829186a2846a697f448150714ab | MATLAB | 1,604 | 61 | function [y,n_dim,vecs,vals,mu,dr_hsi] = hdr_like_pca(hsi,n_dim)
%
%function [y,n_dim,vecs,vals,mu,dr_hsi] = hdr_like_pca(hsi,n_dim)
%
% Hierarchical Dimensionality Reduction
% wrapper over the HierarchicalDimReduction hsitoolkit code
% transforms input image using hierarchical clustering for dimensionality reduction... |
3f50d0023c5d369123ccd923e17d6cd3566bdef8a33b8abc88b36c473bb1419e | MATLAB | 1,605 | 43 | % stimulusParams - Define stimulus parameters
% Define stimulus radius, contrast, noise filter count, and noise sample count
%
% Syntax
% p = stimulusParams(p, w)
%
% Input Arguments
% p – structure containing scan parameters
% w – structure containing window parameters
%
% Output Arguments
% p – updated para... |
3f73430bc3e34ebabea00c9133071a77953b9861eaa537e15f7f2af567ba9a9d | MATLAB | 1,605 | 59 | %firgauss() - Gaussian low-pass FIR filter
%
% Usage:
% >> b = firgauss( fc, fs );
%
% Inputs:
% fc - scalar low-pass cutoff frequency (-6 dB)
% fs - scalar sampling frequency
%
% Output:
% b - filter coefficients
%
% Example:
% fs = 500; fc = 25
% b = firgauss( fc, fs );
%
% References:
% http://... |
5177f2d4daad987a2bdd97b4df7e8170b5ca0628c81343bd6ca0cfc78be866ff | MATLAB | 1,605 | 47 | %{
rf.FlashMap (imported) # site-wide fast retinotopy
-> rf.Sync
-----
response_map :longblob # map of response amplitudes on the screen
x_map :longblob # map of screen locations in brain pixels
y_map :longblob # map of screen locations in brain pixels
%}
classdef FlashMap < dj.Relvar & dj.AutoPopulate
propertie... |
71ab189847ad867a96887d85d05fb05a717a0af7b5d623e33c216682cdd62aaa | MATLAB | 1,605 | 52 | function RDMs_struct=wrapRDMs(RDMs,refRDMs_struct)
% wraps similarity matrices RDMs (in square or upper triangle form)
% into a structured array with meta data copied from refRDMs_struct
% (which needs to have the same number of RDMs).(if they are already
% wrapped then the wrapping (metadata) is replaced by that of
% ... |
c86b18e98a120237c1dd16ff1c1bf446dc39215e75c4b5f63774b895a5a72c83 | MATLAB | 1,606 | 61 | % Please cite this paper if you use any component of this software:
% D. Cunefare, L. Fang, R.F. Cooper, A. Dubra, J. Carroll, S. Farsiu, "Open source software for automatic detection of cone photoreceptors in adaptive optics ophthalmoscopy using convolutional neural networks," Scientific Reports, 7, 6620, 2017.
% Re... |
d99bf4a085f8cad1b1f1989d4c0256bb9de7f1274228edc39e4af36e770f9029 | MATLAB | 1,606 | 48 | function [dITIbyG_small_mean, dITIbyG_large_mean,...
dITIbyG_small_sem, dITIbyG_large_sem, p] = dITIbyG(ITI, RPE, A, israt)
% Calculate delta-belief G
[~, ~, ~, Belief] =...
GenerateSynthData_Bayes(nan(1, 4), A,...
'logn', false, nan);
belief = Belief(1, ~isnan(Belief(1,:)));
g = [nan, 1./(1 - abs(belief(2... |
f40d4d7cb496b64262a6ef31a398ac720c1982943584cdef1eea6a19621989b6 | MATLAB | 1,607 | 62 | % BIDS_WRITEBEHFILE - write behavioral file
%
% Usage:
% bids_writebehfile(beh, fileOut)
%
%
% Inputs:
% beh - [struct] structure containing behavioral data (event
% structure for example)
% behinfo - [struct] column names and description (optional)
% fileOut - [string] filepath of the desi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.