sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
00b83660bc1fba6d5ee7d1dc8f3ddfb3370a9b718b310a5cdd256456f4875f57 | MATLAB | 4,012 | 98 | function dirPath = cnfgr_projectPath(varargin)
% cribay
% dirPath = cnfgr_cribayProjectPath(dirPath)
dirPath.pn = 'cribay';
[~, rawMachineName] = system('hostname');
% machineName = tmp(1:end-1);
% global dirPath_global
if contains(rawMachineName, 'win348')
dirPath.lab = [filesep,... |
4814a2fcb7bdbccc3b9a6ac3c49f1ad6edb4ee8780d8c1ae9adf194f0eb0ddb1 | MATLAB | 4,012 | 119 | classdef PointHighlightsContainer < handle
%
%
%
%<PRE>
% This file is part of dspace-core.
%
% Copyright (C) 2020 University Zurich, Sepp Kollmorgen
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU Affero General Public ... |
8c0b8678a93eb81ff2218822d34cb75ac5464aa1c40e3c4ee6e12a266d1bec7f | MATLAB | 4,012 | 107 | % registration_pick_reference_day_permouse.m
% Sarah West
% 8/23/21
% Cyles through all the mice, calls pick_reference_day, saves the day the
% user picks for registration. Called by main pipeline code
function []=registration_pick_reference_day_permouse(parameters)
% Assign parameters their original names
... |
fd9e26afccc32c69b080e86d6b239d461655b29e332d7d19cece22b11a0672ed | MATLAB | 4,012 | 148 | function [ intersections, volumes, rr, k_coef, m_coef, Rsquared ] = sholl_nucleus_center( cell, cell_nucleus, name, cell_img )
% function: Short description
%
% Extended description
% loading the parameters
parameters;
%% ------------------------- Finding center of the cell -------------------
% Cen... |
6c1f53c43f276bfd9a558c2aaa9f8948e2bfc85c95e5bdbc5e7fbca71381cadc | MATLAB | 4,014 | 128 | function [finalList,dates,RunData]=getTaskFiles(varargin)
ParamFile='';
TaskWild='*.mat';
Subject='p1';
BaseDirs=env.get('data');
DateVec={{'20170303','20180314'}};
% ParamFil
[varargin,ParamFile]=Utilities.ProcVarargin(varargin,'ParamFile',ParamFile);
[varargin,TaskWild]=Utilities.ProcVarargin(varargin,'T... |
faaac00b42d111d27506c3a7fa904a4cb1ac8c87606bdff939a2394bc2af5786 | MATLAB | 4,016 | 128 | function data2=CMapMix2(data,params)
% This function combines colormaps for data scale ranges. It is assumed
% that the data is in 1 column, and that the data is to be scaled to the
% maximum. If the data is to be plotted relative to some absolute (i.e.,
% the numbers in the data are to be respected), the absolute max... |
7b59cff4ef315a9b6de6d7177bcb45fd0da929fd2678dce4197c4c530007cacc | MATLAB | 4,017 | 127 | function [err_train,err_test,err_train_stats,err_test_stats,delta_train,delta_test] = ComputeTrainTestError(allpostdata,firstframes,labeldata,varargin)
prctiles_compute = myparse(varargin,'prctiles_compute',[25,50:100]);
isdone = false;
for i = 1:numel(allpostdata),
for j = 1:numel(allpostdata{i}),
if ~isempty(... |
dda7a8e504f0c22451d4e96fe45894c9d09164a7842f9ec22281ae65dc6405fa | MATLAB | 4,017 | 124 | % velocity stats
%% initialize
% How long is the assay (in seconds)? If one of the csv files is shorter
% than this, defaults to the shorter time.
total_time = 90;
% Bin size for velocity calculations (in seconds). Velocity is calculated
% once per "bin size" by comparing positions at the start and end. Cannot
% be ... |
a2041680d21e50a278d8632810120d02655ef9b091059b65fb0aa45e4d1db822 | MATLAB | 4,018 | 119 | function fit = VBA_getFit(posterior,out)
% derives standard model fit accuracy metrics
% function fit = VBA_getFit(posterior,out)
% IN:
% - posterior/out: output structures of VBA_NLStateSpaceModel.m
% OUT:
% - fit: structure, containing the following fields:
% .LL: log-likelihood of the model
% .AIC: A... |
ab4946be0a2efb02a41c94b7fe8cecdc96ec599045678dbe1f1e21a0384bdcf0 | MATLAB | 4,018 | 126 | function p = meg_params(expt)
% function p = meg_params(expt)
%
% INPUT
% expt: string expt type ('TA2_Preproc','TA2_Analysis','TANoise_Preproc','TANoise_Analysis','TANoise_ITPC','TANoise_ITPCsession8','TANoise_ITPCshort','Cupcake')
% OUTPUT
% p
% parameters, including channel info, event timing, trial segmenting... |
fbbfbb86e4511ef263895f846001923bf34701eac2b9c1415d2e7af82fc0a557 | MATLAB | 4,019 | 113 | % plot_trialAvg_decision_allSess
% new version of plot_bigSbigT_multipleS_trialAvg_decision_normS
singleSess = 1;
pSL = colms - plot_resp_aligned;
i = 0;
for d = 1 : length(plotSig)
dim = plotSig{d};
i = i + 1;
assignSignal
% Overwrite for single session plots
ylims =... |
0cdb95580374008851680cd5e04565df4e320e9ae2451477b4772a099d6f0c6a | MATLAB | 4,020 | 124 | % DELCODE-SAME, Figure "FADE SAME stability"
% _
% original paper: Soch*, Richter* et al., HBM, 2022
% Figure 6: Stability of the FADE scores for older subjects as a function of reference sample
%
% DELCODE paper: Soch et al., medRxiv, 2023
% Figure S3: Stability of the FADE and SAME scores as a function of reference ... |
0713689e140112602c86919969742e88d91d604940f5917621f5129c954bb968 | MATLAB | 4,021 | 124 | function standardizeScaleAndShow(figs, saveFigs, figPath)
% this is a utility function to standardize the scale of groups of figures
% input is a cell array with each cell containing a group of at least two
% figures whose scales will be standardized relative to each other. this
% function also saves the figures to a s... |
6eb4be7f281699b3949cff636fcc01e93acf7b4459da6077f8283da32315792e | MATLAB | 4,022 | 111 | % calculate_ICs.m
% Sarah West
% 9/1/21
% Calculates ICs from SVD compressed data. Assumes one compressed dataset
% per mouse.
function []= calculate_ICs(parameters)
% Return parameters to individual names.
mice_all = parameters.mice_all;
dir_dataset = parameters.dir_dataset;
compressed_data_nam... |
b9743bea1ffe9d4b56668cb22cc5e11b9f9655e7b426b1e87ab75399e8f4d7ae | MATLAB | 4,023 | 123 | function doRetinotopyScan(params)
% doRetinotopyScan - runs retinotopy scans
%
% doRetinotopyScan(params)
%
% Runs any of several retinotopy scans
%
% 99.08.12 RFD wrote it, consolidating several variants of retinotopy scan code.
% 05.06.09 SOD modified for OSX, lots of changes.
% 11.09.15 JW added a check for modality... |
e67ee4279dea8817f0d400a3be99faffbf5b3c4d102c6d1e66758fdd9eb59525 | MATLAB | 4,023 | 151 | function [c,ww] = smooth(varargin)
% Pared down version of Matlab curvefit version
% SMOOTH Smooth data.
% Z = SMOOTH(Y) smooths data Y using a 5-point moving average.
%
% Z = SMOOTH(Y,SPAN) smooths data Y using SPAN as the number of points used
% to compute each element of Z.
if nargin < 1
error(message('c... |
9aeb20a52fa5478a2aa8d3e2616974607c429439524bbd796016bebb25582ace | MATLAB | 4,024 | 106 | function [Z P] = y_TFRtoZ(ImgFile,OutputName,Flag,Df1,Df2)
% FORMAT [Z P] = y_TFRtoZ(ImgFile,OutputName,Flag,Df1,Df2)
% Input:
% ImgFile - T, F or R statistical image which wanted to be converted to Z statistical value
% OutputName - The output name
% Flag - 'T', 'F' or 'R'. Indicate the type of th... |
a0d1498868616b15341945e01f8c102f38b76fbd5f8c0cf847978a15c140c21a | MATLAB | 4,024 | 138 | function [ inside, pint ] = triangle_contains_line_exp_3d ( t, p1, p2 )
%% TRIANGLE_CONTAINS_LINE_EXP_3D finds if a line is inside a triangle in 3D.
%
% Discussion:
%
% A line will "intersect" the plane of a triangle in 3D if
% * the line does not lie in the plane of the triangle
% (there would be in... |
176267c87f844948d194594a69806e933429632ec1d0030ff46aa6698d902080 | MATLAB | 4,025 | 165 | % Step 4: Keypoints and Descriptors
% This is the code that calculates the keypoints locations via Harris Corner 3D
%
% INPUTS:
% img is the image volume
% blur_dim describes the size of gaussian filter
%
% OUTPUTS:
% res_vect: an n x 3 vector of coordinates of distinctive keypoints
%
% Author: Daniel Goodwin dgood... |
45ffacf49b14a457b7fad6755802c6d99fb4e207eb61bc53d12776c8407919f4 | MATLAB | 4,025 | 86 |
% Input data
% parameters.velocity -- treadmill velocity calculated from raw rotary
% encoder output (velocity calculated with the "diff" function"
% Parameters
% Sampling frequency of wheel encoder, in Hz.
parameters.wheel_Hz = 1000;
% Sampling frequency of collected brain data (per channel), in Hz or frames per
... |
be544d76e6eb03def054b86dca7b9b7f12fd50fff1e8ed20c2715fa8e1c90d5c | MATLAB | 4,027 | 99 | function [output] = ft_transform_geometry(transform, input)
% FT_TRANSFORM_GEOMETRY applies a homogeneous coordinate transformation to a
% structure with geometric information, for example a volume conduction model for the
% head, gradiometer of electrode structure containing EEG or MEG sensor positions and
% MEG coil... |
d931f1530cadaf4953bcc736ed954311ad84f0647083a99e1ac691f1e128de6d | MATLAB | 4,027 | 165 | function [hhc pvalc cluster] = cl_random_1d(hh,stat,alpha,nrandom)
% v.0.0.0
%
%
%
%
%
%
disp('Making Multiple Comparision correction')
hhc = zeros(size(hh));
cluster = hhc;
nbchan = size(hh,1);
pvalc=[];
for e = 1:nbchan
%e
clusig = bwlabel(hh(e,:),4);
ccont=0;
for cc = 1:max(clusig)
lc = s... |
e6ce1b7c2bb6bfd9be178b54587fe774bc72c1aac8752f0972d01508eaffae04 | MATLAB | 4,027 | 148 | classdef PropertiesGUIProp < matlab.mixin.SetGet & matlab.mixin.Copyable
properties
% *IMPORTANT*: properties must not be handles; PropertiesGUIProp
% objects must be fully-copied by the shallow copy() method provided by
% matlab.mixin.Copyable!!!
Field % char, fieldname on struct/obj
... |
02492114fed69ca807d346991780be9ba7ff49fc62e794e23c958c0bf8dc16bc | MATLAB | 4,029 | 92 | % Purpose: Split surface-project preprocessed runs into thirds.
% Inputs: Fsaverage6-projected CBIG2016 preproc output.
% Outputs: 3 nifti files per run (5-min increments for HCP data).
%
% Written by M. Peterson, Nielsen Brain and Behavior Lab, under MIT License 2023
% To run:
% 0. Source your CBIG config script wi... |
4f5e4e12d33c790a9b874267a431ef051b046587a26b7b48d7d80bfbfdeada7b | MATLAB | 4,029 | 109 | function [ferns,hsPr] = fernsClfRemoveTrainingData( hs, remove_data_idx, ferns )
% Compute cross-validation error of random ferns classifier
%
% See "Fast Keypoint Recognition in Ten Lines of Code" by Mustafa Ozuysal,
% Pascal Fua and Vincent Lepetit, CVPR07.
%
% Dimensions:
% M - number ferns
% S - fern dept... |
b87d3d3f2a08e1adc7e1aa13df854a5824b62a907626ce15370e226b0a52e638 | MATLAB | 4,030 | 171 | clear all;close all;clc;
% pkg load image
%% Set of image numbers;
Nn=[50:10:320];
n2=find(Nn>140);
ImgWidth=1024;
ImgHight=1248;
%% Load images
mainfolder=cd('images');
im00=imread('Sec042.bmp');
for j=1:length(Nn);
No{j}=num2str(Nn(j),'%03.f');
filename=['Sec',No{j},'.bmp'];
img{j}=imrea... |
cb6302cbd486bc6165b056ba329326b459b5882870cde6867edacffb4fa4cdcc | MATLAB | 4,030 | 106 |
% // Function for getting the often-repeated operations of querying the SDO
% structure for the unit, background, and shuffled matrices; compensating
% for the fact that the individual shuffles may no longer be present.
%
% Here, the 'dSdo' and 'jSdo' are structures, which contain the entirety of
% the 'Unit', 'Bkgd'... |
4e1567357bb20c671b9294c21773a9fd440a4557008efea7cfdcb277aa25494d | MATLAB | 4,032 | 130 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% File: PTBSendTrigger.m
%
% NOTE: Internal function. DO NOT CALL.
%
% Sends a trigger to the USBBox.
%
% Args:
% - value: 0-255 trigger values to send
% - trigger_delay: The delays to use for each trigger.
%
% Usage: PTBSendTrigger(30)
%
% Author: Doug Bemis
% Date: 2/3/10... |
31c934686e092557103f79de6cc492fa6182617e53683311fcffd1c1ed5afa62 | MATLAB | 4,033 | 196 | function [v,diags,parout]=graddiag(M,para);
% approximately diagonalizes arbitrary complex matrices stored in M(:,:,f) for all f
% simplest version:
% Input: M NxNxK tensor with N channels and K matrices to be
% diagonalized
% para is an optional structure.
% para.nite is the number of iterat... |
b156b0dbb114ee656353ca23e29b67de56394a44ba5462db44a0e62cf3da4a54 | MATLAB | 4,033 | 113 | % Script for visualizing Enrichment results
%% Visualize thresholded network matrix
% load enrichment results and corresponding IM structure
load('name of structure containing dataOut');
load('name of IM structure');
fc = load('name of fc data'); % rvals, not zvals
%fc=fc.rmat;
fc=FisherR2Z(fc.rmat);
fc=FisherZ2R(... |
3a956cc06f22bce408b8cef497511a4a07303c5a399fa5613b124d786fc39a5d | MATLAB | 4,034 | 60 | clear;clc;close all
ROOTPATH = strcat(NoveltySU.utils.getRootDirPath(mfilename("fullpath"), 4), "Data\Processed Data\");
cd(NoveltySU.utils.getRootDirPath(mfilename("fullpath"), 2))
protStr = "1000-ms Sound reward";
temp = NoveltySU.utils.dirItem(strcat(ROOTPATH, protStr), "spkData.mat");
popRes = cell2mat(cellfun... |
a2e88cd8d778e28744c65f91bb4f859b821beb5f9eb75bb8ba8585ce2c72b9f0 | MATLAB | 4,034 | 86 | function [result] = TSrmeventcodes(codes)
% TSRMCODES Removes event codes from the Experiment structure
% TSrmcodes( codes ) removes event code definitions from the
% Experiment structure. Codes can be a string indicating the name of the
% code, a number indicating the value the code has, a cell string
% c... |
c86360a3aecc48203c57cb2621113ea613e00385dfaaebde6cd2a6ed9542e470 | MATLAB | 4,034 | 99 | function Aout = h_retrieveSynapseAnalysis3(handles)
[currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles);
fname = get(handles.currentFileName,'String');
[filepath, filename, fExt] = fileparts(fname);
analysisNumber = currentStruct.state.analysisNumber.value;
startingAnalysisFil... |
f8d8c72cb601353ac537b75488984d13789e44db929db66ce729bfd4c1afb479 | MATLAB | 4,039 | 113 | scrsz = get(0,'ScreenSize');
scrWidth = scrsz(3);
scrHeight = scrsz(4);
datRoot = '/Volumes/LaCie/Farries recordings/';
% choose rat
rat = 'IM1130';
sesList = dir([datRoot rat '/20*']);
sesList = arrayfun(@(x) x.name, sesList, 'UniformOutput', false)
% choose session
iSes = 3;
sesList{iSes}
datDir = [datRoot rat '/' ... |
ce4809ec6462831260bcb5c42c8b8ef9a28e9a588becf59902b67bbc2de01284 | MATLAB | 4,041 | 93 | function [] = motorElementAnalysis(dataset,params,figureFile)
close all
JAABA_folder = 'C:\Users\lt532\Desktop\Aggression Project\JAABA Stuff\JAABA-master\MirrorChamberData\';
d = dir(JAABA_folder);d(1:2) = [];
JAABA_subfolder = {d.name}';
lunge_thresh = 3;
wingThreat_Thresh = 45;
wingExt_Thresh = 45;
stopThresh = 1;... |
ebbcae8078fe38bb04a5295973f5d58326fb11ffba23850f655bdf43185dd59d | MATLAB | 4,041 | 124 | function [H] = rotate(f)
% ROTATE returns the homogenous coordinate transformation matrix
% corresponding to a rotation around the x, y and z-axis. The direction of
% the rotation is according to the right-hand rule.
%
% Use as
% [H] = rotate(R)
% where
% R [rx, ry, rz] in degrees
% H corresponding h... |
0add97e62951f7a3e8cb2f7d4fc689df5ab43a896b65336137c93e68fc22b86d | MATLAB | 4,043 | 102 | function [LinkedLineHandles,LinkedMarkerHandles,MeanHandles,ErrorHandles]=...
plotLinked_withMeanError(XData,YData,MeanData,SEMData,Pairs,MeanWidth,MeanOffset,SEMWidth,...
Color,MarkerSize,MarkerStyle,MeanLineWidth,ErrorLineWidth,LinkLineWidth,LinkLineStyle,LinkLineColor)
% Pairs=ExperimentSetPairs(Experiment... |
5683b032019eefe9746c22a5d628779b0f2fb59ccdadb68048653472446ce44d | MATLAB | 4,045 | 82 | %% WRAPPER for analyzing multi-ExR synapses data %%
% Accompanies the manuscript by Kang*, Schroeder* et al., 2023
% Last modified by Margaret Schroeder on 12/14/2022
% Image processing up to this point:
% - background subtraction in Fiji and
% - registration using modified ExSeq pipeline
% - manual ROI ide... |
f5528c34a8bb105f09a45d4c8ef8adc0463f4f31ecc4107c32932c442f04537d | MATLAB | 4,046 | 161 | % Demo for DCM for fMRI: motor and premotor interactions
% This demo looks for motor/premotor responses to 'prepare' and 'go'
% instructions.
close all
clear variables
%-----------------------------------------------------------
%-------------- DCM model specification --------------------
%--- Basic settings
f_fname... |
3dfb85429835b033698c6f46009b308b494eac4eca1093004e936e517c948c8f | MATLAB | 4,048 | 142 | % kstest2d Two-dimensional, 2-sample Kolmorogov-Smirnov test
%
% [p,D] = kstest2d(s1,s2);
%
% Compare two, 2-dimensional distributions using Fasano & Franceschini's
% generalization of the KS-test.
%
% The analytic distribution of the statistic is unknown, and p-values
% are estim... |
ccba5f9162c2a5bb91b3bd3f3592ba210a27e7db94dd445ea3b175a23c5b7c1b | MATLAB | 4,049 | 104 | function [version] = hasyokogawa(desired)
% HASYOKOGAWA tests whether the data input toolbox for MEG systems by
% Yokogawa (www.yokogawa.com, designed by KIT/EagleTechnology) is
% installed. Only the newest version of the toolbox is accepted.
%
% Use as
% string = hasyokogawa;
% which returns a string describing th... |
6ba56429499d7c8638ba36a98b1e6b0e8a86d45d3201b2fa4049a10224a0ede8 | MATLAB | 4,050 | 144 | function EEG = DeleteTriggersForTrials(EEG)
% function EEG = DeleteTriggersForTrials(EEG)
% deletes the triggers for trials corresponding to result.deleted (which
% were removed during readAllEDF due to restarting expt etc.
%
% Should be run after merging files, but before saccade triggers are
% inserted
%
if ~isfield... |
2b6c0a75007f4f91b4010c0cb50a7698770f97c1629713a6eaccde7cf17287df | MATLAB | 4,051 | 152 | function [HL,CLIN] = cmlines(varargin)
% CMLINES Change the color of plotted lines using the colormap.
%
% SYNTAX:
% cmlines
% cmlines(CMAP)
% cmlines(H,...)
% [HL,CLIN] = cmlines(...);
%
% INPUT:
% CMAP - Color map name or handle to be used, or a Nx3 mat... |
4788bd92dffba2d433f9bea0808e14e2c3100cf097276e2ce60949a9cce8e73e | MATLAB | 4,057 | 108 | function [out, azi, ele, idx] = SOFAspat(in,Obj,azi,ele,flag)
% SOFAspat
% [out, azi, ele, idx] = SOFAspat(in,Obj,azi,ele) spatializes the sound IN using
% the HRTFs from OBJ according to the trajectory given in AZI and ELE.
% Input:
% in: vector with the sound
% Obj: SOFA object containing the HRTFs
% azi, ele: ve... |
4c60754e647f742bde17ab92e30c1c0d31332c161a476f35a2beb15a0680a666 | MATLAB | 4,057 | 107 | function s1_prepare_task_input_lists(id_list,task_data_dir,ABCD_table_dir,task_proc_dir)
%
% s1_prepare_task_input_lists(id_list,task_data_dir,ABCD_table_dir,task_proc_dir)
%
% This function prepares input lists required for the rest fMRI preprocess pipeline
%
% Inputs:
% - id_list
% A string. Path of a text file... |
54a5690dfb5298c60c7c4d953a0be9e0cd1803bed21fe1b85e2c95c778b106b2 | MATLAB | 4,057 | 103 | function [Data_Corrected, Header, P]=y_FDR_Image(StatsImgFile,qThreshold,OutputName,MaskFile,Flag,Df1,Df2,VoxelSize,Header)
% function [Data_Corrected, Header]=y_FDR_Image(StatsImgFile,qThreshold,OutputName,MaskFile,Flag,Df1,Df2,VoxelSize,Header)
% Function to perform false discovery rate (FDR) correction.
% References... |
92f5ffb4091a20a106c619cf6fc99b63841d3fb7a6e8f544046addb876667717 | MATLAB | 4,057 | 103 | function CBIG_AuthorTopicEM_ConvertBrainImages(data_dir, ...
gibbs_data_file, em_data_file, brain_mask2mm)
% CBIG_AuthorTopicEM_ConvertBrainImages(data_dir, brain_mask, ...
% gibbs_data_file, em_data_file)
%
% Convert binary-smoothed brain images of activation foci to data input
% for the Gibbs sampler and Expectat... |
e6f6f74271ff9a0430911f5aff57e65b25cfc9d06cbac09139642a288e35a32c | MATLAB | 4,058 | 125 | function [B1,phase,rf_complex,Gz,fa] = tr_foci(params)
% Some parameters
rf_ampl = 2.1865;
larmor_freq = 4.2576e+04;
rf_dur = params.vaso.foci_dur;
% RF Slab-Selective
Gs=1;
Amax = 3.32;
B1max = 0.327152;
w = 0.30; r1=0.64; r2=0.27; r3=0.59; r4=0.00; r5=1.00;
% AMM: For ASL, use 30... |
1ed6056613fd5c2941df280486d263e4030fa150856e1a844e9bf025b62dbda6 | MATLAB | 4,060 | 122 | function [V] = ft_write_mri(filename, dat, varargin)
% FT_WRITE_MRI exports volumetric data such as anatomical and functional
% MRI to a file.
%
% Use as
% V = ft_write_mri(filename, dat, ...)
%
% The specified filename can already contain the filename extention,
% but that is not required since it will be added aut... |
a8e24f5594f211d7b5d21d9ea6576e24841bfa2de7860e83aee551028a1da6bc | MATLAB | 4,061 | 111 | function [mrf, loglikHist] = mrfTrainEm(mrf, data, varargin)
%% Train an mrf with partially observed data via EM
% This does not currently update the undirected backbone parameters, only the local
% CPDs.
% data(n,i) = 0 if node i in case n is unobserved
% data(n,i) = k if node i in case n is observed to be k
%
% 'loca... |
6f216145f3aaca089cf930e47efb9054377d9ee1973dd476c0c16ce541eead0f | MATLAB | 4,062 | 96 | function [X, info] = dominant_invariant_subspace(A, p)
% Returns an orthonormal basis of the dominant invariant p-subspace of A.
%
% function X = dominant_invariant_subspace(A, p)
%
% Input: A real, symmetric matrix A of size nxn and an integer p < n.
% Output: A real, orthonormal matrix X of size nxp such that t... |
d0b6f4f2959dc200473686764f99c775c8886cbd7e65e67672a36040fe0825b7 | MATLAB | 4,062 | 115 | function gradfun = approxgradientFD(problem, options)
% Gradient approx. fnctn handle based on finite differences of the cost.
%
% function gradfun = approxgradientFD(problem)
% function gradfun = approxgradientFD(problem, options)
%
% Input:
%
% A Manopt problem structure (already containing the manifold and e... |
657b6ca8d259b58a83db2054889d3bcc923ce39570ef136d21a435aed04d3718 | MATLAB | 4,063 | 131 | function [assignment, cost] = assignmentallpossible(distMatrix)
%ASSIGNMENTALLPOSSIBLE Compute solution of assignment problem
% ASSIGNMENTALLPOSSIBLE(DISTMATRIX) computes the optimal assignment for the
% given rectangular distance (or weight) matrix, for example the assignment
% of tracks (in rows) to observati... |
984836e203a4932545aa8c1571fde2c9bbd8729ddc848cc93a85655a60704c69 | MATLAB | 4,064 | 114 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% step_1_fitting.m %%%
%%% Fit the electrodes to each patient skin mesh. %%%
%%% ------------------------------------------------------------------- %%%
%%% Ryan: Run th... |
12bf68229527826f5fcfacc334b4c30fd0d4b30390f052b0691fa7d38c912c5b | MATLAB | 4,065 | 118 | function [ avw ] = avw_hdr_make
% AVW_HDR_MAKE - Create Analyze format data header (avw.hdr)
%
% [ avw ] = avw_hdr_make
%
% avw.hdr - a struct, all fields returned from the header.
% For details, find a good description on the web
% or see the Analyze File Format pdf in the
% mri_toolb... |
d20f9d31405985dd735e83583786aff8a1c4e2a7ab11b036d68ac9d0e354a581 | MATLAB | 4,065 | 96 | function h_makeAnnotationROI3(handles)
[currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles);
axes(handles.imageAxes);
% ROISizeStr = get(handles.ROISizeOpt,'String');
% ROISizeValue = get(handles.ROISizeOpt,'Value');
Roi_size = h_getROISize3(currentStruct.state.ROISizeOpt.strin... |
79a7227ddeba51e3fa12e19e2e54bde8691a80d1a14af20d2f1e7b26d826c8e2 | MATLAB | 4,068 | 100 | function [output] = ft_transform_geometry(transform, input)
% FT_TRANSFORM_GEOMETRY applies a homogeneous coordinate transformation to a
% structure with geometric information, for example a volume conduction model for the
% head, gradiometer of electrode structure containing EEG or MEG sensor positions and
% MEG coil... |
ee74cd27d07bb85a0ab923b771544bacf2a83de5d45cabaabbf35414c43bb2e0 | MATLAB | 4,068 | 77 | function [gx,gy,gx_pre,gy_pre,adc,params] = create_spirals_adc_pulseq(spiral_grad_shape,adcSamples,adcDwell,params)
lims = params.gen.lims;
% Dummy trapezoid for pre-allocation
gx_pre = mr.makeTrapezoid('x',lims,'maxGrad',25e-3*lims.gamma,'Area',0);
gy_pre = mr.makeTrapezoid('... |
348551716a6b9e997caa4c27bcbc777c18e53a3717cd4e55923a3e6ed0dab841 | MATLAB | 4,069 | 124 | function [data] = femdata_TR(mesh, t, dt, varargin)
% FEMDATA_TR Calculates time-resolved photon fluence rate for a FEM mesh in
% the NIRFAST format. This function is a wrapper to call
% mesh-type-specific femdata functions. This function handles mesh types
% 'stnd' (single wavlength) and 'spec' (spectral) only.
... |
a4590fb7e21f2739c2a23a75134f989d17fd88365b5f0024c23b21d66cce90dc | MATLAB | 4,069 | 107 | function k=LineCurvature2D(Vertices,Lines)
% This function calculates the curvature of a 2D line. It first fits
% polygons to the points. Then calculates the analytical curvature from
% the polygons;
%
% k = LineCurvature2D(Vertices,Lines)
%
% inputs,
% Vertices : A M x 2 list of line points.
% (optional)
% Li... |
de24885f012283ebe9c64fdd011c42e4b5266332b8c8a32b0ed8864ced7a4b2b | MATLAB | 4,069 | 103 | %% Plot expected and perceived pain like (Jepma et al., 2018) Fig 1d)
function figureOut = PlotLikeJepma2018Fig1d(xhatStats, xhat_Stats, ...
maxVAS, figNr, varargin)
% Plot xhat and xhat_ (avg + SE) on each trial, in red for high cue and in
% blue for low cue, to allow for comparison with Fig 1... |
9cfa0155a6760b166bc922940eb5d07e2ab5796e23ddb5128283b9955516b7c4 | MATLAB | 4,070 | 135 | function h = ft_plot_crosshair(pos, varargin)
% FT_PLOT_CROSSHAIR plots a crosshair at a specified position in two [x, y] or three
% [x, y, z] dimensions.
%
% Use as
% h = ft_plot_crosshair(pos, ...)
% where pos is the desired position of the crosshair. The handles of the lines are
% returned.
%
% Optional input ar... |
5abe032fc1fbd5b91ebd1a372ffe1e7454f8cdbce1c39a4e9ef4581f313830d9 | MATLAB | 4,071 | 63 | % MATLAB
% See also
%
% Embarrassingly parallel function evaluation:
% fevalArrays - Used to apply the same operation to a stack of array elements.
% fevalDistr - Wrapper for embarrassingly parallel function evaluation.
% fevalDistrDisk - Helper for fevalDistr (do no call directly).
% fevalImage... |
85bc45f1dcbc47e69e61860d7c0185d5d2c0c382c1e3d6058dd41ef5aa938e60 | MATLAB | 4,071 | 112 | function [hdr] = read_wdq_header(filename)
% READ_WDQ_HEADER reads header information from wdq files
%
% Use as
% [hdr] = read_wdq_header(filename)
%
% Copyright (C) 2011, Jan-Mathijs Schoffelen
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
%
% FieldT... |
6521c782e2ecb73f2a8d2bcef72a99609ad093164049218f2124d4b6e59d27d7 | MATLAB | 4,072 | 152 | function [img, Vto] = scn_resample_voxel_size(loadImg, voxsize, varargin)
% This function takes an image name in loadImg
% and loads the data, resampling to the space defined
% in the image sampleTo.
%
% :Usage:
% ::
%
% [imgData, volInfo_mapto] = scn_resample_voxel_size(loadImg, voxsize, varargin)
%
% take volInfo... |
a1ffc26193950c95e991c3717043301804f7db04744cb3b6e2fec40514759e43 | MATLAB | 4,073 | 124 | function [varargout] = solid_angle(varargin)
% SOLID_ANGLE of a planar triangle as seen from the origin
%
% The solid angle W subtended by a surface S is defined as the surface
% area W of a unit sphere covered by the surface's projection onto the
% sphere. Solid angle is measured in steradians, and the solid angle
% ... |
29475de4212be3387d58ee5fd9a7200a1b9385bfe300ad205c259b0b17d656d2 | MATLAB | 4,075 | 130 | %% MVGC bootstrap demo
%
% Demonstrates confidence interval construction using a nonparametric bootstrap
% on generated VAR data for a 5-node network with known causal structure (see
% <var5_test.html |var5_test|>). Pairwise-conditional Granger causalities are
% estimated and confidence intervals constructed using both... |
7bc50d4b78e2d9a2c149d25c77c573e8e6b026f61df44b16f20e6536ecbeab50 | MATLAB | 4,076 | 117 | %% MVGC Toolbox "startup" script
%
% Initialise MVGC Toolbox. This file is run automatically if Matlab is started
% in the toolbox root (installation) directory.
%
% You may have to (or want to) customise this script for your computing
% environment.
%
% (C) Lionel Barnett and Anil K. Seth, 2012. See file license.txt i... |
2126fab8e2f6ff5715dabece4fbb6ddc630452ab4de6ab4e147c83a21a65ad80 | MATLAB | 4,077 | 104 | classdef LabelOutlierController < handle
% Controller for the "Suspicious Labels" dialog, which lists outlier labels
% (by angle / distance / reprojection error) and lets the user jump to them.
%
% This replaces the bare uifigure function label_outlier_gui.m: state and
% widget handles move from guidata into ... |
99a6ed4ff902978ffd8afa31a1fe1fd6d8b30b6180c368e52448a9e51042a204 | MATLAB | 4,077 | 100 | classdef VideoRecording < Recording
properties (Transient)
videoReader
end
properties
videoSize = [0 0]
timeStamps = []
end
methods (Static)
function canLoad = canLoadFromPath(filePath)
canLoad = false;
try
i... |
dbe958bdc6fdad89103d6ae3a6c4c64d5c256b8e6078a6dc8207d25fd26cbffa | MATLAB | 4,078 | 120 | %preallocate cell array
aal_labels = cell(116,1);
%assign the labels to each cell entry
aal_labels{1} = 'precentral_r';
aal_labels{2} = 'precentral_l';
aal_labels{3} = 'frontal_sup_r';
aal_labels{4} = 'frontal_sup_l';
aal_labels{5} = 'frontal_sup_orb_r';
aal_labels{6} = 'frontal_sup_orb_l';
aal_labels{7} = 'frontal_mi... |
ec88d09b4227565077f1e044d1f19be9de6a5c696b39550a7b366baddb1b493e | MATLAB | 4,078 | 166 | function [A, fH,figNames] = meg_plotERF(data,p,selectedChannels,plotSingleTrial,plotAvgTrial,plotAvgChannel)
% MEG_PLOTERF(data,selectedChannels,plotSingleTrial,plotAvgTrial)
%
% INPUTS
% data
% structure of condition cells containing
% data matrix, time x channels x trials
% p
% params with expt short type ... |
ff79451884a7e07c5a937f2e95a4a9dcd00b7362ac96954b746b0a59661cbcba | MATLAB | 4,083 | 138 |
%%% Scope: Reading preprocessed BOLD-signals, calculating FCs
%%% (functional connectivity), joining FCs
%%% Author: Jonas A. Thiele
%%% Date: 24.06.2022
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Choose sample
name_sample = 'PIOP2'; % 'PIOP1' , 'PIOP2'
if strcmp(name_samp... |
062a7165ee243ef3f5cadf368ebd158e189c2f4848c94b04f59e5c8c289997ec | MATLAB | 4,085 | 157 | function Y = ttm_me(X, U, edims, sdims, tflag)
%TTM_ME Memory-efficient sptensor times matrix.
%
% Y = TTM_ME(X, U, EDIMS, SDIMS, TFLAG) handles some dimensions
% elementwise and others in the standard way. Here, X is a sparse tensor
% (sptensor), U is a cell array of matrices of length ndims(X),
% EDIMS speci... |
07879a0f4a02e7dfde050d3d71167b7536b7a703e6933648f8cdffc8e7c5e372 | MATLAB | 4,085 | 99 | %% REPLAY DECODING
% Extracts spikes for each replay event and decodes it. Saves in a
% structure called repay_track. Inside each field (each track) the replay events are saved.
% Loads: extracted_replay_events, extracted_clusters and extracted_place_fields_BAYESIAN
function decoded_replay_events = replay_decoding(var... |
2e85890ce94d3b4dafecc78490f9e2263fbca64c95f08a7b2b1d08ac078737d2 | MATLAB | 4,086 | 168 | % This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,... |
dc936f4872f7d6a268dc097173e50650ab213696133a1bd77707da4b1864501c | MATLAB | 4,087 | 114 | function [allVec,allTs,allTs_marker,allTs_trigger] = Closed_Loop_FFT()
% Closed-loop algorithm using fft method to detect peak
% allVec: Raw EEG (channel*sample)
% allTs: Timestamp of each sample
% allTs_marker: Timestamp of event markers
% allTs_trigger: Timestamp of the sample at which triggere was delivered
%%... |
10a8601f560fe1e90814670dea424ea458ca0ea90ba92263c8059ad76f467b79 | MATLAB | 4,092 | 134 | clear
%
figure
set(gcf,'color','w');
set(gcf, 'Position', [230,430,200,400])
for line = 1:2
subplot(2,1,line)
if line == 1 %R4d
load('X:\Ring neurons\single_dot_blue\analysis\ER4d_list')
new_list = ER4d_list;
load('ellipse_data_ER4d.mat','orientation')
elseif line == 2 %... |
3009b041b57b7fab40e942d1376b49377e8fad8182344ab75bb02af6ecf7c02f | MATLAB | 4,092 | 124 | %% predictSDO_plot_relative_error_rates
% Variant of the plotter to compare the accumulation of E1/E2/E3 errors of two
% specified hypotheses.
%
% May be useful for comparing the STA and SDO or SDO to background;
%
% Because yyaxis elements are not handled well in inkscape, if saving plots
% as SVGs, save the... |
c9c5ca5373e66d76b4946bd03af9f29684f9ad6d82c5a2f66522bfd2f3229e76 | MATLAB | 4,093 | 164 | %{
_ _
___ _ __ __ _| |__ ___ ___ _ __| |_
/ __| '__/ _` | '_ \/ __|/ _ \| '__| __|
| (__| | | (_| | |_) \__ \ (_) | | | |_
\___|_| \__,_|_.__/|___/\___/|_| \__|
# NNgenerateTrainingData
**Syntax**
```
C.NNgenerateTraining... |
79d2a96820284fef64863284f4af953e527578f322d30ce50c253c777b93248c | MATLAB | 4,094 | 135 | % newer version is called: plot_bigSbigT_multipleS_trialAvg_decision
pSL = colms - 1;
for dim = dimms
i = i + 1;
clear sl rl ylims
switch dim
case 1
sl = sigSL.TinC*1000;
rl = sigRL.TinC*1000;
ylims = [0 30];
if sub0 == 1
ylims = [0... |
1e7f0eaa9786e90aa3ae4c3b21bf674b4e27452639c29d4ffde3be4669a9b3bc | MATLAB | 4,096 | 107 | % FADE-SAME: Figure S2
% clear
% close all
%%% Step 1: load data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% load results file
FADE_file = '../FADE_scores/FADE_SAME_scores_2021_01_11_FADE_only.xls';
[num, txt, raw] = xlsread(FADE_file);
clear num txt
% specify inference
alpha = 0.1;
% extract variables... |
2f0fb511c2f69e2bfc7dbeb0eab2f8a6beba4cba2b5247bceced18587a137e7f | MATLAB | 4,096 | 113 | function varargout=pcaVisualize( U, mu, vars, X, index, ks, fname, show )
% Visualization of quality of approximation of X given principal comp.
%
% X can either represent a single element (a single image or video), or a
% set of elements. In the latter case, index controls which element of X to
% apply visualization t... |
4188169bcf790be9aa7659060f0c6127143584a3a7081f4e2a7e208150b6f516 | MATLAB | 4,097 | 105 | function [solver_out] = get_solver(solver_in)
% GET_SOLVER Checks and returns supported solver.
%
% SYNTAX:
% GET_SOLVER
% GET_SOLVER(SOLVER_IN)
% [SOLVER_OUT] = GET_SOLVER
% [SOLVER_OUT] = GET_SOLVER(SOLVER_IN)
%
% [SOLVER_OUT] = GET_SOLVER Returns the default solver. If a NVidia GPU
% with CUDA technology is ... |
b87a3603effc1d90c1a32e010f5a217f2c44ae3dd50a233ea8a6df97018d3da9 | MATLAB | 4,097 | 94 | function [U] = st3ddir(srcinfo,targ,ifppregtarg)
% ST3DDIR Direct (slow) 3D Stokes kernel sums (reference for STFMM3D).
%
% U = st3ddir(srcinfo,targ,ifppregtarg)
%
% Stokes direct evaluation in R^3: evaluate all pairwise particle
% interactions with targets. This is the slow O(N^2) direct code used
% as a refere... |
e6b3bd350a57fca69f473319562256c95b9907a110eacaaff5fdb873267671e8 | MATLAB | 4,097 | 93 | classdef heatSimulation
%HEATSIMULATION This class includes all properties and methods
%related to the heat simulation in an MCmatlab.model.
properties
%% Input properties
silentMode (1,1) logical = false % Disables command window text and progress indication
useAllCPUs (1,1) logical = false % If fa... |
2786155163274bf72ea2811b3d179eeb54c670a8c3c3e13b4ef53d6fc478ee3d | MATLAB | 4,098 | 133 | function varargout = simpleCache( op, cache, varargin )
% A simple cache that can be used to store results of computations.
%
% Can save and retrieve arbitrary values using a vector (includnig char
% vectors) as a key. Especially useful if a function must perform heavy
% computation but is often called with the same in... |
629bca529b8ca75251df22358e0e5b372840d580b4a6723e5db02b643595a07f | MATLAB | 4,098 | 120 |
% Detection heuristics
% * Cortical or non-hippocampal channel (given IEDs filtered at
% physiological ripple frequency (80 - 250Hz) exhibit high power in this
% band. Thus non-hippocampal channel are used for first detection.
% * Passband filtered at 60 - 80 Hz (per Gelinas et al 2016)
% * Durations of events... |
6f7f6d2b3108aea7d2254014061ea1793458b41e2811214919a8f3f329a51ee8 | MATLAB | 4,098 | 159 | function [output] = read_mff_bin(filename, begblock, endblock, chanindx)
% READ_MFF_BIN
%
% Use as
% [hdr] = read_mff_bin(filename)
% or
% [dat] = read_mff_bin(filename, begblock, endblock);
fid = fopen(filename,'r');
if fid == -1
ft_error('wrong filename') % could not find signal(n)
end
needhdr = (nargin==1)... |
d5d792dbe7a470040703ead6449a4c8451e8b4bf92799df16e9ae2d1cd139f18 | MATLAB | 4,098 | 106 | function [FF subspace] = ms_event_features(clips,num_features,opts)
%MS_EVENT_FEATURES - Extract PCA features from an array of events
%
%Consider using mscmd_features
%
% Syntax: [FF, subspace] = ms_event_features(clips,num_features,opts)
%
% Inputs:
% clips - MxTxNC array of clips (see ms_extract_clips)
% num_f... |
1580a8d86638ac0a98a839d37f2e858f84e3b4d43cf557d5f7877b43738a6228 | MATLAB | 4,099 | 121 | function phi = phi_Gauss( type_of_phi, Z, probs, options)
% Compute phi for Gaussian disbributions
%
% INPUTS:
% type_of_phi:
% 'MI1': Multi (Mutual) information, e.g., I(X_1; X_2). (IIT1.0)
% 'MI': Multi (Mutual) information, e.g., I(X_1, Y_1; X_2, Y_2)
% 'SI': phi_H, stochastic interact... |
904b925555ec2a22470c80c6841ab20ac91e76c7affd290d7986ea664dfd026f | MATLAB | 4,100 | 109 | % FADE-SAME: Figure S7
% clear
% close all
%%% Step 1: load data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% set results files
FADE_files = {'../FADE_scores/FADE_SAME_scores_2021_01_11_ref_FADE_G1.xls';
'../FADE_scores/FADE_SAME_scores_2021_01_11_ref_FADE_G2.xls';
'../FADE_sco... |
bc3002b0337d3de0131305920345965a703ee695d8550dfe05c59b5c665ed803 | MATLAB | 4,100 | 157 | % Color code for each image:
if ~exist('n_ima')|~exist('fc'),
fprintf(1,'No calibration data available.\n');
return;
end;
check_active_images;
if n_ima ~=0,
if ~exist(['ex_' num2str(ind_active(1)) ]),
fprintf(1,'Need to calibrate before analysing reprojection error. Maybe need to load Calib_Results.mat f... |
5a30726be0c9e9b5f26328c32978731a65531d046d2ba4a7dce28f62fca02f5b | MATLAB | 4,101 | 178 | % This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,... |
470c018db78432b884cc701574acabde0bf01cdceff7559f72c4ef15fc9cadb0 | MATLAB | 4,103 | 133 | %% Wrapper for multi-ExR nanocolumn analysis %%
% Accompanies the manuscript by Kang*, Schroeder* et al., 2023
% Last modified by Margaret Schroeder on 6/6/2023
% Adapted from a script originally written by Tyler Tarr (Sarkar, Kang,
% Wassie et al. Nat Biomedical Engineering 2022)
% Image processing up to this point:... |
34586bed09bb3853204f89030a6f5c9064a810997029f41563c4f2c241959df6 | MATLAB | 4,104 | 117 | function plot_kappLikeStuff(vc, summaryInfoTable, devMeasure_all, kecn, kselPercNtr, kselPerc, varargin)
%% handle optional inputs (varargin):
nOpVar=0; % counter for optional variable
nOpVar=nOpVar+1; opVars.smltSel = []; defaultValues{nOpVar} = nan;
opVars = handleVarargin(varargin, opVars, defaultValues);
if isn... |
04c3408f6ab2254c79c9a6e2ae07302d9369c75f34a4916c10d884072813cc19 | MATLAB | 4,105 | 126 | function f = PlotTopoAndTrace(tVals,pVals,xTimes,varargin)
% function PlotTopoAndTrace(tVals,pVals,xTimes,varargin)
%
% Plot a row of topoplots under a time series of those values
%
% Inputs:
% tVals = [nChans nTimes] matrix of t values (or beta, or voltage etc) to
% use for plotting
% pVals = [nChans nTime... |
1f4bdf8aa1b3aea4abdf88254d9c57053270c72d2eeeac32e77fdc2ae9d57d66 | MATLAB | 4,106 | 87 | function h_openFile3(handles,fname)
global h_img3;
[currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles);
if exist(fname, 'file')
% tic
[pathname,filename,fExt] = fileparts(fname);
if ~exist('pathname','var')
pathname = pwd;
fname = fullfile(pathna... |
0e58c5ed73cf196cb4085416b65e5f002a60a88cf67f734055ad0cf14c865815 | MATLAB | 4,107 | 226 | % 'this function runs some tests on some known
% data to verify that some features work all right'
function [passed,total] = run_all_tests()
hashlib.test()
passed = 0;
failed = 0;
close all
S = getpref('crabsort');
assert(~isempty(S),'crabsort_test_data environment variable is unset. Cannot perform tests!')
asse... |
123fa3add6488e4a7b0176973ef23c72cd411984113396972ca7168c3d25139d | MATLAB | 4,107 | 128 | function FADE = calc_FADE_score(SPM_mat, con_vec, con_type, ref_map, do_plot)
% _
% Calculate FADE score for a single subject using reference map [1]
% SPM_mat - filepath to SPM.mat of estimated GLM
% con_vec - the memory contrast vector (e.g. [+1 -1 0])
% con_type - the memory contrast type (i.e. 't' or ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.