sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
95d684e9afb5007a0044b4793da51c94fb6a8a4550c3e976d8d6dff93afd0560 | MATLAB | 1,393 | 48 | function h = hashmd5(inp)
% Computes the MD5 hash of input data.
%
% function h = hashmd5(inp)
%
% Returns a string containing the MD5 hash of the input variable. The input
% variable may be of any class that can be typecast to uint8 format, which
% is fairly non-restrictive.
% This file is part of Manopt: www.manopt... |
a91be5cba51136e8471b01bc1a73c2961b8a17ed23dbbfe727cf1f96ad265cd1 | MATLAB | 1,393 | 44 | function cfg = cfgMST(cfg)
%
% (C) Copyright 2020 CPP visual motion localizer developers
cfg.design.localizer = 'MT_MST';
cfg.design.nbRepetitions = 10;
cfg.design.nbEventsPerBlock = 10;
% in Liege is 0.6
% on macs is 0.3
cfg.timing.eventDuration = 0.6; % 0.6 seconds
%% variable... |
bb021d04ba20ff6291f3ee376658e5f7031f5469a44d37475500441c3e5ce22e | MATLAB | 1,393 | 43 | function outputImage = rms(this, varargin)
% Computes root mean square along specified dimension, i.e. sqrt(mean(Y.^2))
%
%
% Y = MrImage()
% Y.rms(applicationDimension)
%
% This is a method of class MrImage.
%
% IN
% applicationDimension image dimension along which operation is
% per... |
2742ca753ab8e2780691e8c0c5bfc1cdc87305504958b5890bcb23588c537bcc | MATLAB | 1,394 | 68 | function [im, info] = loadTifFast(FileTif, TifType)
headerFn = FileTif;
imageFn = FileTif;
TifType = lower(TifType);
switch TifType
case 'standard'
disp(['Loading standard tif ' imageFn '...']);
[im, info] = loadBasicTif(imageFn, headerFn);
case 'scanimage'
disp(['Loadin... |
2eeb10032e65c94aa308d8cd7588c030c9bd6735698eeb6b745af69992874be5 | MATLAB | 1,394 | 38 | function [logp, yhat, res] = tapas_gaussian_obs_offset(r, infStates, ptrans)
% Calculates the log-probability of response y under the Gaussian noise model, with an offset
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2018 Christoph Mathys, TNU, UZ... |
98c02239f329f06cec2e5172130aa071fec77d02deda8ee9012e3d444ff08d19 | MATLAB | 1,394 | 47 | function meanValue = meanval(this, varargin)
% Returns mean value of data matrix of MrImage, accepts selection parameters
%
% Y = MrImage()
% meanValue = ...
% Y.meanval('ParameterName1', 'ParameterValue1', ...)
%
% This is a method of class MrImage.
% NOTE: This is a deviation from the nameanvalg convention ... |
203cb3cbd7ae7cfb9e45f9bad37d2ff28e3f3a8c43146fcb532c9d29c4cd2ff3 | MATLAB | 1,396 | 46 | function s = getsubfield(s, f)
% GETSUBFIELD returns a field from a structure just like the standard
% GETFIELD function, except that you can also specify nested fields
% using a '.' in the fieldname. The nesting can be arbitrary deep.
%
% Use as
% f = getsubfield(s, 'fieldname')
% or as
% f = getsubfield(s, 'fiel... |
648d495177ff95c3f8185e906f421bb0c8ab867813b3a49ab8e41a9996dbb0f4 | MATLAB | 1,396 | 51 | function C2 = mahFunc(dat,theta)
%% dat is channel by trial by time, theta is angles (from -pi to pi)
%% requires circ_stat toolbox for circ_dist
% dat = rand(10,1000,100); theta = ((rand(1000,1)*2)-1)*pi;
angspace = -pi:pi/16:pi-(pi/16);
nChan = length(angspace);
%%
nTrial = size(dat,2);
nTime = size(dat,3);... |
df0a3aaebcbd70887c6febe5a879d883c54105bd1c1782a3eb33e623d3bd0374 | MATLAB | 1,396 | 47 | function [nstate] = tapas_mh_mc3_tempering_sample_node(data, model, ...
inference, state, node)
%% Samples for a particular node assuming there is a function for it.
% Fundamentally the temperature schedule is assumed to a state and not a
% parameter.
%
%
% This works as the conditional independency of the level a... |
42c64a8514a68e0f9b67ee669777347a13773ef2ee60475970db58b7e4f74338 | MATLAB | 1,397 | 49 | function y = tapas_beta_obs_sim(r, infStates, p)
% Simulates observations from a Bernoulli distribution
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2015 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is release... |
89c33cd09375806ad35eef9f3ee310a0115e4b46c640912140096593b5448408 | MATLAB | 1,397 | 31 | function [pvec, pstruct] = tapas_hgf_categorical_transp(r, ptrans)
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2013 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is released under the terms of the GNU General Pu... |
8c5ce2f22e23f82f4d5d080f6c335e5ae57d1b21b85591875fc63b95d9fa5cb2 | MATLAB | 1,397 | 49 | %% Plot mean spike
spikeform = SU(:,4:end);
m_spikeform = mean(spikeform,1);
std_spikeform = std(spikeform,1);
figure(1);
clf;
hold on;
fill([1:120, 120:-1:1],[m_spikeform + std_spikeform, fliplr(m_spikeform - std_spikeform)],'k','FaceAlpha',0.1,'LineStyle','none');
plot(m_spikeform,'k','LineWidth',2);
axis off;
%% Pl... |
fc860c95d21e9c86a8b91904db33ad42959d90c577e7a10282caeb2044697e76 | MATLAB | 1,397 | 37 | function [EMdata, FracSIGIC, FracSIGMem, groups, groupID] =...
DATlocation(EMdata)
%Get important variables
%make all ambiguous into membranous
EMdata.SIGCategory(strcmp(EMdata.SIGCategory, 'ambiguous')) = {'membranous'}; %DAT target (N-terminus) is intracellular
ratlist = unique(EMdata.RatID);
EMdata.GroupID = ... |
01dbb2e5421908555833163a44d10821a29935d2ffd943c6b0eed372bee2ee9f | MATLAB | 1,398 | 41 | function [kinematics, neurons, M, config] = loadLock4Decode(mouse, session, config)
% Loads and locks:
% kinematics: eventLockKinematics struct
% neurons: smoothed deconvolved events
% Lock data and screen cells
if nargin < 3
config.preT = -100;
config.postT = 400;
config.tBase = 10;
config.smoothS... |
e42246ee1de355461fabaa39ae62d29276751204a6ed8fc5c8333e0ee79739ec | MATLAB | 1,398 | 22 | % script for compiled EEGLAB version about button
tmptmptext = strvcat(' EEGLAB (compiled version)', ...
' ', ...
' ', ...
'The EEGLAB electrophysiological data analysis software is an open source research', ...
... |
3ba16e6af8ca2ed8c4ba4d7253a24981e0fda99de12468643720ea52e68509c4 | MATLAB | 1,399 | 44 | function outputImage = diff(this, varargin)
% Performs diff operation along specified dimension
%
% Y = MrImage()
% Y.diff(applicationDimension)
%
% This is a method of class MrImage.
%
% IN
% applicationDimension image dimension along which operation is
% performed (e.g. 4 = time, 3 ... |
44c605213b666ec01be9221b31a2b1517db19547cd84bcd30cd7c6973f8c2a55 | MATLAB | 1,399 | 37 | function c = tapas_align_priors_fields(c)
% Aligns parameter fields with the explicit prior definitions with the
% content of the vectors c.priormus and c.priorsas (vice-versa of function
% 'tapas_align_priors.m').
%
% Example:
% >> c_prc = tapas_ehgf_binary_config;
% >> c_prc.priormus(13) = -2;
% >> c_prc = ... |
6c1e69546b7b2dd7190ad1b3b3442a9e05f140a964722f95c8206eefaa73f34a | MATLAB | 1,399 | 66 | %% [r2s, t2s, m0] = R2star_ARLO_mag(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
% ... |
9cf453e9b838c8948d257f56101e27c6dfeb8e4f053afc3d1547a50c066c4e50 | MATLAB | 1,399 | 37 | function [argout] = mxDeserialize(argin)
% MXDESERIALIZE reconstructs a MATLAB object from a uint8 array suitable
% for passing down a comms channel to be reconstructed at the other end.
%
% See also MXSERIALIZE
% Copyright (C) 2005, Brad Phelan http://xtargets.com
% Copyright (C) 2007, Robert Oostenveld ht... |
f67b6f24560a1ef8c6f4c7dd8749a8c3fcebb56b3c6e6393fa1d741aa561d14a | MATLAB | 1,399 | 58 | classdef progressBar < handle
% author : Alessandro Daducci
properties
width
back, msg
i, N
end
methods
% ===========================
% Initialize the progress bar
% ===========================
function obj = progressBar( N )
obj.width = 25;
obj.i = 1;
obj.N ... |
eab6919d672a8e21a3d3ef14b05c8557cf3431325a1f0aa42b31b8dac4169cd4 | MATLAB | 1,400 | 38 | %LC. Mayo 2010.
%A partir del Intraedos [cells X pks] determina el indice de sobrelape de
%todos los picos pertenecientes a ese mismo estado.
%Si el sobrelape entre los picos de un mismo estado es alto (>0.3)
%significa que dichos estados podrian ser considerados el mismo estado.
%El indice de diversidad esta definido ... |
ab758a37e8b42d9fed4b98414fe561cee14e605595494aecca3b158b152f1667 | MATLAB | 1,401 | 31 | function [spikecountAve, spikecountraw, SCvar] = ...
SinGratSpikecount(spiketrain, goodcell, imgPara, stimInd, Dir, StimTimeIndv,...
SpikeCount_Twindow, IgnoreTimeWindow)
StimNum = imgPara.stim_time/StimTimeIndv;
SpikeCountbin = SpikeCount_Twindow/0.001;
spikecountAve = []; spikecountraw = []; SCvar = [];
for n... |
c218bc242b9c79da479ba11b302f2288a6c72be1bd4a8be92542ba29e1bb0b8c | MATLAB | 1,401 | 41 | function [shape] = read_ctf_shape(filename)
% READ_CTF_SHAPE reads headshape points and header information
% from a CTF *.shape the accompanying *.shape_info file.
%
% Use as
% [shape] = read_ctf_shape(filename)
% where filename should have the .shape extension
% Copyright (C) 2003, Robert Oostenveld
%
% This file... |
03a2425c3588ceda2336a0a19c15d64ad6ce4737c03d472ad99cb220c7fc6ce1 | MATLAB | 1,402 | 48 | function [outputStruct, unusedArg] = get_struct(this, varargin)
% Returns the current dimInfo as a struct or creates a struct form the input.
%
% Y = MrDimInfo()
% Y.get_struct()
% Y.get_struct('dimLabels', {'x', 'y', 'z'})
%
% This is a method of class MrDimInfo.
%
% IN
%
% OUT
%
% EXAMPLE
% get_struct
%
% S... |
05bb04ce0b259b8d20fc328e711101fed05ba1bf041d1298c5272ee7468c5462 | MATLAB | 1,402 | 40 | classdef LFProcessing < handle
methods(Static)
function im = apply_circ_mask(im, ctr_yx, r)
im_class = class(im);
if ~isfloat(im)
im = single(im);
end
im_size = size(im);
[s1, s2] = ndgrid(0.5 : im_size(1), 0.5 : im_size(2));
mask = ((s1 - ctr_yx(1)) ... |
3c8339f5bc1ca862d7651f96885581f1137464db27b3a774aa4172e95718e88c | MATLAB | 1,402 | 45 | %% [h_text,h_popup] = sepia_construct_text_popup(parent,fieldString,popupMenu,pos,wratio)
%
% Input
% --------------
% parent : parent of the constructs
% fieldString : text to be displayed in the 'text' field
% popupMenu : selection menu in the 'popup' field, cell variable
% pos : position of th... |
984d3aaf68b7e8df49af18f0d065cf1921cf937934dcf90603bda670a530a78a | MATLAB | 1,402 | 58 | clc;
clear;
txt = 'C:\Users\lihon\Desktop\abcd_study\pnc\vis_v2_r400_ro1\SEA_brain_region_and_development_sigGene5e-2.txt';
tbl = readtable(txt);
struc_stage = tbl{:, 1};
p_val = tbl{:, 2};
p_val_fdr = tbl{:, 3};
struc_all = cell(size(struc_stage));
stage_all = cell(size(struc_stage));
for si=1:length(struc_stage)
... |
94b0be9e86fd5222965933927bf91d908addd9a8f8f446220802842664996d41 | MATLAB | 1,403 | 47 | function outputImage = edge(this, method, thresh)
% Computes edges of a 3D or 4D image per 2D-slice
%
% Y = MrImage()
% outputImage = edge(Y, method, thresh)
%
% This is a method of class MrImage.
%
% IN
% method 'sobel', 'roberts', 'prewitt' See also edge
% thresh custom threshold for edge detection;... |
af53a6ed7fbcfa43f256993f76d85175980bac0ca7cc1f2428ae5dcfc8b1b5fa | MATLAB | 1,403 | 31 | function [pvec, pstruct] = tapas_hgf_categorical_norm_transp(r, ptrans)
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2013 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is released under the terms of the GNU Gener... |
c62e01a9ddf5d40499fb789f49f72cd7e75aab15ddd0165c2b18fdaa9df52af9 | MATLAB | 1,404 | 42 | function [sqpe, yhat, res] = tapas_squared_pe(r, infStates, ptrans)
% Calculates squared prediction errors (pe) with zeta as a weight on pe's
% relative to perceptual priors
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2012-2013 Christoph Mathys,... |
36d1105fa3821e2dc72203b91062385c0f5cc1699072c75ccae55def712d9976 | MATLAB | 1,405 | 38 | function coeffVar = compute_coeff_var(this, varargin)
% computes standard deviation image (coeff_var) over 4th dimension of MrImage
% NOTE: short-cut for compute_stat_image('coeff_var')
%
% Y = MrImage()
% coeffVar = Y.compute_coeff_var('PropertyName', PropertyValue)
%
% This is a method of class MrImage.
%
% IN
% ... |
8c612cbcf5e6e62af7f838839ef927c507a7f9158733eaa8fb0705058b280ff0 | MATLAB | 1,405 | 43 | %{
pre.AverageFrame (imported) # my newest table
-> pre.AlignMotion
-> pre.Channel
-----
frame : longblob # motion aligned and computed as q-norm to approximate maximum projection
%}
classdef AverageFrame < dj.Relvar & dj.AutoPopulate
properties
popRel = pre.AlignRaster & pre.AlignMotion
end
methods(Acce... |
e47342999a7aedbdb7186be9f5bdced28858d52429fd982ccad84b43194fc1cd | MATLAB | 1,405 | 48 | %% 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
% ... |
fe7dc76ff9ca2021cc9c6a0ca1c9ec5bde8d6972974a80d5cb3ad1f9c07a6b60 | MATLAB | 1,406 | 55 | function fh=initFig(varargin)
param.landscape=false;
param.fontsize=5;
param.markerSize=9;
param.lineWidth=0.5;
param.margin=0;
param.windowBottom=20;
param.windowLeft=0;
param.axesColor=[0,0,0];
param.height=24.7;
param.width=17.4;
param.font='Helvetica';
%%
param=parseParameters(param,varargin);
%%
expand=3;
hei... |
a80f26979bd0fc4e24d4c040c85dc4233c7f2a6c008a643401c38ddb90a93d61 | MATLAB | 1,407 | 37 | % This function loads all .txt files in a user-selected directory into a DATA array
% The files should have frequency in the second column and no header row,
% as well as using a tab character for the delimter
%April 26 2017, changed line 27 so that it loads reference contours which
%have frequency in the first colum... |
eb0a9785eff2b1bfa5ac7cebc3cb5c64faab4f2e1664816bf881ec3fe2331c17 | MATLAB | 1,407 | 43 | function [BCMatrix, BCRHS] = boundaryCondition(BC)
% creates the matrix of coefficient and RHS vector
%
% SYNOPSIS:
% [BCMatrix, BCRHS] = boundaryCondition(MeshStructure, BC)
%
% PARAMETERS:
% MeshStructure - a mesh structure created by buildMesh* functions
% BC - Right hand side values of the bounda... |
2a59eaa5b310c1e59571264992fa149c6f8318cb2e4c85b6db087332080e48ec | MATLAB | 1,409 | 55 | function y = tapas_softmax_sim(r, infStates, p)
% Simulates observations from a Bernoulli distribution
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2012-2019 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is rel... |
a651e11bbe4782314f79eadd91703b2b55289248bdd04b882e2839f5c5178616 | MATLAB | 1,409 | 70 | % simutaneouly display two sliceviewer, to compare before and after
function compare(before, after)
% before = zscore(before);
% after = zscore(after);
[nx,ny,nz] = size(before);
% show sliceviewer
gca_before=figure('Name','Before');
% sbefore = sliceViewer(before,'Colormap',jet);
% colorbar;
sbefore = sliceViewer(... |
b88ec095b276c93d367ef7a95c6dda3fbea108883523ac98e9a4caa960776bc1 | MATLAB | 1,409 | 40 | function [verbose] = tapas_physio_plot_rvt_hilbert(t,fr, fr_lp, fr_mag, fr_rv, ...
fr_phase, fr_if, verbose);
%UNTITLED7 Summary of this function goes here
% Detailed explanation goes here
verbose.fig_handles(end+1) = tapas_physio_get_default_fig_params();
set(gcf, 'Name', 'Model: Hilbert RVT (Respiratory... |
f03210cd27a016976f4356a8b9d09e9d719bfca15969af193a9e4a5dfb5596ac | MATLAB | 1,409 | 76 | %script Test_AFNI_IndexChange
%
%
%
%Purpose:
%
%
%
%Input:
%
%
%
%Output:
%
%
%
%
%
%Key Terms:
%
%More Info :
%
%
%
%
% Author : Ziad Saad
% Date : Fri Sep 8 14:02:23 PDT 2000
% LBC/NIMH/ National Institutes of Health, Bethesda Maryland
%Debug Flag
DBG = 1;
clear all
%create a colormap
OptMap.Range = ... |
154037269d06cf84fbcc9bd82b98f49a8c59e6a731409c58198f7ef35cf295ed | MATLAB | 1,410 | 50 | function y = vl_nnnormalizelp(x,dzdy,varargin)
%VL_NNNORMALIZELP CNN Lp normalization
% Y = VL_NNNORMALIZELP(X) normalizes in Lp norm each spatial
% location in the array X:
%
% Y(i,j,k) = X(i,j,k) / sum_q (X(i,j,q).^p + epsilon)^(1/p)
%
% DZDX = VL_NNNORMALIZELP(X, DZDY) computes the derivative of the
% ... |
5be95c24114b1a0f734818da1c4abfb359e4b44ebaaacd75795395f0206bfe6b | MATLAB | 1,410 | 35 | function listHandler(src, evt)
% function mouseHandlerHeatMap(src, evt)
%
% Is triggered when the mouse is clicked in the HeatMap figure. Reads
% the current mouse position, translates it to a selectedIDsor ID and visualizes
% (if matches unit in sta data) its neighborhood and its activity
%% PARAMETERS
se... |
64792bf090c3148449a1442545a5c71ecb8e559b4bfe019a72257ee7c8e15eca | MATLAB | 1,410 | 38 | function rrf = tapas_physio_rrf(t)
% respiration response function, as described in
%
% Chang, Catie, and Gary H. Glover. �Effects of Model-based Physiological
% Noise Correction on Default Mode Network Anti-correlations and Correlations.�
% NeuroImage 47, no. 4 (October 1, 2009): 1448�1459. doi:10.1016/j.neuroimag... |
0096afa1b95b849e8b24c50506a9c1b8c816b36208259a27b9552c96504be012 | MATLAB | 1,411 | 41 | function varargout = spm_bwlabel(varargin)
% Connected component labelling in 2D or 3D - a compiled routine
%
% FORMAT: [L,NUM] = spm_bwlabel(bw,conn)
%
% The calling interface has been modelled on the
% image processing toolbox routine bwlabel. See
% the help for that routine for further information.
%
% Input:
% b... |
2d5c34e0c22a9a1fda82572e1b1e5a45282569c1474c68c408e1c38cdaafac04 | MATLAB | 1,411 | 56 | function M = diffusionTerm1D(D)
% This function uses the central difference scheme to discretize a 1D
% diffusion term in the form \grad . (D \grad \phi) where u is a face vactor
% It also returns the x and y parts of the matrix of coefficient.
%
% SYNOPSIS:
%
%
% PARAMETERS:
%
%
% RETURNS:
%
%
% EXAMPLE:
%
% SEE ALSO:... |
59544c90a382bd66821e7a44a65f28c2cf012d55729cb1dd729cf8045e64a1a6 | MATLAB | 1,411 | 69 | function ft_cubic_mask(input, path_output, name_output, c, r)
% Cubic mask
%
% ft_cubic_mask(input, path_output, name_output, c, r)
%
% Inputs:
% input - file name of time series.
% path_output - path where output is written.
% name_output - basename of output file.
% c - array of center coordin... |
7102d64bfceac23dc7fda27b1e19a528a12a6a98df8175c42301bcd09b3db56d | MATLAB | 1,411 | 45 | % For a mesh of ones, compute conductance between 2 points p1 and p2
% Author: Aina Frau-Pascual
% Input image
im = ones(100);
% Construct mesh structure
Lx = size(im, 1); % domain length
Nx = size(im, 1); % number of cells
Ly = size(im, 2); % domain length
Ny = size(im, 2); % number of cells
meshstruct = createMesh... |
1252da64b8e623272adae0c1b3565a3ffef927fe7afb6fe9707ee39672c6c878 | MATLAB | 1,412 | 33 | function corrected = TransformPhaseECDF(phases,phases0)
%TransformPhaseECDF - correct phases for signal nonuniformity (e.g. asymmetry)
%
% TransformPhaseECDF corrects the 'phases' given to take into account
% the non-uniformity of the signal, as evidenced by 'phases0'
% Siapas 2005 correction for non-uniformity using ... |
35cb104082ad4f99b3fdc8a567a82ed1faabef1e86373ef783f0500ce0dd1b73 | MATLAB | 1,412 | 56 | %% FiringRateCalculator
%% »ç¿ëÇÒ ´º·± ¸ñ·Ï prompt
[filename, pathname] = uigetfile('.mat', 'MultiSelect', 'on');
if isequal(filename,0)
return;
end
Paths = strcat(pathname,filename);
if (ischar(Paths))
Paths = {Paths};
filename = {filename};
end
clearvars pathname
%% °¢ ÆÄÀϺ°·Î µ¥ÀÌÅ͸¦ ºÒ·¯¿Â ÈÄ ÃÊ´ç ... |
95b2ac0937f43a1a6781cd4a3febd01b80d39a3322c06b454ba2bd8688dcc8d6 | MATLAB | 1,413 | 47 | clear all
session= dir;
session = session(3:end);
RootDir = cd ;
for isess = 11:length(session)
% try
sessionpath = [RootDir,'\',session(isess).name];
cd(sessionpath)
if exist('rezDMMerged.mat') || exist('rezDMerged.mat')
continue
end
load rezI
[rez, DAT... |
a37a5cdf415df28aef92cf83d653e0c6b5135ff553d17ba67b6ac791c1a3a35c | MATLAB | 1,413 | 78 | function [err] = ShowRegressors (Task)
%
% [err] = ShowRegressors ()
%
%Purpose:
%
% Gang
%
%Input Parameters:
%
%
%
%Output Parameters:
% err : 0 No Problem
% : 1 Problems
%
%
%
%Key Terms:
%
%More Info :
%
%
%
%
% Author : Ziad Saad
% Date : Fri Jul 18 15:24:43 EDT 2003
% SSCC/NIMH/ National ... |
5b23da8ac71ac904a04c1556c4618628229fbb7fd827a1932fd9be9121835315 | MATLAB | 1,414 | 68 | function [nstate] = tapas_sampler_vlinear_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});
nm = numel(state.graph{nod... |
d59662c158138c284f9c4c40e8dfb9a2bcc742bc4d1bf3b472f00e84ed2391ef | MATLAB | 1,414 | 55 | function [qmf_out] = qmf_detector(hsi_img,tgt_sig,tgt_cov)
%
%function [qmf_out] = qmf_detector(hsi_img,tgt_sig,tgt_cov)
%
% Quadratic Spectral Matched Filter
%
% inputs:
% hsi_image - n_row x n_col x n_band hyperspectral image
% tgt_sig - mean target signature (n_band x 1 - column vector)
% tgt_cov - covariance mat... |
dcf9e8ea7b50e25f9d557439a3177970ef31948454e8385095da3135f01bacf2 | MATLAB | 1,414 | 68 | function [nstate] = tapas_sampler_flinear_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});
nm = numel(state.graph{nod... |
fc61576bba5a2df179d0992f17658e91d292706d88ed20102304eb9ac9007e2b | MATLAB | 1,415 | 47 | %{
#
-> fuse.ScanSetUnit
---
-> anatomy.Layer
%}
classdef LayerMembership < dj.Computed
properties
keySource = experiment.Scan * shared.SegmentationMethod * shared.PipelineVersion & fuse.ScanDone & anatomy.FieldCoordinates
end
methods(Access=protected)
function makeTuple... |
11f3e84f532eb2a7f0559a9252bc46d2bb90b3c2cec387db65e35582d455ae27 | MATLAB | 1,416 | 49 | function [ y ] = tapas_rdcm_subsample(Y, r_dt)
% [ y ] = tapas_rdcm_subsample(Y, r_dt)
%
% Subsamples signal Y (in frequency domain) with a rate r_dt
%
% Input:
% Y - original signal
% r_dt - time step (delta_t)
%
% Output:
% y - subsampled signal
%
% ---------------------------... |
d146b9be387f3679ce8c17ddb7592250c17c6db5837a0ed644dac5d1fc486d08 | MATLAB | 1,416 | 50 | classdef handle_light < handle
% Trick class to hide methods inherited from the handle class
% when calling methods(myclass).
%
% Source:
% http://stackoverflow.com/questions/6621850/is-it-possible-to-hide-the-methods-inherited-from-the-handle-class-in-matlab
% Posted by sclarke81 on StackOverflow on Oct. 24, 2012.
% ... |
ca16e105df4d71bae1a057167cbb2fddbe4bab050aed47b3a3b76d38c5caf4a5 | MATLAB | 1,417 | 67 | function result = FCMclust(data,param)
%data normalization
X=data.X;
f0=param.c;
%checking the parameters given
%default parameters
if exist('param.m')==1, m = param.m;else m = 2;end;
if exist('param.e')==1, e = param.m;else e = 1e-4;end;
[N,n] = size(X);
[Nf0,nf0] = size(f0);
X1 = ones(N,1);
% Initialize fuzzy p... |
1c9744be42b62a0070bd4db080452911334ed1b42863838dc6ad3b1af46c630b | MATLAB | 1,418 | 78 | % this is a record of what we generated for the participants.
% this is archived but we may do something different...
scores = [1 1 1 1 1 1
1 1 2 1 1 1
2 2 2 2 2 2
1 1 2 1 1 1
3 3 1 1 2 2
1 1 1 1 2 2
3 3 1 1 3 3
3 3 3 3 2 2
3 3 3 3 3 2
1 1 1 1 1 1
1 1 2 1 1 1
1 1 1 1 1 1
3 3 3 2 2 1
1 2 2 1 1 1];
overall = [
1
1.1818... |
30efce46c513c4f7d020ce9252ea31a13609725f1504b68a13c9ec78704a3dfc | MATLAB | 1,418 | 60 | function tint=tInterval_Calc(vect, CI)
% tInterval_Calc - confidence interval based on the t-distribution
%
% function tint = NBP.tInterval_Calc(vect, CI)
%
%
% Purpose
% Calculate the t-interval about the mean to a given confidence
% level (CI). Note that nans do not contribute to the calculation
% of the sample size ... |
8914e4759d843d952b8b1af0fc9b523455772e20dc72d1ff2bda474abbae16a5 | MATLAB | 1,418 | 48 | %% 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
% ... |
d97ad061061ab7c42a7191c6bd6320ecba4d306f0ce9d3cecff3efd354adb2bf | MATLAB | 1,418 | 52 | function [avgFR, RPE_firstTrial, firstTrialIdx] = ...
get_avgFR_persistence(neuron, beh, A, twin)
% get average firing rate at A on a sequence of 3 trials where the RPE
% on the 2nd trial is small
if nargin<4
twin = [0 0.3];
end
% get an RPE sequence
% filter out outliers in ITI and compute -delta ITI
cu... |
db6da50a95b24cfee52868146566677c8596902cfdf3edb276671c1b1e73deb4 | MATLAB | 1,418 | 58 | function h = imshow_mri(f, vs, z, slice, palette, scale)
if nargin < 5
palette = 'gray';
end
if ischar(palette)
palette = str2func(palette);
end
if isa(palette, 'function_handle')
palette = palette(2^10);
end
if nargin < 4
slice = 3;
end
dim = [size(f... |
29443fcf095867b646fa64f35cb4a382c19808cf1c2ac15d7796f1dd77ad4ef7 | MATLAB | 1,419 | 55 | function [] = tempdynamicsPC(spikeTimes,lagval)
segLength = 15; % length of segment in seconds
segShift = 5; % shift between segments in seconds
lag = lagval;
ItNum =(duration_s/segShift)-(segLength/segShift);
for i = 1:ItNum
startT = segShift*(i-1);
endT = segShift*(i-1) + 30;
f... |
62ee1a223f339ae654d2b2121ebc5d7be1d3331698fccb756beaef79ece9deff | MATLAB | 1,419 | 42 | function [logp, yhat, res] = tapas_bayes_optimal(r, infStates, ptrans)
% Calculates the log-probabilities of the inputs given the current prediction
% and its precision
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2012-2013 Christoph Mathys, TNU,... |
be151d1dc07455ad545759f232e41a3a4c7da92b10d1f0bb87771946cae55ea2 | MATLAB | 1,419 | 50 | function cfg = default_config()
% DEFAULT_CONFIG Centralized parameters
cfg = struct();
% I/O
cfg.root = fileparts(fileparts(fileparts(mfilename('fullpath'))));
cfg.data_dir = fullfile(cfg.root,'data');
% Base output directory (root for all FC modalities)
cfg.out_dir = fullfile(cfg.root,'out');
% Label for... |
f2b7a1b6b3bd6c68a9d5f10f5fef131805a1c4f52765b66d3c062c6d75f1cf9e | MATLAB | 1,419 | 55 | function [X_scal,param] = data_pretreatment(X,pret_type)
% pretreatment for multivariate data
%
% INPUT
% X: data matrix (samples x variables)
% pret_type: 'cent' cenering
% 'scal' variance scaling
% 'auto' for autoscaling (centering + variance scaling)
% 'rang' ... |
2cefaeb2cf5ff35889ab27866813a70f75d60464997e2164a8f37d5247beec6b | MATLAB | 1,420 | 39 | function STAImage = createSensorSTAImage(str)
% STA Image generator for SpikeSorterSource Object
%
% function STAImages = createUnitSTAImage(str)
%
% Takes a SpikeSorterUnit Object and computes the single Unit STA image
% struct
%
% INPUT:
%
% str - SpikeSorterSource Object
%
%
% OUTPUT... |
26a40831513ce9e420e7c92dd5efb87e8547b600726fd91a14e4bd6b6064d048 | MATLAB | 1,421 | 45 | function [ output ] = nmri_report_regional( suma_all, metric )
% [ output ] = nmri_report_regional( suma_all, metric )
% Will report reginal statistics for a metric (one value per vertex)
% output is a cell array, could be saved with nf_csvwrite, nf_xlswrite
% determine unique ROIs
use_rois=suma_all.annot_key{1}>0... |
82886bc58ae132ed500a4d7f78634b34aafb320058f56b43ff692046f4fe1dc9 | MATLAB | 1,421 | 52 | function [ output_args ] = buildPatternSimilarityGraph( X )
%BUILDPATTERNSIMILARITYGRAPH( X ) Returns a k-nearest-neighbour graph
%according to the consine distance from the pattern data in X.
%
% INPUT:
% X [1x? cell]: cell array of binary activity patterns
%
%
% === Jan Moelter, The University of Queensland, 20... |
83170229c5fcb4573a524167787e985293ef5698aba3b2c71add2116013122b3 | MATLAB | 1,421 | 48 | function cfg = cfgMT(cfg)
%
% (C) Copyright 2020 CPP visual motion localizer developers
cfg.design.localizer = 'MT';
cfg.pacedByTriggers.do = false;
cfg.timing.triggerIBI = 4;
cfg.mri.triggerNb = 5;
% Time between events in secs
cfg.timing.ISI = 0;
% Time between blocs in secs
... |
190d04dbb8e34a49f9645039e7b97ce10f388dc4250fab6b5fbe797e50a73927 | MATLAB | 1,422 | 50 | function test_poincareball()
k = 3;
n = 10;
manifold = poincareballfactory(k, n);
problem.M = manifold;
P = manifold.rand();
problem.cost = @(X) .5*norm(X-P, 'fro').^2;
problem.egrad = @(X) X-P;
problem.ehess = @(X, U) U;
% Check numerically whether gradient and Ressian a... |
72f4c0680d53d4f61addb665b1bed353ee9344f767be1fe7a19c10b211a75c2a | MATLAB | 1,423 | 37 | function [argout] = mxSerialize(argin)
% MXSERIALIZE converts any MATLAB object into a uint8 array suitable
% for passing down a comms channel to be reconstructed at the other end.
%
% See also MXDESERIALIZE
% Copyright (C) 2005, Brad Phelan http://xtargets.com
% Copyright (C) 2007, Robert Oostenveld http:/... |
a750f028454305efb892b30d52c304ceb85c4600156f29647742a8218c1f6553 | MATLAB | 1,423 | 39 | %% Figure 6 analysis
% Runs condition, condition-kinematics-partial-ed, lift-time, and
% time-generalized classifiers using smoothed-deconvolved events
%% Paths
YOURDATAPATH = '/Users/hank/Documents/MATLAB/kaufmanlab/data/P1/';
dataPath = [YOURDATAPATH '/' 'locked' '/'];
savePath = [YOURDATAPATH '/' 'models' '/'];
%... |
3f1ce5dcd71074af234a26294d5383e5c8cc940531534acc811aeffe28fd0bee | MATLAB | 1,424 | 39 | function [ filtered_subjects ] = nmri_filter_subjects ( all_subjects, filters )
%[ filtered_subjects ] = nmri_filter_subjects ( all_subjects, filters )
% Filters subjects according to certain fields in the structs, very
% flexible filters are possible
%
% all_subjects = array of subject struct, e.g. from nmri_all_... |
a5152389bf9bd45c8272b37918a693a4b2cd5f5b81c6f8fe5f84afdc184ac7f9 | MATLAB | 1,424 | 52 | function fn_nii = sero_pulseq_data2nii_adaptiveCombine(fn_data, fn_seq, fn_nii, xps_fn, do_norm)
% function fn_nii = sero_pulseq_data2nii_adaptiveCombine(fn_data, fn_seq, fn_nii, do_norm)
if nargin < 2
fn_seq = [];
end
if nargin < 3 || isempty(fn_nii)
fn_nii = sero_pulseq_fn_data2nii_aco(fn_data);
end
if nar... |
f544f1b9c4e8982a16f56aceb03621cb8c8118bdc4d7eeacc8723e2657007cb0 | MATLAB | 1,424 | 39 | function [xvalue, yvalue, zvalue] = extendBoundaryTensor3D(im)
% This function extends the 3D tensors in the boundary. When using tensors,
% you need to use more neighbors to compute discretized matrix
%
% Author: Aina Frau-Pascual
Nx = size(im, 1); % number of cells
Ny = size(im, 2); % number of cells
Nz = size(im, ... |
a06e7ccbcc5760cd86d30a1a080394c6447312b25b8774a7208ae1ba02770dd4 | MATLAB | 1,425 | 46 | classdef nnsoftmaxloss < nntest
properties (TestParameter)
weighed = {false true}
multilab = {false true}
end
methods (Test)
function basic(test, multilab, weighed)
C = 10 ;
n = 3 ;
if multilab
c = reshape(mod(0:3*4*n-1,C)+1, 3, 4, 1, n) ;
else
c = reshape([7 2... |
0109c8fcbec75be01b513652523db624f7b6a8291d47b4fa5af09c81d9e6bc0e | MATLAB | 1,426 | 23 | function vers = eegplugin_cwcorrection( fig, try_strings, catch_strings)
vers = 'CW Regression Tool 0.01';
% add menu
%----------
toolsmenu = findobj(fig, 'tag', 'tools');
cwregressionmenu=uimenu(toolsmenu,'label','CW Regression Tool','separator','on','tag','CW Regression Tools');
commando1 = [ try_strings.no_check '... |
0885bde2c755802f02926146ed25b5b3f25ffcc48c5664fe5ec85d53d24b9c9c | MATLAB | 1,426 | 61 | clear; clc;
root='F:\GEVI_Spike\Visual';
mouse=[81 82];
date=20200416;
% \m81\20200416\meas05
for m=1%1:3
for d=1%1:2
for n=5%
%
% path = 'F:\TEMPO2D_raw\Spikes\m81\20200131\meas03\converted\spike-ace-varnam-laser561nm-fov1-1khz--BL35-fps401-cG-000.h5';
... |
34bdaa6937c2aa863db71811e394844a9a6b6892c0ebd6adc1d4c82415f1b7fb | MATLAB | 1,426 | 58 | function [X,s,U,V]=mmds(D)
%
%function [X,s,U,V]=mmds(D)
%
%PURPOSE
%
%To compute principal coordinates (linear Metric Multi-Dimensional Scaling)
%
%INPUTS
%
% D (matrix) NxN matrix of dissimilarities
%
%OUTPUTS
%
% X (matrix) NxN matrix of coordinates
% s (vector) Nx1 vector of singular values corresponding to th... |
39e8fe9ef4ee5e9738845770ec032f7951268b0df9cf06c9ca3f87b809d23dc0 | MATLAB | 1,427 | 56 | % op_measureDrift.m
% Georg Oeltzschner, Johns Hopkins University 2019.
%
% USAGE:
% [out] = op_measureDrift(in);
%
% DESCRIPTION:
% Measures the frequency drift of the Cr signal over the course of the
% acquisition.
%
% INPUTS:
% in = Input data structure.
%
% OUTPUTS:
% out = Vector containing the frame-... |
3ee5c5e731b7d67d7080eca46a76ab6fc0cf9fd78a943caaec67a79ca56a6b1e | MATLAB | 1,427 | 44 | function [ hFig ] = nmri_rotate_print( hFig, this_rot, output, title_txt, clipping)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
% get axes
hAx=findall(hFig,'type','axes');
% set export for printer
fig_count=0;
all_plots='';
plot_list={};
%lght=camlight('headlight');
set(hFig,'Pape... |
9336eddc3fdb5eb10525cbe316fe276f31979af37edf5254289b1fec5be054f0 | MATLAB | 1,428 | 38 | function [X_transformed,transformMask] = fsTransform(data,NBSPredict,bestParam)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% fsTransform transforms given data according to best parameter provided.
%
% Arguments:
% data = Data structure were current features and labels are stored.
% ... |
21af68c8ce7f9eb3b153235d1972bf4bb7714b1d5c9002fb70a8a6446b10619d | MATLAB | 1,429 | 41 | function outputImage = fft(this, applicationDimension)
% FFT (including FFT-shift and normalization) using k2image
%
% Y = MrImage()
% Y.fft(applicationDimension)
%
% This is a method of class MrImage.
%
% IN
%
% OUT
%
% EXAMPLE
% Y = MrImage();
% Y.fft(4); % convert each voxel's time series to frequency space ... |
2369c36bedb8808be9e0c6a85925172eac9ebfca8af123f248c034d95ac7873a | MATLAB | 1,429 | 47 | function slice = sd_get_slice(V, xyzmm, transform, vdims, hold)
% SD_GET_SLICE Obtains information from images
%
% DESCRIPTION
% This function obtains information from images, including header
% specifics, transformation matrix, and slice dimensions and positions.
%
% SYNTAX
% [h_figure, p, settings] = SD_GET_SLIC... |
c5aaac631010f156d0043220c3d5e4b4a0dd1422e0b5eb5dce99fedc5931acf1 | MATLAB | 1,429 | 65 | function [theta] = tapas_sem_multiv_init_theta(data, model, inference)
%% Obtain an initial sample with positive likelihood.
%
% aponteeduardo@gmail.com
% copyright (C) 2017
%
ptheta = model.graph{1}.htheta.model;
nc = size(model.graph{1}.htheta.T, 2);
ns = size(data, 1);
mu = model.graph{4}.htheta.y.mu;
nb = numel... |
a3517da398ffc05f2b1110e6e5a3f01d166f2e2cd7a5ae24cfe66104dff293ca | MATLAB | 1,430 | 33 | % This function loads all .csv files in a user-selected directory into a DATA array
% The files should have frequency in the second column and a header row, as
% is typical for Rocca output of whistle contours
function ARTwarp_Load_CSV_Data
global DATA numSamples tempres
path = uigetdir('*.ctr', 'Select the folder c... |
bc544eacfb090b4c0011720333e59221169dae296cb1a0df409ded1e85c4494c | MATLAB | 1,430 | 85 | function options=savetxt(string,varargin)
% EXAMPLE USE WITH ARGUMENTS
% savetxt(string)
% savetxt(string,filename)
% savetxt(string,filename,folder)
% savetxt(string,filename,folder)
% savetxt(string,filename,folder,options)
%
% HELP
% Saves string to a text file
%
% HISTORY
% - 20-04-10 12:55:39 - created by Radek Ch... |
c9e518b528eef713df3617abc8de2d4602289819575e266c8c290590b9222ec1 | MATLAB | 1,430 | 40 | %
addpath('./scripts/')
%% generate patch information from SUVR and Reeb graph
suvr_dir = './examples/sub-1/sub-1_SUVR.raw';
label_dir = './examples/sub-1/sub-1_Reeb.raw';
output_dir = './examples/';
subject_id = 'sub-1';
generatePatchInfo(suvr_dir, label_dir, output_dir, subject_id)
%% compute patch distan... |
f7a5e23e78221501d113f3ea492980c3648178fe35d14f9743444af1edcbf8d3 | MATLAB | 1,430 | 32 | %-----------------------------------------------------------------------
% Job saved on 09-Feb-2024 16:29:35 by cfg_util (rev $Rev: 7345 $)
% spm SPM - SPM12 (7771)
% cfg_basicio BasicIO - Unknown
%-----------------------------------------------------------------------
%% load libraries, I think
run('set_library_paths.... |
4452dbd63673c8b5c13957ade82192db1715418dba14e1d6d0282133203886c8 | MATLAB | 1,431 | 45 | function [ cifti, cdata ] = ciftiopen(filename,wbcommand,verbose)
% [CIFTI, CDATA] = CIFTIOPEN(FILENAME,WBCOMMAND,VERBOSE)
%
% Open a CIFTI file by converting to GIFTI external binary first and then
% using the GIFTI toolbox
%
% FILENAME is string containing file name to open
% WBCOMMAND is string containing the Workb... |
94607fb29919d33fc76f2ebc6be0be70bf648a5dbfd558a5fee2a861cd380804 | MATLAB | 1,431 | 42 | % print_chan_sample() - prints the number of channems and samples
% in the EEG file to the log file
%
% Usage:
% >> print_chan_sample(EEG_temp);
%
% Inputs:
% EEG_temp - input EEG dataset
%
% Outputs:
% None
%:
% Copyright (C) 2017 Brock University Cognitive and Affective Neuroscien... |
f13a625be69c9e6906f21dd5db3d326a62a48f578f02cf0365deb0a5d9dbd10a | MATLAB | 1,432 | 47 | function [latency_mean, latency_sem, pval] =...
latency_post20ul_by_previous_vol(A, varargin)
%latency_post20ul_by_previous_vol Finds wait time on 20 uL trials in mixed
% blocks divded into whether the previous volume is < 20 uL or > 20 uL.
% Input: A - A struct (if you accidentally put in S struct, code will
% ... |
5b7f3164937761d83ae72a2313b26b674265c82b88786c226a08cb6b832f7098 | MATLAB | 1,433 | 20 | %{
preprocess.TrackingParameters (lookup) # table that stores the paths for the params for pupil_tracker
-> preprocess.EyeQuality
---
perc_high : float # upper percentile for bright pixels
perc_low : float # lower percentile for dark p... |
0a0296fe5df00b1ef2ab23c95ad02c4c7fc37fcc875206b16c0fe67b99f4b41b | MATLAB | 1,434 | 71 | % op_median.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% out=op_median(in);
%
% DESCRIPTION:
% Combine the averages in a scan by calculating the median of all averages.
%
% INPUTS:
% in = input data in matlab structure format.
%
% OUTPUTS:
% out = Output dataset following median calculation.
function out... |
0f4c38a13193f708d0399b83f9166c3c7e5bb258a253c2e697422d3d245f69a9 | MATLAB | 1,434 | 33 | function [results,errors] = hlp_schedule(tasks,varargin)
% Schedule the given tasks across a pool of (possibly remote) workers.
% Results = hlp_schedule(Tasks, Options...)
%
% In:
% Tasks : cell array of tasks; formatted as
% * (evaluatable) string
% * {function_handle, arg1,arg2,arg3, ...}
% ... |
17a0480bc445b5bef7e8c99606becfaefed7e21dc155b9b84508db0d73dd57d6 | MATLAB | 1,435 | 38 | function decodeSummary = baggedDecode(decodeSummary, field)
% Gather variables and set params
nTrials = length(decodeSummary.outcomes);
testTrials = decodeSummary.trialsTest;
% Reconstruct outcomes
for tr = 1:nTrials
trialNumber = decodeSummary.outcomes(tr).trialNumber;
% Check which folds this trial was... |
8399ce33c5bcbae197ddedb00a9e7a35a2d7419167e6cb6f9c5b4dcc5807bedb | MATLAB | 1,435 | 39 | classdef McsCmosLinkedDataSource < handle
% Represents a data source that is an external link to another HDF5 file
%
% (c) 2017 by Multi Channel Systems MCS GmbH
properties (SetAccess = protected)
LinkFile % (string) The file name of the external link
LinkTarget % (string) The name o... |
db049e040910adcb2dff960ca5cd1465d4931c394ba4dc179ce2ddc6e475302a | MATLAB | 1,436 | 34 | function [xpos,ypos] = UNBIASED(xpos,ypos,PB)
delta = 1; % step size
move_probs = [0.25 0.25 0.25 0.25]; % movement probabilities
cumulative_probs = cumsum(move_probs);
num_cells = length(xpos);
r_C = rand(1,num_cells); % generate random number for each cell
west_mask = r_C < cumulative_probs(1); % mask of cells to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.