sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
a68af96e184080ddc3559dd554832d948d3b55ff1888ef505ac5e83fa27ab43b | MATLAB | 5,222 | 124 | function [hdr] = read_biosig_header(filename)
% READ_BIOSIG_HEADER reads header from EEG file using the BIOSIG
% toolbox and returns it in the FCDC framework standard format
%
% Use as
% [hdr] = read_biosig_header(filename)
%
% The following data formats are supported: EDF, BKR, CNT, BDF, GDF,
% see for full document... |
dba251c5b3ff3231baf4b0c80c24616f0adf3198a757c51327ffd87546c83a25 | MATLAB | 5,222 | 128 | function [varargout] = likBeta(link, hyp, y, mu, s2, inf, i)
% likBeta Beta likelihood function for interval data Y from [0,1].
%
% Report number of hyperparameters
% s = likBeta ()
% s = likBeta (link)
%
% Prediction mode
% lp = likBeta (link, hyp, y, mu)
% [lp, ymu, ys2] = likBeta (link, hyp, y, mu, ... |
91c837b79c0f5bd8569108457e84d57954c08877f9eb173159fd6eaad9f4e045 | MATLAB | 5,223 | 139 | function varargout = liberty_csv(filename, hdr, begsample, endsample, chanindx)
% LIBERTY_CSV reads motion capture data from the Polhemus Liberty system
%
% Use as
% hdr = liberty_csv(filename);
% dat = liberty_csv(filename, hdr, begsample, endsample, chanindx);
% evt = liberty_csv(filename, hdr);
%
% See also F... |
ccaacd0d4ed3b4438a776b3d52b023a8e0fbf52f77aef72bee18fdd476493b73 | MATLAB | 5,224 | 168 | function M = unitaryfactory(n, k)
% Returns a manifold structure to optimize over unitary matrices.
%
% function M = unitaryfactory(n)
% function M = unitaryfactory(n, k)
%
% Unitary group: deals with arrays U of size n x n x k (or n x n if k = 1,
% which is the default) such that each n x n matrix is unitary, that is... |
fff87f5289f8ee12456958009cea8bc255bfbe4fe93da20addf60d01917b5341 | MATLAB | 5,224 | 106 | function [pwe] = startup_demo_ripples_1_f_noise
%% ########################################################################
% - Startup script for demo
% -------------------------------------------------------------------------
%
% Defines Projec... |
af45ae7f66a24a6ba9c6c8c247361edd041c8bbb04fb7290012ec4e8116c0df7 | MATLAB | 5,226 | 115 | function [W,Gss,Gds,Hds]=sphericalSplineInterpolate(src,dest,lambda,order,type,tol)
%interpolate matrix for spherical interpolation
%
% W = sphericalSplineInterpolate(src,dest,lambda,order,type,tol)
%
% Inputs:
% src - [3 x N] old electrode positions
% dest - [3 x M] new electrode positions
% lambda - [float] r... |
7bd1e7b41fb325c79478763026d77ff66f3d08ab4079c6655a210e1e3ea80e05 | MATLAB | 5,227 | 123 | function [d,Sig]=distanceLDC(B,partition,conditionVec,X)
% function [d,Sigma]=distanceLDC(Y,partition,conditionVec,X);
% Calculates the crossvalidated squared Euclidian distances between activation patterns
% (estimated beta weights) from the first level analysis. The distance is calculated
% by using data across par... |
d87a6b262819480658fcc02f2925e70715291ab70d690a842d988b9fe007d014 | MATLAB | 5,227 | 163 | function [img_pca,img_pca_null]=connectopic_laplacian(s,ind_ins,N,Vn,Null)
% Input:
% s: similarity matrx
% ind_ins: index of subcortical voxels
% N: size of image (MNI152:91x109x91)
% K: degree, used when Disparity=1
% Vn: index of gradient to compute: Vn=2 -> Gradint I; Vn=3 -> Gradient II; Vn=4 -> Gradient I... |
f82c6cf0986e06f8185b7b632b555af419a9ed992ea5cfdb608603d53e4acbf5 | MATLAB | 5,228 | 168 | %%%%% define
% define
subjid = 'subj04';
hemi = 'rh';
%%%%% for each hemisphere
% prep
close all;
% calc
dir0 = sprintf('~/Dropbox/nsddata/freesurfer/%s/',subjid);
% prep
valsLH = cvnloadmgz(sprintf('~/nsd/nsddata/freesurfer/%s/label/lh.flocfacestval.mgz',subjid));
valsRH = cvnloadmgz(sprintf('~/nsd/nsddata/freesu... |
09b66057411b94b7f4c79dc6a99848d5060bf74d28ea6bcb86acc98f340af94a | MATLAB | 5,230 | 136 | function EC_avg = plotEC_targetGroups_plotband(params, M, EC_info, selCh_groups, subjTag)
% plots effective connectivity (EC) of selected channel group (= params.grup_source) to all other groups
% plots = imagesc (a-la spectra) for each class: src->trg & trg->src
% input: M = 5D: ch_src, ch_trg,freq, time, clz
% channe... |
4018f42951231f65e70a16ecb1c4333f960c0e9237818a90008a2add5aee14a6 | MATLAB | 5,230 | 131 | % POP_PLOTTOPO - plot one or more concatenated multichannel data epochs
% in a topographic array format using PLOTTOPO
% Usage:
% >> pop_plottopo( EEG ); % pop-up
% >> pop_plottopo( EEG, channels );
% >> pop_plottopo( EEG, channels, title, singletrials);
% >> pop_plottopo( EEG, channels, title... |
72e3b5307d110b9938457848a83ca654bfa6e1807c7182ab888d65fab3346ee7 | MATLAB | 5,231 | 154 | function [core_svd,state_pks_full,param] = findSVDensemble2(data,param)
% Find ensembles using SVD method.
% INPUT:
% data: N-by-T binary spike matrix, where N is the number of neurons,
% T is number of frames
% coords: N-by-2 matrix, containing coordinates of corresponding
% neurons (for visual... |
d21fc0e364e638952e289bc0e49171bd8281e1495b3d9b7ebde58083aa4d7e89 | MATLAB | 5,231 | 96 | function [fid, hdr, cleanupObj] = write_nifti2_hdr(hdr, filename)
mydelete(filename); %avoid permission issues, and replace links with files instead of overwriting the pointed-to file
fid = fopen(filename, 'Wb'); %always write native-endian - capital W means fwrite() doesn't flush every call
if fid == -1
... |
1659888810873a3fe45f22715ea18e1bd9e9868ecfb43eaedea04628fc1c9814 | MATLAB | 5,232 | 192 | % This creates run-level metrics that are useful for assessing data quality.
% This comes at the very end.
%% %%%%% SETUP
% setup
nsdsetup;
% init
runmetrics = NaN*zeros(8,40,12,7); % 7 metrics are tSNR, FD, R2, RR, PCTCORRECT, EASY, EASYN
runmetricsRS = NaN*zeros(8,40,2,2); % 2 metrics are tSNR, FD
%% %%%%% L... |
4f9995b22e0b1a1096bf1cb53855d84990e5ce45114e1c34d18e814388d8445f | MATLAB | 5,233 | 125 |
%% vector mean fold 6
clear;
mask_b = MRIread('/Users/bo/Documents/brainmask/mask_ERC_harddraw_2mm.nii');
mask_b_ima = mask_b.vol;
mask_b_index = find(mask_b_ima>0);
name_pool = {'periodic_2501_subj_training_6_fieldmap_s'};
sub_pool=[1:28, 30, 32, 33, 34, 35];
output_table = cell(length(name_pool)*length(sub_pool), ... |
b0aa4478280b20630ee5af1ea28eed427c46b047f45be0dffa6778e32c1f508d | MATLAB | 5,233 | 147 | function [rez]=merging_M(rez,Threshold)
%Variable initialization
SF = rez.ops.fs; %sampling frequency to convert from sampling rate to second
Nclusters = length(unique(rez.st(:,end))); %Number of initial clusters from kilosort
NG_clus = Nclusters; %Number of clusters
nt... |
7010610a158443efb3ab634a4f89c384e60fdf4f163efe5cb28a40c6d9fbd47b | MATLAB | 5,234 | 150 | function availableFileList = MaskWrapper(maskFullName, inputDir, sepia_header, algorParam, availableFileList, outputFileList, outputNiftiTemplate)
%MASKWRAPPER Summary of this function goes here
% Detailed explanation goes here
sepia_universal_variables;
disp('---------------');
disp('Signal mask ');
disp('--------... |
9b933ac39c6b1cd9b09dfdf5e96c7664b0c070ad3f11870c03d743371bd2ff34 | MATLAB | 5,234 | 150 | function plotInfo = plotChannel_slicesActivity(params, D, H, selCh_H, plotInfo, groupInfo)
% plots into a single figure:
% - brain slices (axial, sigittal,coronal) - also for bipolar montage
% - freq. band activations
% - spectra
% input:
% - D{freq} = trialsData saved from triggerAnalysis
% - H = header
% ... |
5b3bf951178e20b4ac0115ba68478e3b7c6545b104159f84320ae35e0752fac6 | MATLAB | 5,236 | 140 | function [R] = PhaseEstimator(R, Opt)
if (~isfield(Opt, 'AmpPhase') | ~Opt.AmpPhase),
for (icol=1:1:length(R)),
%Calculate the phase of the trace, with the peak
%to be the start of the phase
nptrc = length(R(icol).tptrace);
R(icol).phz=-2.*ones(size(R(icol).t));
i=1;
j=1;
w... |
a73ff2491a94af23b14741eea16d31337cd634681ca063c7804a317ffbcdc7f6 | MATLAB | 5,236 | 139 | function mi = BF_MutualInformation(v1,v2,r1,r2,numBins)
% BF_MutualInformation Mutual information between two data vectors using bin counting.
%
% Mutual information computed using a histogram-based, bin-counting method.
%
%---INPUTS:
% v1, the first input vector
% v2, the second input vector
% r1, the bin-partitionin... |
b207973083e83a67c175842884fe3174d7b94af86beff7a863494cd997a63bc3 | MATLAB | 5,236 | 155 | function M = multinomialsymmetricfactory(n)
% Manifold of n-by-n symmetric stochastic matrices with positive entries.
%
% function M = multinomialsymmetricfactory(n)
%
% M is a Manopt manifold structure to optimize over the set of n-by-n
% symmetric matrices with (strictly) positive entries and such that the
% entries... |
af3c8166b8795ca88b5fb27097719204543fccd7f00a74eadc985dc75da7fec1 | MATLAB | 5,237 | 164 | function [curves,stats] = SurveyTuningCurves(units,varargin)
%SurveyTuningCurves - Compute and plot tuning curves for all subsessions.
%
% USAGE
%
% [curves,stats] = SurveyTuningCurves(units,<options>)
%
% units optional list of units, i.e. [electrode group, cluster]
% pairs; set clus... |
dd50077b085b51ec2dafd0b8247bfbc2de0a980a997187b8a4e0a6782eaca503 | MATLAB | 5,243 | 180 | function fear_deltaTrigIcaCoactStrength(basename,varargin)
% basename='~/data/Fear/triple/booyah180430/booyah180430';
%%
param.templateIdx=2; %id of template behavior session
param.targetIdx=3; %id of homecage session for significant selection
param.beh='nrem'; %name of behaviror type for siginificant selection : 'nrem... |
d59892946ce01f429dfdd35d844097b8bef69517716895e9355712c621dc788e | MATLAB | 5,246 | 173 | function Vargout=ComputeMI_SubSetOfData(xs,ys)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% COMPUTE MI FROM SCRATCH
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%{
The goal is to code p^(x)=1N∑i=1Nδ(x−x(i),h), eq 17 in Peng 2005,
which is the joint probability of x and y.
This required the following steps:
1. Define ... |
56e01aa41a77a04e9093dc0d609ccc1d4907bf1fe05c79a2409b30e9cfe482a7 | MATLAB | 5,247 | 150 | %% |cmocean| documentation
% The |cmocean| function returns perceptually-uniform colormaps generated by Kristen Thyng. A
% detailed description of the cmocean project is available at <http://matplotlib.org/cmocean>.
%
% If you find an occasion to cite these colormaps for any reason, or if you just want
% some nice b... |
07b89ed438faa0b27df322f2ed3beabff9f4f6d6494f0bf77c5111d14c909c04 | MATLAB | 5,248 | 107 | function [trl,dataselep] = iEEG_func_detectRipples_detector2(fsetup,data)
%% ########################################################################
% [trl,dataselep] = iEEG_func_detectRipples_detector2(fsetup,data)
% #########################################################################
%
% Ripple detection.
%
%... |
8b62d84be69778dc2dd5ab750590390033c390a2d6921cc020e6073877302c5b | MATLAB | 5,252 | 140 | function getWaveformStats_KS2(basename)
% getWaveformStats_KS2(basename)
% get waveform stats
% run makeSpikeFiles_KS2() and getFet_KS2() beforehand.
%
% waveformStats with the following field will be saved in analyses dir
% rise: rise-trough time in ms
% decay: trough-decay time in ms
... |
55637e4831b65978bf34587ae59ecf6de28a5510e3ce5b1ddc761902fb0bcedf | MATLAB | 5,253 | 126 | function [m,t] = mPETH(data, event, varargin)
%
% [[m,t] = mPETH(data,events,<options>)]
% [returns the mean PETH (see <a href="matlab:help PETH">PETH</a>)]
%
%
%
% INPUTS
%
% [data] [data to find events for]
% [events] [events for PETH]
% <options> optional list of property-value pairs (see tab... |
c6e2611def237075c5528465ecd8f95413af016b7f6840b41cdea4d80118d5b3 | MATLAB | 5,253 | 165 | function [Iq,A,W,S,sR]=icasso(mode,X,M,varargin)
%function [Iq,A,W,S,sR]=icasso(mode,X,M,['argid1',value1,'argid2',value2,...])
%
%PURPOSE
%
%Demonstrates the basic Icasso procedure:
%1. Runs FastICA with given parameters M times on data X. in mode
%'both'. See function icassoEst.
%2. Clusters the estimates and comput... |
e35494072d2430411c3d399791f2aad4a0b16327876f498acee3c8d619fbbc46 | MATLAB | 5,254 | 119 | % [totalField, N_std, headerAndExtraData] = Wrapper_EchoCombine_OptimumWeight(fieldMap,mask,matrixSize,voxelSize,algorParam,headerAndExtraData)
%
% Input
% --------------
% fieldMap : original single-/multi-echo wrapped phase image, in rad
% mask : signal mask
% matrixSize : size of the input image
% v... |
f63ae80b9714027c7526efea4b9fb8bb3c79ea59a5811be3a5c86bdcb5f49fe7 | MATLAB | 5,255 | 145 | function ProcessData_Figure2(BestFitEarly, BestFitLate, codedir, savedir)
%ProcessData_Figure2 - function to process data to generate Figure 2. Saves
% data in savedir to be accessed by PlotFigure2
% INPUTS:
% BestFitEarly - BestFit.mat file found at: Mah_CellReports_BehavorialData/FitAll_ITI_VanillaAlpha_First10/BestF... |
853ca63e3b7f415d2a97970ac34f8533a8faa9c8975905414a8bc84b06021481 | MATLAB | 5,257 | 145 | function imdb = cnn_setup_data_voc07(varargin)
%CNN_VOC07_SETUP_DATA Download Initialize PASCAL VOC 2007 data
%
% Copyright (C) 2016 Hakan Bilen.
% All rights reserved.
%
% This file is part of the VLFeat library and is made available under
% the terms of the BSD license (see the COPYING file).
opts.dataDir = fullfil... |
c0bb5e9e1abebc5dbc011f14bc15d5d79401ca64e9e60692148e912ca41ec327 | MATLAB | 5,257 | 126 | function [renderedImage, edges, parameters] = RenderMList(MList, varargin)
% ------------------------------------------------------------------------
% [renderedImage, edges, parameters] = RenderMList(MList, varargin)
% This function renders an MList into a high resolution image.
%------------------------------------... |
90a52e227c23085f56dbbb9923ae5bbf844b17c56778df7a9965f57d327bacc8 | MATLAB | 5,261 | 173 | function [varargout] = opm_fil(filename, hdr, begsample, endsample, chanindx)
% OPM_FIL reads header, data and events from OPM MEG recordings that are done at the FIL (UCL, London).
%
% Use as
% hdr = opm_fil(filename);
% dat = opm_fil(filename, hdr, begsample, endsample, chanindx);
% evt = opm_fil(filename, hdr... |
5c418563c6b1891362d664a66eb31c4a182fe79c4bc080845c85064e4460d861 | MATLAB | 5,262 | 158 | %% This is just run one-time to generate some files.
*** note:
intereseting stimulus statistics:
model wise cross correlation...
contrast,
foreground, etc.
%%%
% define
types = {'Faces' 'Words' [] [] 'Bodies' 'Foreground'};
labeltypes = {'Automated' 'Semi-automated'};
imageres = 50; % resolution for the prf mod... |
498ebd78a4b1c9e24671ca793158d171db04f441590d7a716a6a351d039bde1a | MATLAB | 5,265 | 155 | function fear_tripleChanceLevel_firstREM(basename,varargin)
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName)
param.thrshold=125;
param.nIte=500;
param.chunkSize=2;
param=parseParameters(param,varargin);
load([basicMetaData.AnalysesName '-... |
55781393b66e0b68cb393356a06453ee11b075f8ead5994d81e5ba1c53b5c79d | MATLAB | 5,272 | 131 | % SUBSREF - index eegdata class
%
% Author: Arnaud Delorme, SCCN, INC, UCSD, Nov. 2008
% Copyright (C) 2008 Arnaud Delorme, SCCN, INC, UCSD
%
% This file is part of EEGLAB, see http://www.eeglab.org
% for the documentation and details.
%
% Redistribution and use in source and binary forms, with or without
% modificati... |
74224561884e526568e06aa90f0b03faa30067b0eebf003a136112884162c2be | MATLAB | 5,272 | 123 | function out = CO_Embed2_Dist(y, tau)
% CO_Embed2_Dist Analyzes distances in a 2-dim embedding space of a time series.
%
% Returns statistics on the sequence of successive Euclidean distances between
% points in a two-dimensional time-delay embedding space with a given
% time-delay, tau.
%
% Outputs include the auto... |
f515fe6406f454ae04061e0b66b6246b13439f9005be33f84bb5afb6b94a58e9 | MATLAB | 5,274 | 146 | function [err, out_fn] = Norm (InBrik, N_runs, run, run_norm, run_mask, foutid_log)
%
% [err, norm_fn] = Norm(InBrik, N_runs, run)
%
%Purpose:
%
% Normalize the original dataset so that the beta values in 3dDeconvolve would be automatically percent signal change.
%
%Input Parameters:
%
%
%
%Output Parameters:
% e... |
49cb077b5bad4176fd2d6dd0c554c84aa376da886320fb484f543330c1262362 | MATLAB | 5,275 | 196 | % QRTIMAX - perform Quartimax rotation of rows of a data matrix.
%
% Usage: >> [Q,B] = qrtimax(data);
% >> [Q,B] = qrtimax(data,tol,'[no]reorder');
%
% Inputs:
% data - input matrix
% tol - the termination tolerance {default: 1e-4}
% noreorder - rotate without negation/reorder... |
559a0834c930c9707eb8aaa0efba145bcfef545094419ccbe77b73592c59f1d0 | MATLAB | 5,275 | 120 | % This MATLAB script can be used to reproduce the result of EEG spectral power increase and decrease
%
% Please download BBCItoolbox to 'MyToolboxDir'
% Please download dataset to 'NirsMyDataDir' and 'EegMyDataDir'
% The authors would be grateful if published reports of research using this code
% (or a modified version... |
9fb91565def19a27c2925a7441b743383076b2dbc43aa80e9813111560285883 | MATLAB | 5,275 | 182 | function [ltom, htom, mtol, mtoh, ltom_incong, htom_incong, sems] =...
block_dynamics_latency(A, twin, smoothfactor, varargin)
%plot how latency changes around block transitions. cmc 7/16/21
%inputs: A struct- If given S struct, will convert it to A.
% twin- ntrials around block transitions.
% smoothf... |
773672f8b5049e9ab15145dcb6f826a25fa5adc12832c5eed3744d4a23b9cd95 | MATLAB | 5,276 | 146 | % SBPLOT - create axes in arbitrary subplot grid positions and sizes
%
% Usage: >> axis_handle = sbplot(v,h,index)
% >> axis_handle = sbplot(v,h,[index1 index2])
% >> axis_handle = sbplot(v,h,[index1 index2],axprop,..)
% >> axis_handle = sbplot(v,h,[index1 index2],'ax',handle,axprop,..)
%
% I... |
09f7f1a95c3991786e250dc81192785a5b352bd36803bc108c22819fec53a87a | MATLAB | 5,278 | 159 | function shiftedY = shift_timeseries(this, dt)
% Shifts voxel trace along time dimension by fixed time using Fourier
% interpolation, and updates time vector in dimInfo
%
% TODO: only works for 4D data at the moment!
%
% Y = MrDataNd()
% shiftedY = Y.shift_timeseries(dt)
%
% This is a method of class MrDataNd. It ... |
845929648cfc5477cc2a7047f4be7915cd4f73bdc999c0382ddddfbbe622ff5d | MATLAB | 5,282 | 137 | function export_fieldtrip_hartmut_bnd(input_img, numvertices, outname)
% EXPORT_FIELDTRIP_HARTMUT_BND Write the labelled bnd file the HArtMuT
% FieldTrip example (example_ft_dipolefitting_hartmut.m, cfg_source='mri') loads.
%
% Input: input_img <string> fullpath to the segmented T1 (same handle the
% ... |
67e38b0066a18ff193283adf5af5cd7450e112e84439b402ee77491290c36555 | MATLAB | 5,285 | 166 | function h = boxplot2(varargin)
%BOXPLOT2 Enhanced boxplot plots
%
% h = boxplot2(y)
% h = boxplot2(y,x)
% h = boxplot2(..., p1, v1, ...)
%
% I don't like the original boxplot function... it messes with axis
% dimensions, replaces tick labels with text (even if no rotation is
% needed), and in general hijacks the axis... |
ea6ed945e4b77acd27c319b5c08541a4988e0f74a8a1add87b7792a892fef095 | MATLAB | 5,288 | 184 | function fear_expVar(basename,varargin)
% basename='~/data/Fear/triple/hoegaarden181115/hoegaarden181115';
%%
load([basename '.basicMetaData.mat'])
fprintf('%s start %s with data of %s\n',datestr(now),mfilename,basicMetaData.SessionName)
%%
load([basicMetaData.Basename '.SleepState.states.mat'])
load([basicMetaData.Ba... |
cc592432c0a90ac1b4b712e47acc597cc0b2c787fa7194260c8d0ffae0385491 | MATLAB | 5,290 | 116 | function SaveData_Chisep(Data, RunOptions)
outdir = Data.output_root;
mkdir(outdir);
Options = RunOptions;
tmp = pwd;
eval(['cd(''' outdir ''');']);
if strcmp(RunOptions.InputType, 'nifti')
%save('results.mat','Data' ,'Options','-V7.3')
[save_func, Data.nii_file, Data.save_name]=load_nii_template_... |
0fcd4d3155ea27532bcba781e661c436f1486910979e8ddce7ff0c6636236828 | MATLAB | 5,291 | 125 | %% Wrapper_SWISMWI_SWI_2DHamming(headerAndExtraData,output_structure,algorParam)
%
% Input
% --------------
% headerAndExtraData : structure contains extra header info/data for the algorithm
% output_structure : structure contains output file path and output NIfTI header
% algorParam : structure contains fiel... |
6d64589a0d96c20b0fa9792673c56fe4e8af4ea39942d00597cf4b1d2d507c1b | MATLAB | 5,296 | 154 | function out = WL_DWTCoeff(y, wname, level)
% WL_DWTCoeff Discrete wavelet transform coefficients.
%
% Decomposes the time series using a given wavelet and outputs statistics on the
% coefficients obtained up to a maximum level, level.
%
% ---INPUTS:
%
% y, the input time series
%
% wname, the mother wavelet, e.g., '... |
e6e339009e9da47e88391da0593f31fdb1ffeb50800855bbbe360b32ea54a167 | MATLAB | 5,296 | 150 | % TTEST2_CELL - compute unpaired t-test. Allow fast computation of
% multiple t-test using matrix manipulation.
%
% Usage:
% >> [T df] = ttest2_cell( { a b } );
% >> [T df] = ttest2_cell(a, b);
% >> [T df] = ttest2_cell(a, b, 'inhomogenous');
%
% Inputs:
% a,b = data consisting of UNPA... |
de708d48a0a354548e0e6befc75f73f54bd9aa9fc82a53bed916e54e6c2e7843 | MATLAB | 5,298 | 224 |
function [fod] = csd(data,bDirs,HRdirs, Strue,lmax)
SHscheme = genSH(double(bDirs'),lmax);
SHschemeOUT = genSH(HRdirs',lmax);
SHscheme300 = genSH(HRdirs',lmax);
shhres = SH2RH(amp2SH(Strue,SHscheme));
%shhres/shhres(1)
[fod] = csdeconv (shhres, data, SHscheme,SHscheme300);
function [ FOD] = csdeconv (R_RH, S... |
c4a661ed15884f410262530b9be3aabf517c4f038a91c70b144e4d4f52a2b0e0 | MATLAB | 5,300 | 92 | function res = arg_norep(varargin)
% Like arg(), but not reported to outer functions (inluding GUIs or other frameworks).
% Spec = arg_norep(Names,Default,Range,Help,Options...)
%
% This type of argument specifier behaves like arg(), but is never reported outside the function.
% Possible uses are arguments that are no... |
3cd2fb4414fd77e0f49291020c5ab5abb42b4b33f0ffeb8ec002561d701cd15e | MATLAB | 5,301 | 125 | %% Wrapper_SWISMWI_SWI_2DHamming(headerAndExtraData,output_structure,algorParam)
%
% Input
% --------------
% headerAndExtraData : structure contains extra header info/data for the algorithm
% output_structure : structure contains output file path and output NIfTI header
% algorParam : structure contains fiel... |
aef9ec3ab9c93d61e0227a41152ee2dca556ccfbbab1b5d0c7818a4d5faef4ac | MATLAB | 5,305 | 112 | function plot_histograms_mean_neural_activity_ITI_epoch
close all
clear all
clc
% Plot histograms of mean neural activity during the ITI period for control and APP-KI mice.
% Select a folder containing data.
folder_name = uigetdir;
cd(folder_name)
% Control.
load('activity_iti_control.mat')
activity_iti = activity_i... |
6aeb381d2e4c7607a0db5570196993b7f81edbecfad245a35de481e334a5c493 | MATLAB | 5,307 | 132 | function osp_onFit( ~, ~ ,gui)
%% osp_onFit
% Callback function on fit button click.
%
%
% USAGE:
% osp_onFit( ~, ~ ,gui);
%
% INPUT: gui = gui class containing all handles and the MRSCont
%
% OUTPUT: Changes in gui parameters and MRSCont are written into the
% gui class
%
%
%... |
80b55765ddc955a05a589dd0a5652d3852d142734c05222f0cbd92b89cc243be | MATLAB | 5,307 | 136 | %% DrawStopInN
%% Constants
px2cm = 0.169;
BasePath_Behavior = 'D:\Data\Lobster\BehaviorData';
BasePath_FDR = 'D:\Data\Lobster\FineDistanceResult_syncFixed_June';
BasePath_Original = 'D:\Data\Lobster\Lobster_Recording-200319-161008\Data';
TIMEWINDOW_LEFT = -2000;
TIMEWINDOW_RIGHT = +2000;
numBin = 80; % 50ms bin
fi... |
9e99b3c14b7016cf83c1a3a4a5cd44d6604fdf179f1752446de94f0db663d3a3 | MATLAB | 5,307 | 197 | function [x,status] = denoisingTrace(y,lambda)
% [x,status] = denoisingTrace(y,lambda)
%
% finds the solution of the l1 trend estimation problem
%
% minimize (1/2)||y-x||^2+lambda*||Dx||_1,
%
% with variable x, and problem data y and lambda, with lambda >0.
% D is the second difference matrix, with rows [0... -1 2 ... |
87befcaa36fcf609bbb77dc1e54683c49e26f42f3a2aa17d2d1c01b447a7d893 | MATLAB | 5,308 | 159 | % Script demo_plot_images
% Exemplifies plot capabilities for the Toolbox (montage/slider/overlay/3D/
% spmi)
%
% demo_plot_images
%
%
% See also
% Author: Saskia Bollmann & Lars Kasper
% Created: 2015-02-12
% Copyright (C) 2015 Institute for Biomedical Engineering
% University of Zurich and E... |
5855d59e30dd3bc5b8d261ba24c69dd63fb5ae0480d4403fd9e0eb89c227da5b | MATLAB | 5,311 | 201 | function [err,M] = MakeColorMap (Fiducials,Ncols,Opt)
%
% [err,M] = MakeColorMap (Fiducials,Ncols,Opt)
%
%Purpose:
% returns the RGB colormap containing Ncols that vary linearily
% from the first color in Fiducials to the last.
%
%Input Parameters:
% Fiducials : Nx3 matix specifying the RGB values (0-255) or
% ... |
31f649d2a35b8b5c69ae8d86814ec83c8d6c913a685294ac815a645881fe54da | MATLAB | 5,312 | 137 | function ARTwarp_cli_mode(varargin)
% PARSE INPUT ARGUMENTS
% Instantiate an inputParser object to manage inputs
p = inputParser;
% Add required positional arguments for:
% The path to the folder containing the contours to categorise
addRequired(p, 'inputFolder', @isfolder);
% The warp factor level
validationFcn =... |
0ff68ea15766bf9683b9d7cdaed510acd3bc38d62ef811f1a9811fbe2acda715 | MATLAB | 5,316 | 150 | function [Y, problem, S] = elliptope_SDP(A, p, Y0)
% Solver for semidefinite programs (SDP's) with unit diagonal constraints.
%
% function [Y, problem, S] = elliptope_SDP(A)
% function [Y, problem, S] = elliptope_SDP(A, p)
% function [Y, problem, S] = elliptope_SDP(A, p, Y0)
%
% A is a real, symmetric matrix of size n... |
e6b0156dc27d98603f4fa90c2eeb0c5448c5c1bc77109dec11b5c5b5b62cf2ba | MATLAB | 5,317 | 135 | function out = EX_MovingThreshold(y, a, b)
% EX_MovingThreshold Moving threshold model for extreme events in a time series
%
% Inspired by an idea contained in:
% "Reactions to extreme events: Moving threshold model"
% Altmann et al., Physica A 364, 435--444 (2006)
%
% This algorithm is based on this idea: it uses t... |
fbc757fbaca2b3466e0409b2f0aa65b2df268774ec869651e588cba735bf59db | MATLAB | 5,320 | 152 | function x = DBGetVariables(query,varargin)
%DBGetVariables - Get all variables that match given criteria.
%
% Get variables and related information such as code used to generate them.
%
% This is mostly useful to get information about the variables (who stored
% them, when, which code was used, with what parameters, ... |
e668ef3859f7b134519a7e88ab1ec4c43f67704d3146199129b321a682307cd9 | MATLAB | 5,322 | 157 | function fh = tapas_physio_plot_cropped_phys_to_acqwindow(ons_secs, sqpar, verbose)
% plot parts of the time series to be processed into regressors
%
% USAGE
% fh = tapas_physio_plot_cropped_phys_to_acqwindow(ons_secs, sqpar, y)
%
% INPUT
% ons_secs - output of tapas_physio_crop_scanphysevents_to_acq_window
% ... |
244afc72d9eb363fb3f7c4eeaa06a1d8f4b26f739a5122acf5d8621fe516b05f | MATLAB | 5,324 | 141 | %% h = sepia_handle_panel_qsm_Chi_separation(hParent,h,position)
%
% Input
% --------------
% hParent : parent handle of this panel
% h : global structure contains all handles
% position : position of this panel
%
% Output
% --------------
% h : global structure contains all new and o... |
07713de6d37f5b6f73a8cb603075aa439fb5f0847e143923e847e929e425fd97 | MATLAB | 5,326 | 141 | %{
# object identities in clips from movies
-> movies.Object
clip_number : int # clip index
---
file_name : varchar(255) # full file name
clip : longblob #
parent_file_name : varcha... |
8d6d1ea61cea4e7d4f2377b3fc818d6c3f38c9336f73ab3679ef4d91e4cbe4f5 | MATLAB | 5,329 | 147 | % FieldTrip
% Version unknown www.fieldtriptoolbox.org DD-MM-YYYY
%
% FieldTrip is the MATLAB software toolbox for MEG and EEG analysis that is being
% developed at the Donders Institute for Brain, Cognition and Behaviour in Nijmegen,
% the Netherlands together with collaborating institutes.
%
% The toolbox offers adva... |
a65bb88df8ee11eff2ee4acb37e769f93e1016258e9ca18b6129ac88c88d33ce | MATLAB | 5,330 | 140 | function varargout = TMSFC_GUI(varargin)
% TMSFC_GUI M-file for TMSFC_GUI.fig
% TMSFC_GUI, by itself, creates a new TMSFC_GUI or raises the existing
% singleton*.
%
% H = TMSFC_GUI returns the handle to a new TMSFC_GUI or the handle to
% the existing singleton*.
%
% TMSFC_GUI('CALLBACK',hObject... |
f69dd14619df8e8ef82f98f803406982a46b14db1e7840eb59819e2bf0820600 | MATLAB | 5,331 | 186 | function this = MrDimInfo_load_from_mat(this, testCaseLoadMat)
%ONE_LINE_DESCRIPTION
%
% Y = MrUnitTest()
% Y.MrDimInfo_load_from_mat(inputs)
%
% This is a method of class MrUnitTest.
%
% IN
%
% OUT
%
% EXAMPLE
% MrDimInfo_load_from_mat
%
% See also MrUnitTest
% Author: Saskia Bollmann & Lars Kasper
% Create... |
e6f26b344c209acc3c38a54aae02d8d4cedde157e3cad47b8aa2f728649f76dd | MATLAB | 5,334 | 154 | function [net, info] = cnn_cifar(varargin)
% CNN_CIFAR Demonstrates MatConvNet on CIFAR-10
% The demo includes two standard model: LeNet and Network in
% Network (NIN). Use the 'modelType' option to choose one.
run(fullfile(fileparts(mfilename('fullpath')), ...
'..', '..', 'matlab', 'vl_setupnn.m')) ;
opts.... |
96d657624b71c862e39458e22830dbc734b2fba515431cd84f9eedfe1f36bd6b | MATLAB | 5,338 | 132 | % STD_COMBTRIALINFO - Combine and integrate all the info into the
% field trialinfo
%
% Usage:
% >> trialinfo = std_combtrialinfo(datasetinfo, [1 2]);
% >> trialinfo = std_combtrialinfo(datasetinfo, 'S01');
%
% Inputs:
% datasetinfo - Datasetinfo structure from STUDY or
% ... |
f559fa5dfbdb6c3ea5afba582ea7f54ead083870411a822e7fff0d5930e99298 | MATLAB | 5,339 | 176 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% COMPUTE MI FROM SCRATCH
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%{
The goal is to code p^(x)=1N∑i=1Nδ(x−x(i),h), eq 17 in Peng 2005,
which is the joint probability of x and y.
This required the following steps:
1. Define δ
1.1 Define z, h, sigma
1.2 ... |
7e7d72ec0e26c382c5eaae55c691bf9e0a13da53c9aec0c9a5ac8a7348c5ed4a | MATLAB | 5,343 | 135 | function [testInputs] = get_testInput(varargin)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% get_testInput validates and returns inputs required for a test functions.
% It also returns default inputs if no input are provided.
%
% Arguments:
% Check test_NBSPredict and sim_testNBS... |
deeb936b2676ebcfcf9cd22be30d0df8ff6a93c5cf583c650b1536e3a8a29835 | MATLAB | 5,346 | 161 | %% c
% A heat map of context decoding
% across time. The green diagonal line denotes identical training or testing times
% (see panel d).
clear all
load fig3Cdata.mat
disp(t(steps));
figure
imagesc(mean_context_decmat*100,[20 30])
c = colorbar();
ccc = parula(5);
hold on, plot(steps([1 1]),[0 67],'w--','LineWidt... |
e3aa9a1835bce3615fe31d404b57c604a659978c719e720e3dd4ded3fd0c7a64 | MATLAB | 5,347 | 184 | function [best, lossTest, lossTestSEMs, lossTrain] = crossvalPCAYu(data, labels, maxDim, method, nFolds, nVars)
% [best, lossTest, lossTrain] = crossvalPCAYu(data, labels [, maxDim] [, method] [, nFolds] [, nVars])
%
% Cross-validation for PCA, using Byron Yu's method of double-holdout. We
% first hold out some observ... |
882bcb0e358e9ff90a29d78c78400da788b40cc5bf9500bdfe14afc78cfd130d | MATLAB | 5,348 | 172 | function [H,S,D]=sobi(X,n,p)
% SOBI - Second Order Blind Identification (SOBI) by joint diagonalization of
% correlation matrices. THIS CODE ASSUMES TEMPORALLY CORRELATED SIGNALS,
% and uses correlations across times in performing the signal separation.
% Thus, estimated time delayed covaria... |
61787fcd1b3bf28bbb55740b63f5e998743f6492d6b254bf7298ca6f4dc95f63 | MATLAB | 5,350 | 162 | function this = finish_processing_step(this, module, varargin)
% finishes current processing step by deleting duplicate data and storing
% results of processing step
%
% MrSeries = finish_processing_step(MrSeries, module, varargin)
%
% This is a method of class MrSeries.
%
% IN
% module 'realign', 'smooth', ..... |
88f9f2580ff727612f724a471c255cda76edec0a2822313343748b9ca453e336 | MATLAB | 5,350 | 149 | function [Y, problem, S] = elliptope_SDP_complex(A, p, Y0)
% Solver for complex semidefinite programs (SDP's) with unit diagonal.
%
% function [Y, problem, S] = elliptope_SDP_complex(A)
% function [Y, problem, S] = elliptope_SDP_complex(A, p)
% function [Y, problem, S] = elliptope_SDP_complex(A, p, Y0)
%
% A is a Herm... |
147344c58111678d9012281d83f7ea57d3b879c4315a4ff3e03cd05c7e58ca89 | MATLAB | 5,351 | 198 | function coactPaper_figureS06()
labelWeight=true;
labelCase=false;
labelSize=9;
letGapX=5;
letGapY=6;
fontsize=6;
%
close all
fh=initFig('width',18.6,'height',6,'font','Arial','fontsize',fontsize);
x=15;y=5;
panel_01(x,y,fontsize);
drawnow();
print(fh,sprintf('~/Dropbox/FearAnalyses/paper/figure/figS06_%s.pdf',dates... |
e093e0150989bf838ed5d5d1c13edfed4bc4bb4020bd816f0e61a114f8a29a31 | MATLAB | 5,352 | 127 | % VECTDATA - vector data interpolation with optional moving
% average.
%
% Usage:
% >> [interparray timesout] = vectdata( array, timesin, 'key', 'val', ... );
%
% Inputs:
% array - 1-D or 2-D float array. If 2-D, the second dimension
% only is interpolated.
% timesin - [float ... |
36d8e7b7d0c05633134705923744d4b5f2d59ce66d0a3d7ef5de5b40d1dd7a1b | MATLAB | 5,355 | 168 | function M = stiefelstackedfactory(m, d, k)
% Stiefel(k, d)^m, represented as matrices of size m*d-by-k.
%
% function M = stiefelstackedfactory(m, d, k)
%
% Points on this manifold are matrices Y of size n x k, with n = m*d.
% Y is thought of as m matrices of size d x k each, stacked on top of each
% other. Call them Y... |
26d36e503ba61231bad88f42cdeaa1d3d7e2b9b06e6786866ebf25e91add1282 | MATLAB | 5,357 | 165 | function getClusterQuality_KS2(basename)
% getClusterQuality_KS2(basename)
% get cluster stats
% run makeSpikeFiles_KS2() and getFet_KS2() beforehand.
%
% clusterStats with the following field will be saved in analyses dir
% isoDist: isolation distance (well isolated, >20)
% Lratio; L... |
d3927b75e6d2ad4cde1caad0f081c9bf20938cfdbe840be02c248a0ae6630edb | MATLAB | 5,360 | 121 | function out = WL_modwtvar(y, wname, level)
% WL_modwtvar Multiscale variance decomposition via the maximal overlap DWT.
%
% Decomposes the time series into octave-scale bands using the maximal
% overlap discrete wavelet transform (MODWT) and computes summary statistics
% on how variance is distributed across scales.... |
4a615d0cc89178d81cbc58db1fd9eca33bcfc2917014dc8a81c4c8a398cb2e78 | MATLAB | 5,363 | 138 | function [varargout] = fMRIMaskPreparation(userOptions)
%
% fMRIMaskPreparation will load SPM-defined masks from a directory specified in
% userOptions and will save a struct containing binary mask matrices.
%
% [binaryMasks_nS =] fMRIMaskPreparation(userOptions)
%
% userOptions --- The options struct.
% ... |
8448395a7d27580219cb269478eb081a2108bd6047b7e1956f96613d95c10a5a | MATLAB | 5,364 | 134 | function [ModelOutput] = fit_OspreyParamsToConcModel(inputData, inputSettings, fitParams)
% This function applies a set of Osprey 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 resi... |
d8144aa5383084f7fdd62de2104f171d5623aa17eb9818f24377a89c37f901ad | MATLAB | 5,365 | 179 | function [ output ] = tapas_rdcm_store_parameters(DCM, mN_cut, sN, aN, bN, logF, logF_term, idx_x, z_cut, args)
% [ output ] = tapas_rdcm_store_parameters(DCM, mN_cut, sN, aN, bN, logF, logF_term, idx_x, z_cut, args)
%
% Wraps parameters to the output structure.
%
% Input:
% DCM - model structure
% ... |
b44386b20e0db12b51185c6ecf764b861b3e0a8e8c24806162701f9dfac87928 | MATLAB | 5,369 | 199 | function [prob,perc] = indic2classify1(indic,n,nms)
%
% indic is matrix of indicators, studies/contrasts are rows, 1/0 codes yes/no for
% task and regional activation. integers in indic above 1 are treated as
% 1.
%
% first n indicator vars are task codes, rest are regional activation
% nms is cell array of strings, f... |
88915163717efa196165049ce254de99a654b11b374f491e65ae639763e5f789 | MATLAB | 5,370 | 188 | function ARTwarp_cli_builder()
% This file creates the CLI command based on the input parameters.
% --- Required inputs (enforced) ---
% Input folder
while true
% strtrim to ensure there are no leading or trailing spaces.
inputFolder = strtrim(input('Enter input folder name: ', 's'));
if ~isempty(inputFol... |
3f1201a53524243988c2bde409dc871307010ce1eccbb4b55ebf56c0bded029e | MATLAB | 5,372 | 173 | function varargout = quspin_lvm(filename, hdr, begsample, endsample, chanindx)
% QUSPIN_LVM reads QuSpin OPM data from the LabVIEW measurement file.
% See also https://www.ni.com/docs/en-US/bundle/labview/page/labview-measurement-files.html
%
% Use as
% hdr = quspin_lvm(filename);
% dat = quspin_lvm(filename, hdr,... |
48e1472343e4e5a0ebd22d372ed4b4eeae37dca0607c01e5e8ac53231e9c1a94 | MATLAB | 5,372 | 151 | function M_subj = plotFC_spectral_2NN(M, EC_info, chGroups, thr_nChPerGroup)
% plots results of functional connectivity (FC) - e.g. DTF
% works for two neural networks (NN)
% input:
% - M = FC matrix, 5D: M(ch_trg,ch_src,freq,time,clz)
% - EC_info = freq & time + other info (see: connectivityAnalysis.m)
% - chGro... |
acd08f7864e3b996c7c988e3e560e1c853617882a16707155b62b4ad3c56c971 | MATLAB | 5,372 | 185 | function out = osp_plotMRSImap(MRSCont, kk, nominator_spec,denominator_spec, nominator, denominator, upsample,figTitle)
%% out = osp_plotFit(MRSCont, kk, which, stagFlag, xlab, ylab, figTitle)
% Creates a figure showing data stored in an Osprey data container, as
% well as the fit to it, the baseline, the residual,... |
979b263e56adf6871a7f8f12faa06e0e879322a8485e636ec7ba8e46fe5fe060 | MATLAB | 5,376 | 120 | function [numClust, centInd,predbounds] = decisionGraph(rho, delta, met)
% DECISIONGRAPH Decision graph for choosing the cluster centroids.
% INPUT:
% rho: local density [row vector]
% delta: minimum distance between each point and any other point with higher density [row vector]
% isManualSelect: 1... |
7a99bbc8d3d7fcd9da48b59f7f96780419b3772e97d968f60daff0f40d6aa920 | MATLAB | 5,377 | 169 | function [ subject, ekg ] = nmri_read_ekg(subject, params)
%[ subject, ekg ] = nmri_read_ekg(subject, params)
%
% This function will try read an EKG/ECG channel from MEG/EEG datasets
% in a way that is compatiple to nmri_preproc
%
% subject = subject structure, see nmri_read_subject
% could be a st... |
0c5081cd7b5378a3437d975834fe5d83b0501bab5a2c069141776437626be83c | MATLAB | 5,378 | 175 | function [] = IntensityAnalysis(filename,ROImatrix,filetime,sigma_threshold,colors)
data=mean(ROImatrix');
[num_record,data_len]=size(data);
timeinterval = filetime/data_len;
amplitudes = cell(num_record,1);
[~,savename,~]=fileparts(filename);
cd(savename);
cd('../');
for j=1:num_record
spike_data = da... |
4f816a5ad2f0394fedf764656371ea95d2a9cbf4a36b35573bf7eaca56cfb594 | MATLAB | 5,378 | 154 | function [weightedMean,weightedStdOfMean,weightedStdOfSample] = weightedStats(data, weightsOrSigma,sw)
%wStats calculates weighted statistics (mean, stdev of mean) for a list of inputs with corresponding weights or {std}
%
%SYNOPSIS [weightedMean,weightedStd] = weightedStats(data, weightsOrSigma,sw)
%
%INPUT data: vect... |
eed91f0064d6896cec55a126106790049168bf686f964f80ab4af07775e03210 | MATLAB | 5,378 | 115 | %% TestOddMatrixSize - Tier 1 toolbox-free odd-matrix-size test
%
% SEPIA pads odd-sized matrix dimensions to even before FFT/k-space-based
% processing (estimateTotalField, BackgroundRemovalMacro, QSMMacro - see
% utils/zeropad_odd_dimension.m) and crops back to the original size
% afterward. This test runs the full o... |
91874e88f24bb1f1ff19de2aa41fb6b8cb8cba53c6e6f57f14eed448b16f7f1e | MATLAB | 5,379 | 178 | function tests = test_jsonread
% Unit Tests for jsonread
% $Id: test_jsonread.m 7077 2017-05-23 09:13:10Z guillaume $
tests = functiontests(localfunctions);
function test_jsonread_from_string_1(testCase)
json = '["one", "two", "three"]';
exp = {'one';'two';'three'};
act = jsonread(json);
testCase.verifyTrue(isequa... |
ab2d05bfa656fae94b1cd826c2dd588c949bf02f647c9d6ce8e4e228f6809166 | MATLAB | 5,379 | 124 | function data = readAudioHD5(F,varargin)
% F: Key structure or full filename including path (for example '/path/Patchfile10.h5')
%
% data: audio data extracted from file
% ver: 1.0
if isstruct(F)
if count(experiment.ScanBehaviorFile & F)
F = fullfile(getLocalPath(fetch1(experiment.Session & F,'behavior_pat... |
90c830eb0cc25c3503edb78deb13976ad9e0127d65834c0f69db5b3e956522b2 | MATLAB | 5,380 | 169 | function [ goodTrials, badTrials ] = nmri_trial_selector( subject, data, params, output )
% [ goodTrials, badTrials ] = nmri_trial_selector( subject, data, params )
% Will determine god and bad trials, based on the selectors in
% analysis_params, trial_info and events
% will automatically be called during trial s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.