sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
9f010d7bc99d538950099c167f5061a2c65611b1524734e8603e2386e0afb9ac | MATLAB | 18,600 | 462 | function theTable = TS_ReadInputFile(addWhat,inputFile,beVocal)
% TS_ReadInputFile Interpret a structured input file of time series, operations,
% or master operations into an hctsa-style table.
%
%---INPUTS:
% addWhat: 'mops' (for master operations), 'ops' (for operations), or 'ts'
% (... |
59af0205a0c4c027465b2c2310a0a069c1c66f12026dc8729749dcc8f16b8696 | MATLAB | 18,626 | 487 | function plot_brainSlices(params, vals, plotInfo)
% plots topologically colorcoded values 'vals' of channels onto brain slices
% (c) Jiri, Jan17
%% color maps
clrmap.brain = gray(128); % colormap for brain (T1, T2, CT, ...)
if isfield(params.plot_brainTopo, 'colorMap')
clrmap.chnls = par... |
adcd4800e71ddd2f18e3507016d127d0ab9002ebd10ff0ec72eb46f072ff4574 | MATLAB | 18,632 | 261 | function outstr = GE_dumpImageHeader(img)
%
% outstr = GE_dumpImageHeader(img)
%
% Writes the image header to the string outstr
%
% Souheil J. Inati
% Dartmouth College
% May 2000
% souheil.inati@dartmouth.edu
%
outstr = sprintf('im_suid: %s\n', char(img.im_suid));
outstr = strcat(outstr, sprintf('im_uniq: %d... |
369e23b311e0de25a940d7b836b320c9dc5f78fe791efdf1baafb5eec96b32fb | MATLAB | 18,642 | 453 | function ARTwarp_Run_Categorisation(is_cli_mode, network_params, output_folder)
global NET DATA numSamples warpFactorLevel vigilance bias learningRate maxNumCategories maxNumIterations sampleInterval resample
% OBTAINING NETWORK PARAMETERS
% if not running in cli mode, get the network parameters from the gui
% loadi... |
6c5898db7f40a4788f11fb28b48684fbf5155bf59da231aa9bc0df9f57c619fb | MATLAB | 18,644 | 429 | function [h_old,h_new] = vis_artifacts(new,old,varargin)
% vis_artifacts(NewEEG,OldEEG,Options...)
% Display the artifact rejections done by any of the artifact cleaning functions.
%
% Keyboard Shortcuts:
% [n] : display just the new time series
% [o] : display just the old time series
% [b] : display both time s... |
07db85d6580a5997ddb92bd806f1c8a177a19fb7c29d3e3cfce7db98a42e75d3 | MATLAB | 18,645 | 506 | function create_surface_meshes(input_img, numvertices, input_coordsys, ...
output_coordsys)
%
% Input: input_img <string> fullpath to folder, where the results of
% mysegment.m are stored
% numvertices <integer> number of desired mesh ... |
ec2c41af7f1b6f4fd7f43aeabbd6fdef869a5d53adc7d73b38d3bd583df8f13a | MATLAB | 18,764 | 430 | %% h = sepia_handle_panel_utility_get_header(hParent,hFig,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% hFig : handle of the GUI
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h ... |
c9bf8921569ab53b665bfa5ab3b25265097c84706b44317de9ac1e438040bcd3 | MATLAB | 18,777 | 726 | function M = load_image(type, n, options)
% load_image - load benchmark images.
%
% M = load_image(name, n, options);
%
% name can be:
% Synthetic images:
% 'chessboard1', 'chessboard', 'square', 'squareregular', 'disk', 'diskregular', 'quaterdisk', '3contours', 'line',
% 'line_vertical', 'line_horiz... |
cc6954a0ffa6d25b4a74ac131a70ed869560f4776b5051729e9443d6dcf22038 | MATLAB | 18,789 | 422 | %io_loadspec_rda.m
%
%Jay Hennessy, McGill University 2016.
%Heiner N. Raum, UKM Muenster 2024 (adaption of geometry header fields from XA30 to VE).
%
% USAGE:
% [out]=io_loadspec_rda(rda_filename);
%
% DESCRIPTION:
% Reads in siemens rda data (.rda file).
%
% op_loadspec_rda outputs the data in structure fo... |
0d8da66aafd8884cdbf0e16851957424ac1e9b9a91710224aad82d2771bfbe64 | MATLAB | 18,863 | 553 | function [grad, elec] = ctf2grad(hdr, dewar, coilaccuracy, coildeffile)
% CTF2GRAD converts a CTF header to a gradiometer structure that can be understood by
% the FieldTrip low-level forward and inverse routines. The fieldtrip/fileio
% read_header function can use three different implementations of the low-level code... |
3c4909910cfca033e056622ad295d21cc4c4c5e3fb1da8b0250f8391b2a3a82a | MATLAB | 18,888 | 456 | % pop_loadbv() - load Brain Vision Data Exchange format dataset and
% return EEGLAB EEG structure
%
% Usage:
% >> [EEG, com] = pop_loadbv; % pop-up window mode
% >> [EEG, com] = pop_loadbv(path, hdrfile);
% >> [EEG, com] = pop_loadbv(path, hdrfile, srange);
% >> [EEG, com] = pop_loadbv(path, hdrf... |
8a63a6e4b7fa5cd723bc88c44e0532a7a87343c7428147dde9f2bee7a8540443 | MATLAB | 18,893 | 457 | function TOL_fig_dawson1972(config,params,dat)
% TOL_fig_dawson1972, figure of Dawson (1972) results and apparatus
% Figure S10 for: Duvelle and Grieves (2026) Tolman's Sunburst Maze 80
% years on: A meta-analysis reveals poor replicability and little evidence for
% shortcutting. European Journal of Neuroscience. DO... |
2bf1028c222b35e08a85bb40b9653413f1e7b6fb8e71def3ca40c91b787f5034 | MATLAB | 18,918 | 458 | function out = NL_Dimensions(y, numBins, embedParams)
% NL_Dimensions Box counting, information, and correlation dimension of a time series.
%
% Computes the box counting (D0) and correlation (D2) dimension of a
% time-delay embedded time series across a range of embedding dimensions,
% using TISEAN's 'boxcount' (Renyi... |
fd4b632207034f8d8cceb93e1ba01ae0ea8e9898d7497e438d0ecef34285d902 | MATLAB | 18,931 | 417 | % compare_groundtruth_vs_glm_full.m
% Complete comparison between ground-truth A (sheet 'A') and GLM result b1_CV1
% Computes: AUPRC, AUROC (pos/neg), Pearson r (pos/neg/overall), MAE, RMSE,
% sign accuracy, density, SHD, signed-SHD, weight correlations, and bootstrap CIs (optional).
%
% USAGE:
% - Edit the filename c... |
b027ad5537ca0dec4b6d56da6f86c9673417b20a961ff1a5ad1f556136a29fb9 | MATLAB | 19,006 | 414 | function out = osp_plotLoad(MRSCont, kk, which,ExpIndex, VoxelIndex, stag, ppmmin, ppmmax, xlab, ylab, figTitle)
%% out = osp_plotLoad(MRSCont, kk, which, VoxelIndex, stag, ppmmin, ppmmax, xlab, ylab, figTitle)
% Creates a figure showing raw data stored in an Osprey data container,
% ie in the raw fields. This func... |
b02c6ec3f45faf7a1446defd00afce33dccb8145d64305551ebe131572e7b912 | MATLAB | 19,010 | 444 | % STD_EDITSET - modify a STUDY set structure.
%
% Usage:
% >> [STUDY, ALLEEG] = std_editset(STUDY, ALLEEG, key1, val1, ...);
% Inputs:
% STUDY - EEGLAB STUDY set
% ALLEEG - vector of the EEG datasets included in the STUDY structure
%
% Optional inputs:
% 'commands' - {cell_array} change S... |
b89ebb069cd433e9200e9248e552646924e4e9a6050a23d0ef7c8017a4f576ae | MATLAB | 19,039 | 357 | % POP_NEWTIMEF - Returns estimates and plots of event-related (log) spectral
% perturbation (ERSP) and inter-trial coherence (ITC) phenomena
% timelocked to a set of single-channel input epochs
%
% Usage:
% >> pop_newtimef(EEG, typeplot); % pop_up window
% >> pop_newtimef(EEG, typeplo... |
2facb6fa875a1ae84c034598a178d09ed70a9b3bf96e6169425455e78d9727d8 | MATLAB | 19,067 | 455 | % POP_FILEIO - import data files into EEGLAB using FileIO
%
% Usage:
% >> OUTEEG = pop_fileio; % pop up window
% >> OUTEEG = pop_fileio( filename );
% >> OUTEEG = pop_fileio( header, dat, evt );
%
% Inputs:
% filename - [string] file name
% header - fieldtrip data header
% data - fieldtrip raw data
... |
85dd1f603c852aa65432d54cfac9ac798480f2206308ac9868e9781fdbd39bb0 | MATLAB | 19,102 | 373 | function plot_functional_connectivity
close all
clear all
clc
% Plot functional connectivity.
% Select a folder containing data.
folder_name = uigetdir;
cd(folder_name)
% Control.
load('activity_iti_control.mat')
activity_iti = activity_iti_control;
clear activity_iti_control
% Initialize.
mean_region_by_region_fun... |
47bc429f90bc85fa6fcb9c940bf729499c67de3e5ccd667864d36382b6c3b269 | MATLAB | 19,132 | 436 | function [featureVector,calcTimes,calcQuality] = TS_CalculateFeatureVector(tsStruct,doParallel,Operations,MasterOperations,codeSpecial,howVocal,beVerbose)
% TS_CalculateFeatureVector Compute a feature vector from an input time series
%
%---INPUTS:
% tsStruct, either (i) a vector of time-series data to compute
% or ... |
3a3195365df41a9c6e83e09d8f70836189e61cffe2dc4208f33ddc2a6894d74d | MATLAB | 19,153 | 611 | function [net, stats] = cnn_train(net, imdb, getBatch, varargin)
%CNN_TRAIN An example implementation of SGD for training CNNs
% CNN_TRAIN() is an example learner implementing stochastic
% gradient descent with momentum to train a CNN. It can be used
% with different datasets and tasks by providing a suitable... |
e2792d15ea30ccd42fa5a98969888f6a2834dcd355c3adc46955259d8d70f1ea | MATLAB | 19,165 | 438 | classdef MrDimInfo < MrCopyData
% Holds all dimensionality info (r.g. range/dimLabels/units) of multidimensional data
%
% See also demo_dim_info MrImage.select
% Author: Saskia Bollmann & Lars Kasper
% Created: 2016-01-23
% Copyright (C) 2016 Institute for Biomedical Engineering
% ... |
92d072b37aa395ab7fae69868287da900d9a49c71fc03907e07be69731bbf104 | MATLAB | 19,187 | 484 | function Hash = DataHash(Data, Opt)
% DATAHASH - Checksum for Matlab array of any type
% This function creates a hash value for an input of any type. The type and
% dimensions of the input are considered as default, such that UINT8([0,0]) and
% UINT16(0) have different hash values. Nested STRUCTs and CELLs are parsed
%... |
9a0a4f0a2a30f2f284a6bfbebd5002e3328e4983a3b91b851216fc824f194523 | MATLAB | 19,223 | 587 | function varargout = Setting(varargin)
% SETTING MATLAB code for Setting.fig
% SETTING, by itself, creates a new SETTING or raises the existing
% singleton*.
%
% H = SETTING returns the handle to a new SETTING or the handle to
% the existing singleton*.
%
% SETTING('CALLBACK',hObject,eventData,... |
a4ce72f88190c074be9803dc805a1a6042155fca46dd7c90a24cb8f1d98841a5 | MATLAB | 19,247 | 435 | % IMPORTEVENT - Import experimental events from data file or Matlab
% array into a structure.
%
% Usage: >> eventstruct = importevent( event, oldevent, srate);
% >> eventstruct = importevent( event, oldevent, srate, 'key1', 'value1', ...);
%
% Input:
% event - [ 'filename'|array ] Filename ... |
7ec3b02bb7b0d0a76b632478ad557ff31f916cb3e3e19961f2b3d8f7e960fea2 | MATLAB | 19,278 | 466 | % POP_TOPOPLOT - Plot scalp map(s) in a figure window. If number of input
% arguments is less than 3, pop up an interactive query window.
% Makes (possibly repeated) calls to TOPOPLOT.
%
% If field 'EEG.chanmatrix' exists, will use the TOPOPLOT 'plotgrid' option
% ... |
59ac1199b00212d22bd1cd50441d49b30ab9646c1e6163fe4246ef18b66e1a3d | MATLAB | 19,290 | 622 |
clc
clear all
clc
%% CHANGE THIS FOR STIM LOCKED DATA !!!
%%
% Define the path to the folder containing CSV files
csvFolderPath = 'E:\Joint_Perception\Joint_Perception\preprocessed_pupil_responselocked';
% Get a list of all CSV files in the folder
csvFiles = dir(fullfile(csvFolderPath, '*.csv'));
... |
412c5fb7dc2d221ddc09e004a0187948cd68d8e73599685c27879672f3bbb6e2 | MATLAB | 19,322 | 469 | function SuppFigure_Broad_InDegree(varargin)
%SUPPFIGURE_BROAD_INDEGREE Generate supplementary figure for broad in-degree analysis
%
% Purpose:
% Creates a figure analyzing the effects of broad in-degree distributions
% on network dynamics, including in-degree distributions, balance indices,
% normalization distr... |
6b3fef63228bb93ae922c66c48963e5ae50b5b2deed3aa675812e2441144d137 | MATLAB | 19,375 | 624 |
clc
clear all
clc
%% CHANGE THIS FOR ResponseLOCKED DATA !!!
%
% %%
% % Define the path to the folder containing CSV files
% csvFolderPath = 'E:\Joint_Perception\Joint_Perception\preprocessed_pupil_stimlocked';
%
% % Get a list of all CSV files in the folder
% csvFiles = dir(fullfile(csvFolderPath,... |
f38e287dcead1d3be44c70fa3cf8fb5eeaa040bc01a21ca0a5725c139b6e0241 | MATLAB | 19,384 | 419 | % pop_dipfit_nonlinear() - interactively do dipole fit of selected ICA components
%
% Usage:
% >> EEGOUT = pop_dipfit_nonlinear( EEGIN )
%
% Inputs:
% EEGIN input dataset
%
% Outputs:
% EEGOUT output dataset
%
% Author: Robert Oostenveld, SMI/FCDC, Nijmegen 2003
% Arnaud Delorme, SCCN, La Jolla... |
845b44806ba57c8e5309019ada392acbd3573918144cf8f103df08f30a4cf3f0 | MATLAB | 19,416 | 441 | % MRI3DPLOT - plot 3-D density image translucently on top of the mean MR
% brain image used in DIPPLOT. Plot brain slices in directions
% 'top' (axial), or 'side' (sagittal), or 'rear' (coronal).
% Creates a new FIGURE. Smoothing uses Matlab SMOOTH3
% Usage:
% >> [smoothe... |
e7811ceb0b71ad1fcf08ea75c5fa698b9318e5bae2272b522fc47aad4cc1ebc4 | MATLAB | 19,426 | 627 | function [] = PlotNetMetOrganoid(ExpName)
% plot network metrics for organoid data
% author RCFeord September 2020
%% colours
% c1 = [0.027 0.306 0.659]; % dark blue
% c2 = [0.306 0.745 0.933]; % light blue
% c3 = [0.471 0.674 0.188]; % green
% c4 = [0.929 0.694 0.122]; % yellow
c1 = [0.996 0.670 0.318];
c2 = [0.... |
0c6537d09e24eff41fe4a48b30211bf3f82d292e9022b0f67e2bd1942e6354ab | MATLAB | 19,429 | 459 | % POP_EPOCH - Convert a continuous EEG dataset to epoched data by extracting
% data epochs time locked to specified event types or event indices.
% May also sub-epoch an already epoched dataset (if sub-epochs are
% same size or smaller). This pop_function calls EPOCH.
% Usage... |
39dd912f18d4e02aff8a0d6ffb37ad8b9b6d982e6f0b58660e8745b9dab3d555 | MATLAB | 19,439 | 470 | function [map,num,typ,scheme] = brewermap(N,scheme) %#ok<*ISMAT>
% The complete selection of ColorBrewer colorschemes (RGB colormaps).
%
% (c) 2014-2020 Stephen Cobeldick
%
% Returns any RGB colormap from the ColorBrewer colorschemes, especially
% intended for mapping and plots with attractive, distinguishable co... |
506e3d789e12860173fc7b6bc68843191b1ad57cbd684bd21e2c527e39d128e8 | MATLAB | 19,454 | 539 | % data directory names
dirs = { ...
'DATECENSORED-CVNS001-readingF001'
'DATECENSORED-CVNS001-readingF002'
'DATECENSORED-CVNS001-readingF003'
'DATECENSORED-CVNS001-readingF004'
'DATECENSORED-CVNS001-readingF005'
'DATECENSORED-CVNS001-readingF006'
'DATECENSORED-NSD139-prffloc' % session 1
'DATECENSORED-NSD149-prffloc'
'... |
14e53d8d6e13c78eef008a271d6b809f16a4b82bf174155e37292bddcbf53aa3 | MATLAB | 19,477 | 631 | //========================================================================
// GLFW 3.4 macOS - www.glfw.org
//------------------------------------------------------------------------
// Copyright (c) 2002-2006 Marcus Geelnard
// Copyright (c) 2006-2019 Camilla Löwy <elmindreda@glfw.org>
//
// This software is provided ... |
7ea6270878c629e11bdf72c2eed509e340238f173fe59d7e83fbdf402edca2c7 | MATLAB | 19,482 | 680 | % most likely or 2nd likely block, using all data, not just mixed block as most likely
%% load code and data
%location of analysis codebase
codepath = '~/projects/constantinoplelab/Analysis/';
% add code paths
addpath(genpath(codepath))
addpath(genpath(codepath + "david"))
addpath(genpath(codepath + "maggie"))
datap... |
951dc1e1f19438c94fdb8acf5828885c1431255aad8478be98e2202fd43e800d | MATLAB | 19,498 | 662 | % builds the null distribution of trial shuffles for the regression
%% load code data
%location of analysis codebase
codepath = '~/projects/constantinoplelab/Analysis/';
% add code paths
addpath(genpath(codepath))
addpath(genpath(codepath + "david"))
addpath(genpath(codepath + "maggie"))
datapath = "/Users/dhocker/p... |
5c3b70bbb70d754ee2da6624ab9781c413bce0e5dc17b7bbc766231622b0c5a7 | MATLAB | 19,506 | 373 | set_up_paths_and_data_directories;
stim_names = {
'After_The_Rain', 'Between_Viewings', 'Big_Buck_Bunny', 'Chatter', 'Damaged_Kung_Fu', ...
'First_Bite', 'Lesson_Learned', 'Payload', 'Riding_The_Rails', 'Sintel', 'Spaceman', ...
'Superhero', 'Tears_of_Steel', 'The_secret_number', 'To_Claire_From_Sonny', 'You_Again'
};... |
ed814da59b3bbfb061d52e279d1479efcec103e76ad2b166e4812f696c774c0c | MATLAB | 19,514 | 699 | function [U,B_k,V,p,ierr,work] = lanbpro(varargin)
%LANBPRO Lanczos bidiagonalization with partial reorthogonalization.
% LANBPRO computes the Lanczos bidiagonalization of a real
% matrix using the with partial reorthogonalization.
%
% [U_k,B_k,V_k,R,ierr,work] = LANBPRO(A,K,R0,OPTIONS,U_old,B_old,V_old)
% ... |
19c71539ad39a0e82b2563949d61905b7ee0844ff12fb5c09ac7fde94c91c192 | MATLAB | 19,522 | 361 | % 1. read two csv files, one for attack start times and another for attack stop times (e.g. manually labelled from video )
% - these timestamps are relative to the begining of the video and TDT recording
% 2. read TDT mat files to get photostim times relative to the attack times
% 3. quantify the number of attacks... |
3d77d45ce574082202cbb0df372f767fa3197e98761efe4aa6c6c7b20395eebe | MATLAB | 19,541 | 459 | function [estimations,actual,errors,average] = ReconstructPosition(positions,spikes,windows,varargin)
% Bayesian reconstruction of positions from spike trains.
%
% Instantaneous positions are reconstructed using a Bayesian algorithm.
% Instantaneous population firing rates can be estimated either over fixed time
% win... |
351ea9d1411d5e35d501e1a3aa0b88d065180e69c5fbf7699f5a400b39bcfcdf | MATLAB | 19,579 | 312 | %% trigger analysis: SWITCH-EI
% class 1: switching: E -> I
% class 2: switching: I -> E
% (c) Jiri, May20
%% specify analysis to be performed -> runner
runner = struct;
runner.newJobs = false; % set to 'false' if the results are already computed
runner.newFDR = false; % true = updates the FDR correction over all pat... |
8d741b31adf5d871374219428cde6283a63eadbe5f0c9a3bd22c697853471e4e | MATLAB | 19,583 | 530 | % correlation vs. distance
load('pooldata_SinGrat.mat')
Dir = [0, 135, 270, 45, 180, 315, 90, 225];
[DirSort, DirInd] = sort(Dir);
stimPara = ...
[8 0.16;
2 0.02;
8 0.02;
1 0.02;
1 0.16;
2 0.16;
8 0.04;
2 0.04;
1 0.04];
[stimsort, stimInd] = sortrows(stimPara, [1 2]);
TmFreq = stimsort(:,1);
SpFreq = stimsort(:,2)... |
495553ff22e2a5e6ec120ba2aaa067bb48efed2c0b799500e2ec135f16a91114 | MATLAB | 19,607 | 436 | clear all;
close all;
clc;
ForderName=['PAG/BadMood'];
Monkey_name='all'; % 'c' 'k' 'all'
Num_context=4;
Num_probability=3;
kernH=10;
POP_foldapath=['POP_Neuron/PavFo4C4S/PAV/',ForderName];
POP_allfolda=dir([POP_foldapath,'/*.mat']);
load(['Labnote/Labnote.mat']);
load(['Labnote/Labnote_RAW.mat']);
u=1;
for POP_i=1:... |
1ac118e551f8c7703d138d7ac441e295748ce25885e8cbd604f8d1fd49c20c16 | MATLAB | 19,640 | 404 | % STD_MAKEDESIGN - create a new or edit an existing STUDY.design by
% selecting specific factors to include in subsequent
% 1x2 or 2x2 STUDY measures and statistical computations
% for this design. A STUDY may have many factors
% (task or s... |
ddcb99370562aa279f1ff6ca6031bee5d91f10d4b85c48e51d7c7f479be4241a | MATLAB | 19,656 | 746 | function coactPaper_figureS13()
labelWeight=true;
labelCase=false;
labelSize=9;
letGapX=5;
letGapY=6;
fontsize=6;
close all
fh=initFig('width',18.6,'height',12,'font','Arial','fontsize',fontsize);
x=4;y=7;
panel_01(x,y,fontsize);
panelLetter2(x-letGapX+2,y-letGapY+0,alphabet(1,labelCase),'fontSize',labelSize,'isBold'... |
7ec643c325c98875cb6dea17972dd17dd8f58e37593ec107344de09923e79945 | MATLAB | 19,710 | 390 | function [EEG,HP,BUR,removed_channels] = 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 fro... |
e346856ef0dc2bca60ee702ec81a58884b6bfe83951d61d10589c24d92219d9e | MATLAB | 19,710 | 573 | %[out,out_w]=io_loadspec_data(filename,subspecs,kk,statFile);
%
% USAGE:
% [out,out_w]=io_loadspec_data(ffilename,subspecs,kk,statFile);
%
% DESCRIPTION:
% Reads in philips MRS data (.data and .list files) using code adapted from
% PhilipsRead_data.m, provided as part of the Gannet software package by
% Richard Edde... |
9030021beee383dfc8d02c3ad42f17fd6e6424a3a85c32241e0bccd485ddfb5b | MATLAB | 19,737 | 489 | % ICADEMO - a sample ICA analysis script using the ICA/ERP package
% of Matlab functions distributed via
% http://www.sccn.ucsd.edu/eeglab
%
% Notes:
% Reads ascii ERP data file: pnas.adt
% Reads example ascii ERP data files: chan.nam chan14.locs (=chan_locs)
%
% Author: Scot... |
b882fb4cf900c480a847079325f0aac3b162d4077285c100b9520eb2b9d1bf0d | MATLAB | 19,751 | 500 | function [center, Cn, PNR] = initComponents_parallel(obj, K, frame_range, save_avi, use_parallel, use_prev)
%% initializing spatial/temporal components for calcium imaging data
%% input:
% K: scalar, maximum number of neurons
% frame_range: 1 X 2 vector indicating the starting and ending frames
% save_avi: save ... |
23c50c4f292aa5bf5e6c52ea4af45b408c9b984df83d87ef20d1efcdefb8b32f | MATLAB | 19,782 | 555 | % figure4_decoding_correlation_plot.m - Plot beta-decoding correlations
%
% This script loads pre-calculated decoding and beta power data and
% generates Figure 4 from the paper, showing the relationship between
% beta power and memory decoding fidelity.
%
% KEY FINDING:
% Lower beta power (greater desynchronization)... |
6d312521007bfaa33f68188ebe7aa11ee64bbfe4ca5f1f1f06c5a91a71cea47f | MATLAB | 19,811 | 553 | function [imagePoints, boardSize, imageIdx, userCanceled] = detectCheckerboardPointsPar(I, varargin)
% detectCheckerboardPoints Detect a checkerboard pattern in images
% detectCheckerboardPoints can detect the keypoints of a checkerboard
% calibration pattern in a single image, a set of images, or stereo image
% ... |
a830c7ba95d23feb20f6dcf3170a65e83992801a1ab66c46bf865a044f5c014f | MATLAB | 19,901 | 652 | function [cs] = NewCs(Name, win, p1, p2, p3, p4, p5)
%
% [cs] = NewCs (Name, Con, P1, P2)
%
%Purpose:
% Create a command structure for passing to TellAfni
%
%
%Input Parameters:
% Name: Name of command, see AFNI's README.driver for all possibilities
% Example: SET_THRESHOLD
% To see a list of comm... |
9960657b7aa95aa4d1ac45176ccc6e32f6e60c79442584bdea33244465af0086 | MATLAB | 19,981 | 462 | % STD_READFILE - Read data file containing STUDY measures.
%
% Usage:
% >> [data param range1 range2] = std_readfile(filename, 'key', val);
%
% Inputs:
% filename - [string] read specific file, for instance 's1.daterp'
% containing ERP data for dataset "s1.set". It is also
% possibl... |
c9fccd226b69cb91b3f55fa926e467d38be83270bc41e01c2c9f2020c6701b32 | MATLAB | 19,997 | 416 | %% HGF Toolbox Demo
%% Load binary input
% First, we will load the example binary inputs $u$ provided in the file example_binary_input.txt:
u = load('example_binary_input.txt');
%%
% The inputs are simply a time series of 320 0s and 1s. This is the input sequence
% used in the task of Iglesias et al. (2013), _Neuron... |
2629b6a88c52331ada332a8b3ccad0a8710b681d4d22c1cbecc72e69cc7e8682 | MATLAB | 20,042 | 511 | function [map,num,typ,scheme] = brewermap(N,scheme) %#ok<*ISMAT>
% The complete selection of ColorBrewer colorschemes/palettes (RGB colormaps).
%
% (c) 2014-2022 Stephen Cobeldick
%
% Returns any RGB colormap from the ColorBrewer colorschemes, especially
% intended for mapping and plots with attractive, distingui... |
bfdccae38f299df2c39af8181932fc53d3102f0cc9840aeaa4c5d9b5f8dba9dd | MATLAB | 20,049 | 474 | function out = MF_GARCHfit(y, preproc, P, Q, randomSeed, modelType, innovationDist)
% MF_GARCHfit GARCH time-series modeling.
%
% Simulates a procedure for fitting Generalized Autoregressive Conditional
% Heteroskedasticity (GARCH) models to a time series, namely:
%
% (1) Preprocessing the data to remove strong trend... |
1daeeed0eb2b94526313363fa3c83338448106c7d7e7a280f73a5589d257ba84 | MATLAB | 20,068 | 685 | function t = anova2D(y,group)
if (size(y,1)==1), y=y(:); end
group = group(:);
ng = length(group);
% Calling sequence with named arguments
model = 1; %1: 'linear'
sstype = 2;
varnames = cellstr([repmat('X',ng,1) strjust(num2str((1:ng)'),'left')]);
display = 'off';
alpha = 0.05;
okargs = {'random' ... |
aaa9d67e1b0d7250e4d6963ccd1a8617e72bc08ffae9eda1895044fd4d4b4038 | MATLAB | 20,098 | 581 | % verifyStimuli
% Verifies the textures by computing the power spectrum.
% Plots power spectra and textures, and saves the figures.
% Can also generate and save the textures if they do not exist.
%
% Syntax
% verifyStimuli()
%
% Input Arguments
% None
% Output Arguments
% None
function verifyStimuli()
%% ... |
cd460027f356444d1ae839ae30d601215fa49b189e0f02f6b49899c0e85c325c | MATLAB | 20,115 | 490 | function [physio, R, ons_secs] = tapas_physio_main_create_regressors(varargin)
% Main Toolbox Function for preprocessing & modelling from physio-structure
%
% [physio_out, R, ons_secs] = tapas_physio_main_create_regressors(physio)
%
% OR
%
% [physio_out, R, ons_secs] = tapas_physio_main_create_regressors(...
% log... |
8fa4f7e41332a6f1e81ad141663793197853a77d1e5e9033a95a00fe145aee29 | MATLAB | 20,143 | 588 | function handles = plotSpread(varargin)
%PLOTSPREAD plots distributions of points by spreading them around the y-axis
%
% SYNOPSIS: handles = plotSpread(data,binWidth,spreadFcn,xNames,showMM,xValues)
% handles = plotSpread(ah,...)
%
% INPUT data: cell array of distributions or nDatapoints-by-mDistributions
% ... |
32fee9d0676290068a40212c4958a0fd7c67d65effff6467fb2a9392b23f29da | MATLAB | 20,183 | 521 | % compare_groundTruth_vs_aa1_lassoglm_1x_ALLy_zScore.m
% Compare predicted coefficient outputs from aa1_lassoglm against ground-truth.
% Parallelized over metric files produced by aa1_lassoglm_1y_ALLx_zScore.
%
% Optional in base workspace before calling:
% seedList = [42 101]; % process only these seeds
% seedv... |
b7a9a6893f820809fddeb967f4f7f25e4b4119f99b512d9e11d2c30f98e21cdf | MATLAB | 20,267 | 531 | function save(this,filename,encoding)
% Save GIfTI object in a GIfTI format file
% FORMAT save(this,filename)
% this - GIfTI object
% filename - name of GIfTI file that will be created
% encoding - optional argument to specify encoding format, among
% ASCII, Base64Binary, GZipBase64Binary, ExternalFi... |
f11d29c37ffa5af42f1fc3223991faaef53dc36d573638f847d8de3a19a06d98 | MATLAB | 20,301 | 535 | function [ P,x_positions,y_pos,stats,mult_stats,tbl] = scatter_cmp_conditions(values,plot_name,subplot,input_color_lut,varargin)
% scatter plot of fields in values
% inputs: values,plot_name,subplot,input_color_lut,varargin
% value.fields are row vectors
% TO DO: compare more than 2 fields
mult_stats = []; tbl = [... |
4440aa7bda6a3ec18a5daee8a4677517be07f447709ccc3807d47f378904b3c4 | MATLAB | 20,432 | 366 | set_up_paths_and_data_directories;
stim_names = {
'After_The_Rain', 'Between_Viewings', 'Big_Buck_Bunny', 'Chatter', 'Damaged_Kung_Fu', ...
'First_Bite', 'Lesson_Learned', 'Payload', 'Riding_The_Rails', 'Sintel', 'Spaceman', ...
'Superhero', 'Tears_of_Steel', 'The_secret_number', 'To_Claire_From_Sonny', 'You_Again'
};... |
09a671f20efcce5be20b00602d3e623d5a753b9c082835ca8a680b546c3dfd71 | MATLAB | 20,472 | 565 | % This script loads pre-calculated behavioral data and generates Figure 1
% from the paper, showing:
% - Psychometric curves with swap error modeling
% - Precision, guess rate, and swap rate by trial type
% - Regression coefficients for item distance and congruency
% - Item distance effects on accuracy and... |
8038bf3a9da4c80bfb76f89766b840f19f7697226b5af7aff67da2dfb2418f94 | MATLAB | 20,491 | 498 | %% ms SEI fig: funct6ional & effective connectivity - 3D brains + PLV + DTF
% "final" figure, v5 :o0
% works for two NN: DMN & DAN
% FIGURE 1
% - 3D brains - sel. chnls
% FIGURE 2
% cols = FBs (delta, ..., hiGamma)
% rows =
% - PLV
% - DTF: DMN -> DAN
% - DTF: DAN -> DMN
% jobs:
% - DTF = msSEI_FC_MVARv2_job ... |
76ce742ef923571fd814908d4f70ba2d282751424872760e2c27aa28298987fc | MATLAB | 20,616 | 388 | function Params = getParamsFromApp(app)
% Sets the parameters from GUI input
% INPUT
% app : app object
% MEA-NAP GUI application object
% OUTPUT
% Params : struct
% Parameters for running MEA-NAP
Params.HomeDir = app.MEANAPFolderEditField.Value;
Params.outputDataFolder = app.OutputDataFolderEditField.V... |
5f4141eb4bfac64da9c09499e4018df958bdb45d8548eb33106ad6a913100fad | MATLAB | 20,624 | 659 | function [ subject, data ] = nmri_artifactrejection(subject, data, params)
%[ subject, data ] = nmri_artifactrejection(subject, data, params)
%
% This function will do visual artifact on one subject
% it requieres user interaction / presenece
%
% subject = subject structure, see nmri_read_subject
% ... |
7362dc67a6c786024088b4b4324fbe2d707bba7de47163c396e806290f70a8bc | MATLAB | 20,646 | 547 | % CROSSF - Returns estimates and plot of event-related coherence (ERC) changes
% between data from two input channels. The lower panel gives the
% coherent phase difference between the processes. In this panel, for Ex.
% -90 degrees (blue) means xdata leads ydata by a quarter cycle.
... |
15fe3767373a9870ac3b4ce368400ae74f7ec8ccc022a30f68fec522994f69f9 | MATLAB | 20,659 | 408 | function varargout = apxState(cov,varargin)
% apxSparse - Covariance function for state space representations.
%
% This is a special covariance function which handles some non-standard
% requirements of sparse covariances
%
% [1] Solin, Sarkka, Explicit link between periodic covariance functions and
% sta... |
a96c997f6010b8b197b32eeb6e86fbf9e06c63c5486df2dac48a988fa56e4ca8 | MATLAB | 20,700 | 587 | function glm_nsd(ppdir,ppdirname,designfile,hrfbasisfile,tr,glmdirname,hrfmanifoldfile)
glmdir = regexprep(ppdir,'ppdata',glmdirname);
mkdirquiet(glmdir);
%%%%% LOAD
% define
stimdur = 3;
% figure out runs
files0 = matchfiles(sprintf('%s/%s/run*.nii',ppdir,ppdirname));
if length(files0)==14
files0 = files0(2:end-... |
f0e65a3ef71ed6f75f42ca75a14838aeb7b0c9617333babb34f589cc7617630c | MATLAB | 20,719 | 620 | //========================================================================
// GLFW 3.4 macOS - www.glfw.org
//------------------------------------------------------------------------
// Copyright (c) 2009-2019 Camilla Löwy <elmindreda@glfw.org>
//
// This software is provided 'as-is', without any express or implied
// ... |
fa454177981785a67059912845d3a99fd36c62f408d3fac4534f72f514fefc1d | MATLAB | 20,719 | 385 | function [MRSCont] = osp_fitMEGA(MRSCont)
%% [MRSCont] = osp_fitMEGA(MRSCont)
% This function performs spectral fitting of MEGA-edited MRS data.
%
% USAGE:
% [MRSCont] = osp_fitMEGA(MRSCont);
%
% INPUTS:
% MRSCont = Osprey MRS data container.
%
% OUTPUTS:
% MRSCont = Osprey MRS data co... |
84600104e5b50ddc9fb7b32b96f90ca7013496c16d9b94fcb3bd8ab720c8434d | MATLAB | 20,757 | 423 | % POP_CLUST - select and run a clustering algorithm on components from an EEGLAB STUDY
% structure of EEG datasets. Clustering data should be prepared beforehand using
% POP_PRECLUST and/or STD_PRECLUST. The number of clusters must be
% specified in advance. If called in gui ... |
677756f69651927bcbae40b362bb3535fe0291cda07acb20c0e29015c259da6f | MATLAB | 20,760 | 580 | % PLOTDATA - plot concatenated multichannel data epochs in two-column format
%
% Usage: >> plotdata(data)
% >> plotdata(data,frames)
% >> plotdata(data,frames,limits,title,channames,colors,rtitle,ydir)
%
% Necessary input:
% data = data consisting of consecutive epochs of (chans,frames)
%
... |
d15b576221dc9dcfd5d5ef81f26564423baef1481e2b9fe6ca59f33be6dd6d14 | MATLAB | 20,765 | 416 | classdef McsCutoutSegment < McsHDF5.McsSegmentStream
% Holds the contents of a SegmentStream with spike data
%
% Important fields:
% SegmentData - (1xn) cell array, each cell holding either arrays of
% (samples x segments) values, where 'samples' is the
% time r... |
e27b2aa8a5005c127d57d2de2617c98be169c18dd135d0401806f14d9b78ebfc | MATLAB | 20,774 | 427 | function explore_twopass_masking(varargin)
%% explore_twopass_masking('outputRoot', '/path/to/scratch')
%
% Description: exploratory (not a matlab.unittest / not run in CI) script
% that validates SEPIA's two-pass masking feature on real in-vivo data, and
% sweeps the Magnitude Gradient Field (MGF) two-pass strategy's ... |
f764798f9e024807cbf7529f470373ba13fa04207738be7b79315ae7cfff28fd | MATLAB | 20,873 | 560 | function varargout = bcg_correction_tool_ui(varargin)
% BCG_CORRECTION_TOOL_UI MATLAB code for bcg_correction_tool_ui.fig
% BCG_CORRECTION_TOOL_UI, by itself, creates a new BCG_CORRECTION_TOOL_UI or raises the existing
% singleton*.
%
% H = BCG_CORRECTION_TOOL_UI returns the handle to a new BCG_CORRECTIO... |
63f5604a1c97bff068cfccbb147ebff502597e8c0121176b080ccda9df812fad | MATLAB | 20,892 | 485 | %
%
% Tor Wager & Brencho
%
% Thanks to Tom Nichols for the excellent GUI shell!
%-----------------------------functions-called------------------------
%
%-----------------------------functions-called------------------------
function varargout = Meta_Analysis_gui(Action,varargin)
% global variables we need for th... |
377018dda2caf1629f1c58c87231368a53cdf0e84af8859c4327a4e3ce87414d | MATLAB | 20,898 | 598 | % figure2_tf_switch_plot.m - Plot time-frequency power: Switch vs. Repeat
%
% This script loads pre-calculated TF power data and generates Figure 2
% from the paper, showing oscillatory power differences between switch
% and repeat trials.
%
% KEY FINDING:
% Switch trials show:
% - Decreased beta power (15-25Hz) at... |
10dbede4f5d8a23c415c5f285d3cab4feeca15bb90a95a18c5cb910698ef0119 | MATLAB | 20,902 | 634 | function [net, stats] = cnn_train_Cones(net, imdb, getBatch, varargin)
%CNN_TRAIN An example implementation of SGD for training CNNs
% CNN_TRAIN() is an example learner implementing stochastic
% gradient descent with momentum to train a CNN. It can be used
% with different datasets and tasks by providing ... |
2c72e2d714bed177082b6a5795a3cd32eebb689c85630a26e27a0e0a3a253854 | MATLAB | 20,932 | 471 | function [pro_DA_binned, est_DA_binned, met_DA_binned, di_DA_binned,...
RPEbins_equallyspaced] =...
DA_by_RPE_estrous(ratlist, Pstruct, Bstruct,...
Proestrus_alphas, Estrus_alphas, Metestrus_alphas, Diestrus_alphas,...
pro_ratList, est_ratList, met_ratList, di_ratList,...
numbins, window, event)
%%%... |
cd1e90afd8c40aa6aa791d79a2e6e546953c9719b7b31f29cc51f9239a32816b | MATLAB | 21,004 | 447 | % POP_REREF - Convert an EEG dataset to average reference or to a
% new common reference channel (or channels). Calls REREF.
% Usage:
% >> EEGOUT = pop_reref( EEG ); % pop up interactive window
% >> EEGOUT = pop_reref( EEG, ref, 'key', 'val' ...);
%
% Graphic interface:
% "Compute average re... |
3aad91d646e7de5bba1806f0fe4f54c14aeb75346478a07ac7bcb9efe64f1653 | MATLAB | 21,013 | 433 | % POP_IMPORTEPOCH - Export epoch and/or epoch event information to the event
% structure array of an EEG dataset. If the dataset is
% the only input, a window pops up to ask for the relevant
% parameter values.
% Usage:
% >> EEGOUT = pop_importepoch( EEG ... |
9525038e669f76a21d5807d66bf52106926f631b520da1157de8bd841f24eb5d | MATLAB | 21,027 | 569 | function [err, ErrMessage, Info] = WriteBrik (M, Info, Opt)
%
% [err, ErrMessage, Info] = WriteBrik (M, Info, Opt)
%
%Purpose:
%
% Writes a data vector or matrix in AFNI's format
% Also write data in AFNI's 1D file format,
% and some support for NIML format (Thanks to NNO's efforts)
%
%Input Parameters:
% ... |
f02db319784e7448b5b840d78dea73026d948eae3ce59e82e5c9d811dbf0f778 | MATLAB | 21,044 | 623 | % Analyses of the EMPRISE data set
% by Joram Soch <soch@cbs.mpg.de>
clear
%%% BayespRF empirical analysis, 2023-08-24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % set subject and session
% subj_id = 'EDY7';
% sess_id = 'visual';
%
% % estimate first-level GLM
% create_onset_files(subj_id, sess_id, 0);
% create_mult_regs(s... |
d5c2bb41014a2594b33b164c982a0c345b22ae1fb4f931dd18198864b0a2af26 | MATLAB | 21,053 | 511 | function diagnostics(ALLEEG,type)
% diagnostics(ALLEEG,type) - Creates figures to aid user in understanding
% the generated marks, and the overal quality of the data.
%
% Required Inputs:
% ALLEEG = the ALLEEG structure resulting from loading single or multiple
% eeg *.set files.
% type = 'single' o... |
08537d8197e2a56a740e8e716f4bd0bb8ea1bc7877d72ae3e3247097dba40d41 | MATLAB | 21,070 | 492 | %{
# Relative scan coordinates to a reference map
-> experiment.Scan
-> anatomy.RefMap
field : tinyint # field #
---
x_offset : double # x center coordinate in pixels
y_offset : double # y center coordinate in pixels
field_depth ... |
52e093e3a7c7a9a306d847a6b2876339489aad5982e707b9a67e469cc313c8e8 | MATLAB | 21,108 | 660 | function [net, stats] = cnn_train(net, imdb, getBatch, varargin)
%CNN_TRAIN An example implementation of SGD for training CNNs
% CNN_TRAIN() is an example learner implementing stochastic
% gradient descent with momentum to train a CNN. It can be used
% with different datasets and tasks by providing a suitable... |
a3ea18b09ad167f998dbfcc0ef169797868f2eb04596ee2d842155540f3cd2af | MATLAB | 21,176 | 507 | %% driver_plot_aggregate_metrics_multi_sheet.m
clear all; close all; clc;
warning('off');
% ---------------- I/O and paths ----------------
fullpath = mfilename('fullpath');
if isempty(fullpath)
fullpath = matlab.desktop.editor.getActiveFilename;
end
[scriptFolder, scriptName, ~] = fileparts(fullpath);
parentFolde... |
c1d4ffcdd69a743e1dc591f7dbe21afd58507dfc2c79c9514acc376f94e3225e | MATLAB | 21,183 | 507 | % figure4_decoding_correlation_calculate.m - Decode memory representations and correlate with beta power
%
% This script performs inverted encoding model (IEM) decoding to reconstruct
% memory representations, then correlates decoding fidelity with beta power.
%
% KEY ANALYSES:
% 1. Decode active and latent memory re... |
1beb9b7123d89e392e4d482b1ed7a600c36f8733f26e2aae0dbbf88c16e2443d | MATLAB | 21,187 | 574 |
%
% %% find peak & make sphere
% ima_struct = MRIread('/Users/bo/Documents/data_liujia_lab/task_greeble/pilot_beh_mri_results/MRI_results/periodic_testing_6_fieldmap_cali_clustere_corrp_tstat1.nii.gz');
% cur_ima = ima_struct.vol;
%
% t_ima_struct = MRIread('/Users/bo/Documents/data_liujia_lab/task_greeble/pilot_be... |
739169bce48c5642eea1c378b10ea06e7f95e4435458d4c586995d4777c3da90 | MATLAB | 21,231 | 611 | function PRED = Meta_SVM_from_mkda(DB, fieldname, names_cell, varargin)
% Take output from Meta_Setup (DB) and
% runs a one-vs-one nonlinear SVM classifier, on labels of your choice.
%
% [nbc, data] = meta_SVM_from_mkda(MC_Setup, DB, fieldname, names_cell)
%
% Note: You need the spider package on your matlab path.
%
%... |
bf85f4ef5af686fa6036a387fd271c39e68eb97a5ed78c2378a224ffd4a31741 | MATLAB | 21,281 | 693 | function vrml(h, filename, opts)
% VRML Save graphics to VRML 97 file.
%
% VRML(H, FILENAME) saves a VRML 97 file containing the object
% with handle H and its descendants.
% If the FILENAME does not include an extension, ".wrl" is
% appended. If a file with the name FILENAME exists, it is
% overwritt... |
c740d46a50786f34a9fa3b03ee9b1388817f71aad0274c5716bf4f220f9ebe53 | MATLAB | 21,315 | 67 | %% 400 EXAMPLES OF ASSEMBLY CONFIGURATIONS WITH 10 ASSEMBLIES IN A HONEYCOMB STRUCTURED TECTUM
% THERE ARE 40 CONFIGURATIONS WHICH ARE EMBEDDED IN TECTA OF INCREASING
% DEGREE v = 8 , ... 17
%
% THE ASSEMBLIES WERE CREATED IN HONEYCOMB STRUCTURED TECTUM OF DEGREE 8
% FROM n = 16 POINTS DRAWN FROM A 2D-NORMAL DISTRIBUTI... |
550b81ea5ef0e2b230662317d6b9119396c6a72add7005855d8625a3234845d7 | MATLAB | 21,360 | 695 | function [ss] =FscatJit2_mergeGroups(identifiers, data, varargin)
% Plots data as both jittered points and an error bar, in the
% order the identifiers are passed to it. It preserves whatever order
% was in the fbmm structure. Also includes the option to define the circle
% size or use a default. Also allows someone ... |
214b52f1d107333608e881ff5e2107f99505148e58a3206f653874a639eb433a | MATLAB | 21,375 | 532 | function [x, cost, info, options] = rlbfgs(problem, x0, options)
% Riemannian limited memory BFGS solver for smooth objective functions.
%
% function [x, cost, info, options] = rlbfgs(problem)
% function [x, cost, info, options] = rlbfgs(problem, x0)
% function [x, cost, info, options] = rlbfgs(problem, x0, options)
%... |
d1541302dedacd46d7244c24b1c14e8d58c23fdfd30d4b9c65f2d59a9c211dda | MATLAB | 21,395 | 651 | function [ obj ] = mh_invert( obj )
% Metropolized Gibbs sampling on collapsed HUGE model.
%
% This is a protected method of the tapas_Huge class. It cannot be called
% from outside the class.
%
%
obj = obj.mh_init( );
% number of iterations and burn-in
nIt = obj.options.nvp.numberofiterations;
if isempty(nIt)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.