sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
5b38eb0008b6e59ded245e11cb1a55b9b2f2e8992c59445f826fa58b55f0f585 | MATLAB | 5,702 | 129 | % function [predicted_labels,decision_values,opt] = correlation_classifier(labels_test,data_test,model)
%
% This function uses a Haxby style MVPA analysis where multivoxel patterns
% *within* one class are simply correlated and tested against another
% correlation *between* the same and a different classes. The patter... |
e07dbdddba9926d310f99d669c701b4616dc0cdd4db8ea82ac3c9b4bac69da8d | MATLAB | 5,715 | 180 | %== main function for plotting rasters.
%
% SPIKERASTER - Spike raster of multiple neurons
% SPIKERASTER(spikes, options), plot spike trains given in variable
% SPIKES, which is in format [neuron time] or in a sparse matrix
% with time down columns and neuron number across rows. If
% there are no spikes (S... |
59c1d02e51572d84401a1964923303c4441e15cf6b9870c36afe612c04c1d9ad | MATLAB | 5,716 | 168 | function cf = train_kernel_fda(param,X,clabel)
% Trains a kernel Fisher Discriminant Analysis (KFDA). Works with an
% arbitrary number of classes. For a linear kernel, it is equivalent to
% LDA.
%
% Usage:
% cf = train_kernel_fda(param,X,clabel)
%
%Parameters:
% X - [samples x features] matrix of training ... |
979313419dd9960b4ba98ab273f0db23ddd3364506f171dcca13ff3d6b109b69 | MATLAB | 5,717 | 181 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
% Optimized vs Original Pospischil equations
%
% Authors : KHOYRATEE Farad
% Date : 25/01/2017
% Update by : KHOYRATEE Farad
% Update : 16/04/2019
%
% Version : V1.0
%
% Descritption: Optimized Hodgkin-Huxley from Pos... |
6d1bff324d803699f44916f47cf7e87812de83d20b29b29f0c08f0920b017052 | MATLAB | 5,718 | 168 | function [errs warns] = unit_create_balanced_xvalid_selectors()
% [ERRS WARNS] = UNIT_CREATE_BALANCED_XVALID_SELECTORS()
errs = {};
warns = {};
% see how we create the RUNS in CREATE_TEST_SUBJ
nTimepoints = 18;
% basic test, with all ones active selector
allones = ones(1,nTimepoints);
% DESIRED = (nIterations x nT... |
6d419a1fd3e2075256bb543ac988b1565b5310173382b3463ad589dcc848952e | MATLAB | 5,718 | 154 | %DEMEV3 Demonstrate Bayesian regression for the RBF.
%
% Description
% The problem consists an input variable X which sampled from a
% Gaussian distribution, and a target variable T generated by computing
% SIN(2*PI*X) and adding Gaussian noise. An RBF network with linear
% outputs is trained by minimizing a sum-of-squ... |
947de94537bb81575ab8ed87d5f9a2de6bd6d03b047cffeae2eafe2f71639b19 | MATLAB | 5,723 | 176 | % SYNTAX:
% data_dod = hmrR_MotionCorrectWavelet(data_dod, mlActMan, mlActAuto, iqr, turnon)
%
% UI NAME:
% Wavelet_Motion_Correction
%
% DESCRIPTION:
% Perform a wavelet transformation of the dod data and computes the
% distribution of the wavelet coefficients. It sets the coefficient
% exceeding iqr times the interqu... |
8b0fcd825cac75d07e9f51722b236708ef1f8c67d19c80492108821d2a93eb0f | MATLAB | 5,732 | 121 | function [a11, a12, a21, a22, b1, b2] = ...
estimate_displacement_based_upon_least_square_solution2d(solution, ...
sizeImage, ...
dk, ck, ...
... |
0bd5bf71425a38beb780c6a02232cd0532eecca3638fb82f1500d4fcf5ca9c5d | MATLAB | 5,735 | 167 | function [CFD_log,CFD_thr_log,CFD_surr_log] = Calcalate_CFD(zX_RS,U,Vlow,Vhigh,mean_low,mean_high,N_low,N_high)
% Compute CFD for empirical data and test significance
% =========================================================================
% 1) Compute cellular-functional decoupling (CFD) of empirical fMRI... |
0e56ea1d4626e5157d2a3544710c8153250d49f48d34d0176d2082d349b99c45 | MATLAB | 5,744 | 159 | % MAIN_POPGEOMETRY_NOISECORRS MATLAB script for simulating noise correlations
% and studying the geometry of the population coding.
% This script analyzes the geometry of population coding with emphasis on
% noise correlations and signal/noise axis angles in a two-class problem.
% This script is intended to serve as an... |
058670b719b79b9a9a4796879745a2af16c95bb10311e1ec569e6f2889daae70 | MATLAB | 5,749 | 156 | function [res_ss]=DSC_mri_stable_spline_v5(conc,aif,mask,options)
% ultima modifica: Marco Castellaro 28/10/2010
%Funzione del pacchetto DSC_mri - DSC_mri_stable_spline_v5
%Autore: Castellaro Marco Gianluigi Pilonetto Denis Peruzzo - Università di Padova - DEI
%
%Calcola le mappe parametriche di Cerebral Blood Flow (C... |
b75ecef4ac3c6d902f961815eb7a58c38cde05d91fd73a4e9aab61979dd53fca | MATLAB | 5,752 | 155 | function h = plotActogram(this, varargin)
%PLOTACTOGRAM plot an ACTI object in actogram format
%
% $Author: Peng Li
% $Date: Dec 01, 2021
%
% axes
if nargin == 2
if isa(varargin{1}, 'actogram')
if isempty(findobj('Tag', 'actogramFig'))
h = actogram(this);
else
... |
daaf0b04063e46af951219ea3c794018fb2170420ff37b815fcdccf69f9b56f5 | MATLAB | 5,752 | 174 | function [name_vs_id,directions, guess, ruler]=automatic_identity(neurons,chosen_point,voxel_size,fixed_time,final_time)
name_vs_id = [];
% variables initialization
y_scale_factor = voxel_size(2)/voxel_size(1);
z_scale_factor = voxel_size(3)/voxel_size(1);
chosen_point=chosen_point([2 1]);
% signal correlatio... |
163d93641bd76e05096d05cc1778b99a0f0134d9d147038bc321a527a21c7545 | MATLAB | 5,757 | 118 | % function output = transres_signed_decision_values(decoding_out, chancelevel, varargin)
%
% Calculate signed decision values. This function outputs decision values
% of the classifier with negative sign for incorrect predictions and
% positive sign for correct predictions. The output can be understood as
% accura... |
b2d11bf9e6528267764bcf0180ea1593f53cc56e1bb68d89ba68bf601e5072ce | MATLAB | 5,768 | 182 | function [theta_est, theta_err, LLF, ctable_mod, ctable_fit, py_corr,theta_init] = ...
mADC_model_fit_sel_angles_resp_error_const_mb_5x5(ctable, angles,d_limit,Aeq,beq,lb,ub,r_init)
%% function that fits the m-ADC model to data in a contingency table
%
% Sridhar Devarajan, Sep 2016
% sridhar@cns.iisc.ernet... |
d295934d8a8ea040800a07e20d7d53a5c640bd6c8d91bef1f2067c4c94425d8b | MATLAB | 5,770 | 83 | % for ploting probability density of spikes
%
% INPUTS
%
% A : spikes time courses (time in second dimension)
%
% OPTIONAL
% times : vector with times for spikes ([])
% winP : length of Gaussian window in percentage of range (1)
% doploting : if ==1 plots spike PDF
% bins : number of bins for amp... |
9e81aa5d7c59e5d3a7c4ff85787a646b6c0ac2afc3231029009ce3416ba5461f | MATLAB | 5,773 | 142 | function neuron_state_evolution = Kunert(noisy_connectome,nc,norm_chem,norm_gap,x0,W_neg_chem,W_pos_chem,W_gap,frequencies,drivers,std_,chem_switch,gap_switch,noise_switch,total_time,dt,V_Osc,V_drive,V_thresh,synvarstd,synvarmean,seed)
% MODEL - Kunert et al., 2014
addpath functions
Nn=size(x0,1);
%% Introduce variati... |
b1110d82fb3923b559f969d978be46fdc230a850599692369aca9ae60ca3fbf5 | MATLAB | 5,773 | 128 | clear all;
run_spm12;
proj_dir = pwd;
data_dir = fullfile('/indirect', 'proc_data1', 'brainage', 'Cimbi_database');
for tracer = {'Altanserin', 'Cimbi36'}
% Load subjects
dataset = tracer{1};
tbl = readtable(fullfile(data_dir, dataset, 'worklist_get_files.xlsx'),'VariableNamingRule', 'preserve');
... |
9bf48db30eec6de2255a1ad667be59e66b18c89b28daa6a66ed6070a11576f87 | MATLAB | 5,782 | 181 | function infocapacity_hopf_errorhete_tbi(s,condition)
rng(s);
measure='err_hete';
if condition==1
G=optG_tbicond1; %OptG TBI ses1
elseif condition==2
G=optG_tbicond2; %OptG TBI ses2
elseif condition==3
G=optG_tbicond3; %OptG TBI ses3
end
NPARCELLS=1000;
NR=400;
NRini=20;
NRfin=380;
NSUBSIM=100; %number o... |
27fb9430d6568aae86c39ed1468fd9b121f352649e7d2a427311c2627d0587c1 | MATLAB | 5,785 | 130 | function [update] = estimate_symmetric_update_field(currentScale)
% ESTIMATE_UPDATE_FIELD Estimates the symmetric update field for current scale and iteration
%
% [update] = estimate_update_field(currentScale)
%
% Data used is contained in the data struct registration.
% See also REGISTRATION_EXECUTE
%
% INPUT ARGUMENT... |
4426cb28481cc5f130904c356f79fa31b82f91f4d2f0d779e44f8511daa3367e | MATLAB | 5,786 | 175 | function [name_vs_id,directions, guess, ruler]=automatic_identity(neurons,chosen_point,voxel_size,fixed_time,final_time)
name_vs_id = [];
% variables initialization
y_scale_factor = voxel_size(2)/voxel_size(1);
z_scale_factor = voxel_size(3)/voxel_size(1);
chosen_point=chosen_point([2 1]);
% signal correlatio... |
adc9f68906709c26b54d6344a34f467606e2f27760f44df7c3ea097e9ed48091 | MATLAB | 5,794 | 197 | % tCFS fig 1
% mock data:
ContrRamp = 0:.01:1;
timeRamp = 0:1:10;
FData = 35;
nFData = 55;
FData = 65;
nFData = 85;
barData = [ContrRamp(1,[FData, nFData])];
%
% subplot(2,4,1);
% figure(1); clf;
% set(gcf,'color', 'w', 'units', 'normalized','Position', [.2 .2 .8 .4]);
% % subplot(1,4,1)
% b = bar3... |
bceee9b41a2dbf723c936fb2cad6f1d7b12ac57f299a49e999d89ccad12eff84 | MATLAB | 5,799 | 192 | %DEMGMM3 Demonstrate density modelling with a Gaussian mixture model.
%
% Description
% The problem consists of modelling data generated by a mixture of
% three Gaussians in 2 dimensions with a mixture model using diagonal
% covariance matrices. The priors are 0.3, 0.5 and 0.2; the centres
% are (2, 3.5), (0, 0) and ... |
0c81375ec79c8df92e259a8e26d6aea16b9bbe2705db10a6bfc03c52abc083c2 | MATLAB | 5,807 | 150 | function [T_star_temp, total_fret_amp] = T_star_loop(Image_Time,raw_temperature,dff);
%NH: Putting in some comments to help me understand HBell's code
steep_points = []; % This is the important part for finding the first
time_steep = []; % sustained increase in the del_F signal.
increasing ... |
48d311798e99b16f4b70b11ab9c10063903843f95e7430717c206e909660e5a2 | MATLAB | 5,807 | 181 | function infocapacity_hopf_errorhete_tbi(s,condition)
rng(s);
measure='err_hete';
if condition==1
G=optG_tbicond1; %OptG TBI ses1
elseif condition==2
G=optG_tbicond2; %OptG TBI ses2
elseif condition==3
G=optG_tbicond3; %OptG TBI ses3
end
NPARCELLS=1000;
NR=400;
NRini=20;
NRfin=380;
NSUBSIM=100; %number... |
fb3208a62425211983b02841464c6ee992940bce819688b4b271c4fc437b72ae | MATLAB | 5,813 | 181 | function infocapacity_hopf_errorhete_tbi(s,condition)
rng(s);
measure='err_hete';
if condition==1
G=optG_tbicond1; %OptG TBI ses1
elseif condition==2
G=optG_tbicond2; %OptG TBI ses2
elseif condition==3
G=optG_tbicond3; %OptG TBI ses3
end
NPARCELLS=1000;
NR=400;
NRini=20;
NRfin=380;
NSUBSIM=100; %number ... |
b1a978c28bd43da3d208ad759364c396ef0ea92e2ae8c548f75e791ac32c3f6f | MATLAB | 5,824 | 150 | function set_up_eyetracker(Experiment)
% Felix T???pfer 250219
% based on
% ~\Psychtoolbox\PsychHardware\EyelinkToolbox\EyelinkDemos\SR-ResearchDemo\EyeLinkPicture
% IN:
% - DisplayRefNum = reference number of the presentation screen
% - xResolution = resolution of x axis of the screen (nr of pixels)
% - yRe... |
5504d71241666eb84c37efd7d5efa29a99370e8fa8fe17d2b467a685f842233a | MATLAB | 5,826 | 187 | % STATUS: active. For internal report.
%
% SYNTAX:
% calcSummaryStat(sbjNum,snrThresh)
%
% DESCRIPTION:
% calculate some summary statistics for subject.
%
% RESTRICTION:
% Only for sbj 12 and afterward.
%
% INPUTS:
% sbjNum - string: subject ID. ex: '08'
% snrThresh - double: SNR threshold. This is a hyperparameter... |
3d254775672a056a474dd0084f529f72966b75e779fece7bd1e2d0e34bb7d028 | MATLAB | 5,832 | 139 | % This demo shows how to apply prevalence inference as statistics. It
% takes the test data from Cichy, Chen & Haynes (NeuroImage 2011; used
% with permission) that were used as demo in the prevalence inference paper
% (Allefeld et al 2016) and can be downloaded from the github page below.
% Further explanatio... |
5c9587e7700b7ef86fbf87aa2d5153d2fd2a7b3d7a0eded8bd799e52155a77b5 | MATLAB | 5,834 | 193 | %% load data
clear; close all; clc;
datapaths;
load([PopPath,'\AM_results_salicylate.mat']);
MPlotLabels = [0.06,0.93,0.045,0.03; ...
0.51,0.93,0.045,0.03; ...
0.06,0.63,0.045,0.03; ...
0.51,0.63,0.045,0.03; ...
0.06,0.3,0.045,0.03; ...
0.51,0.3,0.045,0.03];
% plot VSpp after vs. before for paper ... |
0d7acfd695679a59fe01a885764ab850c66169fea8a87657a25491b2d1defa5a | MATLAB | 5,837 | 181 | function infocapacity_hopf_errorhete_tbi(s,condition)
rng(s);
measure='err_hete';
if condition==1
G=optG_tbicond1; %OptG TBI ses1
elseif condition==2
G=optG_tbicond2; %OptG TBI ses2
elseif condition==3
G=optG_tbicond3; %OptG TBI ses3
end
NPARCELLS=1000;
NR=400;
NRini=20;
NRfin=380;
NSUBSIM=100; %numbe... |
a9052061f445348e618d25aa5b28731f3a5fd36e58cfa8a6d52bebbc45df147f | MATLAB | 5,837 | 208 | function [x, options, flog, pointlog, scalelog] = scg(f, x, options, gradf, varargin)
%SCG Scaled conjugate gradient optimization.
%
% Description
% [X, OPTIONS] = SCG(F, X, OPTIONS, GRADF) uses a scaled conjugate
% gradients algorithm to find a local minimum of the function F(X)
% whose gradient is given by GRADF(X). ... |
0da0bb7ddfbe5c36331f7720106a81398fe4a3a587dfa83ca3865df2b6f79672 | MATLAB | 5,841 | 178 | function [scratch] = train_svm(trainpats,traintargs,in_args,cv_args)
% USAGE :
% [SCRATCH] = TRAIN_SVM(TRAINPATS,TRAINTARGS,IN_ARGS,CV_ARGS)
%
% This is a support vector machine training function. It train the
% classifier and makes is ready for testing.
% NOTE : This classfier currently does only two category classi... |
182a62fe8a025a550e695d695fadafaf21c4111fb241b299ccf70cfb4f1bb302 | MATLAB | 5,850 | 154 | function colors = distinguishable_colors(n_colors,bg,func)
% DISTINGUISHABLE_COLORS: pick colors that are maximally perceptually distinct
%
% When plotting a set of lines, you may want to distinguish them by color.
% By default, Matlab chooses a small set of colors and cycles among them,
% and so if you have more than ... |
78c7cc42ec86f767ecf847b835ec3d4c8634c1aeee6a29239de64fe04024246e | MATLAB | 5,860 | 98 | function sum_stats = pullSummaryFitInfo(x_reps, eta_list, eps_list)
num_eta = length(eta_list);
num_eps = length(eps_list);
num_reps = length(x_reps);
tau_values = nan(num_eps, num_eta, num_reps);
tau_x_min = nan(num_eps, num_eta, num_reps);
tau_KS_min = nan(num_eps, num_eta, num_reps);
tau_KS_p95 = nan(num_eps, nu... |
041ae3d84cfe35989291ec44d9a97544944e615e0534dd7435eaed7726869970 | MATLAB | 5,861 | 179 | function [Cm, I_stim, Vinit, GVal, EVal, TauMax, Sm, Vtraub] = NeuronTypeSI(TypeOfNeuron)
if strcmp(TypeOfNeuron,'FS')
%% FS Hodgkin-Huxley parameter
%Size of neuron
Diam = 67; % Diameter of neuron (µm)
Diam = Diam * 10^-4; % cm
Lmem = 67; % Length of neu... |
d3e9f631bcfd61f26c816b5ea2512bd32b5e22b9e992291adb117669f9af5032 | MATLAB | 5,878 | 128 | function layer = fullyConnectedLayer( outputSize, NameValueArgs )
% fullyConnectedLayer Fully connected layer
%
% layer = fullyConnectedLayer(outputSize) creates a fully connected
% layer. outputSize specifies the size of the output for the layer. A
% fully connected layer will multiply the input by a matr... |
fbc9710534015c81a9b2c86113e636c74096ec01e1bec6a293c03008c9200f69 | MATLAB | 5,883 | 146 | function [recon_ratio,recon_FC_r]= Generalizing_eigenmodes_human(mypath,n_null)
% The CC matrix from the homologous brain regions was used to reconstruct the human Bold-fMRI
%% load homology CC matrix and HCP Bold-fMRI
% homology CC matrix
W=load(strcat(mypath,'homology_marmoset_human/homology_matrix_11ROI.mat'))... |
e6c40fcba2a23124feb54c5398083d28c7f029cb1d02a10dba106a3a2b49805f | MATLAB | 5,884 | 177 | clear
[task_info,supPath] = loadDBAndSpecifyDataPaths('Vermis');
PROBABILITIES = 0:25:100;
DIRECTIONS = [0,90];
POPULATIONS = {'SNR'};
req_params.grade = 7;
req_params.task = 'choice';
req_params.num_trials = 100;
req_params.remove_repeats = false;
req_params.ID = 4000:6000;
raster_params.align_to = 'targetMovementO... |
f96d3def4d824bb44462808d328ed910eefe56a8da2ae7e36e1a6eddc142344a | MATLAB | 5,886 | 115 | classdef Stimwave < Sharedmethods & Trace
%Stimwave object
% A Stimwave object is a group of digital to analog out waveforms that are used in NWB stimsets
%
% ---------------------------------------------------------------------------------------------------------------------
% Author: R... |
9e1fd0a46597fe2d7547e572d29b0d7a0512fa6100d18fe62ec05621e46e854e | MATLAB | 5,892 | 113 | function [IncDec, fitresult, gof, SigFitTrace] = createFit_sigmoidDefinedStartEnd(XVals, fluorescence_trace, start_frame, end_frame, baseline_period)
% Create a fit to a sigmoidal curve for the given trace. The portion
% of the trace used for the fit is defined by start_frame and end_frame.
% Equation for sigmo... |
0c286cea097e3d2db9de15c9abf0e3a51d0a44ca8089a6dc419621cffa2769eb | MATLAB | 5,901 | 151 | % function regressor_names = design_from_afni(brik_files,save_on)
%
% This function will extract the relevant information for the current
% decoding from an AFNI BRIK file that contains multiple coefficient maps
% with different names. This information is the names and location of the
% coefficient files and the ... |
d5086656b7630ae12cd5f593e816805e5cd6d0c300fe69c56050b77103c949e4 | MATLAB | 5,911 | 187 | function [X,clabel,Y,M] = simulate_gaussian_data(nsamples, nfeatures, nclasses, prop, scale, do_plot, M)
% Creates data randomly drawn from a multivariate Gaussian distribution.
% The class centroids are randomly place on the unit hypersphere in feature
% space.
% The multivariate covariance matrix is generated by rand... |
e87bb56c6ea26a3d28d3a24c028d6631a34a138a547dff20ea6b3874f1b325ad | MATLAB | 5,913 | 201 | function rendersurface_glasser360(glasser360vector,rangemin,rangemax, inv,clmap,surfacetype)
% script for rendering a glasser360vector
% ML Kringelbach Feb 2021
% glasser360vector : the glasser360vector values to be rendered
%
% rangemin, rangemax : limits for colorscheme
%
% inv:
% 0 colormap, interp
% 1 flip colo... |
ec9b2e1c5211ef10bfa8dab78060a113897391b1168242c24302496a4906800e | MATLAB | 5,928 | 215 | function out_path = download_ds(varargin)
%
% Downloads a BIDS data for a demo from a given source
%
% USAGE::
%
% output_dir = download_moae_ds('source', 'spm', ...
% 'demo', 'moae', ...
% 'out_path', fullfile(bids.internal.root_dir(), '... |
2066f448bef5269c9bf1066de19f6c0517015935c8fc5aa18d275de4564e7b38 | MATLAB | 5,929 | 189 | function [r, toolboxes] = checkToolboxes(appname, options)
%
% Syntax:
% [r, toolboxes] = checkToolboxes(appname)
% [r, toolboxes] = checkToolboxes(appname, options)
%
% Description:
% Checks if toolboxes required by application in the current
% folder are installed. It returns 1 if all required toolboxes are
... |
ea4ec56f7db4aa914f11d150b2a7020c280c22caaebb44ea9b6db82d70c1a777 | MATLAB | 5,933 | 121 | %% Plotting amplitude, baseline and width paramaters of gaussian fitting tuning curve analysis
%% Code
load('tuning_curve_line_fitting_params.mat')
%%
load('MI_split_RFTrials.mat')
split = ["sens cued","LR cued"];
mySplit = ["cuedSens","cuedBias"]; fig_id = ["d","e","f"];
COL(1,:) = rgb('darkred'); COL(2,... |
fff8451ccfc3893632c805ac476845fd4a7f15d9790045fa45706bb5e22825f7 | MATLAB | 5,937 | 207 | function rendersurface_dk68(dk68vector,rangemin,rangemax, inv,clmap,surfacetype)
% script for rendering a dk68 vector
% ML Kringelbach April 2020
%
% dk68vector : the dk68 values to be rendered
%
% rangemin, rangemax : limits for colorscheme
%
% inv:
% 0 colormap, interp
% 1 flip colormap, interp
% 2 colormap, onl... |
2a7f5a66fe9eddf7459f717269f42de94a17f6007753893987be211a6a42b403 | MATLAB | 5,946 | 155 | % SYNTAX:
% [yAvg, yAvgStd, tHRF, nTrials] = hmrS_RunAvg_Nirs(yAvgRuns, yAvgStdRuns, ySum2Runs, tHRFRuns, mlActRuns, nTrialsRuns)
%
% UI NAME:
% Run_Average
%
% DESCRIPTION:
% Calculate avearge HRF of all runs for one subject.
%
% INPUTS:
% yAvgRuns:
% yAvgStdRuns:
% tHRFRuns:
% mlActRuns:
% nTrialsRuns:
% trange: de... |
c6c5747cad1ebdffca9752f9be8159be08923457ecdee0c15208649bf88b2b89 | MATLAB | 5,948 | 144 | % SYNTAX:
% tIncAuto = hmrR_MotionArtifact(data, probe, mlActMan, mlActAuto, tIncMan, tMotion, tMask, STDEVthresh, AMPthresh)
%
% UI NAME:
% Motion_Artifacts
%
% DESCRIPTION:
% Identifies motion artifacts in an input data matrix d. If any active
% data channel exhibits a signal change greater than std_thresh or
% amp_t... |
ca97af8c62ccf86cd9721a765379d6cb2d9100b35ed0068762db3261b33b834c | MATLAB | 5,949 | 201 | % function design = make_design_separate(cfg)
%
%
% Function to generate design matrix for training and testing using the
% decoding toolbox. This function separates data in a set of training data
% and a set of test data. The chunk with the largest index will determine
% the test data, all other chunks will be t... |
fbae85a2dcc2224bc7763e47c9a7c92c3d5dbcfe501bc6e59f6eac0135a56b80 | MATLAB | 5,949 | 183 |
clear
[task_info,supPath] = loadDBAndSpecifyDataPaths('Vermis');
K_FOLD = 10;
req_params.grade = 7;
req_params.cell_type = {'PC ss','PC cs', 'CRB','SNR', 'BG msn'};
req_params.task = 'choice';
req_params.num_trials = 50;
req_params.remove_question_marks = 0;
req_params.remove_repeats = false;
req_params.ID = 4000:60... |
28b1c700a417c0f24f2c310703d8b3b9d0129af42ea5912e854e8a0445825d2a | MATLAB | 5,970 | 163 | function [K1_new, K0_new, K2_new] = tuneVisual(K1, K0, K2, ...
B, I, S, mask_learn, head, target, E, P, conds, light, sines, R)
% Tune the visual weights (retinal slip and target) for all models at the same
% time. Fit the performance of eye and PC on all visual conditions (17 conds)
% before learning, and option... |
8a4d1ceebe09b8164f7d06beb8f8f6e3a21519d180f4e7c3d15eda223f9ac15c | MATLAB | 5,979 | 182 | % Script to interogate meld dataset
clear; close all;
addpath('D:\Documents\Software\spm12\PublicVersion');
spm('defaults', 'eeg');
resultsSavePath = 'C:\Users\smellor\OneDrive - University College London\UCL\Project\Reading\OPMpapers\MELDsimulations\Figures';
%% Load data
ages = readtable('D:\Documents\Data\MELD_... |
7c1c2472dc43128e2b7052cf81c148b264cfaed9b626d891b15f706ead019c42 | MATLAB | 5,982 | 166 | clc
clear
cd 'G:\Fiber_Photometry\GcampD1D2 2022-119 NAc anx Roman\2022-119_PAVLOV_FR_RL\Baseline indiv -2k -05k\RESULTS_PAVLOV_bsl-indiv_-2k-05k-12k_event_group_session' % set le file directory
A=load('CS_D1cre.mat'); %load le fichier .mat d'un Event/Group (par exemple, si tri en Event/Group/Session)
B=load('CS_D... |
c7a148fd2ffec763d08430f25d6172948f9d72242b95c00bacbbd82bd6edaa85 | MATLAB | 5,984 | 156 | %% Output folders for different analysis steps
% Check if the folder to save clean data exists, if not, create it
if exist([output_dir output_general 'Filter_Faster/'], 'dir') == 0
mkdir([output_dir output_general 'Filter_Faster/'])
end
filtered_data = [output_dir output_general 'Filter_Faster/'];
% Che... |
9c605d96ef8d738d93f3f7d3762a076ca502c17a00c0ca1337773b76b3307318 | MATLAB | 5,987 | 158 | function decoding = tbx_cfg_tdt_short
% Configuration file for 'The Decoding Toolbox'
%
% 2015/02/02 Martin Hebart
addpath(fileparts(which(mfilename)))
% ---------------------------------------------------------------------
% Labelname 1
% ---------------------------------------------------------------------... |
07cbd8b56030c1f5e4d22da9525407f2da5ea0f9a38d0db4b2c53b51d3cd6e93 | MATLAB | 5,990 | 217 | % show the angle distribution
np = size(Y, 1);
ndim = 3;
rng('shuffle');
%% Surround
nIter = 1000;
gSize = 90;
targetv = SimpleCSRio;
pairids = nchoosek(1:np,2);
npair = size(pairids, 1);
pairv_s = nan(npair, ndim);
for i = 1:npair
v1 = Y(pairids(i, 1), 1:ndim)-Y(pairids(i, 2), 1:ndim);
w1 = targe... |
5b33d15a661610abfee22d248bc5f37aeaac8bf94879d03aa2acd5c5de544ce8 | MATLAB | 5,994 | 155 | function result = mv_combine_results(results, combine)
% Combines multiple result structs for plotting. This is useful for
% plotting eg multiple subjects or classifiers.
%
% Results can only be combined if all results were obtained on data of the same
% size using the same metrics.
%
%Usage:
% result = mv_combine_res... |
cf85b074590dfb3c4b1c17eb3d5f5b8a9e7d4a9fb33156472aa61f0dccdb0d6c | MATLAB | 6,002 | 164 | %The purpose of this script is to to parse a TDA file from the ISCAN
%software, which must already have been converted to an excel file.
%The script then allows you to select which parameter you care about, then
%normalizes the data, averages it across trials, and loads it into a matrix
%for future analysis
%% C... |
49940d4fe18aae2d384afed33a593b5210e6320544a8ea5f61a8dec4e718d7f0 | MATLAB | 6,007 | 204 | function [im im3d args] = build_overlay_rgb(anat_vol, anat_rgb, over_vol, over_rgb, varargin)
% BUILD_OVERLAY_RGB - Assembles the overlay RGB image from
% anatomical and overlay data.
%
% Usage:
%
% [IM IM3D ARGS] = BUILD_OVERLAY_RGB(ANAT_VOL, ANAT_RGB, OVER_VOL, OVER_RGB, ...)
%
% BUILD_OVERLAY_RGB combines anatomi... |
cd4c2436499f547d87ccb458cbd6121d41b212708d12bfae24cb0b598f0f2362 | MATLAB | 6,012 | 140 |
% load all analyzed ccstep files and create analysis overviews for
% inspection
% load('D:\Human inhibition\Cell classification\AllenClusterMethod\superclusterdata.mat')
% files={SuperCellSummary.File};
% files=ChangeFilenameExts(files, 'mat');
% users={SuperCellSummary.UserID};
destinpath='D:\Human inhibition\Cell cl... |
1d47771428dc6e396f5ef69539eda4f7af82ef4207dd3216beaa3493d04cbc55 | MATLAB | 6,022 | 163 | function sleepSeries = doSleepDet2(data, epoch, V, P, C)
%DOSLEEPDET2 detect sleep episode in actigraphy DATAINMIN
%
% REF.: [1] Cole et al. Automatic Sleep/Wake identification From Wrist
% Activity. SLEEP. 15(5):461-469,1992.
% [2] Jean-Louis et al. Sleep estimation from wrist movement
% qua... |
552d5ae8bba91a5cc4caeefd9f11742132b087c9260acd2a4e675731525c30e5 | MATLAB | 6,028 | 253 | %% polar histogram for phase angle
cutoff=[25,15,15,15];
set(0,'defaultAxesFontSize',20)
set(0,'defaultAxesTickLength',[0.04,0.08])
set(0,'defaultaxeslinewidth',2)
slope=[];
Name_test=[];
if ~exist('graph', 'dir')
mkdir('graph');
end
cw=load('matching_table_cw.mat');
ccw=load('matching_table_ccw.mat');
region=["EC... |
d7b170cc54fa17d0264b1374399ceeffc9eeeccad3d8eecc5ab66791667d84dd | MATLAB | 6,035 | 183 | clear
[task_info,supPath] = loadDBAndSpecifyDataPaths('Vermis');
PROBABILITIES = 0:25:100;
DIRECTIONS = [0 90];
req_params.grade = 7;
req_params.cell_type = {'PC ss','PC cs', 'CRB','SNR', 'BG msn'};
req_params.cell_type = {'SNR'};
req_params.task = 'choice';
req_params.num_trials = 100;
req_params.remove_repeats = f... |
42613460fd2c5557831563f766b2c614900079d4971ada88ca98e83fb90b6eb6 | MATLAB | 6,041 | 152 | % function model = ens_bal_tr(labels_train,data_train,cfg)
%
% This is using an ensemble classification approach to balance training
% data. The idea is to create a number of models based on balanced,
% randomly subsampled data. This cuntion can be used to balance unbalanced
% data, and/or to balance a confound th... |
d707158e34b99a440ec4ca95c44d8c6a95df13465aa579971412679f7ebbbba0 | MATLAB | 6,041 | 205 | function [merged unused] = propval(propvals, defaults, varargin)
% Create a structure combining property-value pairs with default values.
%
% [MERGED UNUSED] = PROPVAL(PROPVALS, DEFAULTS, ...)
%
% Given a cell array or structure of property-value pairs
% (i.e. from VARARGIN or a structure of parameters), PROPVA... |
3e9ba585be4e019246e6d4dd5a433e8921994885d739a278184ca6dac5e8ed97 | MATLAB | 6,050 | 235 | %%% Test 2: Multiecho CPMG
addpath(genpath('lib'));
addpath(genpath('EPGX-src'));
%%% Water excahnge model. For interpretation, compartment A is the larger
%%% (slow relaxing) and B is the small, fast relaxing compartment (myelin
%%% water?)
f = 0.20; %<--- pool b fraction (this is fast relaxing pool) i.e. myelin wa... |
6bd9f8ce7056c63f3cb79355bb899fadfbd9835d50d81bdf0603df16647e0345 | MATLAB | 6,050 | 184 | % 1. Add the path of the current script to the search path
% 2. Change the current folder to "Fig8 PF x tactile interaction\paw"
% 3. Using ctrl+enter within each function to run each section
%% Section 1: open files
% ctrl+enter to run this section
clear
FN=[];
FP=[];
FNlist={};
FPlist={};
condlist=[];... |
14daef61c71c72b40e6985e3878247527c4cc85b0988812cb31d04683591a242 | MATLAB | 6,052 | 180 | %for plotting averages of all dff traces in a condition as well as
%individual traces on the same graph
%requires https://www.mathworks.com/matlabcentral/fileexchange/27485-boundedline-m
%Use after THexporttraces_xlsx.m and THGCaMP_ampsdffsingle.m
prompt='How many traces?';
blank=input(prompt); %decide how many data ... |
2e5fbe2e1fe71101028dd1a84dd34c9cfddcffc2379b80fddabe6a8748deef86 | MATLAB | 6,054 | 250 | function model = nsvm_train(d,A,nu,wp1,arm)
% d: labels
% A: training data vector
% nu: weighted parameter
% -1 - easy estimation
% 0 - hard estimation
% any other value - used as nu by the algorithm
% default - 0
% wp1: percentage of weight for class 1, wp must be 0<=w... |
30d29c009880bb40a672d53faf57e58b609dc12505a962976f339f02cb6c4bed | MATLAB | 6,054 | 192 | function [errs warns] = unit_spm_ana_afnicompare(varargin)
% [ERRS WARNS] = UNIT_SPM_ANA_AFNICOMPARE(varargin)
%
% Unit test of the spm ana files in comparison to the afni brik version of
% those same files.
%
%
% FEXTENSION(*.nii/.img)
% If unset, this will assume you wish to run the tutorial against nifti
... |
4dcede49827e3ab1ff44bb224b0fa97bf36e778ff9ae30c446184772f3d6cc92 | MATLAB | 6,066 | 170 | function demopt1(xinit)
%DEMOPT1 Demonstrate different optimisers on Rosenbrock's function.
%
% Description
% The four general optimisers (quasi-Newton, conjugate gradients,
% scaled conjugate gradients, and gradient descent) are applied to the
% minimisation of Rosenbrock's well known `banana' function. Each
% optimis... |
2cc071487965498347c1d0d7a708514a14940c051e80bfd51d1cdcd1f8eaa92b | MATLAB | 6,067 | 173 | %DEMGMM1 Demonstrate EM for Gaussian mixtures.
%
% Description
% This script demonstrates the use of the EM algorithm to fit a mixture
% of Gaussians to a set of data using maximum likelihood. A colour
% coding scheme is used to illustrate the evaluation of the posterior
% probabilities in the E-step of the EM algorith... |
c3d2c1850db45d8b2a622f115ca7ed1922355cf4c5a9d5ef919e74edadcdd9b6 | MATLAB | 6,071 | 183 | function spfPlotTopView(varargin)
%This function plots top view of Single Plane Fit
%INPUTS:
% singlePlaneFits - single plane fit(s) structure as generated by fdlnEstimateUVHSinglePlane.
% If this is an array of plane structures will plot them one by one.
% Leave empty to draw just
% hLinePosi... |
b6d13880a9878dc14e153bd1bc1c7f20052c040a1981c30c96a97490a8e7a1ee | MATLAB | 6,073 | 176 | function [best_theta_est, p_val, cTab, theta_est, angles_inv, LLF, theta_init] = ...
est_param_mADC(monkey, RF, sessions, beh_dat, sessions_type, mb_lim, num_of_iters, varargin)
%% Function to estimate parameters on pooled across sessions
rand_init = 1:5:3000;
onebyN_flag = 1;
if(nargin==6)
num_of... |
44c675d4a5245b1c739d838de30a6d49316bff9c46dc935b61df32157179ab36 | MATLAB | 6,076 | 190 | % LOAD_SPK_FROM_DAT and detrend
%
% CALL SPK = LOAD_SPK_FROM_DAT( FILEBASE, SHANKNUM, CLUNUM )
%
% GETS FILEBASE dat file assumed to be FILEBASE.dat
% SHAKNUM
% CLUNUM clu number/list of spike times/empty (all spikes in... |
52777876f44bee7c4b59dee3a5cbd633e33519b661928f3c6f2d661f0cc96d18 | MATLAB | 6,080 | 247 | function [errmsgs warnmsgs] = unit_adj_sphere(varargin)
% Unit tests for ADJ_SPHERE.M
%
% [ERRMSGS WARNMSGS] = UNIT_ADJ_SPHERE(...)
%
% See UNIT_TEMPLATE.M and UNIT_ADJ_CUBE.M for more info
defaults.doplot = false;
args = propval(varargin,defaults);
errmsgs = {};
warnmsgs = {};
simple = ones(5,5,5);
s_radius = 2;
... |
353b701cd0279fa0de15eee69007bd170ae8d628e0ef2a6175f9db93ac7fec9b | MATLAB | 6,082 | 144 | % STATUS: Active
%
% SYNTAX:
% [performanceLDALedoit, performanceLDACERNN,...
% performanceCosineKNN, performanceSVM,...
% performanceBagging, performanceBoosted] = ...
% calcCumSum_DiffStartT_AllChn_CompClassifiers_Final_NoSave(sbjNum,...
% trialsTr,trialsTst,movieListTrain,movieListTest,numClasses,...
% ... |
1ebcc137e060f4472ae3408e47c89e96cc8bff6b6a4acac8e28789f35ade0bec | MATLAB | 6,086 | 125 | % This script is the default template, but with a modification that allows
% running analyses with unbalanced data. Multiple solutions are presented
% at the end of this script.
% Same as the standard template, this is for people who have betas
% available from an SPM.mat and want to automatically extract the relev... |
0af0e73c92d112a0d5d86f84dee97224b6b2c48700ef8420c660e2b64ac89d77 | MATLAB | 6,088 | 164 | function vbl = draw_mask(Experiment, cue, flip, flipTime)
% takes 'cue' as additional argument to display a cue inside the mask when
% necessary
% takes 'flip' as additional argument. Default 1 (flip). Set to flip
% outside of script.
% takes flipTime as additional argument to specify exact time of flip
% (script wait... |
04caa718d456545d94d8495d03fd9a2e3b458aec4a46f83bffb58183ebb92eaa | MATLAB | 6,097 | 291 | function [errmsgs warnmsgs] = test_remove_singletons()
% Unit test for remove_singletons
%
% [ERRMSGS WARNMSGS] = TEST_REMOVE_SINGLETONS();
%
% this function creates all kinds of crazy masks and tests the
% remove_singletons function
%initialising the *msgs cell arrays
errmsgs = {};
warnmsgs = {};
try
subj = rem... |
7004ccce61ab4b5c26fee927a8dc656a09f976c1ea8b04190288e9a3ead769af | MATLAB | 6,099 | 152 | % function [design, sortind, sortind_inv] = sort_design(design, sortind)
%
% This function is used to sort designs in a way to speed up decoding
% analyses. If training data happen to be identical in two of the many
% cross-validation iterations, then re-training of data is not necessary.
% decoding.m can recogniz... |
c8a93093b734f1505d627f0d560a55066546637cbc0bf9684e42b9b84eb58814 | MATLAB | 6,107 | 137 | % This demo shows how to apply prevalence inference as statistics. It
% takes SPM images (.nii or .img) or TDT .mat result as input (works for
% searchlight, ROI or wholebrain analysis). Further explanations about the
% analysis in the paper below.
%
% For data in a different format, see
% demo_prevalenceI... |
5ce26a6346a695e5f66e778207e2470ca6a63882828eee78292270289b863760 | MATLAB | 6,125 | 161 | function PatternChange_Regression_1st()
cfg = load('neurovar_cfg.mat').cfg;
trial_cutoff = 1;
pe_type = 'spe'; % 'spe' OR 'rpe'
roi_mask_fn = '/derivatives/Univariate/univ_pe_blockstim-3_2nd/neuron2010_overlap_univ_spe_blockstim-3.nii';
output_dir = fullfile(cfg.global.deriv_dir, 'Pattern_Change_Regression', 'Patch... |
7bb6f7e865cf6a8710b3edef8e12501459488933dc49ad381f21feb1adaf4160 | MATLAB | 6,133 | 123 | % ----------------------------------------------------------------------- %
% M U L T I P L E T E S T I N G %
% ----------------------------------------------------------------------- %
% Function 'fdr_BY' computes the Benjamini-Yekutieli correction of the %
% False Disc... |
1c61d71f995311fe3822ce46b7530cf1ddb34758910bd433aa52aebe81a26b38 | MATLAB | 6,142 | 200 | function [subj] = load_spm_pattern(subj,new_patname,maskname,filenames,varargin)
% Loads an spm dataset into a subject structure
%
% [SUBJ] = LOAD_SPM_PATTERN(SUBJ,NEW_PATNAME,MASKNAME,FILENAMES,...)
%
% Adds the following objects:
% - pattern object called NEW_PATNAME masked by MASKNAME
%% Options
% NEW_PATNAME is th... |
f4680a2b0530b65e0a450abb8bc1cd59d7ebffa19ff685b7d0a1bc77e12583b2 | MATLAB | 6,147 | 172 | function model = train_kernel_ridge(param, X, Y)
% Trains a kernel ridge regression model.
%
% Usage:
% cf = train_kernel_fda(param, X, Y)
%
%Parameters:
% X - [samples x features] matrix of training samples (should
% not include intercept term/column of 1's)
% ... |
c81659f2d47fd8335509e4db2875886135809add5be3b34ec3ae8749120064ae | MATLAB | 6,148 | 140 | function model = lvl1_specify(sub_id, p)
% function model = lvl1_specify(sub_id, p)
%
% Creates a design matrix for a SPM first-level analysis.
%
% Input:
% - sub_id: ID of the current subject.
% - p: Structure with analysis parameters.
%
% Output:
% - model: Structure with all SPM settings used for this analysi... |
5e2f484d79224fd216430400722dc2f90b56937083c847214f0da8021a9b12c3 | MATLAB | 6,150 | 203 | % This demo shows how a simple wholebrain decoding can run on simulated 3D
% toy data. The toy data are Matlab matrices and no real fMRI or EEG data,
% i.e. results do not necessarily generalize to real data.
%
% The script creates multiple volumes in the shape of an ellipsoid where
% all entries are filled with... |
83bf70b4b964c9446260c0f90b91395bd6a85e878127240c1a6f0e0beb89cbe9 | MATLAB | 6,167 | 126 | function neuron_state_evolution = Franciszek(noisy_connectome,nc,norm_chem,norm_gap,x0,W_neg_chem,W_pos_chem,W_gap,frequencies,drivers,std_,chem_switch,gap_switch,noise_switch,total_time,dt,V_Osc,V_drive,V_thresh,seed)
% MODEL - Synaptic polarity of the interneuron circuit controlling C. elegans locomotion, Franciszek
... |
3f8530b5000ccb248b76de36eccc4d64e9db1f10d6bf8121468196401ecf015f | MATLAB | 6,174 | 168 | %This analysis code was used in:
%Mares I, Ewing L, Papasavva E, Ducrocq E, Smith FW, Smith MLS (in press).
%Face recognition ability is manifest in early dynamic decoding of face-orientation
%selectivity – evidence from multi-variate pattern analysis of the neural
%response. Cortex.
%This code was originally cr... |
6845cf034c6f0d6184e38e06182c1562286632f51cbfc4ef3755a244356edf9a | MATLAB | 6,175 | 157 | %DEMARD Automatic relevance determination using the MLP.
%
% Description
% This script demonstrates the technique of automatic relevance
% determination (ARD) using a synthetic problem having three input
% variables: X1 is sampled uniformly from the range (0,1) and has a low
% level of added Gaussian noise, X2 is a cop... |
07abd5a5b4dd0809b31750afba9d50e4c96f9a089472c5ad807af22435aac11c | MATLAB | 6,198 | 206 | function [net, options] = glmtrain(net, options, x, t)
%GLMTRAIN Specialised training of generalized linear model
%
% Description
% NET = GLMTRAIN(NET, OPTIONS, X, T) uses the iterative reweighted
% least squares (IRLS) algorithm to set the weights in the generalized
% linear model structure NET. This is a more effici... |
8ca5d742bb99a07328aa9a75a18f6e0ea142efc5f0cecf108870745906fd1ff7 | MATLAB | 6,200 | 178 | %% Source: https://github.com/scottclowe/superbar
tab_space = 0.03;
LineWidth = 5;
%% 2D Genesis Chest CT T4
font_size = 45;
target_name = {'NCC'; ...
'NCS'; ...
'DXC'; ...
'IUC'};
hf = figure('Position', [0 0 1200 700]);
Y = [ 96.03 97.64 97.45;
70.48 72.39 72.20;
... |
92abc24225d6055f002637113d8c9d6e5835451a456f40b0c76b586c84c699e5 | MATLAB | 6,205 | 202 |
function hopf_DTI_Grange_tbi_lesions_mask1halfSD_bin_personalized(s,condition)
addpath('/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/timeseries/inputs/');
load(sprintf('results_f_diff_fce_cond%d_ON_tbi_personalized.mat',condition));
load(sprintf('empirical_spacorr_rest_cond_%d_ON_tbi_personalized.mat',condition));
load ... |
4b4c3dbc8540b210f6003ce6ff2ea588881cedaa83f5c1a70c49c75a0e1fbc1e | MATLAB | 6,211 | 188 | function guess=find_bpn2_7(sv_var,coords,C,guessed,combinations,final_time)
top_num = 20;
num_neu = 3;
selection = zeros(1,numel(guessed).*top_num + 1);
for i = guessed
[~, corrRanking] = sort(C(i,:),'descend');
selection = [selection, corrRanking(1:top_num)];
end
selection = unique(selection);
sel... |
37977ff9aafc492239793d755d1836085b08c204608b2c15f5c5e4b792d8b6e4 | MATLAB | 6,217 | 231 | %
clear all
close all
clc
%%
% Code lines for Optical Flow Post-processing
load('OpticalFlow.mat')
load('OriginalImage.mat')
load('DifferenceImage.mat')
% Add directory master, structure or table
%%
mkdir Plots;
%
vx = OpticalFlow.vxMat;
vy = OpticalFlow.vyMat;
rel = Op... |
0ac90362d5d44a4a7bb7dae00219a861ffa6f3e4380506a4d275e2576ccd2c6d | MATLAB | 6,219 | 167 | function result = mv_prepare_plot(result, varargin)
% Adds a .plot substruct to the result structure with detailed plotting
% instructions for mv_plot_result (eg type of plot, labels for the axes).
%
%Usage:
% result = mv_prepare_plot(result, <x, y>)
%
%Parameters:
% result - results struct obtained from one... |
5103bd0f6b30850f91cc36a1e1436220215e778cb73e7aeb6e8f54408fff21bb | MATLAB | 6,221 | 132 | clear ()
close ()
code_path='/Volumes/LASA/TBI_OpenNeuro/Shared_code/TBI_ON_Lesions_corr/';
addpath(code_path)
data_path='/Volumes/LASA/TBI_OpenNeuro/TBI_openneuro/data/lesions/overlap_Schaefer/Schaefer1000_wotbi09/';
cd (data_path)
table_overlap_volume_tbi02=import_overlap_volume_Sch1000_tbi02('overlap_volume_combined... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.