sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
442aaada58200b28560460b00abf198981940b779e72c6116f9da4c62962b2d4 | MATLAB | 11,391 | 342 | function [T, Schur_complement, A] = zef_transfer_matrix(zef, ...
A ...
, ...
B ...
, ...
... |
2c51b09aeefa6c5331cc3016ddf081af8d9f7e15b8003c29b3a6b58fe61cb7b9 | MATLAB | 11,515 | 266 | function nse_field = zef_nse_poisson(nse_field,nodes,tetra,domain_labels,mvd_length)
%Output:
%nse_field.bf_capillaries
%nse_field.bp_vessels
%nse_field.bf_capillary_node_ind
%nse_field.bp_vessel_node_ind
%Input:
%nse_field.artery_domain_ind
%nse_field.capillary_domain_ind
%nse_field.total_flow
%nse_field.gravity_x
%... |
379578a38477e9bf07d36bf1b10a446a8af1beff9658b8608220b923ca09d888 | MATLAB | 11,557 | 246 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
function zef = zef_update(zef)
if nargin == 0
zef = evalin('base','zef');
end
if isfield(zef,'h_zeffiro_window_main')
if isvalid(zef.h_zeffiro_window_main)
zef.aux_field_1 = zef.h_co... |
b0a707a5db97a10a44aeaabc047600053b8ac3a1df363e9e70de6c6935ab4649 | MATLAB | 11,600 | 292 | clcl
files={''};
oris1=[1; 1; 3; 1; 1; 5; 3; 5; 5; 5; 1; 1; 1];
oris2=[2; 2; 4; 2; 2; 6; 4; 6; 6; 6; 2; 2; 2];
numtrials=10;
donorm=1; %if =0, analyse the raw beh variables.
redundantnumber=4;
phzflp=[2; 1];
dobasecorr=0;
for fil=1:size(files,1);
clearvars -except files fil donorm numtrials oris1 oris2 mouseav... |
464a00a8cfaf1cbcf6090ea4644fc3ae5f6e9f5732fe070dca6990027fcfc37c | MATLAB | 11,649 | 300 | function poly=mask2poly(mask,countourType,sortPointsMethod)
%% function poly=mask2poly(mask)
% Finds a polygon enclosing the user defind mask of logicals. Kind of a
% reverse/complementary of Matlab poly2mask function.
%
%% Syntax
% poly=mask2poly(mask);
% poly=mask2poly(mask,countourType);
% poly=mask2poly(ma... |
adfa1a3b120479fe22a49fc54b11e400a2832243694d5a1c1a66a2433b98e078 | MATLAB | 11,668 | 280 | function [objopt,kopt,kvec,maps,gev,label] = cluster_koptimum(obj,varargin)
% Calculate optimum number of microstate classes
%
% Useage
% Inputs:
% - xpeak: EEG maps, identified via global field potential peaks using the
% function gfppeaks. Alternatively, this can be full EEG time series
% with op... |
85badd391a59efebdf95743604a1cd0291d829a5bcab656adecb22564e438371 | MATLAB | 11,692 | 340 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
zef_delete_original_surface_meshes;
zef_delete_original_field;
zef.fieldnames = fieldnames(zef);
for zef_i = 1 : length(zef.fieldnames)
zef_data.(zef.fieldnames{zef_i}) = zef.(zef.fieldnames{zef... |
d05a060885df209b7fe2b72437b0e6831b98cb7259c9abb1921e236658460062 | MATLAB | 11,713 | 270 |
%--------------------------------------------------------------------------------
% ensemble_response_analysis.m
%
% Copyright (C) 2024 Takuya Isomura
% (RIKEN Center for Brain Science)
%
% 2024-10-28
%--------------------------------------------------------------------------------
function resp = ensemble_response_a... |
844c38602518a841410a742622599fc1a7b7e142215399efe18df62c5ec558c9 | MATLAB | 11,763 | 265 | %Copyright © 2021- Sampsa Pursiainen & GPU-ToRRe-3D Development Team
%See: https://github.com/sampsapursiainen/GPU-Torre-3D
parameters;
t_0 = 0;
current_iterate = 0;
if make_video == 1
time_lapse = VideoWriter('wave_1.avi');
time_lapse.FrameRate = 24;
open(time_lapse);
end
n_nodes = size(C,1);
n_tetrahe... |
6af3195e4a8d1cab74717de5fb7e85ed1a88a91f86a5f5863de55c4c8e955ebf | MATLAB | 11,771 | 198 | function signal = clean_asr(signal,cutoff,windowlen,stepsize,maxdims,ref_maxbadchannels,ref_tolerances,ref_wndlen,usegpu,useriemannian,maxmem)
% Run the ASR method on some high-pass filtered recording.
% Signal = clean_asr(Signal,StandardDevCutoff,WindowLength,BlockSize,MaxDimensions,ReferenceMaxBadChannels,RefToleranc... |
ab4660e71a1442e9e3dcc183f719f92444c3e7e29b75129f28c50cd34893df51 | MATLAB | 11,806 | 261 | %% MAIN SCRIPT (Aug 2023)
% Written and updated by M. Nollet (Jul 2018 - Aug 2023)
% Adapted from a script written by R. Winsky-Sommerer (DE_RWS Jan 2013)
%
% This script computes the time spent in the different vigilance states
% (VS) and the EEG power density from raw and scored EEG files, and
% requires a... |
59c0883e530be2fa1b70d307b4f1e71ac72798863ac2aa659a6031971397dd25 | MATLAB | 11,846 | 300 | set(0,'DefaultFigureWindowStyle','docked');
load_matfile = true; %false; %
if load_matfile
path="Z:\defazio turbo\data\processed\individual";
%uigetdir("Z:\defazio turbo\data\processed\individual");
files = dir(fullfile(path,'*.mat'));
nFiles=length(files);
else
nFiles=1;
end
do_plots = false;%t... |
2de13ad6d8aac0fb51099563ec71bb07533610e5bb59237066c51f4e3d7789f4 | MATLAB | 11,917 | 289 | function [out, raw] = pulso_pca(streamdat, mode, cfg)
%% Calculate Pullsogram PCA
% out = pulso_pca(streamdat, mode, cfg)
%
% Required cfg fields:
% cfg.eeg_channel
% cfg.pulse.onset__sec
% cfg.pulse.offset__sec
% cfg.pulse.length__ms
% cfg.burst.onset__sec
% cfg.burst.offset__sec
% cfg.burst... |
ab09feed254e00061b0022312c0eb354d12e68312ea0900756048ca4f1e2f5b5 | MATLAB | 11,918 | 294 | function [output] = granule_STDP(net_params,sim_params,options)
%granule_STDP Generates a population of synapses with a kesten process, multiplicative STDP, and heterosynaptic scaling.
% Simulation parameters define simulation time
if nargin<2 || isempty(sim_params)
sim_params=struct;
end
if ~isfield(sim_par... |
69d7fcc6e905e95529c327287e73b3c39fa18f6bc99dbc880f652aaf2747d3c9 | MATLAB | 11,948 | 382 | function [Path,Xi] = hmmdecode(data,T,hmm,type,residuals,preproc)
%
% State time course and Viterbi decoding for hmm
% The algorithm is run for the whole data set, including those whose class
% was fixed. This means that the assignment for those can be different.
%
% INPUT
% data observations, either a struct ... |
caf475442ec5af18922e053ddd18a6f7acfdeaadbb0977d4fc14a70a2977c488 | MATLAB | 12,046 | 295 | function zef_PlotGMModel
parameters = evalin('base','zef.GMM.parameters.Values');
m_size = str2num(parameters{8});
m_width = str2num(parameters{9});
m_sym = parameters{7};
s_length = str2num(parameters{16})^2;
plot_ellipsoids = parameters{11};
ellip_trans = str2num(parameters{12});
meta2 = evalin('base','zef.GMM.meta{2... |
354f82eedfab8fd6561d4e0566e753ff3d1615fef4428fd213cb2c255c8e2a77 | MATLAB | 12,047 | 307 | function [GMModel,GMModelDipoles,GMModelAmplitudes,GMModelTimeVariables] = zef_GMModeling
h = zef_waitbar(0,1,['Gaussian mixature model.']);
GMModelTimeVariables = [];
if evalin('base','isfield(zef,''reconstruction_information'')')
reconstruction_information = evalin('base','zef.reconstruction_information');
if... |
a1d31bac5a9a0cf6bbcceecddb0ad856a413225d4be3187c85102cae64017ddf | MATLAB | 12,089 | 253 | function [hmm,XW] = updateW(hmm,Gamma,residuals,XX,XXGXX,Tfactor)
K = length(hmm.state); ndim = hmm.train.ndim;
if ~isempty(hmm.state(1).W.Mu_W)
XW = zeros(size(XX,1),ndim,K);
else
XW = [];
end
if nargin<6, Tfactor = 1; end
reweight = 0; % compensate for classes that have fewer instances?
if isfield(hmm.tra... |
da06053e250635eb389161a64770c23a038a53a00851bc4fee5554b85408138e | MATLAB | 12,176 | 221 | classdef RegularizerL2_Len < nnet.internal.cnn.regularizer.Regularizer
% RegularizerL2 Abstract class for representing L2 regularization.
% ===============================================
% dir = C:\Program Files\MATLAB\R2019a\toolbox\nnet\cnn\+nnet\+internal\+cnn\+regularizer
% ==================... |
9a85f81f366b3059011cf7d32b73adb7ba7efe8cbcb2f37bc5a9f1021750f3b9 | MATLAB | 12,180 | 221 | classdef RegularizerL2_Len < nnet.internal.cnn.regularizer.Regularizer
% RegularizerL2 Abstract class for representing L2 regularization.
% ===============================================
% dir = C:\Program Files\MATLAB\R2019b\toolbox\nnet\cnn\+nnet\+internal\+cnn\+regularizer
% ==================... |
741f86aece3e885c70a6810bba823997fb9b4c298d2d9493fe2499368dc945c3 | MATLAB | 12,181 | 248 | %% initialize
clear; clc;
currentPath = pwd;
cd ../temp
load('tempFileForAnalysis.mat');
cd(pathBIDS);
cd derivatives
pathDeriv = pwd;
cd(pathDeriv);
cd('spm-preproc'); % For saving preprocessed file from SPM
pathPrepFile = pwd;
prepSubjFolders = dir('sub*');
cd(pathDeriv);
cd('behavior');
pathBehav = pwd;
load('be... |
2457ef694e149c59ca78e15735e0cb03e59436f966ea0de0885263c11c6c2345 | MATLAB | 12,226 | 307 | %% Nat Comms Ictogenesis Figure 2
clear
load('20230127_PooledData.mat');
EXP5HZ = "B30_P5F5_";
EXP10HZ = "B30_P5F10_";
EXP20HZ = "B30_P5F20_";
sz = struct();
sz.stim5Hz = startsWith(sztable.ExpProtocol, EXP5HZ);
sz.stim10Hz = startsWith(sztable.ExpProtocol, EXP10HZ);
sz.stim20Hz = startsWith... |
728e028f5bd1a32cfb3f0fe7f0d5f047431c9f637b4ead02bd75a2cd99cf779d | MATLAB | 12,241 | 327 | function [cv_acc,acc,genplot,model] = standard_decoding(X,Y,T,options,binsize)
% Compute cross-validated (CV) accuracies from a "decoding" model trained
% at each time point (or window, see below) in the trial
% The reported statistic is either the cross-validated explained variance from
% regressing X on the stimul... |
f411a173febb4899f5e2cdbfdd1a1eb2f56ef669b898176a0503613860f08909 | MATLAB | 12,256 | 247 | function bsliang_TMS_main(is_getshamrepvals)
tic
% is_getshamrepvals=0;
% 1- delete values in sham with slope<0, PSE<1 or PSE>5, and extract
% exp(mean-2sd) as values to replace the deleted values (only for TMS conditions)
% 0- directly start fitting
if ~is_getshamrepvals
load(['..... |
a38d20aa84b6594bfb244f697882c9b4c3ec0ae54d6a0ddc0a089f8e26d89e4e | MATLAB | 12,347 | 308 | function [x, cutvalue, cutvalue_upperbound, Y] = maxcut(L, r)
% Algorithm to (try to) compute a maximum cut of a graph, via SDP approach.
%
% function x = maxcut(L)
% function [x, cutvalue, cutvalue_upperbound, Y] = maxcut(L, r)
%
% L is the Laplacian matrix describing the graph to cut. The Laplacian of a
% graph is L... |
e4c130fa735b263cbe3ca0312365f1d96145af82df7bedfa213199bc5f5e3515 | MATLAB | 12,352 | 350 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
function [z] = ramus_sampling_process(void)
h = zef_waitbar(0,1,['RAMUS Sampler.']);
[s_ind_1] = unique(evalin('base','zef.source_interpolation_ind{1}'));
n_interp = length(s_ind_1);
beta = evalin('b... |
2afe59869e9029b8e9e1c808363fcb37bed5a4af6703b4453e7b6c3e20b7123c | MATLAB | 12,365 | 292 |
function zef = zef_nse_iteration(zef)
[zef.nse_field.nodes, zef.nse_field.tetra] = zef_get_submesh(zef.nodes,zef.tetra,zef.active_compartment_ind);
b_node_ind = zef_surface_mesh(zef.nse_field.tetra);
b_node_ind = unique(b_node_ind);
signal_pulse.dir = zeros(size(zef.inv_synth_source,1),3);
flux_val = 7.5e-4/60;
flu... |
67e95e8771763f83eb730573de4883bf34fddc07b05275a1b5ac9fd312f52ba7 | MATLAB | 12,380 | 305 |
if zef.mesh_smoothing_on
length_waitbar = 4+length(priority_vec);
sensors = zef.sensors;
smoothing_param = zef.smoothing_strength;
smoothing_steps_surf = zef.smoothing_steps_surf;
if length(smoothing_steps_surf) == 1
smoothing_steps_surf = repmat([ 0 smoothing_steps_surf],1,zef.mesh_smoo... |
5d91f8fd6a772e574050443a8e5c74b407c1c801de73d025634a832c11c50f7a | MATLAB | 12,461 | 252 | function [y_ES, ES_optimized_current_density, residual, flag_val, source_magnitude, source_position_index, source_directions] = zef_ES_optimize_current(zef_data, varargin)
%% varargin
if nargin >= 2
alpha = varargin{1};
end
if nargin >= 3
eps_val = varargin{2};
end
%% Source properties
source_position_index = zeros(siz... |
f512077b3667adc5d2f62006bcf0d5315ccb85d2357d04c6979b857738bde342 | MATLAB | 12,502 | 377 | close all
clear;
clc;
tic;
%% histogram of the distances of the vessels found in the image
% read the image
im = imread('veins1.tif');
% flip the image horizontally
% Convert to a binary image
bw = imbinarize(im);
% Sum up all the pixel values
total_sum = sum(bw(:));
% Display the result
disp(total_sum... |
859b1f8553fac9e7692e28994a991e844d6a137ad19f5e6ddcd69acd4434b584 | MATLAB | 12,504 | 324 |
if ismember(refinement_flag, [1, 3])
tetra_aux = tetra;
end
if eval('zef.refinement_on')
if refinement_flag == 1
surface_refinement_on = eval('zef.refinement_surface_on');
elseif refinement_flag == 2
surface_refinement_on = eval('zef.refinement_surface_on_2');
% elseif refineme... |
1a13ac169dc22898fbc9336cd22a5cb3462e7f1064a51a2e184d1ca7c7a38397 | MATLAB | 12,516 | 236 | function pout=binotest(s,n,p,Sided)
%function pout=myBinomTest(s,n,p,Sided)
%
% Performs a binomial test of the number of successes given a total number
% of outcomes and a probability of success. Can be one or two-sided.
%
% Inputs:
% s- (Scalar or Array) The observed numebr of successful outcomes
% ... |
5ac9e37bb2c5e5787865b46d2de7d26f0596920f00e7688dafa4146aaad01bc6 | MATLAB | 12,519 | 236 | function pout=myBinomTest(s,n,p,Sided)
%function pout=myBinomTest(s,n,p,Sided)
%
% Performs a binomial test of the number of successes given a total number
% of outcomes and a probability of success. Can be one or two-sided.
%
% Inputs:
% s- (Scalar or Array) The observed numebr of successful outcomes
% ... |
f6f58f7802570bc1394923826a8071cd53217d8b82f5f9fe1390029ad71c5e2e | MATLAB | 12,613 | 342 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
function zef = zef_process_meshes(zef,varargin)
explode_param = 1;
if nargin == 0
zef = evalin('base','zef');
end
reuna_p_inf = [];
output_mode = 'compact';
if not(isempty(varargin))
explo... |
ed3d481cc4f0a4f6d3b6b72976d2fb8abe981c39b3aba832e1737511b79f0c05 | MATLAB | 12,622 | 381 | %function structEP = RunDriftingGratings
%% suppress m-lint warnings
%#ok<*MCCD,*NASGU,*ASGLU,*CTCH>
clearvars -except sStimPresets sExpMeta sStimParamsSettings;
%% define variables
fprintf('Starting %s [%s]\n',mfilename,getTime);
intStimSet = 1;% 1=0:15:359, reps20; 2=[0 5 90 95], reps 400 with noise
boolUseSGL = tr... |
8469c86d3e6617892ca76df3aea9b331289f26e31736a505252a48ca73902824 | MATLAB | 12,637 | 355 | function [hmm,info] = hmmsinitg(Xin,T,options,GammaInit)
% Initialisation before stochastic HMM variational inference, when Gamma
% is provided
%
% INPUTS
% Xin: cell with strings referring to the files containing each subject's data,
% or cell with with matrices (time points x channels) with each
% subject... |
46d895a785b8766492734dc089e2d827a694ef0bc33dc3b96ad73c81b4b8e806 | MATLAB | 12,643 | 355 | function [Gamma,Gammasum,Xi,LL,B] = hsinference(data,T,hmm,residuals,options,XX)
%
% inference engine for HMMs.
%
% INPUT
%
% data Observations - a struct with X (time series) and C (classes)
% T Number of time points for each time series
% hmm hmm data structure
% residuals in case we train on resid... |
69e7ca19346e009a04652d5aa9f9779e0961e73714d69bd78e29c0e5808795f5 | MATLAB | 12,680 | 359 | function ET_main(varargin)
%% ET_main
%get globals
global sEyeFig;
global sET;
cellText = {};
%retrieve variables
if isfield(sET,'objVid')
objVid = sET.objVid;
else
return;
end
%% prepare: set parameters
%set initial dummy values
intTempAvg = -1; %number of frames to average over; higher values limi... |
a9561773d1f5e776c22ec6a143c4c97bf247f768bbef9b01f3c6c8b988eec471 | MATLAB | 12,692 | 386 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
function zef = zef_create_fem_mesh(zef)
if nargin == 0
zef = evalin('base','zef');
end
zef_segmentation_counter_step;
x_lim = [0 0];
y_lim = [0 0];
z_lim = [0 0];
n_compartments = 0;
for k = 1 :... |
ed25b7db7c7099f44d52e65dac8863692ebdb3ef2238865f0c18bf2629ea1586 | MATLAB | 12,841 | 486 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
%
%zef_lead_field_matrix is a function for creating a lead field matrix.
function zef = zef_lead_field_matrix(zef)
if nargin == 0
zef = evalin('base','zef');
end
zef.brain_ind = zef_find_active_c... |
08617aa18d307e75118b5d3f3d43c7773aacd335afa3dfccc9969417495a70f7 | MATLAB | 12,976 | 349 | function [GMModel,GMModelDipoles,GMModelAmplitudes,GMModelTimeVariables] = zef_AdvGMModeling
h = waitbar(0,['Gaussian mixature model.']);
GMModelTimeVariables = [];
if evalin('base','isfield(zef,''reconstruction_information'')')
reconstruction_information = evalin('base','zef.reconstruction_information');
if is... |
c450eb49f2ccb3608d243101b6385fcc15a9366362e77fb10c70f779d5683c48 | MATLAB | 13,102 | 382 | clcl
rednumber=0; %redundant to analyse. if 0, use all. for fig, i used 0
lag=10; %lag of phase
computelagfromtheta=0; %compute the lag based on peak freq
t1=400; t2=799; t3=800; t4=1100;%times of analysis%
for fileload=1;
files1={};%
files2={};%;
two_obvs_per_mouse=1;
end
%find peak
for calcpeakfreq... |
f27bd98287ac5d8d4be10b276c0d263a077a3fe3e183897619fd4f6c15911c8e | MATLAB | 13,121 | 331 | examples.studies.decision_making.zef_parameters_focal_epilepsy;
zef_start_dataBank;
%EEG
zef.L = zef.dataBank.tree.node_1_1.data.L;
zef.source_positions = zef.dataBank.tree.node_1_1.data.source_positions;
zef.sensors = zef.dataBank.tree.node_1_1.data.sensors;
zef.imaging_method = zef.dataBank.tree.node_1_1.data.imag... |
2411c8535be41f1f22473e1df4390e0a383b2a21adf18730041f241156b074b5 | MATLAB | 13,146 | 346 |
function [z_vec,time_series] = UKF_estimate_NMM_parameters(self,L)
% This function detect the sources that causes "number_of_corrclusters"
% different spike activities obtained during the time interval.
% Additionally, the function estimates the time evolution of each of the
% spikes using Jensen-Rit neural mass ... |
06ef35199f244bb52bb2f04136d0dde039d3a3674b42ffa5010a50ef8fe98692 | MATLAB | 13,211 | 365 | function CVerr = cvglmnet(x,y,family,options,type,nfolds,foldid,parallel,keep,grouped)
%--------------------------------------------------------------------------
% cvglmnet.m: cross-validation for glmnet
%--------------------------------------------------------------------------
%
% DESCRIPTION:
% Does k-fold cros... |
e40ce3ff47b3ca0cd7e9bd71a3815af8728aa0bd92d1425799e05b6674066d78 | MATLAB | 13,315 | 398 | function displaytable(data, colheadings, wid, fms, rowheadings, fid, colsep, rowending)
% Prints formatted matrix of numerical data with headings
%
% Syntax
%
% displaytable(data, colheadings, wid, fms, rowheadings, fid, colsep, rowending)
%
% Input
%
% data: a matrix or cell array, containing the data to ... |
5cfd7b0f8083842e2b52e062399d7f8cdd319325453168d04f7ac59802f10082 | MATLAB | 13,318 | 370 | function fit = hmmspectramar(data,T,hmm,Gamma,options)
% Get spectral estimates from MAR model
% If 'hmm' is specified, it will interrogate its MAR parameters
% If not, will recompute the MAR using maximum likelihood
%
% INPUT
% X time series (can be [] if MLestimation = 0)
% T Number of time po... |
69efa218f7475543ab6c21fa78db35b157a67cccc5e88b0cb4f0823984846114 | MATLAB | 13,338 | 320 | % autothreshold!
% read array from file
%loc = "C:\Users\defazio\Documents\data\processed\individual\20250925_233.mat";
%load(loc)
% choose a file or 0 for all files in directory
path=uigetdir("Z:\defazio turbo\data\processed\individual");
%path="C:\Users\defazio\Documents\data\processed\individual";
if ismac()
p... |
c50a1a9b4a6d0bc2d857832944737edad9e6105cb6fb4bfd53536ba264799939 | MATLAB | 13,344 | 414 | #import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <objc/runtime.h>
struct KeyEquivalent {
bool valid;
bool ctrl, opt, cmd, shift;
int key;
};
const static int MenuBegin = 1;
static NSInteger s_currTag = MenuBegin;
static NSInteger s_selectedTag = -1;
@interface MenuItemHandler : NSObject
... |
1cef840e44fde1d4a2024ca5965a1b6478c4f99430cc34cbb3ed4da0c6648c1a | MATLAB | 13,393 | 392 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
function [z,rec_source] = zef_ias_iteration_roi(zef)
h = zef_waitbar(0,1,['IAS MAP iteration.']);
[s_ind_1] = unique(eval('zef.source_interpolation_ind{1}'));
s_ind_0 = s_ind_1;
n_interp = length(s_in... |
ef9d3ea09b45eb4dce41e19a8db9d56aa9d6819a7b47665dfb18c92211811ee2 | MATLAB | 13,396 | 323 | function detection = wendt_spindle_detection(C3,O1,fs)
% WENDT_SS_DETECT Detect sleep spindles using the Wendt algorithm.
% S. Wendt et al. "Validation of a Novel Automatic Sleep Spindle Detector
% with High Performance During Sleep in Middle Age Subjects", Conf Proc
% IEEE Eng Med Biol Soc. 2012, pp 4250-4253
%
% The... |
5c40fd548cf07fbf739f0ea78abb79f2880626a2c0d7b4436b4ada74818c2e9a | MATLAB | 13,432 | 281 | classdef zef_mesh_tool_app_exported < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
h_mesh_tool matlab.ui.Figure
h_forward_simulation_update_from_profile matlab.ui.control.Button
h_forward_simulation_script matlab.ui... |
97daad6cea99a9418cb5842d61783ec00af8aa235801194af7ec75348e8ee931 | MATLAB | 13,440 | 392 | % TD custard
% quick version
function custardOutput = TDcustard2 (n, signal, sigthresh, minAmp, minWidth, tXrise, noFig, detailFlag, silent )
% n, number of points to test for a change
% signal, 1xnpnts
% sigthresh, significance to call an up
% minAmp, to be a peak the relative amplitude needs to exceed this
%detailFla... |
466571336720fa6453f756734e7caf2ca554b09956d7a3ce7377a40179e60c5e | MATLAB | 13,515 | 319 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
function [time_series] = zef_parcellation_time_series(zef)
if nargin == 0
zef = evalin('base','zef');
end
if isempty(zef)
zef = evalin('base','zef');
end
length_reconstruction_cell = 1;
num... |
60ca87383bd9585e794c925708c1e1a267c40208d4eb008ae937ed0884af7633 | MATLAB | 13,554 | 294 | function Fun_SpectralAnalysis(Path, Subject, NumberOfFilesPerSubject,...
FileNamesForSubjects, NumberOfEpochs, NumberOfSpectrumValues,...
Spectra, Scorings, Frequencies, DeltaThetaLimits,...
NumOfScoringsForSpectra, ScoringMappingForSpectra)
%% Written and updated by M. Nollet (Aug 2023)
%
... |
249fa743163a6cc21a1b8e729c742da84c32cfa0b64c05ad8e826e84220f35f6 | MATLAB | 13,668 | 360 | function [x, cost, info, options] = barzilaiborwein(problem, x, options)
% Riemannian Barzilai-Borwein solver with non-monotone line-search.
%
% function [x, cost, info, options] = barzilaiborwein(problem)
% function [x, cost, info, options] = barzilaiborwein(problem, x0)
% function [x, cost, info, options] = barzilaib... |
a03904eae3ff4a5b9329fa0ec6d947cf6a50d32e414cd297fcdd0a2459c40c6e | MATLAB | 13,710 | 401 | % function forLegend = bplot(X,varargin)
% This function will create a nice boxplot from a set of data. You don't
% need any toolboxes.
%
% bplot(D) will create a boxplot of data D, no fuss.
%
% T = bplot(D) If X is a matrix, there is one box per column; if X is a
% vector, there is just one box. O... |
f72c041791548ce52964cde5a803a902077106e85bc139f25d0b52396c95343d | MATLAB | 13,746 | 383 | classdef (HandleCompatible) CommonInverseParameters < dynamicprops
%
% CommonInverseParameters
%
% This class holds onto inverse parameters common to all inverse methods.
%
properties
%
% low_cut_frequency
%
% Highpass passband edge frequency (Hz) used for the ... |
bd85951cab2d02a5f7cce0eb6d36f6df0dc66bb2a7e3993a0a7bbb3a6da12487 | MATLAB | 13,750 | 332 | function [hmm,info] = hmmsinit(Xin,T,options)
% Initialisation before stochastic HMM variational inference
%
% INPUTS
% Xin: cell with strings referring to the files containing each subject's data,
% or cell with with matrices (time points x channels) with each
% subject's data
% T: cell of vectors, where ... |
4e7b6fb1a78b5336ea67dd823c4d6a6d006015b08e5dc8d777aa4e7ddca14e2f | MATLAB | 13,830 | 349 | function fcn_hcp_meg_process_emptyroom(hcp_dir, subjList, badChannels, reports_dir)
% hcp_meg_process: Script to process empty-room MEG data from Human
% Connectime Project
%
% Modified from Brainstorm online tutorials:
% https://neuroimage.usc.edu/brainstorm/Tutorials/HCP-MEG
%
% Inputs:
% hcp_dir: Directory w... |
0af3275ce5d1281fa17a3132f8d7ab5abfd8bba2b91a113d535a83615705c9a4 | MATLAB | 13,975 | 272 | function [connection_w0, connection_w0_len, ...
connection_long_range_hidden1, connection_long_range_len,num_LRC,num_SRC,...
connection_w1, connection_w1_len] = fun_generate_conn_conv_rewireLRC_SRC_LSp(input_cell_num,hidden_cell_num,output_cell_num,...
... |
8e88547551699b78e4d8af039f5e4ab6a8450fb40c655beaea3972197d1e1666 | MATLAB | 14,017 | 319 | classdef Trainer2 < handle
% Trainer Class for training a network
% =================================================
% dir = C:\Program Files\MATLAB\R2019b\toolbox\nnet\cnn\+nnet\+internal\+cnn
% =================================================
% Copyright 2015-2018 The MathWorks, Inc.
... |
bc54dcbd3799e7bda7894f709a3ad7c320bc96ff358cca30f1cb210b1a1aa427 | MATLAB | 14,017 | 319 | classdef Trainer2 < handle
% Trainer Class for training a network
% =================================================
% dir = C:\Program Files\MATLAB\R2019a\toolbox\nnet\cnn\+nnet\+internal\+cnn
% =================================================
% Copyright 2015-2018 The MathWorks, Inc.
... |
de3a7bdf0b58afa708c288053e540485b3a8ce155dddb2129b59be43b26cd00a | MATLAB | 14,047 | 415 | %function structEP = RunDriftingGratings
%% suppress m-lint warnings
%#ok<*MCCD,*NASGU,*ASGLU,*CTCH>
clearvars -except sStimPresets sExpMeta sStimParamsSettings;
%% define variables
[intPresetsCreated,cellExperiments] = assertPresets();
fprintf('Starting %s [%s]\n',mfilename,getTime);
intStimSet = 1;% 1=0:15:359, rep... |
4b8b45f18057f65db840fb8d2df1a86c898d0e411d41d6969bf6b9cf4ce26450 | MATLAB | 14,088 | 234 | function zef_ES_plot_current_pattern(varargin)
switch nargin
case {0,1}
if nargin == 0
zef = evalin('base','zef');
warning('ZI: No zef were called as an input argument.')
else
zef = varargin{1};
end
[sr, sc] = zef_ES_objective_function(zef);
... |
23da00674813ca2928107701b790e86d8bd3bdae83d5f19cbe15d811e7fb001e | MATLAB | 14,206 | 372 | function M = fixedrankembeddedfactory(m, n, k)
% Manifold struct to optimize fixed-rank matrices w/ an embedded geometry.
%
% function M = fixedrankembeddedfactory(m, n, k)
%
% Manifold of m-by-n real matrices of fixed rank k. This follows the
% embedded geometry described in Bart Vandereycken's 2013 paper:
% "Low-rank... |
24e3d72ed4e89f080414a159452b5e0e467a3d229e65f918cbd1c39f72255b3f | MATLAB | 14,247 | 235 |
%--------------------------------------------------------------------------------
% fig3.m
%
% Copyright (C) 2025 Takuya Isomura
% (RIKEN Center for Brain Science)
%
% 2025-06-18
%--------------------------------------------------------------------------------
% initialization
clear
tic
Tinit = 20; ... |
c6d38abf482d33ff8c9e7eca50c789a324967835e8eddb073005c8e954d3ded5 | MATLAB | 14,331 | 319 | %% Nat Comms Ictogenesis Figure S4
clear
load('20230127_PooledData.mat');
% Set up binning ranges
ephistbins = 1:15;
ephistedges = (1:16) - 0.5;
rshistbins = 0:7;
rshistedges = ([0:7, 9]) - 0.5;
EXP5HZ = "B30_P5F5_";
EXP10HZ = "B30_P5F10_";
EXP20HZ = "B30_P5F20_";
sz = struct();
sz.stim... |
ea5baefc68b94398e27bc42a297dc0a9a94c77dee30d65a4d9a702b98c1d9d69 | MATLAB | 14,446 | 464 | function [control_infor, time_infor] = func_desired_traj(traj_type, bridge_type, time_infor, control_infor, properties, dt, plot_movie, traj_frequency)
plot_figures_inside = 0;
val_length=time_infor.val_length;
train_length=time_infor.train_length;
% Get the two-arms property
[m1, m2, l1, l2, lc1, lc2, I1, I2... |
e05a1e4c085d064619b30d933a7af43177b38b85ff94ddfa81e415b132b8933e | MATLAB | 14,498 | 433 | function [predictedY,stats] = predictPhenotype (Yin,Din,options,varargin)
%
% Kernel ridge regression or nearest-neighbour estimation using
% a distance matrix using (stratified) LOO and permutation testing
%
% INPUT
% Yin (no. subjects by 1) vector of phenotypic values to predict,
% which can be contin... |
8516fdbe4a338ec5e1edcf1641c9631461a081a85b565c9a7289cbd163fa2026 | MATLAB | 14,639 | 453 | function zef = zef_mne_tool_window(zef)
h1 = figure(...
'PaperUnits',get(0,'defaultfigurePaperUnits'),...
'Units','normalized',...
'Position',[0.432638888888889 0.572222222222222 0.244444444444444 0.453333333333333],...
'Visible',get(0,'defaultfigureVisible'),...
'Color',get(0,'defaultfigureColor')... |
e5c845a51ddaf693fe407bd0e6676056ad5c6be5ad8defac6ffecda137240ef9 | MATLAB | 14,742 | 458 | function [X,Y,T,options,A,R2_pca,pca_opt,features] = preproc4hmm(X,Y,T,options)
% Prepare data to run TUDA
% 1. check parameters, including the type of classifier (regression is default)
% 2. Format X and Y accordingly to the classifier
% 3. Sets up state to be sequential , if asked
% 4. Preprocesses the data, includin... |
49aedf07223cee781cd75caee056e1138cf5f88cd647108c3924f17e92a80cd7 | MATLAB | 14,875 | 375 | %% Copyright © 2025- Joonas Lahtinen
function [MethodClassObj] = ClassGMModeling(MethodClassObj,reconstruction,zef,args)
arguments
MethodClassObj (1,1) inverse.CommonInverseParameters
reconstruction (:,:) {mustBeA(reconstruction,["double","gpuArray","cell"])}
zef (:,:) struct
args.number_of_clusters (1,... |
e319c2501a256e827d857c6c5c668093a932b992a5dd672c6b32a62b0560c52d | MATLAB | 14,914 | 404 | clcl
lag=10; %lag of phase
freq1a=3; freq2a=15; %%theta bounds;freq1a=3; freq2a=15;% %beta bounds;
calcpeakfreq=1; %if computing peak frequency for each mouse separately
freq3=40; freq4=60; %gamma bounds (actual, divided by 2. so 25 is really 50). 40 and 60
t1=400; t2=799; t3=800; t4=1100;%100 pre to 100 post
for fil... |
f9b9ab08111c3976da87f0b10848cb8787bb8ae2a0473aeda3fef00d7259863a | MATLAB | 15,101 | 489 | function zef = zef_mcmc_window(zef)
h1 = figure(...
'PaperUnits',get(0,'defaultfigurePaperUnits'),...
'Units','normalized',...
'Position',[0.432638888888889 0.52 0.241666666666667 0.505555555555556],...
'Visible',get(0,'defaultfigureVisible'),...
'Color',get(0,'defaultfigureColor'),...
'Integer... |
5b4ca7f1bdae7a400c4a8b1c6e13d89b335e5aee368928beb87c19e57f047a89 | MATLAB | 15,111 | 489 | function zef = zef_sl1_map_estimation_window(zef)
h1 = figure(...
'PaperUnits',get(0,'defaultfigurePaperUnits'),...
'Units','normalized',...
'Position',[0.432638888888889 0.52 0.241666666666667 0.505555555555556],...
'Visible',get(0,'defaultfigureVisible'),...
'Color',get(0,'defaultfigureColor'),.... |
4201223d830de8d023bd761314674b82755b76cdd81eedd7bab5f0c7163fc993 | MATLAB | 15,151 | 489 | function zef = ias_map_estimation_window(zef)
h1 = figure(...
'PaperUnits',get(0,'defaultfigurePaperUnits'),...
'Units','normalized',...
'Position',[0.432638888888889 0.52 0.241666666666667 0.505555555555556],...
'Visible',get(0,'defaultfigureVisible'),...
'Color',get(0,'defaultfigureColor'),...
... |
9b2d8d9530a6fe1d4bdb82e110239b23d0d5872172043d00529f85ad26552f82 | MATLAB | 15,162 | 260 | function [EEG,HP,BUR] = clean_artifacts(EEG,varargin)
% All-in-one function for artifact removal, including ASR.
% [EEG,HP,BUR] = clean_artifacts(EEG, Options...)
%
% This function removes flatline channels, low-frequency drifts, noisy channels, short-time bursts
% and incompletely repaird segments from the data. ... |
6fbed4979023e361c2aacfdffd3d6599491a3d201aa45a7a8839ee84f5e7c40e | MATLAB | 15,431 | 437 | function sPupil = getEyeTrackingOffline(sFile,strTempDir)
%getEyeTrackingOffline Run offline pupil detection
% sPupil = getEyeTrackingOffline(sFile,strTempDir)
%% retrieve paths and copy required files
%placeholder
sPupil = struct;
%temp
if ~strcmp(strTempDir(end),filesep)
strTempDir(end+1) = filesep;
end... |
79b4f6621e887695bd62daa853ba53723d20c066f5b82ae2dab9ea9380a6100e | MATLAB | 15,432 | 449 | function CBH = cbfreeze(varargin)
%CBFREEZE Freezes the colormap of a colorbar.
%
% SYNTAX:
% cbfreeze
% cbfreeze off
% cbfreeze(CMAP) % Freezes it with this colormap!
% cbfreeze(CMAP,'off')
% cbfreeze(H,...)
% CBH = cbfreeze(...);
%
% INPUTS:
% C... |
753bb39af7807a48f8e2abf00f521b6fe15bf63aeea3add3b0c726c169d3631e | MATLAB | 15,653 | 376 | function ETC_genEpochPanel(ptrMainGUI,vecLocation)
%% get globals
global sETC;
global sFigETC;
%% make panel
ptrPanelEpoch = uipanel('Parent',ptrMainGUI);
vecColor = get(ptrMainGUI,'Color');
set(ptrPanelEpoch,'Position',vecLocation,'BackgroundColor',vecColor,'Title','Epoch Annotation','FontSize',10);
ptrPan... |
53ff2f68229bd153bde51f1de19f3d75c341734f44ef20755e5e02d11b86eb63 | MATLAB | 15,685 | 373 | function [hmm, residuals, W0] = obsinit (data,T,hmm,Gamma)
%
% Initialise observation model in HMM
%
% INPUT
% data observations - a struct with X (time series) and C (classes)
% T length of series
% Gamma p(state given X)
% hmm hmm data structure
%
% OUTPUT
% hmm estima... |
7a7312e3667d2feecdaa3e4d1a5b3683e610942f886494b24487558ffc705bf5 | MATLAB | 15,712 | 498 | function outTree = zef_simulate_jr_tree(treeStruct, gd)
%ZEF_SIMULATE_JR_TREE Delay-free JR network simulation with looped passes.
%
% ODE45 version (single-file, no external dependencies).
%
% New-name version (NO legacy aliases):
% gd.blockDuration_s, gd.samplingRate_Hz, gd.gaussianNoiseStd, gd.numFeedbackLoops, ..... |
9f33e27645ba9c86fbff47c67ff6bbca24592ab3bac0021286cfdb3642fb55ea | MATLAB | 15,728 | 346 | function [obj,additionalout] = cluster_estimatemaps(obj,k,varargin)
% Cluster to calculate a specified number of microstate maps
options = microstate.functions.make_options(varargin) ;
% default options
defaults = {'clustermethod','kmeans'; % kmeans, aahc, pca, ica, hmm
'kmeans_... |
a15abe645b2d666b0630239146ce965f8a8a006000d037269e40c99c97892acc | MATLAB | 15,836 | 470 |
close all
clear;
clc;
%% histogram of the distances of the vessels found in the image
% read the image
im = imread('veins1.tif');
% flip the image horizontally
% Convert to a binary image
bw = imbinarize(im);
% Sum up all the pixel values
total_sum = sum(bw(:));
% Display the result
disp(total_sum);
... |
3cdf9c90632c751a86b650258b8e788181bc85f8f35415b56f21cf186b1774c7 | MATLAB | 15,899 | 440 | %% Notes
% 2023/02/11 MVPA for Motor representations in motor adaptation
%% Initialize
clear; clc;
currentPath = pwd;
%% Whether MRI or not
isMRI = true;
%% open window
% Check if Psychtoolbox is properly installed:
AssertOpenGL;
% to avoid sinc problem
Screen('Preference', 'SkipSyncTests', 1);
% Open up a windo... |
776e4b46b0d316f43ad0fd06db1dafd09788493d89ffd71df07dd9d6156ba5d6 | MATLAB | 16,047 | 216 | function process_files(suffix)
addpath(genpath('/home/mfromano/spm/spm12/'));
BASE_DIR = ['/data2/MRI_PET_DATA/processed_images_final' suffix filesep];
MRI_folder_new = [BASE_DIR 'ADNI_MRI_nii_recenter' suffix filesep];
fnames = dir(MRI_folder_new);
fnames = {fnames.name};
rids = arrayfun(@(x) regexp(x,'^([0-9]{4}).*\... |
62619d5d9093aeae71de20a65de3f23bf6a68f17467cd6669a37c467416b8a1a | MATLAB | 16,080 | 394 | function [x, cost, info, options] = arc(problem, x, options)
% Adaptive regularization by cubics (ARC) minimization algorithm for Manopt
%
% function [x, cost, info, options] = arc(problem)
% function [x, cost, info, options] = arc(problem, x0)
% function [x, cost, info, options] = arc(problem, x0, options)
% function ... |
e89f0464fae9a31a00de2ad9c6e0237229469c3d0b716121541ce1be1aded816 | MATLAB | 16,157 | 377 | function [acc,acc_star,Ypred,Ypred_star,Gammapred,acc_Gamma] = tudacv(X,Y,T,options)
%
% Performs cross-validation of the TUDA model, which can be useful for
% example to compare different number or states or other parameters
% (the words decoder and state are used below indistinctly)
%
% INPUT
%
% X: Brain data, (time... |
9fb3870753e4e204ffd9da8d527a803c558f36e113cf5935a2594ae8687e9364 | MATLAB | 16,234 | 370 | function [cleanEEG] = removeArtifactsOnlineWavessobi( EEGdata, Fs, chanLocs, useAcc )
%
% removeArtifactsOnlineWaves
%
% Attempt online artifact removal.
% First perform hard threhsolding to reject very high amplitude
% channels. Then re-reference, calculate wavelet coefficients,
% ... |
8599ba5490f95178776e8b37c4978c358cb86ea7349d164a19cbffe9639b0013 | MATLAB | 16,263 | 400 | %Copyright © 2021- Sampsa Pursiainen & GPU-ToRRe-3D Development Team
%See: https://github.com/sampsapursiainen/GPU-Torre-3D
function [nodes,tetra,domain_labels_aux,distance_vec,tetra_interp_vec] = zef_mesh_refinement(zef,nodes,tetra,domain_labels_aux,distance_vec, varargin)
if isempty(zef)
zef = evalin('base',zef)... |
88d853cd1ebf5ae41fe90a784a3d2f3d2c3f25dd96f95c924eb2cd6107dfd707 | MATLAB | 16,291 | 410 | function [x, cost, info, options] = conjugategradient(problem, x, options)
% Conjugate gradient minimization algorithm for Manopt.
%
% function [x, cost, info, options] = conjugategradient(problem)
% function [x, cost, info, options] = conjugategradient(problem, x0)
% function [x, cost, info, options] = conjugategradie... |
a05f51d168fa427102a04defaee5527af1495094f76a969856b6262327e934ef | MATLAB | 16,322 | 500 | function [sFigETO,sETO] = ETO_genGUI(varargin)
%ETO_genGUI Main function for offline eye tracker
% [sFigETO,sETO] = ETO_genGUI(sFigETO,sETO)
%
%Workflow:
%compile list of all video files in subfolders of master path
%list names & parameters from meta file
%list whether preprocessed
%select which to process
%... |
90bfe038b317fff45b22275d5395453b69ed00194949d06aa020ad97a8214463 | MATLAB | 16,430 | 472 | function result = glmnetPredict(object, newx, s, type, exact, offset)
%--------------------------------------------------------------------------
% glmnetPredict.m: make predictions from a "glmnet" object.
%--------------------------------------------------------------------------
%
% DESCRIPTION:
% Similar to othe... |
d33341ad2acfe93500162e83b7cefce25da266bc33b3d2dac360def1f107b2fb | MATLAB | 16,436 | 452 | function plot(obj,param,varargin)
% Visualise properties of the data and microstates
if nargin == 1
param = 'data' ;
end
% Get axis
idx = find(strcmpi(varargin,'ax')) ;
if isempty(idx)
ax = gca ;
else
ax = varargin{idx+1} ;
end
% ensure... |
39b00b55a9251eb9418381c9d5880e3dec6e2a3e21a6bbdb567fa463b5671647 | MATLAB | 16,439 | 462 | function fit = hmmspectramt(data,T,Gamma,options)
%
% Computes nonparametric (multitaper) power, coherence, phase and PDC, with intervals of
% confidence. Also obtains mean and standard deviation of the phases.
% PDC is approximated: From MT cross-spectral density, it obtains the transfer-function
% using the Wilson-Bu... |
71cba97461841607d33e21338fa75e369524b3aaf368298e7f483ac03cd8cdfd | MATLAB | 16,553 | 362 | % Imports EEG dataset, preprocesses it, and extracts brain features
%
% Cristina Gil, TUM, cristina.gil@tum.de, 25.07.2022
clear all; close all;
rng('default'); % For reproducibility - See discussion in https://sccn.ucsd.edu/pipermail/eeglablist/2022/016932.html
% Define the parameters
params = define_para... |
6d7dfe14789f84375abb10b3c50f1dd2153670141941a461ddb5518f24a84e7d | MATLAB | 16,616 | 610 | function zef = zeffiro_interface(args)
%
% zeffiro_interface
%
% This fuction starts Zeffiro Interface. It can be run with a variable number
% of key–value arguments, which can be called as a list of name-value pairs as
% follows:
%
% zef = zeffiro_interface("name_1", value_1, "name_2", value_2, …);
%
% Matlab vers... |
0d60d89a886eb40c28b7a9dd45583f7095f3a0be1c8cae070273c27843eece99 | MATLAB | 16,702 | 440 | function M = fixedrankfactory_tucker_preconditioned(tensor_size, tensor_rank)
% Manifold of fixed multilinear rank tensors in Tucker format.
%
% function M = fixedrankfactory_tucker_preconditioned(tensor_size, tensor_rank)
%
% n1 = tensor_size(1);
% n2 = tensor_size(2);
% n3 = tensor_size(3);
% r1 = tensor_rank(1);
% r... |
788b5295ed1ecb3916ff2f4f65fa5df477eb1586dd47c749ad6d2fdc8f5d721b | MATLAB | 16,720 | 385 | function [cleanEEG] = FORCe( EEGdata, Fs, chanLocs, useAcc )
%
% FORCe
%
% Fully automated and Online artifact Removal for brain-Computer
% interfacing.
%
% First perform hard threhsolding to reject very high amplitude
% channels. Then re-reference, calculate wavelet coeffici... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.