sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
f8871b807e4ad7a180f51b9b66219289b16acbac10587ce12f6fa8f58a6435ce | MATLAB | 7,949 | 178 | function [biasFieldCorrected, varargout] = segment(this, varargin)
% Segments brain images using SPM's unified segmentation approach.
% This warps the brain into a standard space and segment it there using tissue
% probability maps in this standard space.
%
% Since good warping and good segmentation are interdependent,... |
bbfa80a2f7c06d17ad1b987af0a3003f3acacdb7dc4244b07ffa68fa64196197 | MATLAB | 7,951 | 279 | function [traj, infStates] = tapas_hgf_whatworld(r, p, varargin)
% Calculates the trajectories of the agent's representations under the HGF
%
% This function can be called in two ways:
%
% (1) tapas_hgf_whatworld(r, p)
%
% where r is the structure generated by tapas_fitModel and p is the parameter vector in nat... |
b98753057f1a84de19468f33fb46006bcf70c9d890018bd101bb5838794f521e | MATLAB | 7,952 | 165 | function out = gen_V1_FiringRates(theta1, theta2, c1, c2, varargin)
%GENERATEV1FIRINGRATES Build V1 firing-rate fields from filters + (Gabor or spontaneous) inputs.
%
% Syntax
% out = gen_V1_FiringRates(theta1, theta2, c1, c2)
% out = gen_V1_FiringRates(..., 'Image1','gabor'|'spont', 'Image2','gabor'|'spont', ...
... |
f7781bd140b5a1fd4aeb6617b5d5fe5fed48b7f989f2ce9bee211a64f8d66f0a | MATLAB | 7,952 | 225 | function out = osp_plotOverviewMMSpec(MRSCont, which, g, shift, xlab, ylab, figTitle)
%% out = osp_plotOverviewSpec(MRSCont, which, g, shift, xlab, ylab, figTitle)
% Creates a figure with all spectra or fits.
%
% USAGE:
% out = osp_plotOverviewSpec, which,GUI, g, shift, xlab, ylab, figTitle)
%
% OUTPUTS:
% ... |
8096acecea91185df549029f58b4051cced3c4bb0d6bfd697b07b582c6b5fc4a | MATLAB | 7,953 | 177 | % computeValidationMetrics - Compute validation metrics for pSFT estimation
%
% Computes RMSE, correlation, and R^2 metrics for each SNR level, both
% per-subject/ROI and pooled across all voxels.
%
% Inputs:
% simulated_data - Struct array with ground truth params and SFT curves
% all_pSFT - Cell array o... |
8d0f6e5114cbfc871bdd75ae0690ea2c7db459b1f0f8646b6a2a7a93591702d6 | MATLAB | 7,955 | 226 | function Change_Display_Range_Callback(hObject, eventdata, handles)
% handles.data.settings.LowFreq = 15;
% handles.data.settings.HighFreq = 75;
% handles.data.settings.spect.type = 'Amplitude';
% handles.data.settings.spect.windowsize = 0.0032;
% handles.data.settings.spect.noverlap = 0.0016;
% handles.data.settings.... |
c77d493df510f0746b721fe57f5506ac6390883ace8d738615a8b011710062e4 | MATLAB | 7,956 | 240 | function [ subject ] = nmri_score_vigilance(subject, data, params)
%[ subject ] = nmri_score_vigilance(subject, data, params)
%
% This function as a wrapper to visually score vigilance and technical
% quality of EEG/MEG via the eeg_score viewer
% it requieres user interaction / presence
%
% subject = subject str... |
f56a10eaf131158b958d6558486bf1dbdb7767fb9811b7b354899fcaa7390804 | MATLAB | 7,956 | 181 | function h = brain3D_plot(brainVolume, chnls_MNI_VAL, plotInfo)
% plots semi-transparent 3D brain model into existing axes
% plots colorcoded channels as circles
% highlights selected brain areas
% input
% - plotInfo = params.plot_brain3D + some other fields (TO DO)
% - brainVolumes =
% - chnls_MNI_VAL =
% (c) ... |
3162d2910885cfdfa11bc2fa43fe5617bfc9ae23690ee297f1fc65108ee8d896 | MATLAB | 7,958 | 152 | function [out] = TerminalEstimatedT2(outputDir,outFile,index_1,index_2,bset)
load(fullfile(outputDir,outFile))
PhantomPars.Model = 'BiExpFitModelT2Relax';
switch bset
case {1,2}
PhantomPars.b_values = [0, 10, 20, 30, 50, 70, 100, 150, 200, 250, 300, 330, 350, 450, 500, 550, 650, 750... |
fa29e4971b8272d02af63fa438e7a2b24defcc36f836a4a18f45f7f6d46a862e | MATLAB | 7,963 | 192 | % EEG_TIME2PREV - returns a vector giving, for each event of specified ("target") type(s),
% the delay (in ms) since the preceding event (if any) of specified
% ("previous") type(s). Requires the EEG.urevent structure, plus
% EEG.EVENT.urevent pointers to it.
%
... |
bf9be9007501d0d659d9516acdc7dc0fea6e737878a63a72a6267d96f509bbd4 | MATLAB | 7,966 | 167 | function out = SB_BinaryStats_AR1(y, binaryMethod)
% SB_BinaryStats_AR1 Binary run-length statistics normalized against an AR(1) null
%
% Binarizes the time series (as in SB_BinaryStats) and compares the
% resulting run-length statistics to their analytic expectation under a
% Gaussian AR(1) null process with the sa... |
44c79dd524c47ceef8609498575ca948f378fcd015cfb3538a207be386e679ae | MATLAB | 7,968 | 182 | function c = tapas_ehgf_binary_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the enhanced Hierarchical Gaussian Filter (eHGF)
% for binary inputs in the absence of perceptual uncertainty.
%
% The HGF is the model introduced... |
997fb294b9bc79485e7d4b0ee5c5cdc3c9b82ad803704762d87b25195e9c78c4 | MATLAB | 7,968 | 227 | function [out_rain] = osp_plotRaincloud(MRSCont,model,quant,metab,tit,GMean,VoxelIndex,basis)
%% [out_rain] = osp_plotRaincloud(MRSCont,metab,plots,tit)
% Creates raincloud plot from the quantification tables and the chosen quantifcation and metabolite
% The figure contains raincloud plots with boxplots, as well as, me... |
c412e206486c74ce9ef2a70b0178bbca361871cbc4b7d0173f8636cb7d19e7f7 | MATLAB | 7,972 | 168 | % Covariance functions to be use by Gaussian process functions. There are two
% different kinds of covariance functions: simple and composite:
%
% 1) Elementary and standalone covariance functions:
% covZero - zero covariance function
% covEye - unit covariance function
% covOne - unit constan... |
cf6dd8295c6109c66257f8d64eb3a6f2151ae8c977d54408356abe5be1c7b2e5 | MATLAB | 7,975 | 279 | function [traj, infStates] = tapas_hgf_ar1_binary(r, p, varargin)
% Calculates the trajectories of the agent's representations under the HGF for AR(1) processes
% and binary outcomes.
%
% This function can be called in two ways:
%
% (1) tapas_hgf_ar1_binary(r, p)
%
% where r is the structure generated by tapas_... |
771fa0468a1a365c207221e72cec72dd5e86b46f731a2b14c78aa0470a3c06dc | MATLAB | 7,982 | 253 | % VARARG2STR - transform arguments into string for evaluation
% using the EVAL command
%
% Usage:
% >> strout = vararg2str( allargs );
% >> strout = vararg2str( allargs, inputnames, inputnum, nostrconv );
%
% Inputs:
% allargs - Cell array containing all arguments
% inputnames - Cell array of... |
b036d069f177ee3b84dbb15d95cfd4e298246e9bcf9e89879289ef3838b4f2fc | MATLAB | 7,984 | 165 | function [coregisteredImage, affineCoregistrationGeometry, outputOtherImages] =...
coregister_to(this, stationaryImage, varargin)
% Coregister this MrImage to another MrImage using SPM's coregister.
%
% Y = MrImage()
% cY = Y.coregister_to(stationaryImage)
%
% This is a method of class MrImage.
%
% IN
% stati... |
65c1ebd973b67114f000dba0f9198c0f4929ee5931ea8f2a1b0aa492c7faca70 | MATLAB | 7,985 | 249 | function [spikepos, out_] = SWTTEO(voltageTraces, fs, detectionParams)
%SWTTEO Detects Spikes Location using a modified WTEO approach
% Usage: spikepos = swtteo(voltageTraces, fs);
% spikepos = swtteo(voltageTraces, fs, params);
%
% Parameters
% ----------
% voltageTraces : L x C matrix
% where L is t... |
77ca6d2ce6d1d87214a7024d2c1c3b2930821796229f7c5f0b087cc46fe3efed | MATLAB | 7,985 | 224 | function [ff,xx,xScatter,yScatter] = BF_ViolinPlot(dataCell,addMeans,doveTail,makeFigure,extraParams)
% Plots a scatter of a set of distributions with data points offset randomly (jittered)
%
%---INPUTS:
% dataCell, a cell where each element is a vector of numbers specifying a distribution
% addMeans, a flag for whethe... |
ab2a73c08834122879c50e891304d45db8783fd904cc2bf35517a429a3d03b53 | MATLAB | 7,989 | 179 | clear; close;
%specify ages to include in analysis
ages = {'05', '08', '12', '18', '24'};
%specify other info about data
tasks = {'hand', 'social'};
cohorts = {'gm', 'uk'};
statsDir = '[path-to...]/pruningComparisonsMatlab/stats/bright/'; %CHANGE
% create empty table
columnNames = {'ID', 'Cohort', 'Task', 'Age', 'S... |
5980b4d225646d856584ef45e16bd731dad5e3e053684bf0eb9af3381be0a232 | MATLAB | 7,991 | 149 | function outputStruct = organizeIntrinsicData(recordingStr, epochData, inputStruct, APanalysis, ...
nAPthreshold, deltaIthreshold, numAcqs, skipParameters)
epochFields = fieldnames(epochData);
counter = inputStruct.counter;
% Save the names of the recordings.
inputStruct.recordingStrs = [in... |
e16bba1ca82a8dde525e79d98b4fae227a2201a20ae318a5a9c30f60fb6dd98d | MATLAB | 7,991 | 209 | % POP_ADJUSTEVENTS - Adjust event offset of all (or specified) events
%
% Usage:
% >> EEG = pop_adjustevent(EEG); % launch a GUI
% >> EEG = pop_adjustevent(EEG,'key', val);
%
% Inputs:
% EEG - Input dataset
%
% Optional Inputs
% 'addms' - [float] Positive or negative floating point number specifying... |
f902068348553f780a36741d68695ee4c9dfac88c01acd0eca6c71e329463aae | MATLAB | 8,004 | 196 | function shuffle_icaReacCCG_exSWR(basename)
[rootPath,sesName,~]=fileparts(basename);
fprintf('%s load files for %s\n',datestr(now),sesName);
load(fullfile(rootPath,'data',[sesName '-icaReac.mat']))
load(fullfile(rootPath,'data',[sesName '.sleepstate.states.mat']))
load(fullfile(rootPath,'data',[sesName '.sessions.eve... |
a14210842d55e63f0e08444b941cb9065ba7d510f39e665525b01d70a599b7c7 | MATLAB | 8,006 | 188 | function [data] = support_func_znorm(fsetup,data)
%% ########################################################################
% - Z-NORMALIZE (i)EEG DATA -
% #########################################################################
% [Description:] Z-normalize data (continuous or segmented)
%
% ----------------------... |
02e8f14dcfb632aaeccf57923aa350537af47145e0f1fa9c283aa64ce0d677f1 | MATLAB | 8,011 | 152 | function B1Tx_OptimizeSmoothing(MyelinFile, B1TxFile, LeftPial, LeftMidthick, LeftWhite, RightPial, RightMidthick, RightWhite, SmoothLower, SmoothUpper, LeftVolROI, RightVolROI, GroupCorrected, Output)
SmoothLower = str2double(SmoothLower);
SmoothUpper = str2double(SmoothUpper);
MyelinMap = cifti_read(Mye... |
deb43b6549467cb13a4afbfd88e5c80d1e78e126bb7702214abf4a80d8da4f92 | MATLAB | 8,012 | 213 | function [aveWaveform, spikeTimes] = getTemplate(trace, multiplier, refPeriod, fs, nSpikes, multiple_templates, multi_template_method, channelInfo, plot_folder)
% Description:
% Obtain median waveform from spikes detected with threshold method
% INPUT:
% trace: [n x 1] filtered voltage trace
% multiplier: [scal... |
5d87868fd63c710c5445e64ffdf768f3bf68e9595eb4382885b95d8a75064567 | MATLAB | 8,013 | 222 | function [tab,myAcc] = TS_Predict(timeSeriesData,labels,fileName_classifier,varargin)
% TS_Predict Predict classes for new time-series data using a pre-trained model
%
% This function uses a previously learnt classifier to predict group labels
% of input time series.
%
%---USAGE:
% TS_Predict(timeSeriesData,labels,file... |
9ac72c92ad35fd639acb054b99bbd063833fb0f784502e141fc7241380fd28eb | MATLAB | 8,016 | 250 | % define
subjix = 1; % main subject of interest
roimainix = 1; % main ROI of interest
sess = 10; % session of interest
roistoload = {{'rh.floc-faces.nii.gz' 2} {'rh.floc-places.nii.gz' 2}}; % RH FFA-1 and RH PPA
betadirs = {'betas_assumehrf' 'betas_fithrf' 'betas_fithrf_GLMdenoise_RR'};
ncfun = @(x)100*(x.^2./(... |
47d356af149db44ccd23fdc58422aa20df78c98a6d584c13a55b0008a0d3b3ab | MATLAB | 8,021 | 210 | function [output, Greg] = dftregistration(buf1ft,buf2ft,usfac)
% function [output Greg] = dftregistration(buf1ft,buf2ft,usfac);
% Efficient subpixel image registration by crosscorrelation. This code
% gives the same precision as the FFT upsampled cross correlation in a
% small fraction of the computation time and with ... |
3b9ac2f689d2e67c3fcf647f0856560722104787d8d6d3097579db4e56107465 | MATLAB | 8,030 | 176 | function startup()
% STARTUP Add all paths required for the hctsa package.
% ------------------------------------------------------------------------------
% Copyright (C) 2013-2026, Ben D. Fulcher <ben.d.fulcher@gmail.com>,
% <http://www.benfulcher.com>
%
% If you use this code for your research, please cite the fo... |
dc858a2e643cbbe10803677b1cca23da6896605b0daa8c7017f78b25c1164188 | MATLAB | 8,033 | 253 | % example_pipeline
% This script demonstrates the complete pSFT estimation pipeline using sample data.
% It includes setting up estimation settings (parallelization, grid search, parameter bounds, HRF definition),
% visualizing results, and saving results.
% Results are saved under `/estimates/` with the file format `... |
4a7453241a17711770b08455f3e3d91afe47a9afa9edc5200ec93e0e034d54c7 | MATLAB | 8,036 | 172 | function tapas_BLT_runRating(params, rating)
% tapas_BLT_runRating shows a rating scale via two bars to indicate a number between 0 and 100.
%
% About:
% Coded by F.Petzschner 19. April 2017
% Last change: F.Petzschner 19. April 2017
screenw = 2*params.screen.xCenter;
screenh = 2*params.screen.yCenter;
% horizontal... |
4cba40525006a2c2045a63e814711d2faba9330721eb73f44efde083305b1098 | MATLAB | 8,039 | 171 | classdef RobustnessTests < matlab.unittest.TestCase
% Whole-library robustness tests: run every registered hctsa feature on a
% small set of adversarial synthetic time series and check that
% (1) no operation throws an error (data-dependent failures must return
% NaN, per the NaN-vs-error conven... |
ab8173caa855b3751e54c05a4cedee16a151f2e600cdab373df20edfac8ac5b7 | MATLAB | 8,040 | 197 | clearvars; close('all'); clc
workstation = 'nick_pc';
switch workstation
case 'nick_pc'
onedrivepath = 'E:\Myers\OneDrive - The University of Nottingham';
fieldtrippath = [onedrivepath '\Matlab\toolbox\fieldtrip\'];
studypath = [onedrivepath '\Projects\El-SwitchBeta'];
... |
cccd55860f8bf6d82a6c9ef807fc91ac84e5d2ef7911d57b7da90cbc6a59daa3 | MATLAB | 8,042 | 223 | %% BiExpFitModelT2RelaxSegmented.m
% This function contains a T2 corrected biexponential diffusion model
% modelled as a 2D problem with segmented approach.
%
% lossFunction - calculates loss function for optimizer
% forwardJacobian - calculates the forward jacobian for optimizer
% forwardModel - conve... |
db847e10165979cf0fe5f4afb2fc55c17aee5ae7f60ebf37e17b7d9b1bb32e3f | MATLAB | 8,049 | 192 | function c = tapas_hgf_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the Hierarchical Gaussian Filter (HGF)
% for continuous inputs.
%
% The HGF is the model introduced in
%
% Mathys C, Daunizeau J, Friston, KJ, and Stepha... |
5e10a1e017b59454ab94d9207ee910e89a0f693b89273a9fac75dbd41d6d075d | MATLAB | 8,050 | 231 | %% Example Visualization Script for Calcium Imaging Analysis
% This script demonstrates how to visualize the outputs from analyze_calcium_imaging.m
% It creates various plots including raster plots, connectivity matrices, and synchrony analysis
%% Clear workspace
clear;
clc;
%% Load analyzed data
fprintf('Loading ana... |
1dd82f2c6a1aa574f503ecc2719f6600d180306ed79c47be00eb2d74f9ddfa33 | MATLAB | 8,053 | 194 | function c = tapas_hgf_categorical_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the Hierarchical Gaussian Filter (HGF) for categorical inputs
% restricted to 3 levels, no drift, and no inputs at irregular intervals, in the... |
71e79800242d59b8cdbb42575267dac138d15693944eb4c6f50d1d09589402ee | MATLAB | 8,053 | 203 | % POP_IMPORTPRES - append Presentation event file information into an EEGLAB dataset
% The Presentation stimulus presentation program outputs an ascii
% log file. This function merges existing EEG dataset events with
% additional field information (fields) about ... |
cb6b9d4d7781985689e9314ac883bcac9e99420740f3143b89d4c51f55b01e95 | MATLAB | 8,054 | 276 | function [] = PlotFigure3(datadir, codedir)
%PlotFigure3 - Plots Figure 3. Must be run after ProcessData_Figure3.
% INPUTS:
% datadir - Directory where output from ProcessData_Figure3 was saved
% codedir - Directory of code (e.g., published/dynamic_learning_rate/)
%% Set Path and Load Data
s = pathsep;
pathStr = ... |
33c7b68fd69d4036273f27335129f06cfffadf8438454a1ae15015368800122f | MATLAB | 8,058 | 194 | function c = tapas_hgf_categorical_norm_config
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Contains the configuration for the Hierarchical Gaussian Filter (HGF) for categorical inputs
% restricted to 3 levels, no drift, and no inputs at irregular intervals, i... |
a49cd4231fffa69a33f4e7485e6fcfbd74fe11f6f65e59d44893d698dc917828 | MATLAB | 8,059 | 221 | % EEGREJ - reject/excise arbitrary periods from continuous EEG data
% (e.g., EEG.data).
%
% Usage:
% >> [outdata newt newevents boundevents] = ...
% eegrej( indata, regions, timelength, eventlatencies);
%
% Inputs:
% indata - input data (channels, frames). If indata is a string,
% ... |
deceaf815e3439c2b0dff3f4c8590c0fa9ffb1b86975f860ff369c1a06a95e23 | MATLAB | 8,059 | 208 | function [C2,cfg] = mahal_twoclass_trialwise2_xgen(dat,labels,task,cfg)
% [C2,cfg] = mahal_twoclass_trialwise2_xgen(dat,labels,task,cfg)
if nargin < 4
help mahal_twoclass_trialwise2_xgen
error('missing input arguments!')
end
ntrl = size(dat,1); % number of timepoints
nsens = size(dat,2);... |
31cc24f478c76feaf99e0723681ceb28b3a18cb5ff0c641ed5da5b86f862f91e | MATLAB | 8,060 | 244 | %io_loadspec_sdat.m
%Jamie Near, McGill University 2014.
%Georg Oeltzschner, Johns Hopkins University 2018.
%
% USAGE:
% out=io_loadspec_sdat(filename,subspecs);
%
% DESCRIPTION:
% Reads in Philips MRS data (.spar and .sdat files) using code adapted from
% PhilipsRead.m, provided as part of the Gannet software packag... |
6a533c720515827237494853a6adc8b6a6f12bc92b0b62e2aad5c6e163efe852 | MATLAB | 8,065 | 210 | function TS_Cluster(distanceMetricRow,linkageMethodRow,distanceMetricCol,linkageMethodCol,doSave,theFile)
% TS_Cluster Linkage clustering for hctsa data.
%
% Reads in normalized data from HCTSA_N.mat, clusters the data matrix by
% reordering rows and columns with linkage clustering, and then saves the result
% back ... |
391bf1c52aed1b62b0153b172c25196230d691156aac56f80d5f4b1d9af8d217 | MATLAB | 8,075 | 214 | function [varargout] = osp_editSubSpecAlignLNorm(varargin)
%% [varargout] = osp_editSubSpecAlign(varargin)
% Aligns sub-spectra of edited MRS data to minimize
% subtraction artefacts. It uses a L1 Norm minimization including the
% whole frequency range (Cleve et al., JMR, 2017 (https://doi.org/10.1016/j.jmr.2017.... |
d5ee85e6936ca0d0c2bcc0f44b8e78940075dd6a3186a2c780cb3c7796f5a82e | MATLAB | 8,081 | 135 | function declare_properties(varargin)
% Declare properties of a function.
% declare_properties('Property',value,'Property',value, ...)
%
% This construct can be used to declare any key-value properties for a function. It must not follow
% after a call to arg_define() but before it. These properties can then be retrieve... |
994e7c27ce4ca56386623769397f85865eee7f46db1b60b048b7688ce5cba159 | MATLAB | 8,084 | 199 | function out = CO_FirstMin(y, minWhat, extraParam, minNotMax)
% CO_FirstMin Time of first minimum in a given self-correlation function
%
% ---INPUTS:
% y, the input time series
% minWhat, the type of correlation to minimize: either 'ac' for autocorrelation,
% or 'mi' for automutual information. By default, '... |
36e2ebdf4fde9c1633ae0c2c0a5005a0f6951c8fa111807854c30ef02e755722 | MATLAB | 8,088 | 283 | function [P] = cca(D, P, epochs, Mdist, alpha0, lambda0)
%CCA Projects data vectors using Curvilinear Component Analysis.
%
% P = cca(D, P, epochs, [Dist], [alpha0], [lambda0])
%
% P = cca(D,2,10); % projects the given data to a plane
% P = cca(D,pcaproj(D,2),5); % same, but with PCA initialization
% P = ... |
954032de3ac777b3844f7484a54148640c60ec87fd4d1bdd5623485096791b80 | MATLAB | 8,090 | 307 | % POP_TOPOCHANSEL - pop up a topographic interface to select channels
%
% Pops up a topographic interface to select multiple channels with the
% mouse. Click a polygon around the electrodes you wish to select. Right
% click to finish.
%
% Usage:
% >> [chanlist] = pop_topochansel(chanlocs,selection);
%
% Inputs:
% ... |
334e26e6255da58ff5b9a50d4d618222649e4465160ce5831f5d66f676162ffc | MATLAB | 8,093 | 259 | function [lambda,p,ci,stats,tbl,dist] = permumanova2(x,group,varargin)
%PERMUMANOVA2 Permutation-based two-way multivariate ANOVA and rank MANOVA.
% LAMBDA = PERMUMANOVA2(X,GROUP) performs a permutation-based two-way
% multivariate analysis of variance (MANOVA) for comparing the means of
% data in matrix X, and ... |
63947c86c6e668a9a3d0b26991caba80a3986d5f9589606911ba6444f54be679 | MATLAB | 8,097 | 231 | function [n, fn] = dimlength(data, seldim, fld)
% DIMLENGTH(DATA, SELDIM, FLD) is a helper function to obtain n, the number
% of elements along dimension seldim from the appropriate field from the
% input data containing functional data.
%
% Use als
% [n, fn] = dimlength(data, seldim, fld)
%
% It can be called with ... |
cbc132cbd66cd7598e200df8d6b762dc45aacb46ccd0097dfa0240dc4d211347 | MATLAB | 8,098 | 186 |
cur_file_path ='/Users/bo/Desktop/MRI_Scanning_sub18/bold_run1';
dicm2nii(cur_file_path, cur_file_path, 1);
X = dicominfo('/Users/bo/Desktop/temp_MRI/bold_run1/sms_bold_run1-00001.dcm');
%% T1
% sub_pool = {'01', '02', '03', '04', '05', '06', '07', '08', '09', '10'};
% sub_pool = {'11', '12', '13', '14', '15', '1... |
e2fe57b94d6d650f87974b5f1cd47faaf63eb2ccf5508831a25b2ab771680d35 | MATLAB | 8,101 | 203 | function [ModelOutput] = fit_OspreyParamsToModel(inputData, inputSettings, fitParams)
% This function applies a set of LCModel fit parameters to a basis set of
% metabolite basis functions, and a set of cubic baseline spline basis
% functions.
%
% The function returns the complete fit, the baseline, the residua... |
e77eb3b1243667da1a47630acc760e6ebbfdf3540160aec2ba5854fd5afa328c | MATLAB | 8,104 | 246 | % (C) Copyright 2020 CPP visual motion localizer developpers
%adapted by me Iqra
function [cfg] = setParameters()
% VISUAL LOCALIZER
% Initialize the parameters and general configuration variables
cfg = struct();
cfg.subject.askGrpSess = [false true];% this stops the GUI input for subject group... |
b927e2955858ddf011b695bbbb43d07f3e7e12cb447a72e859b35a8875712f84 | MATLAB | 8,106 | 234 | function SuppFigure_PrefOri_StimOri(varargin)
%SUPPFIGURE_PREFORI_STIMORI Generate supplementary figure for preferred vs stimulus orientation analysis
%
% Purpose:
% Creates a figure showing correlation patterns between neurons based on
% their preferred orientation relative to stimulus orientation and absolute
% ... |
dc88ecd45bb778bacdb1cd201e05d8e6abaf90a7c758b52865daee54d66cd5d5 | MATLAB | 8,117 | 246 | %io_writespar.m
%Georg Oeltzschner, Johns Hopkins University 2019.
%
% USAGE:
% RF=io_writespar(in,outfile);
%
% DESCRIPTION:
% Takes MRS jeader data in matlab structure format and writes it to a SPAR file
% that can be read by LCModel.
%
% INPUTS:
% in = input data in matlab structure format.
% sparFile = ... |
57b49774d0f0ef75c9e97b0f26906ad7cdbd0c71b5be66b32de1ae7997a26461 | MATLAB | 8,121 | 166 | function [SSQs, DFs, MSQs, Fs, Ps]=mixed_between_within_anova(X,suppress_output)
% simple function for mixed (between- and within-subjects) ANOVA
%
% Based loosely on BWAOV2 (http://www.mathworks.com/matlabcentral/fileexchange/5579-bwaov2) by Antonio Trujillo-Ortiz
% (insofar as I used that function to figure out the... |
0f13a3def415eca0140214f0d1f7c903f83b3df10f3f1f3de1fdb366e198751f | MATLAB | 8,122 | 204 | function WriteMoleculeList(MList, newFile, varargin)
%--------------------------------------------------------------------------
% WriteMoleculeList(MList, newFile, varargin)
% This function writes a bin file from a molecule list.
%--------------------------------------------------------------------------
% Outputs:
... |
69d9c7a4fee1145f8c2af3e43de0cf2f172077c3916ac7a9da5df6951cf3697f | MATLAB | 8,125 | 221 | function M = stiefelgeneralizedfactory(n, p, B)
% Returns a manifold structure of "scaled" orthonormal matrices.
%
% function M = stiefelgeneralizedfactory(n, p)
% function M = stiefelgeneralizedfactory(n, p, B)
%
% The generalized Stiefel manifold is the set of "scaled" orthonormal
% nxp matrices X such that X'*B*X i... |
88890515df81c7691b19a66fbe10dc546618952e0a66cbb735765362640795b5 | MATLAB | 8,125 | 213 | function out = CO_AddNoise(y, tau, amiMethod, extraParam, randomSeed)
% CO_AddNoise Changes in the automutual information with the addition of noise
%
% Adds Gaussian-distributed noise to the time series with increasing standard
% deviation, eta, across the range eta = 0, 0.1, ..., 2, and measures the
% mutual informa... |
0cfba5f3643267354704c3410923acb04ed83d5ea8b5ed84848a4098dbeae0fd | MATLAB | 8,128 | 259 | function out = MF_ExpSmoothing(x, ntrain, alpha)
% MF_ExpSmoothing Exponential smoothing time-series prediction model.
%
% Fits an exponential smoothing model to the time series using a training set to
% fit the optimal smoothing parameter, alpha, and then applies the result to the
% try to predict the rest of the ti... |
7fbde0742c46da9d1e573f603f4591246a825d7cb776e3415711e6455a517f1f | MATLAB | 8,131 | 243 | function [centr,clst,sse] = kmeans_st(X,k,restarts)
% KMEANS: K-means clustering of n points into k clusters so that the
% within-cluster sum of squares is minimized. Based on Algorithm
% AS136, which seeks a local optimum such that no movement of a
% point from one cluster to another will redu... |
c408a36e19aa9859ebca20d9141a6db4cef0746ac4aafe30b1d96b6412430bcc | MATLAB | 8,132 | 273 | function [traj, infStates] = tapas_hgf_ar1_mab(r, p, varargin)
% Calculates the trajectories of the agent's representations under the AR(1)-HGF in a multi-armed
% bandit task
%
% This function can be called in two ways:
%
% (1) tapas_hgf_ar1_mab(r, p)
%
% where r is the structure generated by tapas_fitModel and... |
63a1e3cac4fbb087d3d10e5b5eaa8f816848dcbbb46be90d96e3763f3bb4102d | MATLAB | 8,133 | 243 | function coactPaper_figureS04()
labelWeight=true;
labelCase=false;
labelSize=9;
letGapX=5;
letGapY=6;
fontsize=6;
close all
fh=initFig('width',2.54*3.5,'height',4,'font','Arial','fontsize',fontsize);
x=15;y=8;
panel_01_02(x,y,fontsize)
panelLetter2(x-letGapX-9,y-letGapY,alphabet(1,labelCase),'fontSize',labelSize,'is... |
564d6cf982802b3ca78f78171ca883d060a1c7483f72ee91c23ef0c4a95a9dbb | MATLAB | 8,136 | 209 | function ch2roi_plot_allFB_brain3D(GRUP, groupInfo)
% plots one ROI (brain3D + channels) with all activations
% FIG:
% - 3D brain plot with highlighted channels in MNI
% - subplots = freqBands
% - 1 subplot: time x clz
% based on the following criteria:
% - selected anatomical areas (groups)
% - selected fre... |
ff4800376eaf64c5555a17f123f9d8e335727dd2a626ad12534479771f279991 | MATLAB | 8,139 | 201 | % EEG_REGEPOCHS - Convert a continuous dataset into consecutive epochs of
% a specified regular length by adding dummy events of type
% and epoch the data around these events. Alternatively
% only insert events for extracting these epochs.
% May ... |
cb38a8d90efc817d3b40f25bc2add47d1800640c6f38cf794b06e4acbce4828c | MATLAB | 8,140 | 184 | function [NBSPredict] = test_NBSPredict(varargin)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% test_NBSPredict performs NBSPredict on synthetic network. It can be also
% used as a test function. test_NBSPredict delivers parameters and runs
% NBSPredict using them. If no parameters are p... |
f0f54ba19fb568f2666e762edb89a68205565fcc93d5663e37a781f77cf99896 | MATLAB | 8,149 | 214 | function GenTargetVectors
% Function outputs target vectors (X, orginial combinations for first
% generation).
% Define global and persistent variables.
global run filename numFact numDose numComb sheetname vectorState q ps
global countVectors genFirstPop firstGenStat quasiStop CarryScore
global TabuList ... |
0431fb8bd25588ea9f25b4579cac0e12a8a0eb12dab735dc530f7276d5af9485 | MATLAB | 8,157 | 181 | function using_counters()
% Manopt example on how to use counters during optimization. Typical uses,
% as demonstrated here, include counting calls to cost, gradient and
% Hessian functions. The example also demonstrates how to record total time
% spent in cost/grad/hess calls iteration by iteration.
%
% See also: stat... |
7bb1fce03cd7eb9cec63323396fab6de669f0e6689104bfee97e345054785cde | MATLAB | 8,157 | 174 | function EvalComb(cFile)
% Function evaluates the set of target vectors (X) and trial vectors (U)
% defined for the current generation ('run') according to the objective
% function.
global filename numComb sheetname run replicate expMaximum fHeader cellCount
global numCells assayVol resuspVol sampleVol c... |
204f20c1a073237d26a53da6e7b808ac7cd6f4d9e1e4bb1eacd4ad33ac2277a9 | MATLAB | 8,162 | 203 | function [TS_DataMat,TimeSeries,Operations] = TS_Subset(whatData,ts_ids_keep,op_ids_keep,doSave,outputFileName)
% TS_Subset Save a given subset of an hctsa dataset, based on time series and operation IDs
%
%---INPUTS:
% whatData, the source of the hctsa dataset: a .mat filename or shorthand
% ('raw'/'norm'/.... |
e525f61ac0f29f71e94aa8d242ff0d4786052d225c2e7af5bb58357f92c70ddc | MATLAB | 8,167 | 285 | function [traj, infStates] = tapas_hgf_binary_pu(r, p, varargin)
% Calculates the trajectories of the agent's representations under the HGF
%
% This function can be called in two ways:
%
% (1) tapas_hgf_binary_pu(r, p)
%
% where r is the structure generated by tapas_fitModel and p is the parameter vector in nat... |
54157b6f5c7800237f09126e572676c77c5510de29a1bd2498d9f4c8dafc1f08 | MATLAB | 8,173 | 160 | function out = SY_RampingWindows(y, numSeg)
% SY_RampingWindows Monotonic trend ('ramping') in windowed statistics
%
% Splits the time series into numSeg non-overlapping segments, computes
% the mean, variance, skewness, kurtosis, and lag-1 autocorrelation (AC1)
% within each segment, and quantifies whether each of ... |
90a72f1fc08b5ee241dd0f6ad29f549d5ed880feb56eea88f46d866f2e5e1fec | MATLAB | 8,175 | 266 | %% Script to compare the overlap between hand-drawn ROIs and
% both UNC and FreeSurfer projected ROIs
% You cannot run this unless you (1) draw the ROI labels on the UNC template
% in freeview and (2) project the UNC labels onto each individual infant brain.
% Please email sstung@stanford.edu if you would like the l... |
7f7d80288f810e31de62fd8dcca5bbe544e5195758258e59928217758214898b | MATLAB | 8,179 | 253 | function[map] = diverging_map(s,rgb1,rgb2)
%This function is based on Kenneth Moreland's code for greating Diverging
%Colormaps. Created by Andy Stein.
%
%s is a vector that goes between zero and one
map = zeros(length(s),3);
for i=1:length(s)
map(i,:) = diverging_map_1val(s(i),rgb1,rgb2);
end
end
% Interpolate... |
277e3bf8e613e3e4d71b20f082bdeccd95731745970ad906cfded5e59a25c1f7 | MATLAB | 8,180 | 299 | function [record] = thalamus_readrecord(fid)
StorageRecord_Analog = 1;
StorageRecord_Xsens = 2;
StorageRecord_Event = 3;
StorageRecord_Image = 6;
StorageRecord_Text = 7;
StorageRecord_Time = 4;
StorageRecord_Node = 5;
VARINT = 0;
I64 = 1;
LEN = 2;
I32 = 3;
Image_data = 1;
Image_width = 2;
Im... |
a1a5d9f7c14640ba630bd1e2809af5f19768687aaa5126e5b75201bc29ef277d | MATLAB | 8,181 | 133 | function ComputeDVARSandGS(StudyFolder,Subjlist, hp, MRFixConcatName, fMRINames, RegString, ProcString, RecleanMode)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
wbcommand='wb_command';
if strcmp(RecleanMode,"YES")
rclean=1;
elseif strcmp(RecleanMode,"NO")
rclean=0;
else
e... |
d403dbada073eafbcdfb19f75687862ab1cc97b7f5048eaff07dabc9c0060cf4 | MATLAB | 8,185 | 251 | function electrodeHeatMaps(FN, spikeMatrix, channels, spikeFreqMax, Params, coords, figFolder, oneFigureHandle, groundElectrodes, stimInfo)
% Plots the firing rate of each node / electrode with a circle representing
% the spatial location of the electrode / node, and the color representing
% the firing rate (spike... |
68093228f0ff30935d6ad697fcb86de54bfeb588ade5c29298bee816760446f6 | MATLAB | 8,186 | 275 | function varargout = jsonwrite(varargin)
% Serialize a JSON (JavaScript Object Notation) structure
% FORMAT jsonwrite(filename,json)
% filename - JSON filename
% json - JSON structure
%
% FORMAT S = jsonwrite(json)
% json - JSON structure
% S - serialized JSON structure (string)
%
% FORMAT [...] = jsonwr... |
b18f1b072e600fec02af3de38a4da7558464211d5dc4f1a472d5be1edc610cd0 | MATLAB | 8,190 | 336 | % figure generating scripts for probability simplex
% and sample neuron PSTHS, conditioned on most likely or 2nd most likely
% block
%% add path and load DS projection data
%location of analysis codebase
codepath = '~/david/maggie';
% add code paths
addpath(genpath(codepath))
addpath(genpath(codepath + "david"))
ad... |
c446ede66599638fcf5019e440b80961926e78daa5f5f460b0add36a58930383 | MATLAB | 8,190 | 240 | function sR=icassoStruct(X)
%function sR=icassoStruct([X])
%
%PURPOSE
%
%To initiate an Icasso result data structure which is meant for
%storing and keeping organized all data, parameters and results
%when performing the Icasso procedure.
%
%EXAMPLE OF BASIC USAGE
%
% S=icassoStruct(X);
%
%creates an Icasso result st... |
b92cbfd475f68208fe616eb1240686bceeea01e075d0635ac1973adc22dc9ab9 | MATLAB | 8,208 | 285 | function [traj, infStates] = tapas_hgf_binary_pu_tbt(r, p, varargin)
% Calculates the trajectories of the agent's representations under the HGF
%
% This function can be called in two ways:
%
% (1) tapas_hgf_binary_pu_tbt(r, p)
%
% where r is the structure generated by tapas_fitModel and p is the parameter vecto... |
13d38dafea60e2c6f86c12328ce25919e2b23bee73c91b2058e1681d04df7789 | MATLAB | 8,214 | 179 | function PlotExtendedData1(datadir, codedir)
%PlotExtendedData1 - Plots Extended Data 1.
% INPUTS:
% datadir - Local directory where ProcessData_ExtendedData1.mat was saved after running ProcessData_ExtendedData1
% codedir - Local directory where code (e.g., published/EstrousRPE/) was saved
%% Set up paths
s = p... |
d5279662681f421afdc189fa43dbd0317e4bc69875b5b9bfc2ae760163a37edc | MATLAB | 8,219 | 231 | %% Load data
data_path = 'Y:\Alice\0012_NeuroGI\NeuroGI_ephys_data\2024-09-25 Experiment\';
file = 'iv13-wt-03.mat';
load([data_path file], 'data')
%% Plot panel A and B (one channel short example)
y = single(data(3380001:3500000,:));
y(:, (nanstd(y) > 150) | (sum(y)==0)) = NaN;
y = y - nanmean(y,2);
fo... |
ef011e73e386102b9c40fbf1a210c6d5ae85331d64bbaa058a4edf4aa76a6514 | MATLAB | 8,221 | 197 | % Please cite this paper if you use any component of this software:
% D. Cunefare, L. Fang, R.F. Cooper, A. Dubra, J. Carroll, S. Farsiu, "Open source software for automatic detection of cone photoreceptors in adaptive optics ophthalmoscopy using convolutional neural networks," Scientific Reports, 7, 6620, 2017.
% Re... |
77f4ac85698e74e5a70e046115492f0d41e683aafc1d32d1570e36e0fda2c7cf | MATLAB | 8,225 | 185 | % STD_CHECKFILES - Check all STUDY files consistency
%
% Usage:
% >> boolval = std_checkfiles(STUDY, ALLEEG);
% Inputs:
% STUDY - EEGLAB STUDY set comprising some or all of the EEG datasets in ALLEEG.
% ALLEEG - All EEGLAB datasets
%
% Outputs:
% boolval - [0|1] 1 if uniform
%
% Aut... |
cccd53b2cc0d6ece087bc888f6630e0cfb7892de9e03b597a9a28855a6cfaf32 | MATLAB | 8,227 | 214 | function spikes = GetSpikeTimes(units,varargin)
%GetSpikeTimes - Get spike timestamps.
%
% USAGE
%
% spikes = GetSpikeTimes(units,<options>)
%
% units optional list of units, i.e. [electrode group, cluster] pairs;
% special conventions:
% 'all' all units
%... |
b169a7bb1d09ad763fdf233f920d8780d420a6c6a9653ca9dd19e05fd25f9786 | MATLAB | 8,236 | 210 | function combinedData = combineExpNetworkData(ExpName, Params, NetMetricsE, NetMetricsC, experimentMatFileFolder)
% This function collects data from individual experiment analysis files and
% combine them to create a dataset containing all of the metrics from each
% experiment.
% NOTE: This function also saves a csv fi... |
2efe714812f20fcacd951d44728bd928da712093b4adcae8f4056005da265b23 | MATLAB | 8,241 | 216 | % compile_mex Compiles mex files required for hctsa package
%
% This script must be run in the Toolboxes directory.
%
% ------------------------------------------------------------------------------
% Copyright (C) 2013-2026, Ben D. Fulcher <ben.d.fulcher@gmail.com>,
% <http://www.benfulcher.com>
%
% If you use this ... |
3834e296b91195e0f4263df13d8589147c062bc22946fc766651a1d5e5eeb4f7 | MATLAB | 8,248 | 274 | function plot(metaobj, plotmethod)
% plot(metaobj, [plotmethod])
%
% Plot methods:
% ----------------------------------------
% Plot data matrix
% plot(fmri_data_object)
%
% Plot means by condition
% plot(fmri_data_object, 'means_for_unique_Y')
%
%
if nargin < 2
plotmethod = 'data';
end
switch plotmethod
% =... |
c8334a4ad47f06377d9afbe2525fe85062af2e26ccd92679ba1ed456c4445022 | MATLAB | 8,250 | 232 | function [Gx_org,Gy_org,Gz_org]=compute_gradients(img_pca,ins_msk,Subject,Figures,Streamlines)
% Compute eigenmap's gradient magnitude
% INPUT
% img_pca is the eigenmap image in which gradients are computed
% ins_msk is a mask. Only gradients for voxels in the mask are shown in
% figure
% Subject: prefix of ... |
8e14b1bd8ed5a6ab71c09a53d5a0ca1ddde869460c05420614effab61ba0f767 | MATLAB | 8,252 | 175 | function [varargout] = likMix(lik, hyp, varargin)
% likMix - Mixture of likelihoods for regression/classification.
% The expression for the likelihood is
% likMix(t) = sum_i=1..m w_i * lik_i(t),
% where lik_i are the m individual likelihood functions combined by a weighted
% sum with weights wi.
%
% The hyperpara... |
9d3875e1b11bb2606a8639d47181beccc7c6a3a6e01c6d33e3969c3bec767920 | MATLAB | 8,253 | 218 | % most likely or 2nd likely block, using all data, not just mixed block as most likely
% this form will sutract the overall mean firing rate, conditioned on reward, from each neuron
% as a way of removing reward contributions, and potentially reducing
% accuracy of MLB2, which reviewers had concerns about
function []... |
64d3de406484af5ab7d742ce5439957457f256e975b5f07476c46ea6eab124bf | MATLAB | 8,266 | 164 | function out = NW_OrdinalPartitionNetwork(y, d, tau)
% NW_OrdinalPartitionNetwork Ordinal partition transition network measures
%
% Symbolizes the time series into ordinal patterns (Bandt-Pompe) and builds
% a directed transition network in which nodes are the ordinal patterns
% actually observed and edges connect a... |
9eebeeb06e052bf17920d41433d0c9c9a840404d3527f4ac5790f6a6fc317052 | MATLAB | 8,266 | 175 | function osp_SelectionChangedFcn(src,~,gui)
%% osp_SelectionChangedFcn
% This function is triggered when the main tab is changed. It refreshes
% the figure.
%
%
% USAGE:
% osp_SelectionChangedFcn(src,~,gui);
%
% INPUT: src = handle of the fit tabs
% gui = gui class containing all hand... |
b69f40d80df447e7adf11af2baac38d68c3fa3ae2479c45c524cacdfac3fdd5c | MATLAB | 8,268 | 207 | function create_stats_batch(subj_id, session, mod_name, run_batch)
% _
% Create SPM batch editor job for first-level fMRI analysis
% FORMAT create_stats_batch(subj_id, session, mod_name)
%
% subj_id - a string, subject ID (e.g. "EDY7")
% session - a string, session name (e.g. "visual")
% mod_name - a ... |
e30888e56ce530255f9919a7334bd516485fb2756ee0a72aab1358785c715c9e | MATLAB | 8,283 | 163 | function [out] = TerminalSeparate(outputDir,outFile,index_1,index_2,bset)
load(fullfile(outputDir,outFile))
PhantomPars.Model = 'BiExpFitModel';
PhantomPars.b_values = [0, 10, 20, 30, 50, 70, 100, 150, 200, 250, 300, 330, 350, 450, 500, 550, 650, 750, 800];
PhantomPars.TE_values =[47,52,57,62,67... |
cdd3fd0096f89150d5c826bb6d566aae78d702dcfbae8b33bc975febe19ea60e | MATLAB | 8,284 | 207 | function [stepsize, newx, newkey, lsstats] = ...
linesearch(problem, x, d, f0, df0, options, storedb, key)
% Standard line-search algorithm (step size selection) for descent methods.
%
% function [stepsize, newx, newkey, lsstats] =
% linesearch(problem, x, d, f0, df0, options, storedb... |
e4101fabb5ea233f3854ab83f4abead53e39b3e092f753d2ebea9d5bcfc71019 | MATLAB | 8,285 | 285 | function varargout = permloads(varargin)
% Permutation inference for canonical correlation
% analysis (CCA).
%
% Usage:
% [pfwer,r,A,B,U,V,pA,pB] = permloads(Y,X,nP,Z,W,Sel,partial,Pset,nK)
%
% Inputs:
% - Y : Left set of variables, size N by P.
% - X : Right set of variables, size N by Q.
% - nP : ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.