sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
db17f87c133b231e1b1a98b6072b813c000364677c7613513c71a06f3470124d
MATLAB
962
30
function mustBeLogicalScalar(A) %MUSTBELOGICALSCALAR Validate that value is a generalized logical scalar % MUSTBELOGICALSCALAR(A) throws an error if A isn't one of: false, true, 0, 1, "off", "on". % Copyright (C) 2025 by Pietro Bozzo % % This program is free software; you can redistribute it and/or modify % it under...
1d004fe9c29dac454797d3fb3711b1750bb978c2010428a544df2728c94a52c2
MATLAB
963
23
function [pvec, pstruct] = tapas_kf_transp(r, ptrans) % -------------------------------------------------------------------------------------------------- % Copyright (C) 2016 Christoph Mathys, TNU, UZH & ETHZ % % This file is part of the HGF toolbox, which is released under the terms of the GNU General Public % Licenc...
40b2fb0b2c6f9f86dc60d9e59bbcc72d53fe427183c85aaef2fd62abf651c2ef
MATLAB
963
49
function obj = update_model(obj, do_plot) % ---- % mean % ---- obj.update_mean(); obj.elbo_obs(); obj.elbo_mean(); if do_plot, obj.plot(); end % ---------------- % latent precision % ---------------- obj.update_latent_precision(); obj.elbo_latent(); obj.elb...
e2ca12feb0287ee4c7ea775a12c3e78985c4ecf7c68bb1a3ef1f81de9fb4a0da
MATLAB
963
32
function iDim = get_non_singleton_dimensions(this) % returns vector of indices of non-singleton dimensions (i.e. 2 or more elements) % % % Y = MrDimInfo() % Y.get_non_singleton_dimensions(inputs) % % This is a method of class MrDimInfo. % % IN % % OUT % % EXAMPLE % get_non_singleton_dimensions % % See also MrDi...
433da358df080db4eaf843dba8c3aa9ac3ee5a1dd820a64875bb9ab40f4d1300
MATLAB
964
18
%{ vis.FlashingBar (manual) # flashing bar -> vis.Condition --- pre_blank : float # (s) blank period preceding trials luminance : float # (cd/m^2) mid-value luminance contrast : float # (0-1) M...
8abcc7579c631de7b5723e466e72f68649fb1f5fad9fe7e434255b92cbc0f1cd
MATLAB
964
27
function pstruct = tapas_hgf_binary_pu_tbt_namep(pvec) % -------------------------------------------------------------------------------------------------- % Copyright (C) 2016 Rebecca Lawson, Christoph Mathys, TNU, UZH & ETHZ % % This file is part of the HGF toolbox, which is released under the terms of the GNU Genera...
9fa70d257f68c3a47e3aba3ee6cec6b641426e1c435463a62f39e01e33c8c90a
MATLAB
964
35
function outputImage = mod(this, divisor, varargin) % Computes modulus of division with divisor % % Y = MrImage(); % modY = Y.mod(divisor) % modY = mod(Y); % % % This is a method of class MrImage. % % IN % % OUT % outputImage value modulo % % EXAMPLE % modY = mod(Y, 2*pi) % % See also MrImage...
f601f90d9eb02515e85d47dcc48f0102a2ab0dacadcb6831c82c8d9fb0684ca7
MATLAB
964
29
function [subsequences, lengths] = findSubsequences(sequence) % Finds sequences of 1 in binary vector of 1s and 0s % Assign initial and allocate subsequences = {}; subseqN = 0; inSubsequence = false; % Loop over idx for idx = 1:length(sequence) % Current value is 1 and idx is not in a subsequence of 1s if sequ...
fa6533876d0addda1642bab57cbbb7574b88cfe3038669b68fa7f0e6285adf2c
MATLAB
964
36
clc close all clear all [angle_left,distance_left] = textread(['left_dod.txt'], '%f %f'); [angle_right,distance_right] = textread(['right_dod.txt'], '%f %f'); distance = (distance_left+distance_right)/2; distance_list = [] ; for i = 1:4:192 distance_list(end+1) = mean(distance(i:i+3)); end % DoD = arctan (Pd/...
6b11c4862de8d94397338cfb9256050085299b114809ce6afa9a22c8824c1f1e
MATLAB
965
23
function E = staticMiniEnergy(As,B,T,x0,xf) % Calculate the minimum static control energy under unrestricted control path % % E(x_0, x_f) = \frac{1}{2} d^T W^{-1}d % % Inputs: As, N-by-N matrix, system matrix % B, N-by-M matrix, control matrix with M control nodes % T, ...
b7772f217048bb490c6b96b2e85990bb252d0c157de730225e125c7ef389d91c
MATLAB
965
58
function [err, hndl] = addsquare(Pll, Pur, C) % % [err, hndl] = addsquare(Pll, Pur, C) % % %Purpose: % adds a rectangle on current plot % % % %Input Parameters: % Pll : [x y] of lower left point % Pur : [x y] of upper right point % C : rgb triplet, between 0 and 1 rectangle color % % % %Output Parameters: % err...
088e79a6940560d5a58941e20055874411cc55d48539a4f4e3113a2e2ad7647e
MATLAB
966
45
% op_firstPointPhase.m % Georg Oeltzschner, Johns Hopkins University 2019. % % USAGE: % [out]=op_firstPointPhase(in); % % DESCRIPTION: % Performs a zero-order phase correction by multiplying each point of the % FID with the normalized complex conjugate of the first point. % % INPUTS: % in = input data in mat...
cf6ba011a98d9c53552dec39206cfbcda1002045b6ba8a225b4c60c89f584b7f
MATLAB
966
34
function set_filename(this, filename) % Takes input filename and sets parameters.save.path/fileName accordingly % % Y = MrImage() % Y.set_filename(filename) % % This is a method of class MrImage. % % IN % % OUT % % EXAMPLE % Y.set_filename('newFolder/newFile.nii'); % % See also MrImage % Author: Saskia Bollm...
ed7896490aaa3225dd9c9ada4160f6033e50677947ec8465db980977af825bb8
MATLAB
966
34
function outputImage = fliplr(this) % Flips all slices Right-Left; mimicks fliplr in matlab functionality % % Y = MrDataNd() % Y.fliplr(K) % % This is a method of class MrDataNd. % % IN % % OUT % this MrDataNd where data matrix is flipped and dimInfo is updated to % reflect that change % % EXAMPLE % ...
f1c6c7a6115aab1219775200a20e2ac615670bc0c0b2af46ec4372c1c5d75fc0
MATLAB
967
42
function [spikeRaster]=plotSpikeRaster(spikes,Fs,thres,varargin) % assume row > timestamps and column > neuron ID nTrace=size(spikes,2); [b,a]=butter(6,100/(Fs/2),'high'); Time=0:1/Fs:(size(spikes,1)-1)/Fs; spikeRaster=cell(nTrace); negDFF=false; if negDFF spikes=-spikes; end spikeRaster=zeros(length(Time),nTr...
fc3d3308973275bf095b41310c2d9fd060ba6daf30cd6a4f7a21b101053b2653
MATLAB
967
41
function tapas_validate_state(state) %% Checks that a state complies with the interface. % % aponteeduardo@gmail.com % copyright (C) 2016 % if ~ isstruct(state) error('tapas:validate:state', 'state is not a structure'); end if ~ isfield(state, 'graph') error('tapas:validate:state', 'state lacks field graph');...
79fd48463c52beca71c2bc9871132037f80f34d41afe74d7290cc360027b5974
MATLAB
968
26
function vl_nnnotfound(fname) %VL_NNNOTFOUND Prints a help error message to set up MatConvNet % Warn users about common pitfalls in setting up MatConvNet. % Copyright (C) 2017 Karel Lenc. % All rights reserved. % % This file is part of the VLFeat library and is made available under % the terms of the BSD license (see...
7dd72ad546204907b377c8821225404fc81c18225209dee7cedfa6fd6857754e
MATLAB
968
30
function A = multiscale(scale, A) % Multiplies the 2D slices in a 3D matrix by individual scalars. % % function A = multiscale(scale, A) % % Given a vector scale of length N and a 3-dimensional matrix A of size % n-by-m-by-N, returns a matrix A of same size such that % A(:, :, k) := scale(k) * A(:, :, k); % % See also:...
d8515e0a6eda975c143abbfd74c3f63f2bdac3fcd4bf8fe31390fb612de19b36
MATLAB
969
38
function [itiMdl, itiOpt, V, rpe, alpha, G] = generate_ph_mdl(... R, alpha0, D) % generate_ph_mdl - generates data for Pearce-Hall model % INPUTS: % R - reward vector. Must be 1:5 % alpha0 - Base learning rate % D - Scale parameter % OUTPUTS: % itiMdl - trial intiation time with added noise % itiOpt - opt...
39ae17cfee44e25292faa19ebfd83f179ac95ff5013ab9a17d63f1ed04093672
MATLAB
971
26
% Function to calculate the passive forces of the muscle % The passive force is a function of the sarcomere length function PF = passiveForces(SL,time,tDrugApplication,fmyo) SL_rest = 1.9; % (um) PCon_titin = ((time<tDrugApplication)*1+(time >= tDrugApplication)*fmyo(9)) * 1.0*0.002; %(normalised for...
d3dc637aa7a3d6e3cbc81de4c5e52f07b8bf0d896715b5c9ac2b995f92ac8408
MATLAB
971
41
function [RHSdiv, RHSdivx, RHSdivy, RHSdivz] = divergenceTerm(F) % This function calculates the divergence of a field using its face % average value and the vector F, which is a face vector % % SYNOPSIS: % [RHSdiv, RHSdivx, RHSdivy, RHSdivz] = divergenceTerm(F) % % PARAMETERS: % % % RETURNS: % % % EXAMPLE: % % SEE AL...
fe0d031a7f5e11cb51d39dc7c0d54da20f6a8ce3e959e2b20b96aad0a6dfd61e
MATLAB
972
43
function [y] = randdv_sigmoid(dim,dvmu,fixdvmu) % RANDDV_SIGMOID Random decision value generator using sigmoid PDF % [y] = randdv_sigmoid(dim,dvmu,[fixdvmu]) if nargin < 3 fixdvmu = false; end if nargin < 2 error('Missing input argument(s).'); end if size(dim) ~= 2 error('dim should be [n(tri...
3e98dda59d533e1862fcab6820214b94d06b98e65f46c128d4058046032c89ec
MATLAB
973
26
function trialsData = plotTrials_trialsDataInfo(data_info) % returns auxiliary info in trialsData.info % (c) Jiri, Oct20 %% decoding: 'trialsData' auxiliary info clear trialsData; trialsData = struct; trialsData.info.verLines = [-1, 0, 1]; trialsData.info.xlabel = 'time offset (s)'; trialsData.info.ylabel = 'DA (CC)...
caf40beb2fd1d8b8e12022d0729f2e45d9d4e40cd6331ee65f91f146fe929f20
MATLAB
973
47
function shortStr = shortenChannelName(longStr, maxLngth) % shortens the anatomical assignemnt strings % 'maxLngth' = maximum number of characters in 1 word % (c) Jiri, Sep16 %% input if nargin < 2 maxLngth = 4; end tmp = longStr; %% exchange Left (=L) str2ex = 'Left'; k = strfind(tmp, str2ex); if ~isempty(k) ...
1b19e5b51e36d031241f28d1bfad65cf7b6dae7e3aa276b76f0915179dfa56b9
MATLAB
974
30
%% function [Ex,Ey,Ez,EtE] = GradientOperatorKspace(matrixSize) % % Input % -------------- % matrixSize : matrix size of chi % % Output % -------------- % Ex : gradient in x-direction % Ey : gradient in y-direction % Ez : gradient in z-direction % EtE : ...
d277c26b0cfb5b44fb19789ec3a2312f914fee1dd1c3ce90d9874cdf167eec57
MATLAB
974
30
%% addon_config % % Description: Addon script to incorporate new method to the SEPIA framework % % Kwok-shing Chan @ DCCN % k.chan@donders.ru.nl % Date created: 27 June 2020 % Date modified: % % DO NOT change the variable names, update the variable value instead % %% main % This name will be used thorough the SEPIA f...
f66f02d6108ea01605d60162fab0ea4b6b2714d306e887e5e01f86a012977e78
MATLAB
974
61
function [err, Qd, dfx, dmat2] = QRDecom(dmat, cmat) % % [err,] = QRDecom.m () % %Purpose: % % % %Input Parameters: % % % %Output Parameters: % err : 0 No Problem % : 1 Problems % % % %Key Terms: % %More Info : % % % % % Author : Gang Chen % Date : Tue Mar 23 16:09:23 EST 2004 % SSCC/NIMH/ Nation...
926411ede5b21459b9a68903aa684bced8cff3173924d2025152f515b4cc4cd9
MATLAB
975
29
function [potentials,mask_index0] = computePotentials2D(D, meshstruct, M, RHSbc) % Compute potentials 2D % Define mask Nx = D.domain.dims(1); Ny = D.domain.dims(2); G=reshape((1:(Nx+2)*(Ny+2)), Nx+2, Ny+2); mnx = Nx*Ny; rowx_index = reshape(G(2:Nx+1,2:Ny+1),mnx,1); % main diagonal x % Compute conductance aux = sum...
4a7f8a6fd358ace1df7cefac8194e2914184c469e3aa4f6b323d352bae654c07
MATLAB
976
30
%% addon_config % % Description: Addon script to incorporate new method to the SEPIA framework % % Kwok-shing Chan @ DCCN % k.chan@donders.ru.nl % Date created: 27 June 2020 % Date modified: % % DO NOT change the variable names, update the variable value instead % %% main % This name will be used thorough the SEPIA f...
825a3b75aa4727f31031f08217f2a54d4b329bc453d972b63926551bec2309cf
MATLAB
976
37
function renameParam(obj, oldName, newName, varargin) %RENAMELAYER Rename a parameter % RENAMEPARAM(OLDNAME, NEWNAME) changes the name of the parameter % OLDNAME into NEWNAME. NEWNAME should not be the name of an % existing parameter. opts.quiet = false ; opts = vl_argparse(opts, varargin) ; % Find the param to...
8a16b752d6de9dcabc9937baebbcbd5421053964d59ef9b05cf8842f1c5fa299
MATLAB
977
34
function this = t_filter(this) % high-pass filters temporally (4th dimension of the image) as SPM % % MrSeries = t_filter(MrSeries) % % This is a method of class MrSeries. % % IN % parameters.TR_s % parameters.t_filter.cutoffSeconds % % OUT % % EXAMPLE % t_filter % % See also MrSeries % Author: Saskia Klei...
91a7aeb86d76612bd4b61526a9255f80a56e281f5eb485b33888dfd198d62bbb
MATLAB
977
31
function [RSS,rms_val,chi,AIC,BIC,R_sq_mean] = qualityFit(Nb,Np,observed_arr,predicted_arr) numVoxels = size(observed_arr,2); RSS = zeros(numVoxels,1); rms_val = zeros(numVoxels,1); chi = zeros(numVoxels,1); AIC = zeros(numVoxels,1); BIC = zeros(numVoxels,1); for i = 1:numVoxels observed_signal = observ...
d06734b0e84fba36df6eaa158372475d37078e4d0a3c5c60f5e1b429c9291eeb
MATLAB
977
38
%Creado por Luisca Mayo09. %A partir de Spikes, toma los picos con un umbral determinado y genera la %matriz Rasterbin y el arreglo Pks_Frame que indica los frames %correspondientes a cada pico diferente. Pks_Frame correspondería a %Rasterbin_Ren function [Rasterbin,Pks_Frame_Ren,Pks_Frame]=PksFrame(Spikes,pks) %S...
2914c2dafaea7fdd04049771a72f2472ae06186c623b35b5f6576925f3c74b5e
MATLAB
978
45
function tmppath = fsgettmppath(tmppathdefault) % tmppath = fsgettmppath(<tmppathdefault>) % Gets path to a temporary folder (does NOT generate a random file name) % First looks in the following order: % 1. $TMPDIR - env var must exist and folder must exist % 2. $TEMPDIR - env var must exist and folder must exist % ...
8878f16c93b237d891a8fa6a35e800771fed79d0f8254004556763243e009b74
MATLAB
978
35
function opts = mergeOptions(opts_sub, opts_master) % Merges two options structures with one having precedence over the other. % % function opts = mergeOptions(opts1, opts2) % % input: opts1 and opts2 are two structures. % output: opts is a structure containing all fields of opts1 and opts2. % Whenever a field is prese...
3e79bea6d023f462f040d66b74099893a6c0675fe3a06f58f57c740127eea902
MATLAB
979
32
function bVals = binningVals(vals, binRangeLabels) % given a column vector 'vals' and binRangeLabels with format: % binRangeLabels = % % -1.0000 -0.7854 0.7854 % 1.0000 -3.1416 -2.3562 % 1.0000 2.3562 3.1416 % label loRange hiRange % bins the vector into N unique bins and returns the...
a2c11f99b1d5151cc5027a949e2b416045af1800e19ab6960fb86aadba1f7f91
MATLAB
979
62
function out = getResiduals(input,coeff,proc12,dfactor) out = cell(size(input)); for i = 1:numel(input) d = []; e = []; dec = []; proj = []; res = []; numtrials = []; num_times = []; num_channels =[]; e= input{i}; nan_mask = isnan(e); rows_with_nan = any(any(nan_mask,...
1cbe0e1f9cfa55854d8794553992b487fe4caabebac87411271adcd52ba3dd3b
MATLAB
980
35
function RHSbcM = computeCurrentsROI3D(im_sizes, RHSbc, atlas, mask) % Compute potentials 3D % % Author: Aina Frau-Pascual % Define mask Nx = im_sizes(1); Ny = im_sizes(2); Nz = im_sizes(3); G = reshape((1:(Nx+2)*(Ny+2)*(Nz+2)), Nx+2, Ny+2, Nz+2); rowx_index = reshape(G(2:Nx+1,2:Ny+1,2:Nz+1), Nx*Ny*Nz, 1); % Compute...
36ed6f6d085bc683f45a20efd7447574aaddea45a736cbf1050de98ec99ff72c
MATLAB
980
30
%% addon_config % % Description: Addon script to incorporate new method to the SEPIA framework % % Kwok-shing Chan @ DCCN % k.chan@donders.ru.nl % Date created: 27 June 2020 % Date modified: % % DO NOT change the variable names, update the variable value instead % %% main % This name will be used thorough the SEPIA f...
2a14098300abde852838a44265aa8a80025a52ec2d8ab804f08a364e9f8fd399
MATLAB
981
37
function [indEx, indRef, indSat] = sero_pulseq_getRFBlockInd(seq, blockInd) % function [indEx, indRef, indSat] = sero_pulseq_getRFBlockInd(seq, blockInd) if nargin < 2 blockInd = []; end indAll = sero_pulseq_getAllRFBlockInd(seq); indEx = sero_pulseq_getExcitationBlockInd(seq); nShot = numel(indEx); indRef = z...
0bd329cc34519a273c21b9adabad51ce89b59b846f8d0b4e9eaf7753620ee59a
MATLAB
982
28
function pstruct = tapas_hgf_binary_pu_namep(pvec) % -------------------------------------------------------------------------------------------------- % Copyright (C) 2012-2015 Christoph Mathys, TNU, UZH & ETHZ % % This file is part of the HGF toolbox, which is released under the terms of the GNU General Public % Lice...
657dc83e94da2cd16c8fa495b8cac4fce5a1c24376abf51b316ec10ec5150e3a
MATLAB
982
35
function outputImage = angle(this, varargin) % Computes phase value per complex-valued image pixel % % Y = MrImage(); % angleY = Y.angle() % angleY = angle(Y); % % % This is a method of class MrImage. % % IN % % OUT % outputImage phase value image for complex-valued image % % EXAMPLE % angleY =...
9b6de97b8fcf80bf7299759cebdf272e479683955de88b94de9f9a4116f4cb42
MATLAB
982
36
function [nstate] = tapas_mh_mc3_node_sample(data, model, ... inference, state, node) %% Samples for a particular node assuming there is a function for it. % % % This works as the conditional independency of the level allows one to sample % without worrying about the values in other nodes. % % aponteeduardo@gmail....
11e884e6ccdbbefedbf308b4796c33f44775bee7a57691afe6d2e978fd05ca7b
MATLAB
983
27
rng('shuffle'); rngState = rng; deltaSeed = uint32(feature('getpid')); seed = rngState.Seed + deltaSeed; rng(seed); in_dir = 'test_data/raw_warped_seg'; out_dir = 'test_data/raw_warped_seg'; in_suffix = '_seg_warped_single.mat'; out_suffix = '_skel_warped_single.mat'; files = dir(fullfile(in_dir,'*_seg_warped_single....
4323fb1dd43b8fe7235fbb4f4461c5c07a932690b38f69b43f7affb7266c209a
MATLAB
983
34
function [x,varargout] = ZeroToOne(x,varargin) %ZeroToOne - Normalize values in [0,1]. % % USAGE % % [y,b0,b1...] = ZeroToOne(x,a0,a1,...) % % x array to normalize % a0... additional inputs to transform using the same % scale as x % Copyright (C) 2008-2011 by Michaël ...
84b14dd71589b2f36ca3546bd3ac86387f69c62b7d2e0edcf3595edd0df0ceab
MATLAB
983
28
function pstruct = tapas_ehgf_binary_pu_namep(pvec) % -------------------------------------------------------------------------------------------------- % Copyright (C) 2012-2015 Christoph Mathys, TNU, UZH & ETHZ % % This file is part of the HGF toolbox, which is released under the terms of the GNU General Public % Lic...
bbc4393772b68bd3e5c1fd217be2ec308183e17d327ebc28e32c8a0fa8eea8b5
MATLAB
983
35
function val=jsonopt(key,default,varargin) % % val=jsonopt(key,default,optstruct) % % setting options based on a struct. The struct can be produced % by varargin2struct from a list of 'param','value' pairs % % author: Qianqian Fang, <q.fang at neu.edu> % % $Id: loadjson.m 371 2012-06-20 12:43:06Z fangq $ % % input: % ...
02628ce9478efebebc9800c34d201e909e8cb7ee4b1c8e21ed627b1ce8f03635
MATLAB
984
31
classdef SprottE < Environment % SprottE system. properties D = 3; % system dimension Ranges = [2.5, -1; 1.5, 0; 8, -3]; % variable ranges Params = struct(); ...
1c8e0fedc2328dd6ebe9dba4ecb50337c07632c8f577022f131df31d94cd8b9c
MATLAB
984
39
function mask = generate_target_mask(hsi,filt,halo) %function mask = generate_target_mask(hsi,filt,halo) % % generates a binary image mask with halo of pixels around each target % that matches the filter % % 10/30/2012 - Taylor C. Glenn - tcg@cise.ufl.edu % determine which alarms to score gt = hsi.groundTruth; n_ta...
2887b7e15230e41ece715fead8ba9f26a818185545397ff2012e2b136f4167fd
MATLAB
984
31
classdef SprottH < Environment % SprottH system. properties D = 3; % system dimension Ranges = [8, -6; 8, -1; 5, -3]; % variable ranges Params = struct(); ...
425aa5dee7e1907ff5d3c0f6ddbf5b1a6810d0d798446ad8e16b1d3f1f9ed086
MATLAB
984
31
classdef SprottG < Environment % SprottG system. properties D = 3; % system dimension Ranges = [5, -3; 4, -3; 6, -3]; % variable ranges Params = struct(); ...
67d613b7b11afde7443574d24c2f141975d4faf64d0c8b19104578d74655bdfe
MATLAB
984
44
%% markCropBox % video annotation GUI built on top of movieAnalyser classdef markCropBox < movieAnalyser properties folder_name mask end % end properties methods function a = createGUI(a) createGUI@movieAnalyser(a); p = a.ui_handles.pause_button.Position; a.ui_handles.mark_roi_button = uicontrol...
d50729df559bbf0497fb1c0633bcf16adcad4e237aab60487327e2c84e8f6d6b
MATLAB
984
30
%% addon_config % % Description: Addon script to incorporate new method to the SEPIA framework % % Kwok-shing Chan @ DCCN % k.chan@donders.ru.nl % Date created: 27 June 2020 % Date modified: % % DO NOT change the variable names, update the variable value instead % %% main % This name will be used thorough the SEPIA f...
ddc0f76ed6194a20ff0ef63e9b3e31a6bf50895ba2924dbf1eb9de9e8b9ecb28
MATLAB
984
45
function nii = nii_load(niifile,untouchopt,img_idx) %author EML vartype = 16; if nargin < 2 || isempty(untouchopt) untouchopt = 1; end if nargin < 3 || isempty(img_idx) img_idx = 0; end if ~untouchopt try if ~img_idx niiraw = load_nii(niifile); else niiraw = load...
fb941dacea5dbcd3f6f56d5886441cc7cce387021e2fdf66a28abf1675f28e2e
MATLAB
984
28
function disp_centre_and_origin(obj) % Displays centre and origin of MrImage object. Helper for demo script. % % disp_centre_and_origin(input); % % IN MrImage object % % EXAMPLE % disp_centre_and_origin(data) % % See also demo_set_geometry % Author: Saskia Bollmann & Lars Kasper % Created: 2018-11-06 % Cop...
0e559a3b5a5dfdc704a3d46035afb6441522359319fea839a1df1162836d4271
MATLAB
985
36
function plot_ens_seq(ax,tt,ens_labs,ens_cols,sellabs) % Reference paper: Herzog et al. 2020 "Scalable and accurate automated method % for neuronal ensemble detection in spiking neural networks" % https://www.biorxiv.org/content/10.1101/2020.10.12.335901v1 % Rubén Herzog October 2020 nens = max(ens_labs); cla(ax); t...
f8ebd0a060da29dabed958373d723072a67bc07ffe4cbb65575d0782c8aa9122
MATLAB
985
31
classdef SprottB < Environment % SprottA system. properties D = 3; % system dimension Ranges = [10, -5; 10, -5; 10, -5]; % variable ranges Params = struct(); ...
060fed15010576f75a3aa84cbb5f9036c63a6d34e2d5249014865cc6ea184f42
MATLAB
986
27
function y = vl_nnreshape(inputs, inSize, dzdy, varargin) %VL_NNCONCAT CNN concatenate multiple inputs. % Y = VL_NNCONCAT(INPUTS, DIM) concatenates the inputs in the cell % array INPUTS along dimension DIM generating an output Y. % % DZDINPUTS = VL_NNCONCAT(INPUTS, DIM, DZDY) computes the derivatives % of the block...
0ca03efbae18d7b3c74b94d1641b5e1d64be77b72926ef0d04643537e1a49cf6
MATLAB
986
41
function A = triangulation2adjacency(face,vertex) % triangulation2adjacency - compute the adjacency matrix % of a given triangulation. % % A = triangulation2adjacency(face); % or for getting a weighted graph % A = triangulation2adjacency(face,vertex); % % Copyright (c) 2005 Gabriel Peyré [tmp,face] = check_f...
26b977a18fdd78a99f27205862eef43094dc2a3878274c75c289876a22797da7
MATLAB
986
55
function [branch, revhash] = tapas_get_revision_info(directory) %% % % aponteeduardo@gmail.com % copyright (C) 2016 % if nargin < 1 directory = pwd(); end if ~(exist(directory) == 7) error('tapas:get_revision_info', 'no directory'); end gitroot = fullfile(directory, '.git'); if ~(exist(gitroot) == 7) ...
aec7b0f52bb17200470f0a97f04cb17fed322303509036de41660997c5730165
MATLAB
986
31
function origin = get_origin(this) % Computes the origin of this image geometry. % % Y = MrImageGeometry() % Y.get_origin() % % This is a method of class MrImageGeometry. % % OUT Voxel indices x, y, z of the origin, i.e. those voxel who are % at location [0 0 0]. % % EXAMPLE % origin = Y.get_origin() % % ...
f6039737e7a1429d17acb861dbd32d5aa63f682726bcbb12ebf35c079564102e
MATLAB
986
31
classdef SprottA < Environment % SprottA system. properties D = 3; % system dimension Ranges = [10, -5; 10, -5; 10, -5]; % variable ranges Params = struct(); ...
1c5588cd15bc70908f64fd31cdbd8674bb6b167f6c23cc8ccd78b63694aecc70
MATLAB
987
28
function window = extractWindowForBiomarkers(V_ode,i_tot, Istim ,t,Cai,Nai,Frc,Lsrc,svl, wspan) flag = 0; [pks_MDP, idx_MDP] = findpeaks(-V_ode); idx = find(pks_MDP<0); pks_MDP(idx)=[]; idx_MDP(idx) = []; if length(pks_MDP)<=10 disp('Error') flag =1; window=[]; return end numAPsBiomarkers = 9; N = leng...
82237eafe64390b68ef56ef12853bab9f33050d4cb8b775b6ead4141cd36a377
MATLAB
987
15
%----------------------------------------------------------------------- % Job configuration created by cfg_util (rev $Rev: 4252 $) %----------------------------------------------------------------------- function TMSwrite(MATdir,ROIlist) ROIlist; matlabbatch{1}.spm.spatial.normalise.write.subj.matname = {MATdir}...
9e168657fbd9ee5edd22d6ccf7be9ddb192a59543cbeb8a796789094609f536a
MATLAB
987
31
function [sigma,bnd] = bdsqr(alpha,beta) % BDSQR: Compute the singular values and bottom element of % the left singular vectors of a (k+1) x k lower bidiagonal % matrix with diagonal alpha(1:k) and lower bidiagonal beta(1:k), % where length(alpha) = length(beta) = k. % % [sigma,bnd] = bdsqr(alpha...
de98ef3cdcc5e44b251ac0dc075d3b79024f9fcfdbc6c8684ba38c050a355732
MATLAB
987
20
clear all %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% The following variates are needed to be loaded before performing each analysis step (step2-step6). % set working paths Pathnew=['D:\Documents\OneDrive - bnu.edu.cn\My_publications\0-8y...
197559b6e0f487329a407d7769135f5397e0e04ffc3fc723d33f6b8d5fcfbb63
MATLAB
988
35
function regressor=task_regressor(TR,T,taskfile) %taskfile: If using the Custom 3 column format, prepare a plain text file (avoiding editors such as MS Word) %containing one line for each stimulus associated with the condition to be modelled by this EV. %Each line must contain three numbers: the onset time (in s...
aaa708cde811ccff7617bf234701ae508101fcefc2a8061b97aed9962cd64982
MATLAB
988
31
classdef SprottR < Environment % SprottR system. properties D = 3; % system dimension Ranges = [7, -5; 7.5, -2.5; 10, -9]; % variable ranges Params = struct(); ...
b8a82a8f2cd47f30f7b9ccc61cfd14dbea28e05f77628cd90172df44127b1dac
MATLAB
988
31
classdef SprottC < Environment % SprottC system. properties D = 3; % system dimension Ranges = [5, -2.5; 5, -2.5; 5, -2.5]; % variable ranges Params = struct(); ...
bd9b1ddb07bd08ccbdbe93e4e9861784cb4abaecb2b857083b78acf3a48e3a0f
MATLAB
988
28
function spikeTimes = findSpikeTimes(spikeTrain, method, samplingRate) %findSpikeTimes calculate spike times given binary matrix % assumes input matrix in the form numSampl x numChannel % returns spikeTimes as an array of vectors % if method is 'seconds', then spike times are returned in seconds % otherwis...
d23b1331fd93f685e20a8cbe586e0ea26096c164551f645ce948a8181484a13c
MATLAB
988
46
function [vertex,face] = read_off(filename) % read_off - read data from OFF file. % % [vertex,face] = read_off(filename); % % 'vertex' is a 'nb.vert x 3' array specifying the position of the vertices. % 'face' is a 'nb.face x 3' array specifying the connectivity of the mesh. % % Copyright (c) 2003 Gabriel Peyr...
0b9a23915bddd371f8bad877f93d5d9dd3213c3d41d3acd8a8483af47cc757c1
MATLAB
989
30
%% addon_config % % Description: Addon script to incorporate new method to the SEPIA framework % % Kwok-shing Chan @ DCCN % k.chan@donders.ru.nl % Date created: 27 June 2020 % Date modified: % % DO NOT change the variable names, update the variable value instead % %% main % This name will be used thorough the SEPIA f...
67261b5648ae783f9d4113457d31201ce02542ec6b84603c2cbdfeab83ddbc76
MATLAB
989
34
function [loss, tstar] = computePerformance(o, utest) % Computes loss and t*. % Parameter % --------- % o (DxT, double) : reservoir output (forecast) of T time steps % utest (DxT, double) : ground truth/ prediction target % % Returns % ------- % loss (1x1, double) : prediction loss % tstar (1x1, double) : pre...
096d4317de480afce1c8f9dfb318cb6c06f62ed2d739d441c1e358dc510d189a
MATLAB
990
35
function [nstate] = tapas_mh_mc3_hier_node_sample(data, model, ... inference, state, node) %% Samples for a particular node assuming there is a function for it. % % % This works as the conditional independency of the level allows one to sample % without worrying about the values in other nodes. % % aponteeduardo@g...
d2975e6039bb49e78957775c7a260f73779642eb4da52aa4005e956e67fe613f
MATLAB
990
34
%% fgColor = sepia_theme_fg_color() % % Output % -------------- % fgColor : text (foreground) colour (RGB triplet) for interactive % uicontrols (edit/popup/pushbutton fields) % % Description: Companion function to sepia_theme_bg_color.m - returns the % text colour that keeps typed/selected text legible ag...
011326259a118094f93183ee8d6b09ec6a2a63b06c3261a0f31b93b3a31e22ab
MATLAB
991
31
function [stop, reason] = stopinteractive(problem, x, info, last) %#ok<INUSL> % This became a tool: see stopifclosedfigure reason = 'Interactive stopping criterion: figure closed.'; % Fix a likely unique figure id. figureid = 1465489213; % If first iteration, create a figure to capture interactio...
2071772331e3de8a2e6d75e10c29bfc2246187e489512114dd18cf33379db22a
MATLAB
991
42
function [posterior] = tapas_sem_hier_estimate(data, model, inference, pars) %% Estimates the hgf using mcmc. % % Input % data -- Data of the model. It should be a structure array with % fields y, and u of dimensions n times 1, when n is the % number of subjects. % model ...
3f3bcddcc5e6782ced473807e45a4f43caf7c3298cea830eddf2199d6155a279
MATLAB
991
30
%% addon_config % % Description: Addon script to incorporate CLEAR-SWI to the SEPIA framework % % Korbinian Eckstein @ UQ % korbinian90@gmail.com % Date created: 26 September 2022 % Date modified: % % DO NOT change the variable names, update the variable value instead % %% main % This name will be used thorough the S...
47e1c73254cef6751b4d897a8a7d15ff7beebed33d339a36c2269a079072048b
MATLAB
991
41
function clims(varargin) %clims - Equalize the the color limits on all the axes of the current figure % Copyright (C) 2017 by Ralitsa Todorova % % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; ...
b373d8cfb7671118a0486c2425e7491269d733d5042a185b91e2164d6b51a6e5
MATLAB
991
31
classdef SprottN < Environment % SprottN system. properties D = 3; % system dimension Ranges = [100, -93; 61, -44; 22, -13]; % variable ranges Params = struct(); ...
32bf1caf2570ce2e2d0ce57884c9ff4ddd75e2f61cbb04c4a9d3ac50f5020e4f
MATLAB
992
33
classdef nnmnist < nntest properties (TestParameter) networkType = {'dagnn', 'simplenn'} end methods (TestClassSetup) function init(test) addpath(fullfile(vl_rootnn, 'examples', 'mnist')); end end methods (Test) function valErrorRate(test, networkType) clear mex ; % will reset GP...
7629fd26aa125b301ea6fe057d402ff7317388e714836bdbbf7f30257c05144e
MATLAB
992
28
function [N, S] = getUsedROIs(GRUP, minSubj) % returns N = vector(freq), number of used ROIs in trialsData of each frequency band (FB) % returns S = number of used ROIs in spectra (significance taken from the last FB) % used = more than minSubj % (c) Jiri, Jul22 %% number of used ROIs in trialsData of each frequency ...
b24441ad5d6ce9a583ac425bb4e4536d134b4a6574ae7d62ec9c255ce2e7e0f5
MATLAB
992
31
classdef SprottP < Environment % SprottP system. properties D = 3; % system dimension Ranges = [2.8, -0.8; 2, -1.5; 2, -0.4]; % variable ranges Params = struct(); ...
b270fb734dcbf5e5be79a56e933c2c885390499d3d2fb3ee0677d815f97a03e2
MATLAB
992
28
function varargout = covMaternard(d,varargin) % Wrapper for Matern covariance function covMatern.m. % % Matern covariance function with nu = d/2 and with Automatic Relevance % Determination (ARD) distance measure. For d=1 the function is also known as % the exponential covariance function or the Ornstein-Uhlenbeck cov...
b28d02f9c39f293d229b699cebd4321e1f7d6bbf31c5f7144909c359a604dbc8
MATLAB
992
19
% Evaluate the order R elementary symmetric polynomials using Newton's identity, % the Newton-Girard formulae: http://en.wikipedia.org/wiki/Newton's_identities % % Copyright (c) by Carl Edward Rasmussen and Hannes Nickisch, 2010-01-10. % speedup contributed by Truong X. Nghiem, 2016-01-20. function ...
df03ff7aa6bd5d3c4bcf8f302f924f2f223a238610dfbfe03c49496516e336f5
MATLAB
992
28
function[] = ellipse (xycenter, hr, vr, facecolor, edgecolor, edgethickness) %% Function Description % circle (xycenter, hr, vr, facecolor, edgecolor, edgethickness) % % Draws an ellipse horizontal radius 'hr' and vertical radius 'vr' centered around a given x,y coordinate. % % Inputs: % hr = horiztonal radius...
f8e8e9fc4c2bbd1d95cbaab0744ea0cb9c7a66675fd70e7d5c5bfa2119641ba6
MATLAB
992
26
function [pvec, pstruct] = tapas_logrt_linear_binary_transp(r, ptrans) % -------------------------------------------------------------------------------------------------- % Copyright (C) 2016 Christoph Mathys, UZH & ETHZ % % This file is part of the HGF toolbox, which is released under the terms of the GNU General Pub...
03b28750398c103afc7bade45576410450b69436521d67cf925b5d2c7fec67f5
MATLAB
993
31
classdef SprottK < Environment % SprottK system. properties D = 3; % system dimension Ranges = [6.6, -4.7; 4, -2.5; 6.7, -0.8]; % variable ranges Params = struct(); ...
3f4717e74e7ba03da98cbd4e29fd456617e0d1c1afc5dbaf6a4196a6d010db33
MATLAB
993
35
%% [weights, fieldmapSD]= compute_optimum_weighting_combining_phase_difference(magn, TE) % % Input % -------------- % magn : multi-echo magnitude images, 4D % TE : echo times % % Output % -------------- % weights : weighting factors, 4D % fieldmapSD : theorectical noise derived from magnitu...
451dab9d00b4d2de133a391f70cd4a46cfa0d881881276f51448ac489759f8d9
MATLAB
993
29
function Y = vl_nnsoftmax(X,dzdY) %VL_NNSOFTMAX CNN softmax. % Y = VL_NNSOFTMAX(X) applies the softmax operator the data X. X % has dimension H x W x D x N, packing N arrays of W x H % D-dimensional vectors. % % D can be thought of as the number of possible classes and the % function computes the softmax alon...
11895f25937a3cb30ae5dc6cc5450d8fb3aecb492a29d9610f252e5faac68237
MATLAB
994
25
% solve_chol - solve linear equations from the Cholesky factorization. % Solve A*X = B for X, where A is square, symmetric, positive definite. The % input to the function is R the Cholesky decomposition of A and the matrix B. % Example: X = solve_chol(chol(A),B); % % NOTE: The program code is written in the C language ...
18effc0dc2d0d81d2971b069b7178d0a6b40e578c1664c24fa7cd373b18c2b58
MATLAB
994
29
%% Generate36data % Script for making 36 attack data basePath = 'D:\Data\Lobster\BehaviorData'; filelist = dir(basePath); sessionPaths = regexp({filelist.name},'^#\S*','match'); sessionPaths = sessionPaths(~cellfun('isempty',sessionPaths)); fprintf('%d sessions detected.\n', numel(sessionPaths)); % Session for sessi...
c2d94e955411b167f9b0dc831bed2ef8b32f963d8725f315de52c7d3a2b383f9
MATLAB
994
23
function [inputPath, outputsFolderPath] = configurePaths(dataRawLoc, dataOutLoc, cohort, timepoint, task, params) % Configures the input and output file paths based on the cohort, % timepoint, task, and pruning method. Creates output directories if they % don't exist, ensuring proper file organization throughout the...
5b9bc79c9ee9eb80b59d4c0d2014734ddec94f701cec99320b62b5ec4e253c6e
MATLAB
995
41
function [posterior] = tapas_sem_mixed_estimate(data, model, inference, pars) %% Estimates the hgf using mcmc. % % Input % data -- Data of the model. It should be a structure array with % fields y, and u of dimensions n times 1, when n is the % number of subjects. % model ...
9ee1dca0ce9a10753e2089d7be24bd1b079de29b0657995475f8aa0608f22ff3
MATLAB
995
30
%% addon_config % % Description: Addon script to incorporate new method to the SEPIA framework % % Kwok-shing Chan @ DCCN % k.chan@donders.ru.nl % Date created: 27 June 2020 % Date modified: % % DO NOT change the variable names, update the variable value instead % %% main % This name will be used thorough the SEPIA f...
b34002c0721e73a320a2a7b6a9cb8e6e580719990aa0357511435e7dce88853d
MATLAB
995
36
function U = randunitary(n, N) % Generates uniformly random unitary matrices. % % function U = randunitary(n, N) % % U is a n-by-n-by-N array such that each slice U(:, :, i) is a random % unitary matrix of size n (i.e., a matrix in the unitary group U(n)), % sampled from the Haar measure (uniform distribution). % % By...
730439d72fcc249806210895da85ab0870d8964aedf0ef81a22cd842a10fde16
MATLAB
996
43
function database = DBUse(database) %DBUse - Set (or determine) current database. % % Set (or determine) current database to store/retrieve processed data. % % USAGE % % DBUse(database) % database = DBUse() % % database database name % % SEE % % See also DBConnect. % % Copyright (C) 2007-2012 ...
79ee3bba7f10528bba7f55dba06cb8885fcd8ef263a7a0efe1827fbb977cf378
MATLAB
996
43
function [old_dirs,old_stps,Hdiag,Bcompact] = dampedUpdate(y,s,corrections,debug,old_dirs,old_stps,Hdiag) %B0 = eye(length(y))/Hdiag; S = old_dirs(:,2:end); Y = old_stps(:,2:end); k = size(Y,2); L = zeros(k); for j = 1:k for i = j+1:k L(i,j) = S(:,i)'*Y(:,j); end end D = diag(diag(S'*Y)); ...
7c47d568f69c91c8d86cbeb1948fb1cdab28f0b257891f905b444aed8b2e43b6
MATLAB
996
30
%% addon_config % % Description: Addon script to incorporate new method to the SEPIA framework % % Kwok-shing Chan @ MGH % kchan2@mgh.harvard.edu % Date created: 6 July 2025 % Date modified: % % DO NOT change the variable names, update the variable value instead % %% main % This name will be used thorough the SEPIA f...
4726ce0aa397160a20e8c1bfdb3f66f589160c93652018ef0306d86fc69ab6f6
MATLAB
997
40
function [lab, pos] = read_besa_sfp(filename, uniqueonly) % READ_BESA_SFP reads a besa style electrode location file. % % Use as: % [lab, pos] = read_besa_sfp(filename, uniqueonly) % % Input arguments: % filename = the file name % uniqueonly = flag to determine behavior, to return the positions of the % ...