sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b4d1a91e3af72c161ee2008c969e82d75ba6df469855476fdf630c07075fb783 | MATLAB | 1,525 | 42 | function [ states_corr, states_lag ] = xcorr_states( Pools_coords, Spikes,xcs_lag )
%LC July 14, encuentra la correlacion entre todas las celulas que pertenecen a un estado especifico
%para todos los estados. Las variables de salida son la media de la
%correlacion para cada estado y el tiempo maximo de la correlacion e... |
b6e9c66ab1e7fe2a5c289587352203c145073ae06e13cb6521fedcb77833f175 | MATLAB | 1,525 | 42 | function [Mask_res, Data_res] = resample_data(Mask,Data,steps,b_values)
%resample_data(Mask 'double', Data 'double', steps 'double', b_values 'double')
% resample Matrix and Data for downsampling
%
% Mask : array containing masking
% Data : diffusion data
% steps : current resampling step matrix
% b_va... |
fb7b1f96ea3ac172d86914438348538f5a8d90cfa401a2e2fe9699c5d3d9e772 | MATLAB | 1,525 | 37 | function [F_Rest, Noise_cov] = baselineF(EEG, f_axis, FWHM,varargin)
%v1.2 Nadine Jacobsen, April 2022: added IC option
if ~isempty(varargin)
switch varargin{1}
case 'EEG'
data = permute(EEG.data, [2,1]); % pnts x chans
titleString = 'Mean standing baseline power of each chann... |
66e5c7448c58bd1d08d0434e93d0642edb49a11e07fba6ec97c2459ccb0cfce4 | MATLAB | 1,527 | 45 | %{
a stand-alone script for Monet stimulus processing of galvo traces
%}
%% prepare
matched_trials = preprocess.Sync * vis.Trial & 'trial_idx between first_trial and last_trial';
%% all galvo scans for which there is a monet stimulus
monet_keys = fetch(preprocess.Spikes*preprocess.SpikeMethod*preprocess.PrepareGalvo*... |
934c44d4bf395bd39f27342e19e4c383b4bc7bd281f2517d9c90401cc76f133a | MATLAB | 1,527 | 79 | function [summary] = tapas_sem_generate_summary(data, samples, model, ...
subject, robust)
%% Generate a summary table from the model.
%
% Input
% data -- Data from subjects.
% samples -- Posterior samples.
% model -- Model stucture.
% subject -- Subject identifier. Defa... |
9d251299a541f0845aed4f09cd0283637ddc256ecd90ab558405eba1ab1f7f33 | MATLAB | 1,528 | 51 | function [raster, mapOfOddsJoint]=Rasterize(deltaFoF, sigma, movements, mapOfOdds, xev, yev, params)
temp=deltaFoF;
temp(logical(movements),:)=0;
transfDataMatrix=bsxfun(@rdivide,temp,sigma);
cc=bwconncomp(~mapOfOdds);
stats=regionprops(cc,'PixelList');
indZero=find(xev(1,:)>0,1,'first');%
for i=1:cc.NumObjects
... |
4dc6336b54eae708c98030fff594a09de0e26630aca339cea5308676eec64cf0 | MATLAB | 1,529 | 65 | %calling function to search the optimal number of clusters
path(path,'..\..\FUZZCLUST')
%the data
data.X=PII(:,[1 2]);
[N,n]=size(data.X);
%data normalizaiton
data = clust_normalize(data,'range');
%parameters
ncmax=10; %maximal number of cluster
param.m=2;
param.e=1e-3;
%
ment=[];
figure(1)
for cln=2:ncmax
param.c=c... |
7db83b986fc14224322b81bc0ce1a947666bb757df1b70530796b1f07b1195e3 | MATLAB | 1,529 | 48 | function rf_summary
% summarizes the quality of mice
set(groot,'defaultAxesColorOrder', parula(4)*0.7, 'defaultAxesLineStyleOrder', '-|--|:')
fits = pro(monet.Fit, 'radius*pow(contrast,1.5)->score') & 'segment_method=2' & 'spike_inference=2';
keys = fetch(pro(common.Animal, rf.Session, 'max(session_date)->sess_date') &... |
0be64d7cf7b2ddb372922c8e492c42ba3eda94ec53e9200de585dc55b062c5a4 | MATLAB | 1,530 | 53 | %% 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
% ... |
2fa824e524885b0972184ab6a9e8d505f7f7271ee0ec3da2f4188afa46c659e3 | MATLAB | 1,530 | 63 | function idx = closestval(a,b,w)
% function closestval - find closest match to a given value
%
% syntax: idx = closestval(a,b)
% idx = closestval(a,b,w)
%
% closestval(a,b) finds the index idx of the value in vector a closest to
% the scalar b. For several identical nearest values, idx only returns the
% first... |
61b348d923aa131e1eb0e9953c3a2945665775fc245fdd535b5b799f41609283 | MATLAB | 1,530 | 42 | function [MLhandle] = gen_MLhandles(modelName)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% gen_MLhandles returns function handle to initiate given machine learning
% model. Once you generate function handle, you can initiate machine
% learning model with parameters you define.
%
% Argu... |
9b5eecfcb0b696c51209de66a5521046c0aad0a08ae1ad04f5901ddfd7e68335 | MATLAB | 1,531 | 59 | function tempname=mwpath(fname)
%
% tempname=meshtemppath(fname)
%
% get full temp-file name by prepend working-directory and current session name
%
% author: Qianqian Fang (fangq <at> nmr.mgh.harvard.edu)
%
% input:
% fname: input, a file name string
%
% output:
% tempname: output, full file name located in the ... |
ee83051ba0cd49f0413335b9d42de59d9a10047aa4ba665a30de463e34edd2e0 | MATLAB | 1,531 | 64 | path_shut3 = "D:\Data_fib\Lobster_Training-190725-161613\21JAN5-210224-111236\Lobster_Training-190725-161613_21JAN5-210224-111236_Vid1_buttered.csv";
path_lob1 = "D:\Data_fib\Lobster_Training-190725-161613\21JAN5-210225-115452\Lobster_Training-190725-161613_21JAN5-210225-115452_Vid1_buttered.csv";
%% Load Data
data_sh... |
07bbc21985858966f72ef16b7a496034c268ab2096aa3c229454fd2c2203a1f8 | MATLAB | 1,532 | 65 | %calling function to search the optimal number of clusters
close all
%clear all
path(path,'.\FUZZCLUST')
%the data
%load motorcycle.txt
data.X=Z(:,[1 2]);
[N,n]=size(data.X);
%data normalizaiton
data = clust_normalize(data,'range');
%parameters
ncmax=10; %maximal number of cluster
param.m=2;
param.e=1e-3;
%
ment=[];... |
9cbfb08d40788c683910f177b73f54ad6a66ce3d5fe5f5ee6cabea28db6f1bca | MATLAB | 1,533 | 40 | function rotatedData = rotatePoints(alignmentVector, originalData)
% Rotate a set of points around a specific axis using matrix and vector
% operations
DOF = size(originalData,2);
% Rotating in 2D
if DOF==2
[rad_theta, rho] = cart2pol(alignmentVector(1), alignmentVector(2));
deg_theta = -1 * rad_theta * (180/... |
787fd83f3ce27e5ee14502e20bb6376e5c85c861a1a7bf0434e60371c840ebc3 | MATLAB | 1,534 | 47 | function this = apply_inverse_transformation(this, otherGeometry)
% Applies inverse of given transformation (as an Image geometry) to this
%
%(e.g. given mapping stationary -> transformed image transformation that
% now shall be applied to transformable image to warp into space of
% stationary image )
%
% Y = MrImage... |
c3bc195286b3e72c3f34cc9466b6338cc04cafcc16aeae0c630aabb40b19c4b6 | MATLAB | 1,534 | 41 | function [cropMovie, corn] = postCropping(movie,corn)
% crop image to remove boundary values
% more advanced version, 2019-12-04 by Jizhou Li
% improved version, 2020-05-14 by Simon Haziza
% add corn output, 2020-06-07 by Jizhou Li
[movie_pad]=padarray(movie,[1 1],0,'both');
if nargin<2
% needs to compute corn
... |
05233712385f370d1c04b5b355a5d1e563f25c5795de961746a3ba56dbd5fa49 | MATLAB | 1,535 | 58 | function [Xwh, mu, invMat, whMat] = whiten(X,epsilon)
%function [X,mu,invMat] = whiten(X,epsilon)
%
% ZCA whitening of a data matrix (make the covariance matrix an identity matrix)
%
% WARNING
% This form of whitening performs poorly if the number of dimensions are
% much greater than the number of instances
%
%
% INPU... |
059405b867a30c66fa8457d516f3a6dc21db6704804c659b9d808a7c71640523 | MATLAB | 1,535 | 59 | function [state_raster,state_pks,fac_cut] = SVDStateBinary(S,state_cut)
% Find SVD states.
% Shuting Han, 2018
p = 0.025; %significant states need to appear at least 5% of the time to be considered LCR
% do SVD on binarized similarity matrix
sz = size(S,1);
[~,S_svd,V_svd] = svd(S);
% binary search factor cut
fac_cu... |
3c0520ec91c4b2c3aec4feebe9b1477dedfeff85dc42e5510fd143e037b7eaea | MATLAB | 1,535 | 56 | function p = gammcdf(x,a,b);
%GAMCDF Gamma cumulative distribution function.
% P = GAMCDF(X,A,B) returns the gamma cumulative distribution
% function with parameters A and B at the values in X.
%
% The size of P is the common size of the input arguments. A scalar input
% functions as a constant matrix of the ... |
40a498e01a45c8a828c9781d2fc03bfe59a76a6ad6cb7b06aad75a0cd367eaa7 | MATLAB | 1,535 | 46 | % Warnning: run this code will take a very long time...
% final optimization result is saved as ./results/MLEFit.mat
clearvars;
[t123idx,sRow,sCol,concT123,rspT123] = prep_ds_data();
%% prepare the initial guess
load(which('initialParameters.mat'));
%
pairNum = length(sRow);
for i = 1 : pairNum
AVec0(i,1) = aMa... |
5bd3fd0413de03477d8aee2afccb65c3c712db9217a4136c7e9661606cc9b8f0 | MATLAB | 1,535 | 59 | function y = tapas_softmax_mu3_sim(r, infStates, p)
% Simulates observations from a Boltzmann distribution with volatility as temperature
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2017-2019 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is pa... |
36b5fba1004273f1369007901c3d80de25f77f2db0e135100207f684884a0ac0 | MATLAB | 1,536 | 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... |
dc032c7ca4ebed436fd23385e20f7ba74e7487c12cd056e43945289dba131c55 | MATLAB | 1,536 | 52 | classdef field < brca.dot.base
% FORMAT dot_field = brca.dot.field()
%
% Inner product between 3D volumes based on a a mixture of differential
% energies (absolute, membrane, bending) implemented using finite
% differences.
%
% References:
% -----------
% - Ashburner J., "A Fast Diffeomorphic Registration Algorithm",
%... |
06a472730f77ccb029402dcb95c978c5dee1af57fbde1f1282bf096e48bdcae1 | MATLAB | 1,537 | 58 | function [state] = tapas_sampler_mc3g(data, model, inference, state)
%% Sampler for population mcmc (mc3) with generalized temperature.
%
% aponteeduardo@gmail.com
% copyright (C) 2016
%
ollh = state.llh{1};
olpp = state.llh{2};
% Get the joint
%for i = 2:nn - 1
% lpp = lpp + sum(state.llh{i}, 1);
%end
T = model... |
157c4c62f98b25705f316df6b0331249ede7306b1adf996ab5924284ea967ba6 | MATLAB | 1,537 | 67 | %recreates clustering results of Figure 1, on PSTH-based feature space
datadir = '/Users/dhocker/projects/ofc/data/published/';
%% load cluster labels and aggregated data structure
disp('loading aggregated data and cluster labels');
clustfilename = strcat(datadir,'clustlabs_psth.mat');
clustfile = load(clustfilena... |
60ad8eac487689c381628c6a045d304c9f88206090a251bb01f9eb4ddb548aa8 | MATLAB | 1,537 | 74 | clc;clear;close all
hold on
axis([ 0 100 0 100])
set(gca,'YLim',[0 100]);
set(gca,'XLim',[0 100]);
set(gcf,'MenuBar','none');
% axis off;
box on;
set(gcf,'color','black');
colordef black;
% set(gca,'LooseInset',get(gca,'TightInset'))
set(gca, 'LooseInset', [0,0,0,0]);
x_list = [0:5:100]';
y_list = [0:5:100]';
for j... |
9581f1105326280ca4081f157b9c6f5e78a62077e0a98caa30e13f77fb162123 | MATLAB | 1,537 | 62 | function nameout = cleanvarname(namein)
% Routine to remove unallowed characters from strings
% nameout can be use as a variable or field in a structure
% Cyril Pernet & Arnaud Delorme
% custom change
if strcmp(namein,'#')
namein = 'nb';
end
% 1st change space to underscore (keeps readability)
for l=1:length(nam... |
a37a5575be754e823e59bfebf21defe95cdba2b8574b63d12cc1702b1b12aac3 | MATLAB | 1,537 | 45 | function plotSingleTrials(params, trials)
% plots single trials
% (c) Jiri, Nov16
%% aux. info
clear trialsData;
trialsData = struct;
trialsData.info.verLines = [-2:2];
trialsData.info.horLines = 0;
trialsData.info.yLims = getYLims(trials.data);
% trialsData.info.outDir = [params.storage.outputDir filesep 'singleTria... |
ad2271c758a1f8c1fe835341e9deb24b69116a52bd769c7d7ba215ba657ec385 | MATLAB | 1,537 | 63 | function p = getLocalPath(p,os)
% Converts path names to local operating system format using lab conventions.
%
% localPath = getLocalPath(inputPath) converts inputPath to local OS format
% using lab conventions. The paths that are converted are stored in the
% commons_lab.Paths table.
%
% localPath = getLo... |
4e1d8c4842c1849f9e16fd568b66a2a2f3cffa1cba4ba90d18810d1608162e2a | MATLAB | 1,538 | 55 | function newEye(key)
p = fetch1(rf.Session & key,'hd5_path');
f = fetch1(rf.Session & key,'file_base');
n = fetch1(rf.Scan & key,'file_num');
f = ['C:' p '/' f num2str(n) 'eyetracking.avi']
f = regexprep(f,{'/scratch01/','\/'},'\\');
dat = rf.readHD5(key);
packetLen = 2000;
datT =... |
974d3d2db1407476341696882b40aa7c28d3a03c464d02a1a7a941726d539f34 | MATLAB | 1,538 | 34 | function categoryActivation = ARTwarp_Activate_Categories(input, weight, bias)
% ARTwarp_Activate_Categories Activates the categories in an ARTwarp network.
% CATEGORYACTIVATION = ART_Activate_Categories(INPUT, WEIGHT, BIAS)
% This function returns a structure containing the activation values(biassed
% tim... |
d7149c0b221afa9312d49b7b077c609d9f4d19b06efed66070895fcf5134a948 | MATLAB | 1,538 | 50 | function obj = update_latent_precision(obj)
if isfinite(obj.nA0)
% ---------------------------------------------------------------------
% Maximum likelihood (n0 == 0) or Variational posterior (n0 > 0)
% ---------------------------------------------------------------------
N = numel(obj.data);... |
0bb6b821d27af4efb6d5c039c44fb9ed65b09ccb4965d3d7c245a39db195efb2 | MATLAB | 1,539 | 52 | function [minValue, minPosition] = min(this, varargin)
% Returns minimum value of data matrix of MrImage, accepts selection parameters
%
% Y = MrImage()
% [minValue, minPosition] = ...
% Y.min('ParameterName1', 'ParameterValue1', ...)
%
% This is a method of class MrImage.
%
% IN
% varargin parameterName... |
1800369e30c8d4bf4e48763435ce2fc22467fdc3c815a2605178d3b78beee1be | MATLAB | 1,539 | 65 | function M = constantfactory(A)
% Returns a manifold struct representing the singleton.
%
% function M = constantfactory(A)
%
% Given an array A, returns M: a structure describing the singleton {A} as
% a zero-dimensional manifold suitable for Manopt. The only point on M is
% the array A, and the only tangent vector at... |
b0c4c9c657a7a36871cdcfd02968de6c873853a1fa83ebce2fc1d344b7814901 | MATLAB | 1,539 | 52 | function [logp, yhat, res] = tapas_bayes_optimal_whatworld(r, infStates, ptrans)
% Calculates the log-probability of the inputs given the current predictions
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2013 Christoph Mathys, TNU, UZH & ETHZ
%
% ... |
d87020042143d9cd04b0cb190206984530a652cac28e2aeef8554a4b771c395c | MATLAB | 1,539 | 82 | function [err,XYZdic, map] = THD_3dmm_to_dicomm (Info, XYZmm)
%
% [err, XYZdic, map] = THD_3dmm_to_dicomm (Info, XYZmm)
%
%Purpose:
% Transform image coordinate (in mm) to dicom (RAI) in mm
%
%
%Input Parameters:
% Info: Structure of header file, see BrikInfo
% XYZmm: Nx3 matrix of 3dmm coordinates
%
%
%
%Outpu... |
fad2ed840cc8b8abea3d9b3b467a9b16dd9dbd15c77dad40f89c43b78bde7c50 | MATLAB | 1,539 | 44 | function outputImage = rotate(this, rot_deg)
% Geometric rotation of MrImage
%
% Y = MrImage()
% Y.rotate(rot_deg)
%
% This is a method of class MrImage.
%
% NOTE: This is a method of MrImage rather than MrImageGeometry, because
% the latter is composed on the fly from affineTransformation and
% dimInfo... |
149fec6ac0564f35cfa230e6dbbde80cceca74aa15775e76a806ebb59ce0255a | MATLAB | 1,540 | 49 | function this = permute(this, order)
% Permutes dimension info given a specified dimension order
%
% Y = MrDimInfo()
% Y.permute(order)
%
% This is a method of class MrDimInfo.
%
% IN
% order [1, nDims] vector or permutation of 1:nDims indicating order
% of dimensions after permutation.
% N... |
dcc495fbbc0281c53be1118e9d36df959995183b935de17ec20c2fef437352e0 | MATLAB | 1,540 | 49 | % dod = hmrConc2OD( dc, SD, ppf )
%
% UI NAME:
% Conc_to_OD
%
% dod = hmrConc2OD( dc, SD, ppf )
% Convert concentrations to OD
%
% INPUTS:
% dc: the concentration data (#time points x 3 x #SD pairs
% 3 concentrations are returned (HbO, HbR, HbT)
% SD: the SD structure
% ppf: partial pathlength factors for each wav... |
1106fdb3344ef349d98d3d6d79ba53c9198ecd435216d39a56e8bf7e590859a5 | MATLAB | 1,542 | 40 | %{
pre.SpikeInference (lookup) # spike inference method
spike_inference : tinyint # spike inference method
---
short_name : char(10) # to be used in switch statements, for example
details : varchar(255) #
language ... |
68e2b10d5636d3ecc47a41e1c8b9a756a0468e76944b3283e5e1944a95de91be | MATLAB | 1,542 | 50 | function filteredPropvalArray = tapas_uniqc_filter_propval(propvalArray, propStruct)
% returns property/value pairs where name matches property name of a
% structure/object
%
% filteredPropvalArray = tapas_uniqc_filter_propval(propvalArray, propStruct)
%
% IN
% propvalArray cell(1, 2*nProperties) property name/v... |
bf911cb0b29a91be15701088c285b83a7de7138286e96e73726c967c258b6f67 | MATLAB | 1,543 | 37 | function [m,dm] = meanSum(mean, hyp, x)
% meanSum - compose a mean function as the sum of other mean functions.
% This function doesn't actually compute very much on its own, it merely does
% some bookkeeping, and calls other mean functions to do the actual work.
%
% m(x) = \sum_i m_i(x)
%
% Copyright (c) by Carl Edwa... |
465611b5067a7426916d4cc909e800c4a23f7a6a00539bd472695e6a138aec0e | MATLAB | 1,545 | 61 | function [nstate] = tapas_sampler_dlinear_cv_gibbs_node(data, model, ...
inference, state, node)
%% Samples from a linear model with variance using a gibbs step and a
% leave one out approach.
%
% Input
%
% Output
%
% aponteeduardo@gmail.com
% copyright (C) 2016
%
nstate = state;
[np, nc] = size(state.graph{no... |
46a3c2bc61fa204a26ecdfdafbd04b2222baed0d687e930a6764a43f1e87e1db | MATLAB | 1,545 | 59 | function [F,net,tr]=ANN_EO(sol,data)
LN=round(sol(1));NN(1)=round(sol(2));NN(2)=round(sol(3));NN(3)=round(sol(4));tf(1)=round(sol(5));tf(2)=round(sol(6));tf(3)=round(sol(7));tf(4)=round(sol(8));
normalized_data = normalize(data, 'range', [0, 1]);
TF=TransFun_EO(tf,LN);
if LN==3
NNN=NN;
elseif LN==2
NNN=N... |
74799feba0dc53782134e1c98f4a5e72e54e42ae46812cf642f3c26b6b59e6d5 | MATLAB | 1,545 | 65 | %% isEu(Matriz)
%
% Determina si la Matriz es un Ciclo Euleriano.
%
% Matriz = |a11 a12 ... a1n|
% |a21 a22 ... a2n|
% | . . ... . |
% |an1 an2 ... ann| nXn
%
% Propiedad del Ciclo Euleriano
%
% 1) La Matriz Euleriana sólo contie... |
d496a80eebf6053919410be9d48730ca477fe7220653833e81a407270959740e | MATLAB | 1,545 | 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... |
2638202216a98db3564285c1e991f600c18cc8360b0241ede644c1c2369f0554 | MATLAB | 1,546 | 62 | classdef Filter < dagnn.Layer
properties
pad = [0 0 0 0]
stride = [1 1]
dilate = [1 1]
end
methods
function set.pad(obj, pad)
if numel(pad) == 1
obj.pad = [pad pad pad pad] ;
elseif numel(pad) == 2
obj.pad = pad([1 1 2 2]) ;
else
obj.pad = pad ;
end
... |
2735d217c707b3fb2d2f6a26a4cfaa4183c75670de456350fd9ed0980ea06e70 | MATLAB | 1,546 | 53 | %% get_set_r2s_Trapezoidal(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 b... |
63e4d48c3d829697c21eddd2179c8c01e6f3d186a2249288be5312764849b0c6 | MATLAB | 1,546 | 34 | % ISNUMERIC - returns 1
%
% 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
% modification, are... |
3380de10653c3cca80b315c88f32d3fa8e7cc3322fd47c161bb3acecde625318 | MATLAB | 1,547 | 44 | function result = OptimProblem(M)
% Function evaluates the performance result of a single combination from
% the set of target (X) and trial (U) vectors according to the objective
% function defined here. The variability in the datapoints is generated
% by the pre-defined intra- and inter-experimental var... |
65f8d16c17b486e8ec8b09b4423e9b56913755c5bed85a651bdb1f6c4659ed9d | MATLAB | 1,547 | 52 | function [maxValue, maxPosition] = max(this, varargin)
% Returns max value of data matrix of MrImage, accepts selection parameters
%
% Y = MrImage()
% [maxValue, maxPosition] = ...
% Y.max('ParameterName1', 'ParameterValue1', ...)
%
% This is a method of class MrImage.
%
% IN
% varargin parameterName/Val... |
9cd26012949ed6e9a8bc1252f5233c5bed31b3cb5e9b50a3b75b5292d70c46e5 | MATLAB | 1,548 | 51 | function a = hlp_wrapresults(f,varargin)
% Wraps all outputs produced by function f for the given arguments into a cell array.
% Results = hlp_wrapresults(Function, Arguments...)
%
% In:
% Function : some function handle to execute
%
% Arguments... : list of arguments to pass to the function
%
% Out:
% Result... |
afff0e0cebc3365613821b6007bb7ac9c2fd1fa55925cc2fe9d52ee9e865b02f | MATLAB | 1,548 | 70 | function [input] = tapas_sem_trapp_generate_input(t_sim, theta, ptheta)
%% Generates the input for the model u
%
% Input
% t_sim -- Length of the simulation in ms
% ptheta -- Structure with fields
%
% Output
% input -- Matrix of dimensions 2 X nnodes X (stime/dt)
%
% aponteeduardo@gmail.co... |
968ea76a1877f259fd962e9b066d7ba2339a30b5f806b890c9a6d25f749d192a | MATLAB | 1,549 | 39 | function physio = tapas_physio_cell2char(physio)
%convert all cellstrings (e.g. created via matlabbatch) back into regular
%strings for all relevant parameters of physio-structure
%
% physio = tapas_physio_cell2char(physio)
%
% IN
%
% OUT
%
% EXAMPLE
% tapas_physio_cell2char
%
% See also
% Author: Lars Kasper
%... |
d08c659bc75e20e57cff22149da70a47bc689dbc5742aea48a6748da7d3cd1f6 | MATLAB | 1,549 | 62 | classdef Filter < dagnn_bc.Layer
properties
pad = [0 0 0 0]
stride = [1 1]
dilate = [1 1]
end
methods
function set.pad(obj, pad)
if numel(pad) == 1
obj.pad = [pad pad pad pad] ;
elseif numel(pad) == 2
obj.pad = pad([1 1 2 2]) ;
else
obj.pad = pad ;
e... |
23d8264149900b1d194b5a6ce8ab5a6f1d945d3b0e0d9a7727a56ca87b007c4e | MATLAB | 1,550 | 25 | %{
vis.Monet (manual) # pink noise with periods of motion and orientation$
-> vis.Condition
---
-> vis.MonetLookup
rng_seed : double # random number generate seed
luminance : float # (cd/m^2)
contrast : float ... |
4d09a03e722efce0bf9aedcbd39ba137cd2eb1edf2225b0ab20608df7801eb38 | MATLAB | 1,550 | 61 | % fit_readLCMBasisSetMetabs.m
% Georg Oeltzschner, Johns Hopkins University 2023.
%
% USAGE:
% metabList = fit_readLCMBasisSetMetabs(filename);
%
% DESCRIPTION:
% Reads an LCModel basis set and returns a cell array with all metabolite
% names in the basis set.
%
% INPUTS:
% filename = filename of LCModel .basis file.... |
58ff92cdc82ab14126570803b7702384414aeb913830f3f9acf2ce70b1f8d868 | MATLAB | 1,550 | 55 | function [out,sig_ind] = ace_rx_detector(hsi_img,tgt_sig,mask,guard_win,bg_win,beta)
%
%function [out,sig_ind] = ace_rx_detector(hsi_img,tgt_sig,mask)
%
% Adaptive Cosine/Coherence Estimator with RX style local background estimation
%
% inputs:
% hsi_image - n_row x n_col x n_band hyperspectral image
% tgt_sig - targ... |
7224d31a156ce3718809aa66f48ed0d3b4820846e2743552bc2dd1218a948ed0 | MATLAB | 1,550 | 52 | %% Use this to create a Jesse-like matched_frames precursor
clear; clc
baseFolder = 'D:\\20191030\mouse11';
cd(baseFolder)
camnames{1} = 'Camera1';
camnames{2} = 'Camera2';
camnames{3} = 'Camera3';
camnames{4} = 'Camera4';
camnames{5} = 'Camera5';
camnames{6} = 'Camera6';
% num_frames is the total number of frames, ... |
b35d2db6fb71d9fbbeaf686ea7fd106100c1c5b261ad7377db5be1ec0580a2aa | MATLAB | 1,550 | 46 | function [rez]=projection(rez,DATA)
M_clust = length(unique(rez.st(:,end)));
nt0 = rez.ops.nt0;
Nchan = rez.ops.Nchan;
batch = length(unique(rez.st(:,end-1)));
Nrank = 3;%default value for projection hard coded
[~,W, ~, ~,~] = SVD_template(single(rez.M_template/(rez.ops.bitmVolt*rez.ops.scaleproc)), Nrank,rez.ops.Ch... |
f9f10baf2ad57943d327949d4ed22094567269ed27f46e54a4c10665936c6d69 | MATLAB | 1,550 | 47 | function amplitudes = LoadSpikeAmplitudes(filename,nChannels,nSamples,peak,rate)
%LoadSpikeAmplitudes - Read spike times, cluster IDs and amplitudes from disk.
%
% USAGE
%
% amplitudes = LoadSpikeAmplitudes(filename,nChannels,nSamples,peak,rate)
%
% filename spike waveform file name
% nChannels ... |
fac6e562f4364f8d35b523bd1c563307de5be95470acccf1717724cab5b1a140 | MATLAB | 1,550 | 56 | function outputImage = imfill(this, locations, nD)
% Fills image slice-wise; mimicks imfill in matlab functionality
%
% Y = MrImage()
% filledY = Y.imfill(locations, nD)
%
% This is a method of class MrImage.
%
% IN
% locations
% array of 2D coordinates or string 'holes' to fill all holes
% nD di... |
594161d37dc83603d5951aa426a0e17af82c00ac0911096bbbbd29a745647414 | MATLAB | 1,551 | 32 | function trace = remove_50Hz_v2(trace,fs)
% Remove 50 Hz and its harmonics from a given trace of sampling rate fs
% Adapted by HLC on 2020/05/08 from remove_50Hz.m
% Normalize the transfert function to one at zero frequency.
% -------------------------------------------------------------------------
% Transfert fu... |
e33e9a5d0d0b5017c33b24540124046e1790d15aebe3bfbbdba6c4168796d42c | MATLAB | 1,551 | 44 | function dyALFF
path = '/mnt/NCPL09/ReseachPlan/DTIanaly_PD/FunImgProcessing/FunImgARTCwm'
mpath = '/mnt/NCPL09/ReseachPlan/DTIanaly_PD/FunImgProcessing/T1Img'
opath='/mnt/NCPL09/ReseachPlan/DTIanaly_PD/FunImgProcessing/dALFFmap'
list = dir(path);
step = 5 ; winlen = 50; TR =2.4 ;
parfor i = 3 : length(list)
mkdir... |
4ac831ac39ccbd523c834d6f3f7c04579f98f0f3d9e17c644a9a5e15208907bb | MATLAB | 1,552 | 56 | function plotFigureS3_muscimolPhys(muscimolPhysPath)
% Plot example cell recorded before and after muscimol infusion in an
% anesthetized rat. Plot summary of activity for all cells recorded before
% and after muscimol infusion.
% INPUTS:
% muscimolPhysPath = local path to muscimol physiology data downloaded
% ... |
0d7320d7bfc4dba0b6cdd6fa74c42dbd68fe81d78118bbba73d5f10df5240bc8 | MATLAB | 1,553 | 51 | function times = LoadSpikeTimes(filename,rate)
%LoadSpikeTimes - Load spike times and cluster IDs from disk.
%
% USAGE
%
% times = LoadSpikeTimes(filename,rate)
%
% filename spike file name (either .clu or .res)
% rate sampling rate
%
% OUTPUT
%
% The output is a list of (timest... |
69bcf365547c94f3165003f84a5b0c8e41fd15d85794cc4608b2ab865d031e3f | MATLAB | 1,553 | 72 | %does an XOR task
% %number of inputs
N = 2;
%XOR
%%%%%%%%%%%%%%%%%%%%%%
T = 500;
[x1,x2,target] = generate2bitparity(T);
X = [x1,x2]';
original_target = target;
%%%%%%%%%%%%%%%%%%%%%%
%learning rate
eta = 0.2;
sigma = 0.1;
tau = 0.001;
tau_b = 0.001;
%number of recurrent units
M = 100;
%numb... |
9530107435721ad655ca105ef07bf35d19375238bf124b2d042b0c2b79b7bc91 | MATLAB | 1,553 | 61 | function RunLengthPosterior = calculate_changepoint_model(R, Ntruc)
% RunLengthPosterior - calculate Bayesian Online Changepoint Detection
% model (Adams and McKay, 2007)
% INPUTS:
% R - Reward vector
% Ntruc - number of trials to trucate runlenght posterior (~70 is
% efficient)
% OUTPUTS:
% RunLengthPosterior ... |
e0516a1ae4a9ad09d6815eba822da092e66c06bc4e62294c203fabddcc9bce4f | MATLAB | 1,553 | 60 | function figHandle = plotIdvStimDataAndTrace(rawData, channelIdx, stimInfo, Params)
%PLOTELECSTIMDATAANDTRACE Summary of this function goes here
% Detailed explanation goes here
figHandle = figure;
p = [100 100 1000 600];
set(figHandle, 'Position', p);
subplot(2, 1, 1)
% Plot detection threshold
if strcmp(Param... |
401ac2de59825e4be6857bd20fd71288311f5858bc6b130a2d4bce511178d541 | MATLAB | 1,554 | 41 | function c = tapas_cdfgaussian_obs_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Observation model for binary responses based on the probability mass (cumulative distribution
% function) of the second level belief (on x2). The probability of choosing 1 (... |
5e457ee3355680e9ef80b493a0da14c206178047c7d30201ee8e94a18a2c4b46 | MATLAB | 1,554 | 82 | function [X,Y,Trace,fig]=analysis_trace(Mr,thre,P)
% file='Test 1/image17.tif';
% thre=150;
% P=30;% Minimun area of cells to extract
% cell segmentation
%1. take the mean value to find the mask
Mean = mean(Mr,3);
% figure(11);
% imshow(Mean,[]);
X=[];
Y=[];
%% 2. thresholding
% thre = 50;
BW = imbinarize(Mean,thre);
... |
650b30e2d62a24bc5d1bd1963b757e136e10b9eefc55c7567a3c5cec759f765d | MATLAB | 1,554 | 57 | function [p,praw] = ClusterCorrection2(dat, nSims, p_thresh)
%[p,praw] = ClusterCorrection2(dat, nSims, p_thresh)
%% Cluster Correct across any number of dimensions
if nargin < 3
p_thresh = 0.05;
end
mincluster = 0;
[praw,tObs] = ttestfast(dat);
maxSize = zeros(nSims,1);
siz = size(tObs);
nsamp = size(d... |
8e9bdcee65d116c83cd1a0f66bbdef8a7c3c791c6b8ca79f69265b2691d87ad7 | MATLAB | 1,554 | 46 | function help = parse_help(help,summary_len)
% helper function for the arg* specifiers, to parse the help into a first and second part.
% Help = parse_help(Help,SummaryLength)
%
% In:
% Help: some help specification (as it appears in the arg* functions
%
% SummaryLength : the maximum length for the executive sum... |
aad34faa052dfda91c646a370731cdf9af8ed1a5e98609e38ddc3f5db32cfd22 | MATLAB | 1,554 | 40 | function y = geometric_median(X,tol,y,max_iter)
% Calculate the geometric median for a set of observations (mean under a Laplacian noise distribution)
% This is using Weiszfeld's algorithm.
%
% In:
% X : the data, as in mean
% tol : tolerance (default: 1.e-5)
% y : initial value (default: median(X))
% max_iter ... |
058c3b551e9f342b28c4c0a5900b8a63085d87e054ced7faac35cc3066ed713d | MATLAB | 1,555 | 53 | function [fa, md, tensor, voxel_size]= read_fib(file_name)
% Read .fib generated with DSI Studio and return FA, MD, tensors and
% voxel size
%
% Author: Aina Frau-Pascual, modified from public code in
% http://dsi-studio.labsolver.org/Manual/export-data-to-matlab
if ~exist('file_name')
file_name = uigetfile('*... |
bd25dc5862ebce62d9de3982a8c88e4c7790b37a285eacf76da6741d83aab2f5 | MATLAB | 1,555 | 58 | classdef Concat < dagnn.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
fun... |
e87b24020f9a5c41749f81b3bc2d32b448b20e48b09e9f0cdc95a40f967d53d5 | MATLAB | 1,555 | 40 | function roiChans = getROIChannels(task, timepoint)
% Selects region of interest (ROI) channels specific to the experimental
% task and timepoint. Returns an array of channel indices that correspond
% to the relevant brain regions for the analysis.
% Select ROI channels based on task and timepoint
switch ta... |
8e800f65d80d10e866db311c949f785c237ef85f4efbd019e67b5649ee89e9a5 | MATLAB | 1,556 | 83 | function y = nansem(X,dim)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ################################################################# %% DESCRIPTION
%FUNCTION short desc.
%
% USAGE:
% out = template(in) process with default settings
%
% out = template(in,optional1)... |
3b6d67990d467a4a36e0f0ddeb196d7fd9ee593656d4810d954f2c9c4e4a1628 | MATLAB | 1,557 | 49 | function [dyn_IAC, mean_IAC] = dyn_env_pleakage(data)
% Computes the Instantaneous Amplitude Correlation (IAC) with pairwise
% leakage correction/pairwise orthogonalisation
% Tewarie et al., 2019 Tracking dynamic brain networks using high temporal
% resolution MEG measures of functional connec... |
9de0ba99bb39c96531f43483225fa510f3ddd35e7ff8af4a149a5a3caafbcd28 | MATLAB | 1,557 | 53 | function plot_fig5ef(datadir)
% Plot fraction of cells with significant slopes at different task events
% (left) and histogram of slopes for significantly modulated cells at the
% offer cue (right).
%
% INPUTS
% datadir: file path of data downloaded from Zenodo. Link to download can
% be found in README.
fpath = fullf... |
9e0661bc475bb000363adc5685d99e9b086ddbc8e43730dc53e8996c97ad66af | MATLAB | 1,557 | 44 | % Example using the phantom Fibercup (original version)
% Data can be downloaded in http://www.tractometer.org/original_fibercup/data/
%
% Author: Aina Frau-Pascual
% Load Input image, generated with DSI Studio
%dsi_studio_run --action=src --source=data.nii.gz --bval=bvals --bvec=bvecs --output=data.src.gz'
%dsi_stud... |
f585fb8422b02570de8ec3b09d7f0098f243132165ed15b28e380ae89bbb2058 | MATLAB | 1,558 | 54 | function tapas_physio_save_batch_mfile(matlabbatch, fileBatchM, ...
doRemoveEmptyDefaults)
% Saves created matlabbatch variable to .m-file for later call of
% spm_jobman or run(fileBatchM)
%
% tapas_physio_save_batch_mfile.m(matlabbatch, fileBatchM)
%
% IN
% matlabbatch variable from workspace
% fileBatc... |
fcace77a049280d7620eaed658aa299246d35863b0b04671eead4eb276878d38 | MATLAB | 1,558 | 66 | function clnew = reclassify_clusters(cl,varargin);
% clnew = reclassify_clusters(cl,varargin);
%
% Takes a set of database peaks (XYZall) within a clusters structure
% and performs a clustering algorithm on those peaks
% Then creates a new clusters structure based on the classifications of
% peaks to clusters.
% See al... |
8812a5baf142e048e7a9517dfee9ddb854b4020419c286e92caa07800b272b8a | MATLAB | 1,559 | 41 | % ZG_rsum(X)
% row sum
%
% Machine Learning Toolbox
% Version 1.0 01-Apr-96
% Copyright (c) by Zoubin Ghahramani
% http://mlg.eng.cam.ac.uk/zoubin/software.html
%
% ------------------------------------------------------------------------------
% The MIT License (MIT)
%
% Copyright (c) 1996, Zoubin Ghahramani
%
% Pe... |
c38c5c62610d9e6a5332fab33db063dc730d73de2d19ebfe7c54731f397f0c6d | MATLAB | 1,559 | 71 | function [ans, Prefix] = PrefixStatus (Prefix)
%
% [Status, Prefix] = PrefixStatus (Name)
%
%Purpose:
% Determines if the name chosen is a valid for an AFNI Brick
% If you pass a name containing prefix only and no view then
% View is assumed to be +orig
%
%
%Input Parameters:
% Name: a string containing an AF... |
ee029efc5c162037439810d46a78bc5cee8179696a740c6f70b370c6a52332f5 | MATLAB | 1,559 | 61 | function tapas_find_dependencies()
% function finding dependencies of tapas toolboxes
%
%
% (C) 2020 Matthias Müller-Schrader TNU-IBT Universität Zürich & ETH Zürich
%
% parameters
exclDir = {'.','..','.admin','.git','misc'};
useAg = false; % otherwise use ack
ignoreInds = [7,6]; %Ignore the first and last i... |
7d231311295786304ce999455fe07d0906a1b51dcd45c787aa8a3d447db779f3 | MATLAB | 1,560 | 56 | function plot_data(sub_report, data, layout, channels, desc)
if length(data.trial) == 1
% segment the data into 2s
cfg = [];
cfg.length = 2;
cfg.overlap = 0;
data_epoched = ft_redefinetrial(cfg,data);
else
data_epoched = data;
end
%run FFT on the data
cfg = [];
cfg.channel = channels;
cfg.method... |
0e09a2eb76e7533a3f30e3adfe4c021800936b070604733973d36f221c88dc46 | MATLAB | 1,561 | 56 | function T = readMask(mFiles)
% function rsa_readMask(mDir)
% Read the functional mask images for the subject.
%
% INPUTS
% mFiles: full file path for the functional mask
% Optionally, an Nx1 cell array of file-names can be provided to
% load N functional mask files (requires full path)
%
% OUTPUT... |
2a341ab770b5226f0c423caf78ffc7a18738aa16cac4e153edfd8fdbef294422 | MATLAB | 1,561 | 39 | function diffOddEven = compute_diff_odd_even(this, varargin)
% computes difference image between first and last volume of time series
% NOTE: short-cut for compute_stat_image('diff_last_first')
%
% Y = MrImage()
% diffOddEven = Y.compute_diff_odd_even('PropertyName', PropertyValue)
%
% This is a method of class MrI... |
3ff0323c54e1ddd41123e96d2c7b977d239d3b91cbb06f413b36a2001a000b6e | MATLAB | 1,561 | 59 | % op_addextra.m
% Jamie Near, McGill University 2014.
%
% USAGE:
% out=op_takesubspec(in,index);
%
% DESCRIPTION:
% Add the subspectra with indices corresponding to the 'index' input
% array.
%
% INPUTS:
% in = input data in matlab structure format.
% index = vector indicating the indices of the subspectra you... |
98d43b6b6663c7541ba385942d13532d22848475514a011ca21f086c4612796e | MATLAB | 1,561 | 42 | % Scritp to test the ehgf_jget model
%
% --------------------------------------------------------------------------------------------------
% Copyright (C) 2020 Christoph Mathys, TNU, UZH & ETHZ
%
% This file is part of the HGF toolbox, which is released under the terms of the GNU General Public
% Licence (GPL), versio... |
a0747b2dd57f6198f04bada6013b0ac5d5b0cc74ad0b662177d529745b949c65 | MATLAB | 1,561 | 57 | function [Data, Fs, pdData, pdFs] = getOpticalData(key,photodiode)
% function [Data Fs pdData pdFs] = getOpticalData(key)
%
% Gets the data from the Intrinsic Imager program.
% Data : camera data in: [time x y]
% Fs : Sampling rate
% pdData : photodiode data
% pdFs : photodiode Sampling rate
%
% If photodiode is t... |
5892f69ec56419c44b53a720922e20333f35721a521ee888d6b9b4a909386a3b | MATLAB | 1,562 | 54 | function is=surfing_subs2inds(siz, pos)
% Linear indices from multiple subscripts; a generalization of sub2ind
%
% IS=SURFING_SUBS2INDS(SIZ,P) returns the linear indices for each row of
% subscripts in P based on a matrix with dimensions SIZ.
% If SIZ=[s1, ..., sn] refers to a matrix of size s1 x ... x sN, and P is
... |
adba155f3208fcebca490f2ff52b1859b2d9c9af05fc6108fa66f7552787850f | MATLAB | 1,563 | 54 | function nii = niftiReadMatlab(fileName, volumesToLoad)
%
% Reads a NIFTI-1 file into a VISTASOFT nifti structure.
% See http://nifti.nimh.nih.gov/nifti-1/
%
% niftiImage = niftiReadMatlab(fileName, [volumesToLoad=-1])
%
% fileName - path to a .nii or nii.gz file.
% VolumesToLoad - The optional second argu ... |
246859fd609e1cd31e9a5c0de42c78b4c0fcd0b65ac0d61aa89204a8ea7caab7 | MATLAB | 1,564 | 59 | function sem=SEM_calc(vect, CI)
% SEM_calc - standard error of the mean, confidence interval
%
% function sem = NBP.SEM_calc(vect, CI)
%
% Purpose
% Calculate the standard error the mean to a given confidence
% interval (CI). Note that nans do not contribute to the
% calculation of the sample size and are ignored for ... |
574f7f059b41f45a32033b0c2b89a21951c47c61e7e3f28bf2f309376fef9b25 | MATLAB | 1,564 | 54 | function [spmat, spt, spc,zsig] = CellsortFindspikes(ica_sig, thresh, dt, deconvtau, normalization)
% [spmat, spt, spc, zsig] = CellsortFindspikes(ica_sig, thresh, dt, deconvtau, normalization)
%
% CELLSORT
% Deconvolve signal and find spikes using a threshold
%
% Inputs:
% ica_sig - nIC x T matrix of ICA temporal s... |
c05b938fbf4e2b2c66b91de50bce76777cedcbd858c1e5a336f1c7b776d00a31 | MATLAB | 1,564 | 58 | function outputImage = power(this, otherImage)
% Computes input image to the power of other image per pixel as new image
%
% NOTE: If voxel dimensions of 2nd image do not match - or a scalar is
% given as 2nd argument - data in the 2nd argument is automatically
% replicated to match this image geometry.
%
%
% Y = MrI... |
483bdf638f437ea577a87e6d5196aaa45452f1a29d3edc90fef5adc456fe8fd3 | MATLAB | 1,565 | 64 | %clear all;clc
% small n vs N
n=50;
% input data
x=load('../output/scales/scales_combined.txt');
% output data
y=load('../output/Action_Potential/amp_freq_combined.dat');
%x=log(x);
%y=log(y);
%hist(y(:,2));
[nxrows nxcol]=size(x);
N = nxrows;
disp(nxrows)
%braking the data into two pieces, 1:400 and 400:onwards
x... |
c92049791b63307bb0abad151dd4a615e576424b57614c125bd493e3d02b2212 | MATLAB | 1,565 | 47 | %A partir del S_index vectorizado compara todos los renglones para
%determinar cuales son diferentes. El numero de renglones diferentes
%constituye el numero total de estados de la red. LC Junio 2010.
function [Edos_vector]=Nedos(S_index)
N=size(S_index,2); %Número de picos
S_indext=S_index>0.3; %Considera los vector... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.