sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
8331306347650689a667fb41427d7bbc94775cf129a71feb936c411ca11d7e3a | MATLAB | 2,678 | 77 | function [logp, yhat, res] = tapas_logrt_linear_binary(r, infStates, ptrans)
% Calculates the log-probability of log-reaction times y (in units of log-ms) according to the
% linear log-RT model developed with Louise Marshall and Sven Bestmann
%
% -------------------------------------------------------------------------... |
9cf12c609353e9ba7c13fd374487f3406b3bc27bd1df8a1be7f8c79195821376 | MATLAB | 2,679 | 76 | %% get_set_bfr_lbv(h,mode,input)
%
% Input
% --------------
% h : structure contains all handles of SEPIA
% mode : 'set' - extract information from GUI to config file
% 'get' - extract information from config file to GUI
% input : if mode is 'set' then input should be fid
% ... |
d3cae5f7710c6ded20c830a55029b4e70ddf760d8df5f4b6a361247e686a28ba | MATLAB | 2,680 | 98 | classdef meta_nbc
% meta_nbc: Naive Bayesian classifier object for meta-analysis
%
% An empty object is created by calling the function with no arguments.
% Properties below are assigned using the methods train, test, and cv
% along with meta_dataset objects.
%
% % test properties
% class_pred
% posterior_probs
%
% % ... |
4a258b555d32bbb3543c5f0fc77c3f9722cf44c42f8f723849fe4d3d6c423a1c | MATLAB | 2,681 | 107 | % (C) Copyright 2020 Agah Karakuzu
% (C) Copyright 2019 CPP BIDS SPM-pipeline developpers
function initEnv
% 1 - Check if version requirements
% are satisfied and the packages are
% are installed/loaded:
% Octave > 4
% - image
% - optim
% - struct
% - statistic... |
e804d2fe1ec0d169a68708555cbe1a91fd1cbf996ec916007d1377054f3d8d26 | MATLAB | 2,683 | 47 | function [glb_frame_ranges,sub_session_frame_range,tot_num_frames,num_first_plane_frames] = get_subsession_frame_range(exp_sheet_name,combine_proc_path,subsession_idx,Fs,varargin)
sub_session_minutes = [];
for v = 1:numel(varargin)
if strcmpi(varargin{v},'sub_session_minutes')
sub_session_minutes = vara... |
6245562d20e0b048af577b69a39c11238e79f621d01df9a4a7ca18838816c186 | MATLAB | 2,684 | 70 | %% [totalField, N_std, headerAndExtraData] = Wrapper_EchoCombine_MEDInonlinearfit(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... |
ecabe11cd7c6f04a52bbfacd37b0a72273101fad7ac0166ed389f12b598b4ebd | MATLAB | 2,684 | 67 | % compare EEGLAB distributions
% Copyright (C) 2006 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 that the following conditions are met:
%
% 1. ... |
0d6c69a94ae0bea8d8b71f6e38be43d53b558167cf945c68201919d39330c749 | MATLAB | 2,685 | 47 | function AFI_GroupAverage(myelinFile, myelinAsymmOutFile, AFIFile, AFITargAngle, AFIAsymmOutFile, myelinCorrOutFile, myelinCorrAsymmOutFile, fitParamsOutFile)
%take numbers as strings, for unified compiled/interpreted handling
AFITargAngle = str2double(AFITargAngle);
%Figure GROUP_MYELIN_AND_AFI
... |
9e36a38930092cf3c9f5e2e66f3fc5dda8fadbf2b3009ea08d76abb7e28ebda4 | MATLAB | 2,685 | 124 | function [ind,colors] = pt_given_a_plot(eff,p,legstr,varnamecode,regionnames)
% [indices, colors] = pt_given_a_plot(studycount,totalstudycount,code,varnamecode,regionnames)
%
% tmp =
% pt_given_a_plot(clnew.COUNTS.effpt_given_a,clnew.COUNTS.Ppt_given_a,levels,'PTplot_',clnew.COUNTS(1).clusternames);
%
% given counts, d... |
3df7c0584d40ebdd2056005df5e637d6a3209ecba6eb7904d0025a6350fe5960 | MATLAB | 2,686 | 110 | % (C) Copyright 2020 Agah Karakuzu
% (C) Copyright 2019 CPP_SPM pipeline developpers
function initEnv()
%
% Sets up the environment for the analysis
%
% 1 - Check if version requirements are satisfied
% and that the packages are installed/loaded:
%
% Octave > 4
% - image
... |
bbac2d8ddd56df63c3cafce8d00ada88abf767043aded5b6e6d1e8aeed9fefeb | MATLAB | 2,686 | 70 | %{
# brain area membership of cells
-> fuse.ScanSetUnit
-> anatomy.RefMap
-> map.RetMap
---
vret : double # vertical retinotopic angle
hret : double # horizontal retinotopic angle
%}
classdef UnitRetinotopy < dj.Computed
... |
e6b17023b4f920a80c3506e2831ab30ed884eaf0a49a8f069ed0890f6f9bf496 | MATLAB | 2,686 | 110 | function [spec, headerinfo] = read_caret_spec(specfile)
% READ_CARET_SPEC reads in a caret .spec file.
%
% Use as
% [spec, headerinfo] = read_caret_spec(specfile)
%
% Output arguments:
% spec = structure containing per file type the files listed
% headerinfo = structure containing the specfile header
%
% T... |
6372e3fe24b6363a9b685019a7ef886c1d14bb423f92cbe26e9f4472872f63a9 | MATLAB | 2,687 | 92 | function makeTensor_TCA(dataPath, savePath)
%INPUTS:
% dataPath = path to matfiles containing S and SU structs -- these should
% be files with only cells from the specific region of interest
% savePath = path to folder for saving 3d matrix of responses
%OUTPUTS:
% data = 3d matrix that will be used to crea... |
f0237e558b051b10384ed4a412a0d0bc3bdf9040097200b01eec73d7b7dc10e7 | MATLAB | 2,687 | 101 | function [linehandle patchhandle dothandle cfg] = plotpatch(y,timevec,patchcolor,cfg)
%[linehandle patchhandle dothandle cfg] = plotpatch(y,timevec,patchcolor,cfg)
nsubs = size(y,1);
ntime = size(y,2);
ncond = size(y,3);
if ndims(y) > 3
error('plotpatch: Input Data Matrix has too many dimensions!');
end
if nargi... |
1cb977e4f88d69aa5c34aad576be739b40ec23e4ca854ed74c76ef5edb00d84a | MATLAB | 2,688 | 89 | function organiseTsvFile
% it is a mini function to reorganise the _events.tsv files
% in order to make them bids-compliant.
% first, it omits the empty column
% then looks at empty cells and inserts
deleteSuffix = 1;
% add bids repo
bidsPath = '/Users/shahzad/GitHubCodes/CPP_BIDS';
addpath(genpath(fullfile... |
691e649df191ce396831d15d93bd25d631205f346acbc66ee564e7124f9b7c07 | MATLAB | 2,688 | 68 | function [segmentedData,segTime,timeAxis,samplingRate] = EventRelatedPotentials(time, data, eventTimes, interval,samplingRate)
% Author: Qasim Qureshi May 2024
% segmentDataAroundEvents - Segments data around each event time within a specified interval.
%
% Syntax: segmentedData = segmentDataAroundEvents(t... |
3d1cb9c019c43096a55494177acb2d716ac42e754f9a0d02b1cfb51ec2f60cfc | MATLAB | 2,691 | 77 | classdef nnsolvers < nntest
properties (TestParameter)
networkType = {'simplenn', 'dagnn'}
solver = {[], @solver.adagrad, @solver.adadelta, @solver.rmsprop, @solver.adam}
end
properties
imdb
init_w
init_b
end
methods (TestClassSetup)
function data(test, dataType)
% synthetic dat... |
5c824e48958c0b7fd1664af85747edb1702d84e4386da33aee1ca0b048cd5b2a | MATLAB | 2,691 | 88 | function [fit,cfg] = Zhang_fit(data,cfg)
% [fit,cfg] = Zhang_fit(data,cfg)
%
% fit maximum-likelihood mixture model as described
% by Zhang & Luck, Nature 2008
if nargin < 2
cfg = struct;
end
if ~isfield(cfg,'fitmean')
cfg.fitmean = false;
end
if ~isfield(cfg,'offset')
... |
6029980a36e9775cfdcb0f00b4ec7d167fc1b3e607970076d1410926bcd6191d | MATLAB | 2,692 | 69 | function ProcessData_Figure5(datadir, codedir, savedir)
%ProcessData_Figure5 - Process raw data saved under datadir such that it can be plotted by PlotFigure5.
% INPUTS:
% datadir - Local directory where 'Golden_Nature/RawData_Figure5.mat' from Zenodo was saved
% codedir - Local directory where code (e.g., publishe... |
1497784a0fb7af50710b303e22f1a24c314fb2a91f77eec4639b437da87ff6df | MATLAB | 2,693 | 106 | function Test_fixedrank_3factors()
% function Test_LSR()
%
% Test file for the fixedrankLSRquotientfactory
% Problem: Low-rank matrix completion
% Paper link: http://arxiv.org/abs/1112.2318
%
% All intputs are optional.
%
% This file is part of Manopt: www.manopt.org.
% Original author: Bamdev Mishra, July 11, 2013.
%... |
a6411e828f41d20ae5144c7acfef1f6beb8cfceeb441d7ad5db75f55d35fa2bd | MATLAB | 2,693 | 71 | function out = DN_Fit_mle(y, fitWhat)
% DN_Fit_mle Maximum likelihood distribution fit to data.
%
% Fits either a Gaussian, Uniform, or Geometric distribution to the data using
% maximum likelihood estimation via the Matlab function mle
% from the Statistics Toolbox.
%
% ---INPUTS:
% y, the input data vector.
% fitW... |
095799d09cb8e5ff4ca2871b9dc4f84f5f319e0cc254f23ec476453213622782 | MATLAB | 2,695 | 73 | function [D,S,Q] = perform_fast_marching_mesh(vertex, faces, start_points, options)
% bla bla bla
% perform_fast_marching_mesh - launch the Fast Marching algorithm on a 3D mesh.
%
% [D,S,Q] = perform_fast_marching_mesh(vertex, faces, start_points, options)
%
% vertex, faces: a 3D mesh
% start_points(i) is the i... |
ad27d58bb64da364bec645a47e421ef532868679d41d77e734271ef34c90f85e | MATLAB | 2,695 | 67 | function y = minimize_lbfgsb_objfun(X,varargin)
% extract input arguments
varargin = varargin{1}; strctX = varargin{2}; f = varargin{1};
% global variables serve as communication interface between calls
global minimize_lbfgsb_iteration_number
global minimize_lbfgsb_objective
global minimize_lbfgsb_gradien... |
f35adee3c1ad16a9bae5939bf7b9f3db763b460ed23a1045348f5e147dfef47f | MATLAB | 2,695 | 80 | % ABSPEAK - find peak amps/latencies in each row of a single-epoch data matrix
%
% Usage:
% >> [amps,frames,signs] = abspeak(data);
% >> [amps,frames,signs] = abspeak(data,frames);
%
% Inputs:
% data - single-epoch data matrix
% frames - frames per epoch in data {default|0 -> whole data}
%
% Output... |
9e1e05471179cca3bea759b0b3ae17ca4340694475ae24fa350d0ec461a51b2b | MATLAB | 2,698 | 68 | function p = HT_HypothesisTest(x, theTest)
% HT_HypothesisTest [DEPRECATED] Statistical hypothesis test applied to a time series.
%
% DEPRECATED: use HT_MarginalTests (tests about the distribution of values)
% or HT_IndependenceTests (tests of serial independence) instead; this thin
% wrapper is kept only so that c... |
83cc3b81a25b016d61820fb79aee18c997221a9554e0ee6d996666f8d2f8eb02 | MATLAB | 2,699 | 87 | function mpcu_data = mpcu
% Demonstration of MPCU log parsing
%
% VERSION : 2.0
%
% AUTHOR : Mike Tyszka, Ph.D.
% PLACE : Caltech
% DATES : 03/10/2011 JMT From scratch
% 05/08/2013 JMT Correct ECG header parsing and trigger handling
%
% The MIT License (MIT)
%
% Copyright (c) 2016 Mike Tyszka
%
% Permissio... |
2b9751efd043aeb56767ac88ee9a724052552a1e8d6fa37050d4f0a2b5883042 | MATLAB | 2,702 | 79 | % add relevant paths
if ~exist('preprocColorSpace_GetMetaParams','file')
addpath('../');
addpath('../utils/');
end
% Load images
d = load('NaselarisStansburyGallant_2012_ValImages.mat');
% the field d.S is an array that is (96 x 96x 3 x 126); (X x Y x Color x
% Images). The images are stored as 8-bit integer... |
81d056d5c537a03519d090fc41350e9c0598f324bfd05f2c279ff511eaab8d2c | MATLAB | 2,702 | 74 | function imageData = histogramNormalization(imageData, options)
%HISTOGRAMNORMALIZATION Normalize PETRA or ZTE image.
%
% DESCRIPTION:
% histogramNormalization normalises a PETRA or ZTE image following [1].
% The image histogram is first computed, and the soft-tissue peak is
% normalized to 1. The histogram... |
c9ed28739c4180a4d6803bfd1e7968712c179a0e68187b2beb21d842f56fc217 | MATLAB | 2,702 | 57 | function out = WL_fBM(y)
% WL_fBM Parameters of fractional Gaussian noise/Brownian motion in a time series
%
% Uses the wfbmesti function from Matlab's Wavelet Toolbox
%
% ---INPUT:
% y, the time series to analyze.
%
% ---OUTPUTS: two Hurst-exponent estimates from wfbmesti's second-order-
% derivative estimators: a p... |
2212d74a348e0c9f24aa3f1eee50ef4a44b5b591d6065ec1c69d4d7f873afc92 | MATLAB | 2,704 | 85 | %% do stats on dynamic coding
%binmat is a [nSubjects nTimepoints nTimepoints] data matrix
%get data
data = binmat;
data = (data + permute(data,[1 3 2]))./2; %make data matrix symmetric
nsubs = size(data,1);
ntimes = size(data,2);
%get diagonal values and project along either time axis
xdiag = nan(nsubs,ntimes,n... |
a10c47c3c3b9ea8631f0e0a367c25dfbbe380e63125c90ef01c8a5a2932a1369 | MATLAB | 2,705 | 61 | function out = DN_Moments(y, theMom, doNormalize)
% DN_Moments A moment of the distribution of the input time series.
%
% ---INPUTS:
% y, the input data vector
% theMom, the moment to calculate (a scalar)
% doNormalize, whether to normalize by std(y)^theMom, giving the proper
% scale-invariant standardi... |
c27ba8fb29a295d6827abc2a812685f21b4cf2750f2b6788ec37c9f8182033e9 | MATLAB | 2,705 | 130 | function [err, Cnext, cend] = NextString (C, Delim, cpos, Opt)
%
% [err,Cnext, cend] = NextString (C, Delim, cpos, Opt)
% or [Cnext, cend] = NextString (C, Delim, cpos, Opt)
%Purpose:
% gets the next string in charachter array C that is delimited by Delim
%
%
%Input Parameters:
% C : a character array
% Delim :... |
e449417cc3e7842c27ac8f9c6c066236ecc3aaef7e6872d91d4ab9f7496e69d4 | MATLAB | 2,705 | 90 | %% unitTest.m
% This function performs a command line unit test based on the jobTesting.m file in the
% ci folder. All Osprey modules are tested in dependence of the
% included dataset. You can change the jobTesting.m file according to your desired
% needs. The results unittest class includes detailed informati... |
87eeecf8ea2bd61cf850d46824ea2033616d83dfbc81799cf0c64879f6ccf39f | MATLAB | 2,707 | 73 | %HATCHFILL2_DEMO Demonstration script for HATCHFILL2 function
% 4 examples from original HATCHFILL by Neil Tandon
% a bar plot example
clear; close all; drawnow
%%% In this example, the 2 contour of a contour plot
%%% is filled with hatching.
load([mfilename '_data']);
% plot background data
figure;
[~,h] = cont... |
bcf2790724fb3109c22b70bd1a19c7e565df2d53103ffb4d4dc064bdcbbe5f2f | MATLAB | 2,707 | 103 | %
% a script to show and sample default colors on the X windows system
% default colors are read from /usr/lib/X11/rgb.txt if it exists, else from myrgb.txt
% see also ROIcmap
%
Nmax = 2000;
name(Nmax).s = '';
name(Nmax).r = 0;
name(Nmax).g = 0;
name(Nmax).b = 0;
if (exist('/usr/lib/X11/rgb.txt') == 2),
Colname = '... |
d2be446a51646050360af6632505142391d883b5c34661383631f92fd1b43e86 | MATLAB | 2,707 | 67 | function zyp05Image = createWarpable(imageDirectory, xInResolution, yInResolution, zInResolution, xOutResolution, yOutResolution, zOutResolution, processingDirectory, datasetPrefix, nThread)
%% Check parameter validity
if (imageDirectory(end) ~= '/')
imageDirectory = [imageDirectory '/'];
end
if (processingDirecto... |
5ff2a31be5f442763b61d026d3e4a656ec3017e5ddbd97eb67d8c36f7ffcb5fc | MATLAB | 2,708 | 69 | % Bang et al (2020) Private-public mappings in human prefrontal cortex
%
% Reproduces Figure 1-figure supplement 3
%
% The visualisation is based on the analytical approach and code developed
% by Rani Moran for "Bang et al. (2017). Confidence matching in group
% decision-making. Nature Human Behaviour"
%
% T... |
a5eafad75fff8c4874e26ed9542334fc215c0a1db49c2baf6602c96d431bf468 | MATLAB | 2,711 | 95 | function [U,S,V] = spm_svd(X,U)
% Computationally efficient SVD (that can handle sparse arguments)
% FORMAT [U,S,V] = spm_svd(X,u)
% X - (m x n) matrix
% u - threshold (1 > u > 0) for normalized eigenvalues (default = 1e-6)
% - a value of zero induces u = 64*eps
%
% U - {m x p} singular vectors
% V - {... |
b2b782831df79e5be39b44a80d5a88a7bb58c111115b8747bd52bce9629c8e88 | MATLAB | 2,712 | 57 | %% sepia_configuration_R2s
%
% Description: a script contains all the background field removal method names and related function names
%
% Kwok-shing Chan @ DCCN
% k.chan@donders.ru.nl
% Date created: 11 March 2020
% Date modified:
%
% DO NOT change the variable name
% DO NOT change the order of the entities, add a ne... |
037e2ed30fe6423ee27d4736677b01a7fef16842f626e15acfb1ee321741064d | MATLAB | 2,713 | 50 | % calcOSI - calculate orientation preferences, osi, gOSI, and maximum
% response from a set of responses to oriented grating stimuli
%
% Usage - [oriPref,osi,gOSI,maxResp] = calcOSI(stimThetas,respMat,normExtent,customNorm);
%
% Input - stimThetas: vector of stimulus orientations that were used, correspondin... |
2d925eafb4296492d73e3b361048fb5f789b1667e4bc8115497bc46785035616 | MATLAB | 2,714 | 46 | function spec = arg_specifier(varargin)
% Internal: create a base specifier struct for an argument.
% Specifier = arg_specifier(Overrides...)
%
% In:
% Overrides... : name-value pairs of fields that should be overridden
%
% Out:
% A specifier that is recognized by arg_define.
%
% See also:
% arg_define
%
% ... |
c7f94884ebc66f91c17bf32e871c8a9a7a9b2770423e0357a53c1e36e596442a | MATLAB | 2,714 | 62 | function [signal, lineNoiseOut] = cleanLineNoise(signal, lineNoiseIn)
% Remove sharp spectral peaks from signal using Sleppian filters
%
% Usage:
% signal = cleanLineNoise(signal)
% [signal, lineNoiseOut] = hcleanLineNoise(signal, lineNoiseIn)
%
% Parameters:
% signal Structure with .data and .srate fields
... |
3ba24cf14a57947796ee7348b5359072103d27d81bae338b145ad25234e8f48a | MATLAB | 2,715 | 78 | %%%%%%%%%%%%% pick randomvolumes and write an orthogonal view png
outputdir = '~/nsd/ppdata/specialscrub';
mkdirquiet(outputdir);
fullrec = {};
for subjix=1:8, subjix
files = matchfiles(sprintf('~/nsd/nsddata_timeseries/ppdata/subj%02d/func1pt8mm/timeseries/timeseries_session*.nii.gz',subjix));
for rep=1:100, rep
... |
84f035a17cf4e8be7c9cf59e271c6f9a0478eab23168de2b3552d368300706f7 | MATLAB | 2,715 | 84 | function [alpha,IM2,Mask]=LoadImage(app)
Tab=app.Tab;
aux=app.Aux.Value;
if strcmp(Tab,'Multiple Simulations')==1
S0 = [1, 1];
Idx = [app.Y0_2.Value, app.X0_2.Value];
My=app.My_2.Value;
Mx=app.Mx_2.Value;
Name=[app.imfolder,app.ImageDropDown_2.Value];
... |
de8028e893cad6e667e636170c3e306370d7c0e2ea3b31e69ce54bcba1b546a6 | MATLAB | 2,715 | 45 | function outinfo = cifti_diminfo_dense_get_volume_structure_info(diminfo, structure, cropped)
%function outinfo = cifti_diminfo_dense_get_volume_structure_info(diminfo, structure, cropped)
% Get information on how to map cifti indices from one volume structure to voxels.
% The volsform1 field is adjuste... |
f6c93a4051dd0e4af3e2c6c47a2f21bd150b93e63cf45a05b9af4f174a4e4740 | MATLAB | 2,715 | 75 | % GETCHANLIST - Obtain indices of specified channel types.
%
% Usage:
% >> chanlist = getchanlist(chanlocs, type)
%
% Inputs:
% chanlocs - EEGLAB channel location structure
% type - [string] select channel of specified type
% can enter a cell array to select several channel types
%
% O... |
b3fa5305ce320f2a0ebb2e4dff39b01be59e93f104b8235f6a1413627a96d736 | MATLAB | 2,716 | 64 | % bids_gettaskfromfolder() - Scan bids folders to get the list of tasks
%
% Usage:
% >> tasklist = bids_gettaskfromfolder(bidsfolder);
%
% Inputs:
% bidsfolder - a loaded epoched EEG dataset structure.
%
% Outputs:
% tasklist - [cell array] list of tasks
%
% Authors: Arnaud Delorme, SCCN, INC, UCSD, March, 2021... |
1a4963b65b31c7aa05d740582ceab3546a96feb59f3d16a9153bd9003f87f22e | MATLAB | 2,717 | 103 | function bar_interactive(images, xnames)
% bar_interactive(images, xnames)
%
% create interactive bar-plot that pops up in spm_orthviews window
%
% tor wager
%
% 2006.05.02 - Modified by Matthew Davidson
% find the spm window, or make one from a p-image
spm_handle = findobj('Tag','Graphics');
if isempty(spm_handle) |... |
638a9e53744d98616f3caaa6ce6cbc2aa5aad4b78d87c227267e6f8e2e5a5f14 | MATLAB | 2,717 | 90 | % Runs batch analyses and publishes HTML report with figures and stats to
% results/published_output in local study-specific analysis directory.
% Run this from the main mediation results directory (basedir)
close all
warning off, clear all, warning on
resultsdir = pwd;
fprintf('Creating HTML report for ... |
7e475e77ce306aae495b19014f315f1c3e4e1990f9b796c24a881b6a1ca0b346 | MATLAB | 2,717 | 106 | function [logp, yhat, res] = tapas_softmax_mu3_wld(r, infStates, ptrans)
% Calculates the log-probability of responses under the softmax model
% with phasic volatility exp(mu3) as the decision temperature and parameters
% accounting for win- and loss-distortion of state values.
%
% -------------------------------------... |
765a14f81904472793f707d8e125d1cd21d8da4a7c1aa539ea95dea32d310d55 | MATLAB | 2,718 | 101 | function status = GE_convertADW(inDir,outStem,starttime,nvols)
%
% status = GE_convertADW(inDir,outStem,starttime,nvols)
%
%GE_convertADW
%
% Version 3.1
%
% Converts a series of GE slices acquired on the Advanced
% Development Workstation into Analyze format for SPM.
% inDir is the name of the first directory containi... |
e3f2fae002dea512fa0986101f0e8a1a7b1eb9c88ee7e1aad9ad6ba63b7cdd17 | MATLAB | 2,718 | 68 |
%%
Bytediv = 4;
nn = -1;
samplingRate = 30000;
start = 1;
stop = 50;
trailSplitInterval = 10;
filtSpec.range = [10 20];
filtSpec.order = round(5 * samplingRate / filtSpec.range(1));
continuousFile = '.\107_CH13_2.continuous';
spikesFile = '.\TTp113.0n3_2.spikes';
t64File = ... |
b38ff5e64318d2c8fd481b1a0013e19382290a16a4d31093c08f5433e3f535c8 | MATLAB | 2,719 | 56 | % extract eye positions for all animals, all sessions and all scans
% build a map, an element of the map represents the number of eye positions
% within a circle centered at the element
function BuildEyePositionClusterMap(radius)
% get lookup table to assign circle membership to eye positions
rv = preprocess.CirclesLo... |
44a8e064b43e3e34f9f35953ce97a2ba76086bb30b4e8647466ec1f6214f39b5 | MATLAB | 2,723 | 73 | function osp_onLeftZ( ~, ~ ,gui)
%% osp_onLeftZ
% Callback function on process click on left x voxel direction button.
%
%
% USAGE:
% osp_onLeftY( ~, ~ ,gui);
%
% INPUT: gui = gui class containing all handles and the MRSCont
%
% OUTPUT: Changes in gui parameters and MRSCont are written into... |
4972f19bdd7fde6dd0bbfe2bca087c773fde093123c072807d2c8763c199b402 | MATLAB | 2,723 | 73 | function osp_onLeftY( ~, ~ ,gui)
%% osp_onLeftX
% Callback function on process click on left x voxel direction button.
%
%
% USAGE:
% osp_onLeftY( ~, ~ ,gui);
%
% INPUT: gui = gui class containing all handles and the MRSCont
%
% OUTPUT: Changes in gui parameters and MRSCont are written into... |
65267647703248e0a6a33ec1827eced435d454a095dd491b216a0e37182d87bb | MATLAB | 2,723 | 73 | function osp_onLeftX( ~, ~ ,gui)
%% osp_onLeftX
% Callback function on process click on left x voxel direction button.
%
%
% USAGE:
% osp_onLeftX( ~, ~ ,gui);
%
% INPUT: gui = gui class containing all handles and the MRSCont
%
% OUTPUT: Changes in gui parameters and MRSCont are written into... |
3bf26ae8125676c29e496e04e8380de9fa08637c3b6d96d700d12293b0389a32 | MATLAB | 2,724 | 107 | function plot_fig5d(datadir)
% Plot trial-by-trial changes in average firing rate surrounding each task
% event (0-0.3 s) vs -delta trial initiaton time for an example cell.
%
% INPUTS
% datadir: file path of data downloaded from Zenodo. Link to download can
% be found in README.
fpath = fullfile(datadir, 'data-publis... |
426bf77b1edc67354ea519721cb36c40b6d9956a488c1a9c2f54e84a611072aa | MATLAB | 2,724 | 65 | %{
aod_monet.CleanRF (computed) # cleaned up and normalized receptive fields
-> aod_monet.RF
-----
clean_map : longblob # cleaned up receptive field map
%}
classdef CleanRF < dj.Relvar & dj.AutoPopulate
properties
popRel = aodpre.ExtractSpikes & aod_monet.RF
end
methods(Access=protected)
function mak... |
b5114ccd86884b7d5ecc3a249144a748d9b305bc3570e8751ca58d739be406d5 | MATLAB | 2,724 | 81 | function [svert,svertdist] = plot_points_on_surface(coords,varargin)
% function [svert,svertdist] = plot_points_on_surface(coords,colors)
plothandle = [];
surfacecutoff = 20;
plottext = 0;
mymarkersize = 8;
if length(varargin)>0, colors = varargin{1};,
else
for i = 1:size(coords,1)
colors{i,1} = 'ro';
... |
d823ad80617faa85500bea008ad49bbd536813eefa3192f364a4ee5e2cdb95e1 | MATLAB | 2,724 | 75 | function job = tapas_physio_replace_absolute_paths(job, pathArray)
% Replaces all absolute paths in a structure variable by relative ones
%
% job = tapas_physio_replace_absolute_paths(job, pathArray)
%
% IN
% job structure variable, e.g. SPM, matlabbatch, or physio structure
% with different fields (p... |
44c2b401edcf26c69e0d6e633098e0cc1bf906da2c07ff7745166d267d676b6d | MATLAB | 2,725 | 105 | function [outputArg1,outputArg2] = PlotSubjectResponsesBubbles(ResponseMatrix, TitleStr, BubbleSize, Color)
% Plots a bubble plot histogram of the responses in the input
% ResponseMatrix where columns are
% --- Default values for input parameters
if ~exist('TitleStr','var')
% title parameter does not exist, so d... |
63ef08a26189f1e55383e086e57b2c459893e092dc2404c68e7805c69a680a62 | MATLAB | 2,725 | 57 | % check folder
eeglab;
if ~exist('task-P300_events.json', 'file')
error('Download the data from https://openneuro.org/datasets/ds003061/ and go to the downloaded folder');
else
filepath = fileparts(which('task-P300_events.json'));
end
% import data
pop_editoptions( 'option_storedisk', 1); % only one dataset in... |
6a26fb73e38cdeae2649254e8291caff3a83a03236dfd4595e9a4da2c03d7bf6 | MATLAB | 2,729 | 67 | %{
# design matrix for directional response
-> tuning.Directional
-> tuning.CaKernel
---
design_matrix : longblob # times x nConds
regressor_cov : longblob # regressor covariance matrix, nConds x nConds
%}
classdef OriDesignMatrix < dj.Computed
... |
0433ef852c716b9f54a2918802cc8277b418bdcac70352630d00e348e029fcff | MATLAB | 2,730 | 107 | function [err,maplocation, mapsign, Mtrans] = AFNI_CoordChange (Orig, Trans, Morig)
%
% [err, maplocation, mapsign, Mtrans] = AFNI_CoordChange (Orig, Trans, [Morig])
%
%Purpose:
% Change the AFNI coordinate system between the 48 different coordinate systems allowed
% Coordinates are as they appear on the top left... |
3df1448abd84891c878c47d79a240cb5ca73e13083cbb508004d5fc92a29c0ba | MATLAB | 2,730 | 73 | function [chi2,actual,expected,colnames] = computeynchi2(studycount,totalstudycount)
% function [chi2,actual,expected,colnames] = computechi2(studycount,totalstudycount)
%
% 07.22.01 by Tor Wager
%
% computes a yes/no chi2, where #nos is total - #yesses
%
% each row of studycount is the number of 'hits' for conditions ... |
762a99cb0bc27b347d159a0845b1c1df039c1a65d8ae18495035a4d6f97df632 | MATLAB | 2,730 | 83 | function obj = cv(obj, meta_data_obj)
% Cross-validated error for meta_nbc object
% on dataset stored in meta_data_obj
%
% obj = cv(obj, meta_data_obj)
%
% ----------------------------------------------------------------------
% Cross-validation on meta dataset
% This can be used to optimize parameters for testing on o... |
737361306dc480091b511f66e259561537f745e3e82f9b30aef27be6cc2dcbd0 | MATLAB | 2,731 | 73 | function activityStats = calTwopActivityStats(expData, Params)
% Calculates properties related to two-photon activity
% INPUTS
% ------
% expData : struct
%
% RETURNS
% --------
% activityStats : struct
activityStats = struct();
%% Metrics shared with ephys
% get spike counts
if strcmp(Params.twopActivity, 'peaks... |
20c1022d130cb78a4a62c4e940d36c214260ad74d947598e00149be65726db0f | MATLAB | 2,732 | 57 | % COMPUTE_ERSP_TIMES - computes the widest possible ERSP/ITC time window,
% which depends on requested ERSP/ITC parameters such as epoch limits,
% frequency range, wavelet parameters, sampling rate and frequency
% resolution that are used by TIMEF.
% This helper function is called by P... |
3ea3b09ec89e883d3c1360b2d66b80d5a43cb21df2953d4315f7614512156005 | MATLAB | 2,732 | 82 | function out = DN_Mean(y, meanType)
% DN_Mean A given measure of location of a data vector.
%
% ---INPUTS:
%
% y, the input data vector
%
% meanType, (i) 'norm' or 'arithmetic', arithmetic mean
% (ii) 'median', median
% (iii) 'geom', geometric mean
% (iv) 'harm', harmonic mean
% ... |
83e147ab6297a5a2bf48b1ea556caddba8a3739b9955ea7999fc68c18dff6600 | MATLAB | 2,732 | 77 | function [varargout] = run_nbsPredictGlm(X,y,contrast,test)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% run_nbsPredictGlm performs a simple version of GLM used in NBS toolbox.
% (Zalesky et.al., 2010)
%
% Arguments:
% X: design matrix (independent variables).
% y: data (depende... |
e493aafb6821b441e1113b934896c1b19fff1b95ffadd9b97fc7803819520e43 | MATLAB | 2,732 | 89 | % Bang et al (2020) Private-public mappings in human prefrontal cortex
%
% Reproduces Figure 6B
%
% Visualises ROI EDIs and performs associated statistical tests
%
% Data also contains split-data RDMs (sdRDMs) underlying EDI calculation
% as well as run-specific EDIs and sdRDMs
%
% Statistical tests can be reproduced b... |
02e906a91ab80a01f3e935818c4556a99c919354f217bec864edd8a51cab918e | MATLAB | 2,734 | 106 | function myeb(Y,varargin);
%
% myeb(Y,varargin);
%
% This function makes nice coloured, shaded error bars. Exactly what
% it does depends on Y, and on whether you give it one or two inputs.
%
% If you only pass it Y, and no other arguments, it assuemd you're
% giving it raw data.
%
% myeb(Raw_Data)
%
% .) if Y is 2... |
9298439fb9424e77a3ea0f90c132b5ecd0d90d5567eedd3d761ad6b189e0a10a | MATLAB | 2,734 | 65 | function h = plot_overlay(background_image, data, thresholds, colormap_name, transparency)
% plot cest images onto anatomical images
% Yi Zhang 20190706
if size(background_image) ~= size(data(:,:,:,1))
error('unmatched size');
end
if nargin <=5
SliceToProcess = 1:size(data,3);
end
min_threshold = min(t... |
98eedf56e39019d5a2ab5ded02aa803f7a89cddb84d85272e91057b90eb8416a | MATLAB | 2,736 | 84 | function V = tapas_uniqc_spm_write_vol_with_tr(V,Y)
% Write an image volume to disk, setting scales and offsets as appropriate
% FORMAT V = tapas_uniqc_spm_write_vol(V,Y)
% V (input) - a structure containing image volume information (see spm_vol)
% Y - a one, two or three dimensional matrix containing the ima... |
db798cf6ac1cb377ee3252a31eb6c1a0bbee4ae798f8fd2deb1c0b3580bed0f0 | MATLAB | 2,736 | 89 | function [sin_info] = get_sin_info(sin_file)
%% [sin_info] = get_sin_info(sin_file)
% Loads a Philips *.sin file and extracts the header information.
%
% Input:
% sin_file *.sin file to be loaded
%
% Output:
% sin_info struct containing the header info
%
% Author:
% Dr. Georg Oeltzschner... |
667115f596bf1ed50825e93eb0edc028dc6e6e8ba25f7afed49af117b82508bd | MATLAB | 2,737 | 98 | function [C_offset] = updateTemporal_endoscope(obj, Y, allow_deletion)
%% run HALS by fixating all spatial components
% input:
% Y: d*T, fluorescence data
% allow_deletion: boolean, allow deletion (default: true)
% output:
% C_raw: K*T, temporal components without being deconvolved
% Author: Pengcheng Zhou, Car... |
fe98e2126b13d08407f51ec7b5ab34d7eb64a17718deea017579fa657d1f6afd | MATLAB | 2,737 | 75 | % Script demo_copy_data
% Shows functionality of MrCopyData for deep cloning and recursive operations
%
% demo_copy_data
%
% Since MrCopyData has no properties, we created a dummy class
% MrCopyDataTest with the following properties:
% - numeric/string values, cells of nums/strings,
% - MrCopyDataTest values and ... |
d7f6cea37578584fa4f92cb4296057e860023822c2cd71c51d13cd590bec3ca5 | MATLAB | 2,738 | 62 | %{
pre.ScanInfo (imported) # header information
-> rf.Scan
---
nframes_requested : int # number of valumes (from header)
nframes : int # frames recorded
px_width : smallint # pixels per line
px_heig... |
ff7ad2c589845205636db7560f552ff41a33ca9a1f78b914c9f57ad55c20b0a4 | MATLAB | 2,738 | 89 | function [indic,scount,su,words] = title_keywords(titles2)
% [indic,scount,su,words] = title_keywords(titles2)
%
% given a string matrix, stores individual words in each row, and finds the most frequent words.
% Then stores a matrix of which rows have which of the most frequent words.
t = titles2;
% get all words in ... |
5602bad9fa4d660e8e9c9992ddc0bb06de97747d7f3dd50cf65c5ddd10385ac9 | MATLAB | 2,739 | 76 | clear all;
clc;
method_linkage = 'average';
link_crit = 'min';
listener_idx = 1; % from 1 to 100, 0 indicate the speaker
class_label = load("meta.mat");
if listener_idx == 0
fine_label_names = class_label.fine_label_names;
ct = load('cifar100_ss20_ni1e-1_ychen_trail1.mat');
ct_ychen_data = struct2array(... |
ea7da08ee3c0af21792c031d176e28f27ca0caa1421e0d13768baf53c19c2704 | MATLAB | 2,739 | 81 | % you can call it with all the required variables set.
% it'll translate it to some kind of fieldtrip format
% and then utilize the m_do_ functions to do the actual correction.
% you can also call this without any parameters, but with only a single
% input varable: the data. this must in any case be given.
% the e... |
06158f7c14fb71e89fb31fd544de994ec96b6a77b645720a0c047416850b6fd1 | MATLAB | 2,741 | 79 | function outputImage = image2k(this, applicationDimensions)
% Computes k-space representation (scaled/circshifted FFT) of image
%
% default: image per slice by applying transformImage2Kspace, but 3D or
% time series (4th dim) possible as well)
%
% Y = MrImage();
% image2kY = Y.image2k(applicationDimensions)
% ima... |
95ed42cddb920b23cd31c266d1c83be10865e29f1ee16bc387dedd98b3d01b8d | MATLAB | 2,741 | 76 | function out = DN_Spread(y, spreadMeasure)
% DN_Spread Measure of spread of the input time series.
%
% Returns the spread of the raw data vector, as the standard deviation,
% inter-quartile range, mean absolute deviation, or median absolute deviation.
%
% ---INPUTS:
% y, the input data vector
%
% spreadMeasure, the... |
bb15da896a93edbeec38c5a8b2c41a50dfa54b24c1bf29c082fa75cc191f3036 | MATLAB | 2,741 | 92 | function step2SmoothSearchlight( maps, funcFWHM2Level)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Step 1 was running searchlight analysis
% Here is Step 2, smoothing the SL result maps
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% maps = 'beta'% 't_maps';
% funcFWHM = 0... |
d408b32722d2659a18135a6c6472a51eb563d148328e416accd2289872d71e62 | MATLAB | 2,741 | 126 | %% test thread management
max_thread=64;
for i=1:max_thread
mmx(i);
A = randn(1);
B = randn(1);
assert(mmx('mult',A,B) == A*B)
assert(mmx('b',A,B) == A\B)
assert(mmx('s',A,[]) == A*A')
mmx((max_thread+1)-i);
assert(mmx('mult',A,B) == A*B)
assert(mmx('b',A,B) == A\B)
assert(... |
88dfe88a9e9cdca367c10277f2c76fff9944e99c19ae523f3922e86355740531 | MATLAB | 2,742 | 85 | %% [RDF] = Wrapper_BFR_BFRnet(totalField,mask,~,~,~, headerAndExtraData)
%
% Input
% --------------
% totalField : total field map (background + tissue fields), in Hz
% mask : signal mask
% matrixSize : size of the input image
% voxelSize : spatial resolution of each dimension of the data, in mm
% al... |
f4a771ec99ba40098d8d60aabc698d695170b8af7a83e7a2b3330972e427c3d5 | MATLAB | 2,742 | 77 | function cellGrad = gradientCellTerm(phi)
% this function calculates the gradient of a variable in x direction, in
% the cell center. It needs a cell variable as an input.
%
% SYNOPSIS:
% cellGrad = gradientCellTerm(phi)
%
% PARAMETERS:
%
%
% RETURNS:
%
%
% EXAMPLE:
%
% SEE ALSO:
%
% Copyright (c) 2012-2016 Ali Akba... |
2b61e4fc30f6c1d12de33bca06392c942dfded26e1106f78af4e6b220cc9fce5 | MATLAB | 2,743 | 78 | function [SPM, matlabbatch, indContrastsExisting, indContrastsCreate] = ...
tapas_physio_create_missing_physio_contrasts(SPM, model, namesPhysContrasts)
% Creates all valid physiological subset regressors for given PhysIO model
% that are not already existing in SPM, ignores
%
% [matlabbatch, indContrastsExisting, ... |
3f6b93c0200637c3bdb34fb3250cc9c9ee43314c3ce4a1334522e3b12bb66020 | MATLAB | 2,743 | 77 | function selected = SelectSpikes(spikes,varargin)
%SelectSpikes - Discriminate bursts vs single spikes.
%
% USAGE
%
% selected = SelectSpikes(spikes,<options>)
%
% spikes spike times
% <options> optional list of property-value pairs (see table below)
%
% ======================================... |
6b9026782fb8ae234b6eb99134ec810c70eb3a74f2eb3fa7dbad560f891758b6 | MATLAB | 2,743 | 66 | function X = solve_for_triu(A, H)
% Solve the linear matrix equation AX + X'A' = H for X upper triangular.
%
% function X = solve_for_triu(A, H)
%
% Given A of size p-by-p and H (symmetric) of size p-by-p, solves the
% linear matrix equation AX + X'A' = H for X upper triangular.
%
% The total computational cost is O(p... |
8f7763f2265bfb452eabebd46b1f944b9c9874c837fe9a314f6a0390a5a795dd | MATLAB | 2,743 | 72 | function osp_onLeftExp( ~, ~ ,gui)
%% osp_onLeftX
% Callback function on process click on left x voxel direction button.
%
%
% USAGE:
% osp_onLeftX( ~, ~ ,gui);
%
% INPUT: gui = gui class containing all handles and the MRSCont
%
% OUTPUT: Changes in gui parameters and MRSCont are written in... |
084bf690d0bec704b7489282d23f7d62fb14e4b5a4169656f8c0eade5e78ee79 | MATLAB | 2,744 | 81 | classdef MrRoi < MrCopyData
%class for regions of interest of an MrImage OR MrSeries
%
%
% EXAMPLE
% MrRoi
%
% See also MrImage MrSeries
% Author: Saskia Klein & Lars Kasper
% Created: 2014-07-01
% Copyright (C) 2014 Institute for Biomedical Engineering
% ... |
8a89f6fbdc2f77664f486938b40e87d8ebeca28fec58f77115139e5e11c5ba00 | MATLAB | 2,744 | 74 | % HIST2 - draw superimposed histograms
%
% Usage:
% >> hist2(data1, data2, bins);
%
% Inputs:
% data1 - data to plot first process
% data2 - data to plot second process
%
% Optional inputs:
% bins - vector of bin center
%
% Author: Arnaud Delorme (SCCN, UCSD)
% Copyright (C) 2003 Arnaud Delorme, Salk In... |
9567f76e53b785a5e0d548fd877f6c385830e910288274107a7ff5c8d336e653 | MATLAB | 2,744 | 77 | function printFigs(figNums, folderName, format, fileTitles, landscape)
% useage:
% printFigs(figNums, folderName)
% printFigs(figNums, folderName, format)
% printFigs(figNums, folderName, format, fileTitles)
%
% figNums is just a list of the figure numbers (e.g., 1:10)
% if folderName doesn't exist, it will b... |
b5e4517a3796bfa460d6450b7665fb2fc3be25556dfe92dc94872023bd2d8a63 | MATLAB | 2,744 | 71 | % demonstrate usage of regression
%
% Copyright (c) by Carl Edward Rasmussen and Hannes Nickisch 2016-08-29.
clear all, close all
%% SAY WHICH CODE WE WISH TO EXERCISE
id = [1,1]; % use Gauss/Exact
id = [1,2; 3,2; 4,2]; % compare Laplace
id = [1,3; 2,3; 3,3]; % study EP
id = [1,5; 2,5]; % look into KL (takes quite a w... |
c27bb4445860be85564b1e7c201a4fa8adf99a231b09d0b61d590031590b793e | MATLAB | 2,747 | 74 | function verbose = tapas_physio_print_figs_to_file(verbose, save_dir)
% prints all figure handles in verbose-struct to specified filename there
%
% verbose = tapas_physio_print_figs_to_file(verbose, save_dir)
%
% IN
% verbose.fig_handles
% verbose.fig_output_file
%
% OUT
%
% EXAMPLE
% verbose = tapas_physio_pri... |
3be65597b0f958a7c39a7cd8e7ee79f6284b7d0f635fc3dcd4b181b2af526490 | MATLAB | 2,748 | 61 | function [pval,norm_zscore,mean_zscore,diff_zscore] = get_sta_signif(raw_trace,this_event_frames,shuf_frame_range, varargin)
% determine whether each cell’s activity was significantly correlated with a behavior
% ZZ 2022
% Ref: Paquelet et al, Neuron, 2022.
Fs = 10; % frame rate is 10 Hz by default
baseline_frames... |
a702c6bc2152c4c0d0220ea865754d4c620164dfe4cb655a70426018dcee4a9f | MATLAB | 2,748 | 68 | % FIRST LEVEL ANALYSIS
%
% Karolina Finc, Centre for Modern Interdisciplinary Technologies, NCU
%
% Last update: 08.05.2018
%% SETUP
clear; clc;
top_dir = '/media/finc/Elements/LearningBrain_training_prep/'; % directory with raw subjects' data
out_dir = '/media/finc/Elements/LearningBrain_analysis/first_level_dual/' ... |
81f5c00aea6ed63d935ca154ca1882020c8db7efc9ec59c0831bed083571bca6 | MATLAB | 2,749 | 93 | function output = targetPartialClassifier(data, kinematics, config)
% Regress kinematics off of data
config.kinematicField = 'jointAngles';
data = partialOffKinematics(data, kinematics, config);
% Neural
% Fit
nFolds = 1;
nPartitions = 5;
fitBins = find(ismember(config.tPts, 50:config.postT));
predictors = getPredict... |
f41dc442306fbac036655d4cec6febb52221160828b63097ad4e43d45a8fa9e2 | MATLAB | 2,749 | 78 | function out = BF_cat(s,d,surr)
% BF_cat Concatenate strings.
%
% Converts a cell of strings (or vector of numbers) into a single, concatonated
% string listing each string in the cell.
%
%---INPUTS:
% s, the cell of strings to be concatinated
% d, the delimiter (a comma by default)
% surr, an optional string to sur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.