sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
d68c5cc8324ada8436a0831de52a23d742cd7ab75dfdda51659d907317cf6cd7
MATLAB
2,086
65
function [ellapsed, difference] = wait2( timeout, flushevents) %WAIT waits for a specified duration in milliseconds % % Syntax: WAIT(timeout); % Syntax: WAIT(timeout, flushevents); % % Inputs: % timeout, the timeout to wait in milliseconds % the variable timeout has to be numeric, scalar and real % flush...
9abe77da7b964a075dd9ed9726cb40f5df5bcac54680a82f7d6a6ff82bb72ffc
MATLAB
2,087
72
function plotJointKinematicsCVPCA(lossTests) % Pair plot of cvPCA results % Figure fig; axis off hold on; % Params colors = turbo(size(lossTests,1)); markers = {'s', 'x', '+', '*', 'o'}; % Loop over mice for mouseN = 1:size(lossTests,1) % Angles mouseLoss = lossTests(mouseN,:,1); [mouseBestA, mouseB...
3ce8b5de1dc8c87b86f1b309a93c80f66787bc178afd8aaae10f08922f171d2c
MATLAB
2,089
80
function fear_icaReacCCG_NREM(basename,varargin) % basename='~/data/Fear/triple/achel180320/achel180320'; load([basename '.basicMetaData.mat']); fprintf('start %s\n%s loading data for %s \n', mfilename, datestr(now), basicMetaData.SessionName) load([basename '.Sleepstate.states.mat']) load([basename '.sessions.events....
72e1deb14737882d4e0613aeeb2b8dab1ea9dafffab6a588bf1d44b592830d46
MATLAB
2,089
61
function count = fwriteVAXG(fid, A, precision) % FWRITEVAXG(FID, A , PRECISION) writes the elements of 'A' to the % specified file in VAXG format, translating MATLAB ® values to the specified % precision. COUNT is the number of elements successfully written. % % FID is an integer file identifier obtained from ...
41347cc45d7050f99b1a378a3a8c178f3c863c001e79382db3e95fcf9ebd15ae
MATLAB
2,091
52
function out = BF_SignChange(y,doFind) % BF_SignChange Where a data vector changes sign % %---INPUTS: % y, the input vector % doFind, (i) 0: returns a logical vector with 1s where the input changes sign % (ii) 1: returns a vector of indicies of where the input vector changes % sign % -----...
96369f876c54606ae627895e40dd4ee2de2612d6b708dc8a1a7ba87a0658d4f2
MATLAB
2,091
59
function [iProcessingStep, dirProcessing] = ... find_max_processing_step(this) % Returns maximum processing step that has been done for this object (via % folder structure, even if current object is at an earlier processing % step) % % Y = MrSeries() % Y.find_max_processing_step(inputs) % % This is a method of ...
e22a4b4b66d1540697600345e61037d541a007a12d68ef996a838f216ba60d93
MATLAB
2,092
59
function [] = load_tracks() %load_tracks Load X/Y tracking data % Function that imports manual worm coordinates generated in FIJI and % collated in a series of .xslx tabs. Tab names must match info.wormUIDs. global info global dat %% Import tracks % Updated for single camera configuration [dat.Xvals.Pixels, dat....
4f17ec44768c339da9a4621804baf287504a12b006ce9bb26429aad4f3a87063
MATLAB
2,093
56
function PostHocDenoising_Callback(hObject, eventdata, handles) % This function uses a convolutional neural network, trained in % "TrainPostHocDenoiser_Callback.m", to seperate noise from USVs. % Load the network [FileName,PathName] = uigetfile(fullfile(handles.data.squeakfolder,'Denoising Network','*.mat'),'Select D...
cb037000153c302421c6c308c270690e17f21f10026287bceab44d0f7b6475f2
MATLAB
2,093
56
function results = analysis01D(config) % Runs analysis 01D: Initialise a large population of (neuromorphic) % reservoirs, evaluate their performance nTest times, and test the % following hypothesis: Is the probability of a successful prediction, % given that the prediction was emergent, higher than the marginal % pro...
dd7a683ed6d634c3afd2d818e609e74c6775471f08d13c8a6ff81735b6c55a82
MATLAB
2,094
61
function newPosition = tapas_uniqc_convert_montage_position_to_selection(montagePosition, ... montageSize, dimInfoSelection, selectionIndexArray) % Converts (mouse) position in montage into x,y,z selection of plotted data % % newPosition = tapas_uniqc_convert_montage_position_to_selection(montagePosition, ... % ...
181af8b6a7040ed65e3cadd17436d2611f3a22beb8f6c365f1a8aef2c974830b
MATLAB
2,095
48
function params = sero_pulseq_InitialiseParameters_v2(varargin) % pulseq_InitialiseParameters: Initialize and pack pulse sequence parameters % with default values that can be overridden by user input. % Example usage: pulseq_InitialiseParameters('FOV', 50e-3) % Set default parameter values defa...
54ab0354d059a7c3ab075f3d7ef63c3b92c4ac9544ea3d0411169ac033b3acc6
MATLAB
2,095
57
function BF_ResetSeed(resetHow) % BF_ResetSeed Reset the random seed generator in Matlab % % Allows functions using random numbers to produce repeatable results with a % consistent syntax. % %---INPUTS: % resetHow, one of: % 'default' -- reset to the Mersenne Twister with seed 0 % 'none' -- don...
93d4c1130f87a054290be692ed5e01aaf096f7731ae5f6097bb9cfdefaee3c7e
MATLAB
2,095
58
function [hdr] = read_brainstorm_header(filename) % READ_BRAINSTORM_HEADER reads the header information from .EEG files % that have been generated by the Nihon Kohden system. The function % constitutes a wrapper around BrainStorm3 functionalities % % Use as % [hdr] = read_brainstorm_header(filename) % % See also ...
3da2e747e847798c19cd27920b7215a7ff427a66e15e25ccfedd56e08db98723
MATLAB
2,096
75
function [ h ] = tapas_rdcm_get_convolution_bm(options) % [ h ] = tapas_rdcm_get_convolution_bm(options) % % Creates a fixed hemodynamic response function (HRF) by convolving a single % event (impulse) with the standard Balloon model from DCM. % % Input: % options - options structure with relevant informa...
c45e0b36a2779d55ad16848383a914f808da1eff3337f0f31a63b26c7a1cc1c5
MATLAB
2,096
42
function updateCSVstatusInGui(app, groupNameBeginsWnumber, groupNameContainsSpecial, allDIVisValid, groupNameIllegal) %UPDATECSVSTATUSINGU Update the text field in GUI based on whether the CSV %pass all the checks if groupNameBeginsWnumber app.MEANAPStatusTextArea.Value = [app.MEANAPStatusTextArea.Value; ....
23924546a63fcd19a3bd7bbbbd4bdd5c6e723db6ca28ae5327950be291d0cbf6
MATLAB
2,097
55
% ERRORDLG2 - Makes a popup dialog box with the specified message and (optional) % title. % % Usage: % errordlg2(Prompt, Title); % % Example: % errordlg2('Explanation of error','title of error'); % % Input: % Prompt - A text string explaining why the user is seeing this error message. % Title ...
f958e641fbb45599c69885c9ff28e99f5a116b2c6fc6897b40b5dc5e891e34de
MATLAB
2,097
48
%% Spike code to find the mid point of spikes % Created by Aaron Choong and Jesslyn Sutanti % Last modified 10/8/2017 % Supervised by Kostas, Yan & Masoud function [spikes_index] = spike_detection(spike_data,threshold) %% This spike code finds the mid point of the spikes instead of the peaks % Faster computatio...
2e5ecbc7b406f58de6f6d4f714a3f53ba127143e7c0effa84bc2fecc147dd6fb
MATLAB
2,098
75
%{ map.Masks (imported) # -> map.Area --- mask : mediumblob # area mask %} classdef Masks < dj.Relvar & dj.AutoPopulate properties popRel = (map.Area) end methods (Access=protected) function makeTuples(obj,key) pat...
c3a98eae9ca0d98101b3e22437219bfbc58b7bab61c27a5ca3920ddb4ac2bd90
MATLAB
2,098
80
function obj = init_model(obj) D = prod(obj.lat); % ---- % mean % ---- format = brca.format.auto(obj.mu0); if ~isfinite(obj.nm0) obj.mu = obj.mu0; else if format.numel(obj.mu0) == 1 obj.mu = obj.format.allocate(obj.lat); obj.mu = obj.format.write(obj...
e7e05b66ebec797c9fcb431c80c89a8640996c23133e737a4f639b782e57235f
MATLAB
2,098
90
function [a, b] = isintent(this,intent) % Correspondance between fieldnames and NIfTI intents % FORMAT ind = isintent(this,intent) % this - GIfTI object % intent - fieldnames % a - indices of found intent(s) % b - indices of dataarrays of found intent(s) %____________________________________________...
330aab85f9a01364a86da3c97d78b7a58267a319766d2a4897ef8903f5554bcf
MATLAB
2,099
69
function tapas_hmm_binary_displayResults(r) % Displays results estimated by fitModel for the hmm perceptual model in the binary case % Usage: est = fitModel(responses, inputs); hmm_binary_displayResults(est); % % -------------------------------------------------------------------------------------------------- % Copyr...
bbc4b5ec1c70f66335d06b698518018b1c3e52d62517e81534f9ccc2109445da
MATLAB
2,100
46
function [numStrides,numValidStrides, percValid, percThresh] = validStrides(EEG_block, gait_event_order,gait_timeNextHs) gait_event = gait_event_order{1}; timeNextHs = gait_timeNextHs*EEG_block.srate; idxHS = find(strcmp({EEG_block.event.type}, gait_event)); %check whether threshold crossings were marked if isf...
ec5bea3b7f52e63ac82f6af31f20d28b3a45d67db995d728e89be3d3a61eaa77
MATLAB
2,100
56
function y = block_geometric_median(X,blocksize,varargin) % Calculate a blockwise geometric median (faster and less memory-intensive % than the regular geom_median function). % % This statistic is not robust to artifacts that persist over a duration that % is significantly shorter than the blocksize. % % In: % X : t...
383efef3cd704736a06ca94c2e51448415601d19a15fc3af2d7e1a66e60c3ad1
MATLAB
2,101
66
function SaveEvents(filename,events,varargin) %SaveEvents - Write events to file. % % USAGE % % SaveEvents(filename,events,options) % % filename event file name % events event data % <options> optional list of property-value pairs (see table below) % % ===============================...
8e16c7778ccb90087e734b00625f33ab5ceccf507f3cc039187a554bf86192b1
MATLAB
2,101
46
function [fileNameSourceArray, fileNameTargetArray, ... fileNameSourceMovedArray, fileNameTargetMovedArray] = tapas_uniqc_move_with_hdr(... fileNameSourceArray, fileNameTargetArray) % Moves given files; for .nii (nifti-) files, also moves .mat-header, % if existing; for given .img (analyze) files, also moves .h...
1c31ef97fa29efdab18590c22f8598e4d1a5df1c583816484726de74061b3f9b
MATLAB
2,102
87
function out = meta_chi2_matrix(dat,w) w = w ./ mean(w); myalpha = .05; [N,npairs] = size(dat); [rows,cols,ncorr] = corrcoef_indices(npairs); str = sprintf('Computing differences among correlations %04d',0); fprintf(1,str); chi2 = zeros(ncorr,1); chi2p = zeros(ncorr,1); diffr = zeros(ncor...
a96f7f6f9277435b8a3baa1ba6c9d5d06f83735d74ca755c142bec971eea04b6
MATLAB
2,102
67
function coords = getNodeCoords(adjM, Params) %GETNODECOORDS Summary of this function goes here % Detailed explanation goes here if strcmp(Params.nodeLayout, 'force') % Create a graph object from the adjacency matrix G = graph(adjM, 'lower'); % Use layout to get coordinates without plottin...
54112ccd253512d8128f57be0fb34bb04740476e3bad49ecf107b4b9d39c1ae4
MATLAB
2,104
81
function y = binomcdf(x,n,p) %BINOCDF Binomial cumulative distribution function. % Y=BINOMCDF(X,N,P) returns the binomial cumulative distribution % function with parameters N and P at the values in X. % % The size of Y is the common size of the input arguments. A scalar input % functions as a constant matrix ...
1ce5d27c7a1629a4794dce88a5c4ce60b0c3d32b9b9291a3be2ad46461a740bc
MATLAB
2,106
76
function I=processvarargin(I,D) %function I2=processvarargin(I,D) % %PURPOSE % %Subfunction of various functions in Icasso. % %INPUT % % I (cell array) input {'id1' value1 'id2' value2 ...} % D (cell array) defaults {'id1 value1 'id2' value2 'id3' value3 ...} % %OUTPUT % % I2 (cell array) combination of inputs I and de...
43f21b0179dba158e8b14c32d1986e50fc9c36a962754289a60cb96e6d790932
MATLAB
2,106
60
function Model=modelMANOVA(Fa,Fb,varargin); % function Model=modelMANOVA(Fa,Fb,varargin) % This function generates the RDM model for a fully-crossed MANOVA design (2-factorial). % INPUT: % Fa: a nConditions column-vector, indicating the assignment of condition k to % level A % Fb: a nConditions column-vector,...
d3a6c6c98f342f788861dea4d1cdd4663296eeaae1641d0fcc9a001a767e888e
MATLAB
2,106
81
function [stimind,causal_ind,covops] = stimulusInfo(stim,covname) %grabs index and information about a covariate in stim %useful for removing, merging, etc. %important sizing information if isempty(stim.TDcausalvec) ntdc = 0; ntdac = 0; else ntdc = sum(stim.TDcausalvec(1,:)); %number time-dep. causal st...
5dee0e3ac8d51834619b2da9efbdf6727173893d4464e6b5776f9d64e72057de
MATLAB
2,107
93
function [tx,ty,T] = pred_time_index(x,parm) % Time index for delay embedding prediction % [tx,ty,T] = pred_time_index(x,parm) % --- Input % x : Input data : Xdim x Tsample x Ntrial % parm : Time delay embedding parameter % parm.Tau = Lag time % parm.Dtau = Number of embedding dimension % parm.Tpr...
f3e0aa7309d080284c660c599931c9f0142f22c7be5666513c73bc95696739fc
MATLAB
2,107
64
% RMSAVE - return the RMS in each channel, epoch % % Usage: % >> ave = rmsave(data,frames); % Copyright (C) Scott Makeig, CNL/Salk Institute, La Jolla, 9/98 % % This file is part of EEGLAB, see http://www.eeglab.org % for the documentation and details. % % Redistribution and use in source and binary forms, wit...
53dee0fae2df97596e9973d8158bd149272f53ac11cfbc3461d4907bbb61a41b
MATLAB
2,108
59
function [basefun,basefunst] = chooseBasis_ofc(ops) %CHOOSEBASIS_OFC: a wrapper function around chooseBasis for ofc studies %length of history filter in timesteps, lh = ops.lh; %length history filter. a 1.2 s filter ls = ops.ls; %length stimulus filter. a 1.s s filter. dim = ops.dim; %dim hist basis dimst = ops.dimst...
86f34261519e7520a4792725823aeb0cbbe5a05f39cbcd536fe3a275a7ee0833
MATLAB
2,108
71
function c = tapas_rs_belief_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the 'belief' response model according to: % % Vossel, S.*, Mathys, C.*, Daunizeau, J., Bauer, M., Driver, J., Friston, K. J., and Stephan, K. E. % (...
df816e7c3435cd144d10f5653f482dedf0c764a78d979c8e0427ce9ece3cc52e
MATLAB
2,108
56
% setdiff_bc - setdiff backward compatible with Matlab versions prior to 2013a % Copyright (C) 2013 Arnaud Delorme % % 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 % modification, are permitted provide...
55f360d5dfe96854405b2e96bd7c464f7abb58f9d5dfc1babba8d54d1a067a8d
MATLAB
2,110
67
function [phase,amplitude,unwrapped] = Phase(samples,times) %Phase - Compute instantaneous phase in signal. % % Compute instantaneous phase (wrapped and unwrapped) and amplitude % in signal, using the Hilbert transform of the signal. % % USAGE % % [phase,amplitude,unwrapped] = Phase(samples,times) % % samples ...
8e2a42f5265d898e05a3981deee348a7c0f8accab72ab9f5eac79e2350f6ea9d
MATLAB
2,110
57
function c = tapas_squared_pe_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuraton for the squared-prediction error optimization of perceptual parameters % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
e6e687563b2b93798fffa421ca42f4a5aefad13da641597f0d2688a00b5ce4a1
MATLAB
2,110
36
function excel_Callback(hObject, eventdata, handles) function t = loop_calls(Calls, hc,includereject,waitbar_text,handles,call_file, audioReader) exceltable = [{'File'} {'ID'} {'Label'} {'Accepted'} {'Score'} {'Begin Time (s)'} {'End Time (s)'} {'Call Length (s)'} {'Principal Frequency (kHz)'} {'Low Fr...
e3343b83a7f32462542542c2a5d4bf4c539a3fbd2f233a978564e230a096900d
MATLAB
2,111
62
function adjM = get_sttc(spikeTimes, lag_ms, duration_s, method, use_c_code) % Description: calculates pairwise correlation between pairs of neurons % using spike time tiling coefficient % % See the original paper: % https://www.ncbi.nlm.nih.gov/pubmed/25339742 %---------- % Parameters % spikeTimes - [n x...
987ab3b630287c8e94f5ed6e5e923b0e76b62928f4562af0eb365acf96ef2d94
MATLAB
2,112
83
function [out] = osp_SenseUnfolding(in,SENSE) Voxels=2; %% Navg = in.sz(in.dims.averages); if in.dims.subSpecs ~= 0 NsubSpec = in.sz(in.dims.subSpecs); fids = zeros(in.sz(in.dims.t),in.sz(in.dims.averages),in.sz(in.dims.subSpecs),Voxels); for ll = 1:Navg for mm = 1:NsubSpec fids(:...
45cebf71ae9f910ae30d8f4b9b478368cf09ef13992a835b094d3a0b350554e8
MATLAB
2,114
56
% recursively get the list of Matlab file in % a given directory % % A. Delorme, 2017 % Copyright (C) A. Delorme, 2017 % % 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 % modification, are permitted pr...
a69017f94516c6f33145702f5c2b44229d28c4a0cc6d1f7e0b38869cfb0cf569
MATLAB
2,114
56
% RESHAPE - reshape of memory mapped underlying array % % 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 o...
10370691d4b9dc86f78147480c39bf4d3be3c2b72e527e91cbb057ffdeda3e47
MATLAB
2,115
64
function [ ] = tapas_huge_compile( ) % Compile integrator for DCM fMRI forward model. This function assumes that % source code file 'tapas_huge_int_euler.c' is in the same folder as this % function and places the compiled mex-file in the same folder. Running % this function requires a C compiler to be installed. For mo...
18111462bd1a6e072c27c5122de4603eaccddb9b52d3382e9c11342e46127fa6
MATLAB
2,115
56
% ismember_bc - ismember backward compatible with Matlab versions prior to 2013a % Copyright (C) 2013 Arnaud Delorme % % 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 % modification, are permitted provi...
4f8996132b000f3766202e4c5ed4ea1e53777a27c8bcea477435c57dbfa45163
MATLAB
2,115
90
function DB = Meta_Prune(DB,include) % DB = Meta_Prune(DB,include) % % Prunes database given an indicator vector of points (peaks) to include % Includes only contrasts for which ALL peaks are included! % Thus, if any peaks are excluded, the whole contrast is excluded. % % Called in Meta_Select_Contrasts and Meta_Logis...
136650d86b30469ee5b377b04925c1ff5e11f46df819a70f330242d3b3d53ee9
MATLAB
2,116
71
function call_copy_withLabels(xstring, ystring) a = gca; f = gcf; cm=get(f,'colormap'); cf=get(f,'color'); % mousepos = get(gcf,'CurrentPoint'); set(f,'units','pixel') set(a,'units','pixel') posA = get(a,'Position'); posF = get(f,'Position'); set(f,'units','normalized') set(a,'units','normalized') posAn = get(a,'Posi...
d9ddd6b861a1eacee33f415854465d437b8315a97c11be02a9aec71fe91b83c0
MATLAB
2,116
71
function c = tapas_rs_surprise_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the 'surprise' response model according to: % % Vossel, S.*, Mathys, C.*, Daunizeau, J., Bauer, M., Driver, J., Friston, K. J., and Stephan, K. E....
869ada29816fa6a3e443606c276c8fdaa741c504ecf64012feb0fe9f4ddf422a
MATLAB
2,117
77
function this = load(this, fileName) % Loads Geometry info from affine image header (.nii/.hdr/.img) or Philips % (par/rec) % % NOTE: .mat-header files (for 4D niftis) are ignored, since the same voxel % position is assumed in each volume for MrImage % % geom = MrImageGeometry() % geom.load(fileName) % % This...
6dbc5e9744811650f73a924f52bd8fca6329b72b0216ba4d40d5b9ac1c18ed97
MATLAB
2,118
53
function args = hlp_struct2varargin(struc,varargin) % Convert a struct into a sequence of name-value pairs; inverse to hlp_varargin2struct. % Args = hlp_struct2varargin(Struct,Options...) % % In: % Struct: a 1x1 structure array % Options: optional name-value pairs; % 'suppress': suppress the output names...
9f553415f15bbe06d73e6215a0dc7395452598758e1d1cd62d181507c2964de2
MATLAB
2,118
59
function download_tMPPCA_toolbox() % Check whether Tensor-MP-PCA (https://github.com/Neurophysics-CFIN/Tensor-MP-PCA) % is available on the path; if not, download it into SEPIA_HOME/external/ % and add it to the path. % % Unlike FANSI/HEIDI, Tensor-MP-PCA needs no SpecifyToolboxesDirectory.m % entry - its location is a...
bdc323a143c05511448e276aa192810fc67d1eabbc53b3a2bdd3ddb1aeea423b
MATLAB
2,119
76
function out = study_table(study,varargin) % function out = study_table(study,varargin) % % prints a table of studies; input the study variable, and input columns, in order % columns with ones and zeros are converted to X's or blanks. % (not implemented yet; everything must be cell arrays of strings now) % % study is a...
be77858205a415012909405adfacdbdbf7cd20c382cfa0c209f071745d7a8234
MATLAB
2,119
61
function [group,threshold,em] = Otsu(vector) % The Otsu method for splitting data into two groups for 1 dimensional data. % This is somewhat equivalent to kmeans(vector,2), but while the kmeans implementation % finds a local minimum and may therefore produce different results each time, % the Otsu implementation is gu...
beda2c49751191c7f1a25d9b15ba24837a64a5d23c1ddfc474459c6703a1d389
MATLAB
2,119
69
function indexFoundPattern = tapas_physio_find_string(stringArray, searchPattern, isExact) % Finds a string pattern in a cell of strings and returns found cell indices % % NOTE: this function behaves the same as find should behave % % indexFoundPattern = find_string(stringArray, searchPattern, isExact) % % IN % ...
f4d07f898da5e78fa5e06dcdada7a24a94f32d2f6651b94808ccbcfce870d7a7
MATLAB
2,119
67
function [this, argsUnused] = update(this, varargin) % updates Geometry directly or computes given new FOV/resolution/nVoxels or whole affineTransformation % % Y = MrImageGeometry() % Y.update('FOV_mm', FOV_mm, 'resolution_mm', resolution_mm, ... % 'nVoxels', nVoxels, 'affineMatrix', affineMatrix, ... % ...
4e68c86730f28a43906f8c3b6fe2a42af424c2771571ba6119347d8c9feaa35d
MATLAB
2,120
75
function [RegisteredImage,MOVINGREG] = registerImages(MOVING,FIXED) %registerImages Register grayscale images using auto-generated code from Registration Estimator app. % [MOVINGREG] = registerImages(MOVING,FIXED) Register grayscale images % MOVING and FIXED using auto-generated code from the Registration % Estimat...
5e1dca8c412b6593da918cdf62fed07cb672f019665d076c04625eb17658759c
MATLAB
2,120
85
function W = fast_ica(x,pcomponents,nit) % Originally written by the Finish (Aapo) team; % Modified by the PIB team in Aug. 21, 2007 % PIB - Biological Information Processing Lab - UFMA - Brazil % Modified by Vítor Lopes dos Santos Aug. 2011. if nargin < 3, nit=100; end % fprintf ('Removing mean...\n'); %----------...
6f52350014de89000753706b2cdcd7a6bb948853554e234a3b59983dc46045a5
MATLAB
2,120
71
function c = tapas_rs_precision_config %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Contains the configuration for the 'precision' response model according to: % % Vossel, S.*, Mathys, C.*, Daunizeau, J., Bauer, M., Driver, J., Friston, K. J., and Stephan, K. ...
c25063016699f4d9094cf37fa31da424fd77efc81f4f4ad1245e07e08a9bf20d
MATLAB
2,120
49
function DBCreateTables(database) %DBCreateTables - Create tables in existing database. % % Create figure and variable tables in an existing database. If you % have admin rights to the database server, use <a href="matlab:help DBCreate">DBCreate</a> instead. % Otherwise ask the DBA to create an empty database with the...
512e098db89e7fd967734f926912c214c45aac837e6a8d35f57aff23d07b7450
MATLAB
2,121
62
function [encoderNet, decoderNet] = VAE_model() latentDim = 32; imageSize = [128, 128, 1]; encoderLG = layerGraph([ imageInputLayer(imageSize,'Name','input_encoder','Normalization','none') convolution2dLayer(3, 8, 'Padding','same', 'Stride', 2, 'Name', 'conv1') batchNormalizationLayer('Name', 'bnorm...
5fc6c480e674c95954afb0882c716b5c5cf2b20ac467e0bf91fa5857c368ac97
MATLAB
2,121
56
% unique_bc - unique backward compatible with Matlab versions prior to 2013a % Copyright (C) 2013 Arnaud Delorme % % 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 % modification, are permitted provided ...
9808542ccd5b6838663e190c5c4ceeac3dc601f33e4122860e3914893b59b4c0
MATLAB
2,121
68
function [M,stderr,V,grpids] = means(X,grps) % MEANS: Means, standard errors and variances. For column vectors, means(x) % returns the mean value. For matrices or row vectors, means(x) is a % row vector containing the mean value of each column. The basic % difference from the Matlab funct...
8d579f8f1e6e12b362abb86f6cf8323a5b6ac5067e6b37d98d6550286ccacca8
MATLAB
2,122
67
function [config] = tapas_get_config(tpath) %% Loads the configuration of the project. % % aponteeduardo@gmail.com % copyright (C) 2016 % fname = fullfile(tpath, 'config.static.ini'); config = ini2struct(fname); fname = fullfile(tpath, 'config.ini'); tc = ini2struct(fname); tf = fields(tc); for i = 1:numel(tf) ...
ec653ab0f18f3fd20aae1a703a85af4ce899e5a6aaf361645fa3172d0c8434e1
MATLAB
2,122
54
function SupervisedClassification_Callback(hObject, eventdata, handles) % This function uses a convolutional neural network, trained in % "TrainSupervisedClassifier_Callback.m", to classify USVs. [FileName,PathName] = uigetfile(fullfile(handles.data.squeakfolder,'Clustering Models','*.mat'),'Select Network'); net = l...
ef60c58252be8c5c717517bc58bda288342965e674cd6e11adc823a2963cea28
MATLAB
2,122
105
function linearModelExamples % % Linear model call format % % % % Build data % rng(555), % n=10; % R=rand(n,5); % R(:,3)=R(:,3)+1; % % X=repmat(1:5,size(R,1),1); % lemmings=R(:); % group=X(:); % % clf % % % We can call notBoxPlot with just X and Y % subplot(2,2,1) % notBoxPlot(lemmings,group,'jitter',0.75) % grid on...
87a7c4b32a6f16b590536b6b4940f0ee4fddaa8a8b03fd62c5af46875cfc0c5e
MATLAB
2,123
70
function processDPrime(ephysPath, codePath, savePath) % Compute the discriminability index for large versus small volume rewards % in mixed blocks for each cell in the recorded area of interest %INPUTS: % ephysPath = local path to ephys folder downloaded from zenodo for the % recording area you want to analyz...
c4537d42a32a2bf1115ec37444fab88a5ebc219a98e0c392339f6926933c0b50
MATLAB
2,123
73
function [K,dK] = covULL(hyp, x, z) % covULL Stationary covariance function for underdamped linear Langevin process % % [K,dK] = covULL(hyp, x, z) % % where the hyperparameters are: % % hyp = [ log(mu) % log(omega) % log(a) ] % % The covariance is obtained by filtering white noise through an underda...
e8e072aa1022ab3215c8af76483760785bc2c4fb96229192b4e697408906f306
MATLAB
2,124
66
function plot(evtStream,cfg,varargin) % Plot the contents of a McsEventStream object. % % function plot(evtStream,cfg,varargin) % % Produces a plot in which the time stamp of each event is shown as a line % on a time scale. % % Input: % % evtStream - A McsEventStream object % % cfg - Re...
35e9f3cbca0f288cdcf76821e61f8f03209c066eb7606da1788bf0c2362a98fa
MATLAB
2,125
40
% noise_std a 1*2 vec with noise std for players 1 and 2 % Dyad_acc:51 (player 1 'ready made increasing mean') * 51 % (player 2 'ready made increasing mean')* 8 (Gaussian increasing mean). function output = calc_landscape(noise_std, ready_made_conf_dist, stimuli); conf_mean_vec= 1:.1:6; Dyad_acc=zeros(length(con...
831b43b45a4d687e28c0a65c09ea00604b265ec582bf4372957589e7da1068d4
MATLAB
2,125
72
function [file] = read_bti_ascii(filename) % READ_BTI_ASCII reads general data from a BTI configuration file % % The file should be formatted like % Group: % item1 : value1a value1b value1c % item2 : value2a value2b value2c % item3 : value3a value3b value3c % item4 : value4a value4b value4c % %...
93220d00fc506c150acddd1a778da37305313582ba82b1ab8467d357360c44f7
MATLAB
2,125
65
% Test point by point conductance computation, in a 2D vector example % Author: Aina Frau-Pascual % Input image im = zeros(3) + 0.0; im(1, :) = 0.8; im(:, 1) = 0.8; im(:,:,2) = 1 - im(:,:,1); im(im==1) = 0; % Construct mesh structure Lx = size(im, 1); % domain length Nx = size(im, 1); % number of cells Ly = size(im,...
04b7ce579f691cd5e8f6180b54b70aa034635a7351bc51fd3fa70a9e8d90ef81
MATLAB
2,126
65
% Continuous Tone Controlled by Mouse Movement % Move your cursor horizontally in the figure to change the tone frequency. % Define a global variable to hold the current frequency. global currentFreq; currentFreq = 200; % Start at 200 Hz % Audio parameters fs = 44100; % Sampling rate in Hz dt = 0.05; % ...
068aa76f37f141aa23f9866211e61a985dcb5376cb3a4427249b2cd7f905fb99
MATLAB
2,126
47
% eegplugin_clean_rawdata() - a wrapper to plug-in Christian's clean_artifact() into EEGLAB. . % % Usage: % >> eegplugin_firstPassOutlierTrimmer(fig,try_strings,catch_strings); % % see also: clean_artifacts % Author: Makoto Miyakoshi and Christian Kothe, SCCN,INC,UCSD 2013 % History: % 05/13/2014 ver 0.30 by Chri...
c0284b20f6af6b17ba938f46d50b3223481ed026f96b4f25dd9af0979577cc2e
MATLAB
2,126
72
% SPM ReML overiew % _ % This script plots several variants for the variance components used % in restricted maximum likelihood estimation (ReML) in SPM. % % Joram Soch, MPI Leipzig <soch@cbs.mpg.de> % 2023-09-06, 12:30: first version clear close all % specify covariances n = 5; p = 0.4; TR= 2.1; Q = cell(4,2); Q{1...
7056c50adf2c02b336f19f2dba43c52d2f3f63dfc063bb8a67650651327cfb18
MATLAB
2,127
63
function this = load(this, fileName, varargin) % Loads MrSeries from given folder or loads image files (.nii etc.) into MrSeries.data % % Y = MrSeries() % Y.load(fileName) % % This is a method of class MrSeries. % % IN % fileName % '.mat', % 'nii', % '.img'/'.hdr' % ...
da9c4258d339c3c34863b6ded59b9aa8802a963176fc41bb9ad2672b4188edf0
MATLAB
2,127
82
function varargout=checkRAM() % Checking amount of available RAM on the computer (in bytes) % SYNTAX % checkRAM() - prints the information about the RAM into the command line % [availableRAM,summary]= checkRAM() % % INPUTS: % - noinputts % % OUTPUTS: % - availableRAM - available RAM in bytes % - summary - structure co...
e6f31cb25c02d4b8185032bf62593898e7c693c30ce121d41a3d8274799996bc
MATLAB
2,127
68
function corrMat=RDMCorrMat(RDMs,figPlotSpec,type) % USAGE % corrMat=RDMCorrMat(RDMs[,figPlotSpec]) % % FUNCTION % returns and optionally displays the correlation matrix (spearman) of a set % of RDMs (can be square or upper triangle form and wrapped or bare). % % 08-2011 CW: slight modifications for how nans are handle...
242e13f10ce8c7bc030221a9da6f344f173f2b1156d8c48c003bc294e2d7f517
MATLAB
2,128
56
% union_bc - union backward compatible with Matlab versions prior to 2013a % Copyright (C) 2013 Arnaud Delorme % % 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 % modification, are permitted provided th...
2a150a49e90a79e80357e8b4ee4231f915977c6569c882f039bb53bc627492f5
MATLAB
2,128
58
clear all; clc; % % Add software, add DPABI before spm if ismac addpath(genpath(fullfile('..', 'DPABI_V8.1_240101'))); addpath(genpath(fullfile('..', 'REST_V1.8_130615'))); addpath(fullfile('..', 'spm')); elseif ispc addpath(genpath(fullfile('..', 'DPABI_V8.1_240101'))); addpath(genpath(fullfile('....
e264663a77b3bd64cd35865416af91e9163b4661dc04cabef458329cbd777985
MATLAB
2,128
58
clear all; clc; % % Add software, add DPABI before spm if ismac addpath(genpath(fullfile('..', 'DPABI_V8.1_240101'))); addpath(genpath(fullfile('..', 'REST_V1.8_130615'))); addpath(fullfile('..', 'spm')); elseif ispc addpath(genpath(fullfile('..', 'DPABI_V8.1_240101'))); addpath(genpath(fullfile('....
ffe4d7294f1af8f47a9b757c9c390ddc0503e9a87fd79c7e87af2a0202552188
MATLAB
2,128
58
clear all; clc; % % Add software, add DPABI before spm if ismac addpath(genpath(fullfile('..', 'DPABI_V8.1_240101'))); addpath(genpath(fullfile('..', 'REST_V1.8_130615'))); addpath(fullfile('..', 'spm')); elseif ispc addpath(genpath(fullfile('..', 'DPABI_V8.1_240101'))); addpath(genpath(fullfile('....
37788f2d7aa8b254a9b2c62cda8ac2544abf31fe54c5a29093fb45dfa564e838
MATLAB
2,129
57
function cmdString = tapas_physio_create_spm_toolbox_link(pathPhysIO) % Creates a symbolik link of PhysIO/code folder to subfolder SPM/toolbox/PhysIO % to make toolbox visible to SPM Batch editor % % tapas_physio_create_spm_toolbox_link() % % IN % % OUT % cmdString string of executed command % % EXAMPLE % tapas...
76f43fa2c3728c7d7ef04aebdbcc758d5e289fc6ac4162733aa58313268c098a
MATLAB
2,129
78
function plot_fig3d_right(datadir) % Plot z-scored rat trial initiation time and model simulation regressed % against reward offers in the last 15 trials. For visualization, only 7 % trials are shown. N = 10 rats. % % INPUTS % datadir: file path of data downloaded from Zenodo. Link to download can % be found in README....
78d8a14ca3d9b2984e92804b3ec242b3f699f9103bd7db658ea07201226482b8
MATLAB
2,129
66
function BrainNet_GenSurface(filename,outputfilename,threshold) % BrainNet Viewer, a graph-based brain network mapping tool, by Mingrui Xia % Function to generate surface file from Nifti mask %----------------------------------------------------------- % Copyright(c) 2015 % State Key Laboratory of Cognitive Neuros...
3b7edb3aed1667f9ac099c038b18b3304fdc8544d2230510b10ad988a5f3e28a
MATLAB
2,130
75
%isivector - Test if parameter is a vector of integers satisfying an optional list of tests. % % USAGE % % test = isivector(x,test1,test2,...) % % x parameter to test % test1... optional list of additional tests (see examples below) % % EXAMPLES % % % Test if x is a vector of doubles % ...
4503b204d3fe4634cfe4c10bda0fb37b5b14c999cce10c11db461bbec7b32c47
MATLAB
2,130
60
function ResampleBinary(inputName,outputName,nChannels,up,down) %ResampleBinary - Resample binary data file. % % Resample binary data file, e.g. create LFP file from raw data file. % % USAGE % % ResampleBinary(inputName,outputName,nChannels,up,down) % % inputName binary input file % outputName binar...
6f342a63525216d5aa052ddd82792d83655425513cedd3a0085af3a06dcc4bab
MATLAB
2,130
65
function varargout = ft_warning(varargin) % FT_WARNING prints a warning message on screen, depending on the verbosity % settings of the calling high-level FieldTrip function. This function works % similar to the standard WARNING function, but also features the "once" mode. % % Use as % ft_warning(...) % with argume...
a4e2c836edcdd9b1276a4f68303f9cf5d7a86fd498939f3cad1040d624395465
MATLAB
2,130
80
function prob=pca_dim(lambda,N); % PCA_DIM Automatic choice of dimensionality for PCA % % Laplace approximation and subsequernt simplifications to the % posterior probability of the Data being generated from hidden var's % of dimensionality k % Methods described in % Thomas Minka: % Au...
ce9fa8bf6a44e7778622c927f96a114dc9dec7d7fe71d273b98cf9721c621cdf
MATLAB
2,130
61
function unit = ft_estimate_units(size) % FT_ESTIMATE_UNITS tries to determine the units of a geometrical object by % looking at its size and by relating this to the approximate size of the % human head according to the following table: % from 0.050 to 0.500 -> meter % from 0.500 to 5.000 -> decimeter % fr...
de3eb5fb88e0bd8dad8a8aedbe9ee4411f936f2490a607ceaf3b03ef621342a1
MATLAB
2,130
70
function [model,IDmap] = runTCA(data,R,titles,plotArg) % converts data matrix to tensor object then finds the model with the % lowest error for the provided rank. Plots model %Does not remove neurons with neuron factors of 0 at this stage %INPUTS: % data = data matrix created in time__Tensor % R = number of compo...
e0ad8ea2e1e982e0f644cbaaf9402bcf7bf2711f19ede5782d3d33001b4b3785
MATLAB
2,130
48
% Wakeman & Henson Data analysis: Extract EEG data and import events and channel location % Data available at https://sccn.ucsd.edu/eeglab/download/ds000117_sub-01.zip % (subject 1 of https://nemar.org/dataexplorer/detail?dataset_id=ds000117) % % EEGLAB plugin/extensions required % - File-io % - Fieldtrip % - bids-matl...
5ce04357174a4da36e052ab697a3c2d17ca68e4c7a27f0e18d2b8b93f3879a0e
MATLAB
2,132
52
%{ stack.StackInfo (imported) # header information -> experiment.Stack --- nchannels : tinyint # number of recorded channels nslices : int # number of slices frames_per_slice : int # number of fra...
dc332658e75d14e84f68e2ef2eaef06be6109608c5299dea250828664c3343ad
MATLAB
2,132
91
function plot_fig2g(datadir) % Plot event-aligned ACh responses (baseline corrected), split by relevant % conditions at each event, averaged across rats (N = 10). % 1. Offer Cue: volume % 2. Reward Port On: side % 3. Reward Cue: delay % 4. Reward Delivery: delay % 5. Opt Out: side % % INPUTS % datadir: file path of dat...
c9a3c4d671fadda9465bf708dac1372f605a8871131022cc73a89ba7b36a2f7f
MATLAB
2,133
54
function herr = plot4BarsWithDots(plotdat,colormat,plot_sig,plot_sig_diff,plot_exact) if nargin<5 plot_exact=true; end if nargin<4 plot_sig_diff=true; end if nargin<3 plot_sig=true; end hold on nt = size(plotdat,2); nx = size(plotdat,1); mubar = mean(...
cbf07411ea3b6c598a8b74b40087bbed78d60e1aff033948c5b19c34c1deb40a
MATLAB
2,133
55
function output = decodeWiener(kinematics, neurons, tPts, ROIs, lags, kinematicField, neuralField) % Fit a lagged Wiener filter model with specified lags % lags must contain 0 % Note tPts argument instead of tBins, tPts is integer values of time % points, ie -100:10:400 % For the first submission we fit RADICaL to the...
d140806f99585771f5f1409d94ed5780d287d1915ff8ce5d727170f62d0fe9fc
MATLAB
2,133
54
function [S, f] = calculateSegmentSpectrum(data, lineNoise) % Multi-taper segmented spectrum for a univariate continuous process % % Usage: % [S, f] = calculateSegmentSpectrum(data, lineNoise) % % Parameters: % data (single channel) -- required % lineNoise structure with various parameters set % % ...
d2b38c7b97aec1d835df4e92d522791606924d3a16038772776063f7a84c5d93
MATLAB
2,133
53
% RSPFUNC - sub-function used by RSGET % % Usage: res = rspfunc(pval, l, rval) % % Input: % pval - p-value to optimize % l - [l1 l2 l3 l4] l-values for Ramberg-Schmeiser distribution % rval - expected r-value % % Output: % res - residual % % Author: Arnaud Delorme, SCCN, 2003 % % See also: RSGET % % Referen...
673b26599ce4768b40ebc3154bd7ff99e698a5c9674f0845255919b728f6fdcf
MATLAB
2,135
60
function patchMatchCost_group(thisSubj,subject_list,dInput1, dInput2, fileDir) load(subject_list) Patch1 = strcat(fileDir, thisSubj,'/',thisSubj,'_Patch_RH.mat'); if exist(Patch1,'file') A1 = load(Patch1); load(dInput1); C = cell(1,length(subject_list)); outputCost = strcat(fileDir, thisSubj,'/',thisSu...
bfc024ae7359550d4dd89382274c76a56ccf211ac1e2905d2f887360f0ad2ce4
MATLAB
2,135
58
% GETTEMPFOLDER - return the temporary folder % % Usage: >> folder = gettempfolder; % % Output: a string containing the folder if a temporary folder can be found. % Empty if the folder cannot be found. % % Author: Arnaud Delorme, SCCN, UCSD, 2012 % % Copyright (C) Arnaud Delorme % This file is part of EEGLAB,...
d4c2f9f57f229574eb6b38d7533a4f5c6ee8324a10a089a84360955ae2a33d09
MATLAB
2,135
53
function [m,dm] = meanGPexact(mean,cov,x,y, hypz,z) % Mean function being the predictive mean of a GP model: % % mu(z) = posterior mean of GP at location z as given by % mu(z) = gp(hyp,@infExact,mean,cov,@likGauss,x,y, z) where % hyp.mean = hyp_mean; hyp.lik = log(sn); hyp.cov = hyp.cov; % % The hyperparameters are: %...