sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
a19c96124ee8118442a8bfc476fb8ca4c07a1f8440867648d6461338addc1e09 | MATLAB | 5,560 | 155 | function M = stiefelcomplexfactory(n, p, k)
% Returns a manifold struct. to optimize over complex orthonormal matrices.
%
% function M = stiefelcomplexfactory(n, p)
% function M = stiefelcomplexfactory(n, p, k)
%
% The complex Stiefel manifold is the set of complex orthonormal nxp
% matrices. If k is larger than... |
2e18134f9de06571bd8cff0ac6eeb4bcf0d3511b173953295e9f26d2dc997c50 | MATLAB | 5,567 | 216 | classdef ToTrackInfoSet < matlab.mixin.Copyable
properties
ttis = [];
end
methods
function obj = ToTrackInfoSet(varargin)
if nargin >= 1,
obj.ttis = varargin{1};
end
end
end
methods (Access=protected)
function obj2 = copyElement(obj)
% overload so that .ttis is... |
ece6e2c104d72b1fedff1ecd60330a80d330ae77749db25dfd01edb49ff5f21e | MATLAB | 5,567 | 169 | %% Plot Figure 3 and 5
function figureOut = PlotFigure3and5(xhatArr, xArr, AhatArr, Rs, figNr, ...
legend_xhat, legend_Ahat)
% Plot Ahat and R in upper subplots, pain (xhat) and tissue
% damage (x) in lower subplots, all for different values of Ahat and R
% ==== Input ===
% perc... |
2ee32a2f356f9a8aab96e97b596931ba582d1993c42cf98a0822bb7a4536c426 | MATLAB | 5,568 | 193 | function [Mean_MMT_Shoulder] = Muscle_Moment_G1(x)
% MATLAB code provided by Seyed Mohammad Ali Rahmati
% Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA.
% This script computes the maximum muscle moment averaged over the cycle as a funct... |
55ae68a89a7f73d8ab62cf214b4618588066b4d39b2860b1bed19700e73673ed | MATLAB | 5,569 | 193 | function h = CBIG_DrawSurfaceMaps_fslr(lh_data, rh_data, mesh_name, surf_type, min_thresh,max_thresh,colors)
% h = CBIG_DrawSurfaceMaps_fslr(lh_data, rh_data, mesh_name, surf_type, min_thresh,max_thresh,colors)
%
% This function a given labels (parcellation labels, activation patterns...)
% in fslr to a Matlab figures... |
45d49307a339a1b9c6126a7df6b86f58afa63891ecc6017a7c76f3fedb6fbf10 | MATLAB | 5,574 | 199 | % RSKEL_XSP Extended sparsification for recursive skeletonization.
%
% The extended sparsification of a compressed matrix F = D + U*S*V' is a
% sparse matrix embedding
%
% [D U ]
% A = [V' -I]
% [ -I S]
%
% where I is an identity matrix of the appropriate size and S is itself
... |
9c56de5a4f8a86c86f2f817200e48bf398bbde1692793a9a1aeaf3d7f742b3cc | MATLAB | 5,574 | 149 | %% Set parameters.
% Network architecture.
V = 6; % Two rule-dependent inputs, two phase-dependent inputs, and two sensory inputs.
N = 100;
M = 1;
layer_size = [V N M];
nconnections = inf;
g_by_layer = [1.0 1.0 1.0]; % Defines the initial scale of synapses for each layer.
layer_type = {'linear', 'tanh', 'linear'}; % De... |
9e01674d5d1b6e3152e7ce567e57886b45c43ed354bd06926d94070d83717819 | MATLAB | 5,579 | 163 | %{
Copyright (c) 2025 Axion BioSystems, Inc.
Contact: support@axion-biosystems.com
All Rights Reserved
%}
classdef BasicChannelArray < handle
%BASICCHANNELARRAY Class used to hold plate type and channel mapping
% lists within entries.
% PlateType: Numeric ID of the loaded plate that thes chan... |
5ec82258086b0fb552d5343a292b5429fe0db8ebac38db81b9a973bcd8b9b4a3 | MATLAB | 5,581 | 157 | function FWHM=w_Smoothest_Surf_WangR(SurfFiles, ResidualFiles, MskFiles)
% Estimate global FWHM for surface files
% %------------------------------------------------------------------------
% Usage: FWHM=w_Smoothest_Surf(SurfFiles, ResidualFiles, MskFiles)
%
% Input:
% SurfFiles - Surface file list, nx1 cell. e.g... |
69444f20211f8659a9258740c4789531e7d77310ec5e68c378e15da4ddc0f989 | MATLAB | 5,582 | 178 | function [slbl,tp,locg,ntgtstot] = genWriteTrnPack(lObj,dmc,varargin)
% Generate training package. Write contents (raw images and keypt
% jsons) to packdir.
[writeims,writeimsidx,~,~,verbosejson,tblsplit,~,...
cocoformat,jsonfilename] = myparse(varargin,...
'writeims',true, ...
'writeimsidx',[], ... ... |
b0103d632b372452a0bdc28fd3b1c4cc36de74b4ea9c4a823b7365ec8586175c | MATLAB | 5,585 | 1 | % TSPARSEP Flexibly extract information from time & position stamped data.
% This is TSparse modified to deal with 3-col TSData in which the 3rd col
% contains the position of the wheel as of each event. (Of course, many
% of the "events" in the 2nd col are also positions; in those cases 3rd
% col has same va... |
44975d7210a952d5185b9f5230d042e08c0be2a938fa155ebe03e47538dde871 | MATLAB | 5,587 | 157 | % Covariance matrix on the unit line, Matern 3/2 kernel.
%
% This is basically the same as COV_LINE1 but using the Matern 3/2 kernel.
%
% Inputs (defaults are used if not provided or set empty):
%
% - N: number of points (default: N = 16384)
% - OCC: tree occupancy parameter (default: OCC = 64)
% - P: half-number... |
b70e570794edc441e4bc28a4f9eff3a72f91e680b46b797aae589773809884aa | MATLAB | 5,588 | 161 | t = round(medA.leverage(1).t, 3);
plotT = find(t >=0.2 & t <=0.5);
compTP = find(round(t, 3) == 0.55);
proj_type = 'PC1weights'; % 'PC1weights', 'uniform', 'randn', 'gauss'
for sess = 1 : 8
clear spk par dat_raw
load(fullfile(saveLoc, ['spk_S' num2str(sess)]), 'spk', 'par')
par.tsl = ... |
8f9e95f675fb734d71352ceb1b07801b38321c8c6df04817bc4b0249feef3b67 | MATLAB | 5,591 | 169 | % Second-kind integral equation on the unit circle, Laplace double-layer.
%
% This example solves the Dirichlet Laplace problem on the unit disk by using a
% double-layer potential, which yields a second-kind boundary integral equation.
% The integral is discretized with the trapezoidal rule; the resulting matrix is
% ... |
02afba433d14e1cdf615c3e29691f3a0bd6174383fea4f2736dd197b3144d4f2 | MATLAB | 5,592 | 141 | function h_autoPosition3(handles)
global h_img3;
[currentInd, handles, currentStruct, currentStructName] = h_getCurrendInd3(handles);
h_copyROI3(handles);
% this is a bit unnecessary, but sometimes when loading files, the color channel would change...
channelInd = currentStruct.state.channelForZ.value;
if... |
241f39652005d26482428769bf0f8c71ee086dddc77fff72f3850ce580f62b82 | MATLAB | 5,593 | 158 | function [vol,q,q_area,status] = CheckMesh3D(e,p,nodemap,input_flags)
% Performs some checks on a 3D mesh (either surface or solid) and returns
% volume/area and quality of elements. The mesh elements are defined in 'e'
% and cooridinates are in 'p'. It also returns the validity of mesh
% status in 'status' as:
% For s... |
bf8c1b409708c70ea1a9033fd4e3a908be54801a8f9c80b9f35b4aacf3574ded | MATLAB | 5,595 | 139 | function hh=shiftebar_h(mean,sd,nshift,varargin)
% shiftebar -- draw shifted errorbar_h
%function shiftebar(mean,sd,nshift,varargin)
%
% [Input]
% -mean: mean of the data
% -sd: std of the data
% -nshift: number of shift
%
%
%
% [note]
% 2 [-0.14, 0.14]
% 3 [-0.14, 0, 0.14]
% 4 [-0.275, -0.095, 0.... |
f4539eb324946e2d23e34c624560f4646386344c49cc4083b16b324c8a4bfd91 | MATLAB | 5,596 | 173 | %% plotHeader
%
% Header script for the collection of plotter methods used to visualize
% the SDO and SDO effects, as called by the sdoMat and sdoMat classes
%
% All plotter subscripts may be called independently.
%
% PREREQUISITES:
% sdoMat or sdoMultiMat
% INPUT PARAMETERS
% sdo: 'sdoMat' or 'sdoMultiMat' Cla... |
3019711cf9f0dec4a34cae71eefcae6fdf0090c6f0db729e580366c0e0926142 | MATLAB | 5,598 | 145 | % Noam Saadon-Grosman
% August 2020
clear all;
close all;
% This code takes mesh (surface) time courses of all participants and the two stimulus
% directions (star_lip and start_toe) and computes a random effect group t-values map
% corrected for multiple comparisons and masked for significance.
%%% input: Files... |
ab618210567053feec7197f92ff99656e9c61820dc7d966b9c8870bc24d58468 | MATLAB | 5,598 | 160 | function [lfp, spike, stm, bhv] = spass2fieldtrip(dirname, varargin)
% SPASS2FIELDTRIP reads data from a set of SPASS data files and converts
% the contents into data structures that FieldTrip understands. Note that
% dependent on the SPASS data it might be required to change some
% hard-coded parameters inside this f... |
2346a9af97e4824d7ee8c30741ed3ececf09c45545f98309b69d378554ca692d | MATLAB | 5,599 | 157 | function CBIG_AuthorTopicEM_PreprocessExpDataFromText(text_data_path, ...
data_dir, binary_smooth_kernel_rad, brain_mask)
% CBIG_AuthorTopicEM_PreprocessExpDataFromText(text_data_path, ...
% data_dir, binary_smooth_kernel_rad, brain_mask)
%
% Preprocess data of activation foci's locations in text form: write the
... |
5e9e1f3d5648ddd5c18d9ee9b8db208d449c6b7e0eac94a7525eb1a77725b647 | MATLAB | 5,600 | 159 | function [this] = read_biff(filename, opt)
% READ_BIFF reads data and header information from a BIFF file
%
% This is a attemt for a reference implementation to read the BIFF
% file format as defined by the Clinical Neurophysiology department of
% the University Medical Centre, Nijmegen.
%
% read all data and informat... |
363eaee8f427fb0949569249f03c3e6ff91766a085a46e17033ffc1a939328a4 | MATLAB | 5,601 | 100 | function [spikeMat, V_m, G_sra, G_syn_E_E, G_syn_I_E, G_syn_E_I, G_syn_I_I] = randnet_calculator(modelParam, network, simDuration, varargin)
% randnet_calculator.m
%
% Simulates network of recurrent LIF neurons
%
% Input:
% - parameters: A struct containing simulation parameters
% - network: A struct containing net... |
b565210b0e5cccf86b20d0e186f01911963da19dfbe170c90b1636d62d5a4df4 | MATLAB | 5,603 | 143 | %%
mat = '/nrs/branson/al/cache/multitarget_bubble/openpose/view_0/apt_expt2/deepnet_resultsdo_inf_diags.mat';
lbls = '/groups/branson/bransonlab/apt/experiments/data/multitarget_bubble_expandedbehavior_20180425_FxdErrs_OptoParams20181126_dlstripped.lbl';
lbl = '/groups/branson/bransonlab/apt/experiments/data/multitarg... |
ba305b943fe3df26cc53e1af94caeb0fefc1f87a78e9848eedb213a94e82a913 | MATLAB | 5,604 | 152 | function [montage, cfg] = ft_prepare_montage(cfg, data)
% FT_PREPARE_MONTAGE creates a referencing scheme based on the input configuration
% options and the channels in the data structure. The resulting montage can be
% given as input to FT_APPLY_MONTAGE, or as cfg.montage to FT_PREPROCESSING.
%
% Use as
% montage =... |
5c1249415a005d27c90afa7652290eac8a9888b247f8c94f7973e007fab23083 | MATLAB | 5,606 | 180 | %% Parameters
folder_path = '.\segmented\'; % Input folder (Imaris files).
folder_output = '.\extracted\'; % Output folder.
reprocess_samples = false; % If false, the script will not re-compute samples that have already been processed.
min_struct = 0; % Parameters to filter microglia by size (minimum
max_struct = 1... |
ac23b0d85ca5293e568b5c86644c17587e3804ddc41c14a2f13121c58d2fc5a9 | MATLAB | 5,607 | 183 | % TrioEEGBehCorrel
clc; clear all; close all;
load('TrioEEGBehAnalysis.mat','varNames','trialTab','vars' );
nVars=3;
[nPP, nConds, nDrugs, nTr] = size(vars.velres);
%% do all vars?
% varNames = {'vel','ampl','srt','endptVarCorr','depAngle','velres'};
% nVars = length(varNames);
%% regress each variable against each ot... |
589179a7d73778ab82728ade5e779fd1ee84f7fe20237fe093be29a4332c81bb | MATLAB | 5,609 | 162 | classdef Raster < handle
% Raster is a class that implements the ray intersection method of
% Patil S. and Ravi B [see Patil S and Ravi B. Voxel-based
% representation, display and thickness analysis of intricate shapes.
% Ninth International Conference on Computer Aided Design and Computer
% Graph... |
b6e5d58591fd2d808a20ab0b42c13cd55e78242255ce2978039d1336f251a64e | MATLAB | 5,612 | 122 | function InputStruct = ProcessSensoryFields(InputStruct, SegmentationStrings, varargin)
% Defaults
Threshold = 0;
ExportPlots = false;
ExportFolder = "";
ShowCentroids = false;
ParseVarargin()
% Create output folder
if ExportPlots
if ~exist(ExportFolder, 'dir')
mkdir... |
0c406d5b0e5209368eb5e0a4c49bd9354bdeb3587de06471a42cb0b288ef40fc | MATLAB | 5,613 | 174 | function M = rotationsfactory(n, k)
% Returns a manifold structure to optimize over rotation matrices.
%
% function M = rotationsfactory(n)
% function M = rotationsfactory(n, k)
%
% Special orthogonal group (the manifold of rotations): deals with matrices
% R of size n x n x k (or n x n if k = 1, which is the d... |
8b6879941a808860b1071127678378b208f5cc39345b54db898e56c1d853baff | MATLAB | 5,613 | 179 |
% load data
% contact Lead Author for data
%% CUE CORRELATION relationship
% calculate dfof correlation with cue template
% 4G-N
load('fig6_avr1avr2_10bin.mat'); ttl = 'avr1-avr2';
% load('fig6_avr1vvr1_10bin.mat'); ttl = 'avr1-vvr1';
% load('fig6_avr2vvr2_10bin.mat'); ttl = 'avr2-vvr2';
% load('fig... |
5e5f24e5465954f18d29ec872abba7bbd188398939ef58d938142fd21ad8871b | MATLAB | 5,616 | 166 | classdef FeaturesDetector < FeaturesReporter
properties
detectedTimeRanges; % An nx2 matrix of non-overlapping time ranges (start, end) in ascending order.
end
events
DetectedTimeRangesDidChange
end
methods(Static)
function n = typeName()
... |
d2fb4243e21f91fa8f6e07053b1fd0e3e9bc6ab0f5ac00deb4ea998f20275df3 | MATLAB | 5,619 | 160 | %% mvgc_makemex
%
% Build MVGC |mex| files
%
% <matlab:open('mvgc_makemex.m') code>
%
%% Syntax
%
% mvgc_makemex(force_recompile,verbose)
%
%% Arguments
%
% _input_
%
% force_recompile forced recompilation flag (default: false)
% verbose verbosity flag (default: false)
%
%% Description
%
% Builds ... |
5184a14f7d40bdf21cd1b07666fbaac6829f644306afb4367604b538b737a71f | MATLAB | 5,622 | 185 | function [tfr,rtfr,hat] = tfrrmsc(x,t,N,f0T,trace,K);
%TFRRMSC Reassigned Morlet Scalogram time-frequency distribution.
% [TFR,RTFR,HAT] = TFRRMSC(X,T,N,F0T,TRACE)
% computes the Morlet scalogram and its reassigned version.
%
% X : analysed signal
% T : the time instant(s) (default ... |
7c912887be6810bbfabb08847683fed0810402c07a9c9211071221e093d19f8d | MATLAB | 5,622 | 94 | function y_Convert_BIDS2DPARSF(InDir, OutDir, SubID)
% function y_Convert_BIDS2DPARSF(InDir, OutDir, Options)
% Convert BIDS data structure to DPARSF data structure.
% Input:
% InDir - Input dir with BIDS data.
% OutDir - Output dir with DPARSF data.
% SubID - subject ID
%_________________________... |
4829984567705d0bf78fe2d8d4ecaba057b139c470b7ac67457ca8b7d5cb1a12 | MATLAB | 5,626 | 187 | function [hout,ax_out] = uibutton_cust(varargin)
%uibutton: Create pushbutton with more flexible labeling than uicontrol.
% Usage:
% uibutton accepts all the same arguments as uicontrol except for the
% following property changes:
%
% Property Values
% ----------- -----------------------------... |
077ba72b6fd7ffb646a5941ec8f15477d0114c947eaa92c499a009633c7f34bf | MATLAB | 5,627 | 140 | function CBIG_MSHBM_avg_profiles(seed_mesh,targ_mesh,out_dir,num_sub,num_sess)
% CBIG_MSHBM_avg_profiles(seed_mesh,targ_mesh,out_dir,num_sub,num_sess)
% This function will be used to average profiles across all the subjects
% and all the sessions. Please note that the profiles of sub-sessions will
% not be included. ... |
d672d3af664bd97e2c27a7b7ee26cbceb3b2a7e462eef5183367233a046f18ea | MATLAB | 5,627 | 149 | function data = ft_removetemplateartifact(cfg, data, template)
% FT_REMOVETEMPLATEARTIFACT removes an artifact from preprocessed data by template
% subtraction. The template can for example be formed by averaging an ECG-triggered
% MEG timecourse.
%
% Use as
% dataclean = ft_removetemplateartifact(cfg, data, templat... |
33dc7a31d2b8eeaaf95e041d134c5f3713176110f816be8ff30d42540524bd51 | MATLAB | 5,628 | 169 |
%%%%%%%%%%%%%%%%%%%% SHOW EXTRINSIC RESULTS %%%%%%%%%%%%%%%%%%%%%%%%
if ~exist('n_ima')|~exist('fc_right')|~exist('fc_left'),
fprintf(1,'No stereo calibration data available.\n');
return;
end;
ind_active = find(active_images);
no_grid = 0;
if ~exist(['n_sq_x_' num2str(ind_active(1))]),
no_grid = 1;
end;
... |
829acebe8196011df0f1e9396d33b5d228c57a101549dae456212c9ae0377a03 | MATLAB | 5,628 | 183 | function MergeReview(spkDat, mergeDat, varargin)
% convert waveform data from int16 to double-precision floating point
spkDat.waves = double(spkDat.waves);
maxScale = 1;
sameScale = true;
convertToVolt = true;
nSampTarget = 100;
showIdx = 1:size(mergeDat,1);
Fs = spkDat.Fs;
wvFs = Fs * spkDat.upsample;
minIsi = 1;
f... |
b7bc1ea8132fd2e1a204e45cbe5bd20e7d7e09f2250d13133d7f41b5515a2eaa | MATLAB | 5,629 | 149 | function [data] = ft_removetemplateartifact(cfg, data, template)
% FT_REMOVETEMPLATEARTIFACT removes an artifact from preprocessed data by template
% subtraction. The template can for example be formed by averaging an ECG-triggered
% MEG timecourse.
%
% Use as
% dataclean = ft_removetemplateartifact(cfg, data, templ... |
de307f9ce607c3114a22d5d711637f15a6d7acc73f51d581657f5245155d0699 | MATLAB | 5,634 | 103 | function [ImageArrayDFTReg_FirstImages,DeltaX_DFTReg_Whole,DeltaY_DFTReg_Whole]=...
Episodic_DFT_Reg(RunParallel,myPool,StackSaveName,...
ImageArray_FirstImages,ImageArrayCoarseReg_FirstImages,...
ReferenceImage_FFT,ReferenceImage_Padded_Masked_Filtered_Enhanced_FFT,...
AllBoutonsRegion_... |
01eaa8d3bbb878688b80448b03e989354c44b3d55bf04d91718f11bbe507a8df | MATLAB | 5,636 | 362 |
function plot_object_explore_results(basepath,explore_vectors,results)
% load position
basename = basenameFromBasepath(basepath);
% load animal behavior and session files
session = loadSession(basepath);
load(fullfile(basepath,[basename,'.animal.behavior.mat']),'behavior')
% load behavior epochs
behave_ep ... |
b24192803e6ba2442e6d37cb68184f6b08afd8dd9bca27b24bdf410672c6fb3b | MATLAB | 5,638 | 159 | classdef UncertainFramesController < handle
% Owns the figure and listbox for displaying uncertain frames.
properties (Access=private, Transient) % private by convention
labelerController_ % parent controller
labeler_ % Labeler
model_ % UncertainFramesModel
figure_ % uifigure handle
thresh... |
596f88cae1a8125707d1a4a90d163a8f7b4b1cb878aee7911d92da5b358d95d9 | MATLAB | 5,639 | 139 | function [type] = ft_voltype(headmodel, desired)
% FT_VOLTYPE determines the type of volume conduction model of the head
%
% Use as
% [type] = ft_voltype(headmodel)
% to get a string describing the type, or
% [flag] = ft_voltype(headmodel, desired)
% to get a boolean value.
%
% For EEG the following volume conduct... |
a54c5f31c1cc9749c4e8fd0aa86bfc4832724ad63e363a84bd27ccff3e5dade7 | MATLAB | 5,641 | 146 | function preconfun = preconhessiansolve(problem, options)
% Preconditioner based on the inverse Hessian, by solving linear systems.
%
% function preconfun = preconhessiansolve(problem)
% function preconfun = preconhessiansolve(problem, options)
%
% Input:
%
% A Manopt problem structure (already containing the m... |
d8d3ab629e8672e35e79faeecbbbc661910b5d00d063e2d5875ec140b5200097 | MATLAB | 5,642 | 149 | % Five-point stencil on the unit square, constant-coefficient Poisson equation,
% Dirichlet boundary conditions.
%
% This is the same as FD_SQUARE1 but using HIFDE2X.
%
% Inputs (defaults are used if not provided or set empty):
%
% - N: number of discretization points in each dimension (default: N = 128)
% - OCC: t... |
a1c18c583c3c198d93503df9a2653543b724b8324110088f9d5f957e0bb7eb03 | MATLAB | 5,644 | 231 | classdef MovieReader < handle
% Like VideoReader, but wraps get_readframe_fcn
properties (SetAccess=private)
filename = '';
readFrameFcn = [];
nframes = nan;
info = [];
nr = nan; % numrows in raw/orig movie
nc = nan; % numcols in raw/orig movie
nchan = nan; % numchans "
fid = n... |
f2c53e187ed2aa35dbd2a0dedfa6ea3bddb9ac136bbc487310379076c1623a3c | MATLAB | 5,644 | 148 | function [dat] = read_yokogawa_data_new(filename, hdr, begsample, endsample, chanindx)
% READ_YOKAGAWA_DATA_NEW reads continuous, epoched or averaged MEG data
% that has been generated by the Yokogawa MEG system and software
% and allows that data to be used in combination with FieldTrip.
%
% Use as
% [dat] = read_y... |
ee974f0d71e3390d9c852cdfcdf8318dee5e1f876b6f5424a2b798ca79f20741 | MATLAB | 5,646 | 156 | function [] = plot_ground_truth_compare_two_shuffles(folders,option,method)
total_number(1:3) = 0;
for nfolder = 1:length(folders)
cd(folders{nfolder})
load decoded_replay_events
[~,time_range]=sort_replay_events([],'wcorr');
for event = 1:length(decoded_replay_events(1).replay_events)
... |
705613c0c04fddf89ccbf8b5cbd2c7b47098ac52107bdf6302d5d21943655f4c | MATLAB | 5,648 | 174 | function draw_figure4E_5BCD(p,encRes)
%
% This code is for drawing figure 4E, 5BCD
%
%
%% settings
% use feature sets
compFeats = {'dimension','category','semantic','vision'};
load(p.roiInfPath,'roiInf');
nSbj = length(p.sbjID);
roiSets = {'individual','network17','subcortex'};
%% draw figures
for roisitr = 1:lengt... |
53039b1de9207fa6a4abaf5dc2adda318627a6fdd4269328288564b98b0d4af2 | MATLAB | 5,651 | 160 | % manual_bloodvesselmasking_loop.m
% Sarah West
% 9/14/21
% Modified from SCA_manual_masking.m, just the manual masking parts. Will
% also put in code from create_bloodvessel_masks_withbackgroundmasks.m .
% Let's you keep adding masks until you say you're done. You can return to
% it.
% This has the exact same code ... |
4daf47d3f7325ab382f25b8c345af5e22f3818fde8f2937db84141778700b5a7 | MATLAB | 5,652 | 172 | % FADE-SAME: Figure 4
% clear
% close all
%%% Step 1: load data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% set results files
FADE_file = '../FADE_scores/FADE_SAME_scores_2021_01_11_FADE_yFADE.xls';
covs_file = 'covariates/covariates.xls';
% load results files
[num, txt, raw1] = xlsread(FADE_file);
[num... |
859764126f4f7710bb7e6e1ba91d04955ef129979fea381ecaafba31fdc36b24 | MATLAB | 5,653 | 159 | function [freq] = ft_datatype_freq(freq, varargin)
% FT_DATATYPE_FREQ describes the FieldTrip MATLAB structure for freq data
%
% The freq data structure represents frequency or time-frequency decomposed
% channel-level data. This data structure is usually generated with the
% FT_FREQANALYSIS function.
%
% An example o... |
8c033dfed08b137222f0467da80ec32a36bc7f8bc7e25f15064d0d46e85b91a3 | MATLAB | 5,654 | 164 | function y_Meta_Image_CallR(TFiles,OutputName,MaskFile,N1, N2, Regressor)
% function y_Meta_Image_CallR(TFiles,OutputName,MaskFile,N1, N2, Regressor)
% Perform meta analysis call 'metansue' R package.
% Input:
% TFiles - n by 1 Cell. Each cell is a T file for a study.
% OutputName - OutputName
% Mas... |
56e829aa2f9dbd324165a1ed6223fa7236d62ac766b797ee228adf2221798431 | MATLAB | 5,655 | 136 | function detrend(subject, task, strategy)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This script applies the required steps for detrending fmri after fmriprep%
% It also regress signals from the BIOPAC after being preprocessed with %
% drifter. ... |
d622350ddb0f285a9ca66276746e68c103fa7835e651fc91561658e48bfdae02 | MATLAB | 5,655 | 1 | % TSgetlimit returns the vector of integer indices specified by
% the contents of those subfields of Experiment.Info that specify active
% subjects, sessions, trials, and phases. For example, when one of these
% fields contains 'all', TSgetlimit converts that to the vector containing
% all the relevant index numbers. I... |
4530527096927b990425d3a7343e9f960de0dc33ebc2b29fd5e900e62da598dc | MATLAB | 5,657 | 156 |
%% loading data, surface, parcel indeces
lh_pial = SurfStatReadSurf1('schaefer_atlas/parcellations/CBIG-master/stable_projects/brain_parcellation/Schaefer2018_LocalGlobal/Parcellations/FreeSurfer5.3/fsaverage5/surf/lh.pial');
rh_pial = SurfStatReadSurf1('schaefer_atlas/parcellations/CBIG-master/stable_projects/brain_... |
f74a6e2603b0e002c679f54f42a32c9eff317bac34ae6b4e6257c01d8adba5d7 | MATLAB | 5,659 | 155 | % Five-point stencil on the unit square, constant-coefficient Helmholtz
% equation, Dirichlet boundary conditions.
%
% This is basically the same as FD_SQUARE1 but for the Helmholtz equation. The
% resulting matrix is square, real, and symmetric (at general frequency).
%
% Inputs (defaults are used if not provided or s... |
00c90234af5cfcda4a655663104c1a71d0d6ca2cc16b24e4b93df7143c35d754 | MATLAB | 5,660 | 134 | %% pmtk3 interface to mlcomp
%
%% What is mlcomp?
% <http://mlcomp.org/ mlcomp> is "a free website for objectively
% comparing machine learning programs across various datasets for
% multiple problem domains". The basic idea is that it creates
% a data x algorithm table,
% which stores the performance of
% man... |
b8ab063112ce1c8499b816b4a04cca02a93374e4b8607c19adebe5802a5ea42d | MATLAB | 5,661 | 156 | function [ReHoBrain, GHeader] = y_reho_Surf(InFile, NNeighbor, AMaskFilename, AResultFilename, SurfFile, CUTNUMBER)
% Calculate regional homogeneity (i.e. ReHo) from the 2D surface brain
% FORMAT [ReHoBrain, OutHeader] = y_reho_Surf(InFile, NNeighbor, AMaskFilename, AResultFilename, SurfFile, CUTNUMBER)
% Input:... |
c296533ceeb358415f1492d6a71571c2411449524e88706c4395719f47661aef | MATLAB | 5,662 | 189 | %% Phase locking value for gamma band (70-100hz)
for q=1:64
q
LowGammaData_70_100(q,:) = bandpass(LFPRawAll(q,:),[70,100], DecFS);
end
for chan = 1:64%length(good_chan)
the_chan = chan%good_chan(chan)
phase_envelope_70_100(the_chan,:) = unwrap(angle(hilbert(LowGammaData_70_100(the_chan,:))));
end
se... |
1c0c77555a8e00e066d3e0c3b3fac43f160519a90316d5a637b1cf7ce4325948 | MATLAB | 5,663 | 167 |
%% parameters setting
clear;
hemi={'lh';'rh'};
%hemi={'rh'};
hm=1;
% surf_tpe='inflated'; %edit me
surf_tpe='sphere';
surfsuffix='orig';
dataDir = '/home/xianchige/YZY/20220523data/sub05/session01/';
%dataDir = '/home/xianchige/YZY/20220322test/data/session1/sub01/';
%% load data
% ssname='litongsubjectfortest';
% s... |
c085899de4c3c4b038d127fce0542a80adc77cacc6a36cc72f9b996e7de583a3 | MATLAB | 5,664 | 144 | %% Simulations part 2: Sensitivity to heterogeneous training and test sets
%
% Main script to run simulations to test how predictions from different
% kernels are affected by fitting the HMM either only to training subjects
% or to all subjects, when train and test subjects are taken from different
% distributions.
%
... |
049ef5c6b9787fbdecac919e7179f704b2659a7e85f676389e3cd755bbeb13c4 | MATLAB | 5,665 | 268 |
%load data: contact lead author
%%
load('otherIdx.mat')
i=find(nRuns(:,1)>1);
allFieldsUse=allFields(i);
aodx = [29:38 39:42 43:52 63:72 111:120];
vsdx = [9:18 81:90 91:94 95:104 127:136];
F=allFieldsUse;
F=cell2mat(F');
F=F(otherIdx,:);
AOVSF=[];
for n=1:size(F,1);
a=F(n,:);
a1=a(aodx);
... |
e91057033c02047239fa0cdc36a40940ec3a1e2f62557162fe05b9fa8a1404f2 | MATLAB | 5,665 | 131 | function [dLh,resels,FWHM, nVoxels]=y_Smoothest(StatsImgFile, MaskFile, DOF, VoxelSize)
% function [dLh,resels,FWHM, nVoxels]=y_Smoothest(StatsImgFile, MaskFile, DOF, VoxelSize)
% Function to estimate smoothness like smoothest in FSL.
% Reference: Flitney, D.E., & Jenkinson, M. 2000. Cluster Analysis Revisited. Tech... |
b6e57f65b2a4cb47029f0f2898879795df50cae426d7e2ce54c220ceefe6cc63 | MATLAB | 5,666 | 123 | function [] = plotMotorElementAnalysis(dataset,params,figureFile)
close all
nGenotype = numel(dataset);
fs = params.fs(1);
yl = {[0 2],[0 0.5], [0 15],[0 15],[10 50], [10 50],[150 180],[10 30],[0 15],[-4 4],[1.5 3]...
[-180 180],[-180 180],[-180 180],[0 50], [0 50],[10 50], [10 50]};
units = {'mm','norm','mm/s','m... |
9680fe4e9e15ca6968d08e9faf50e17afa1c5b898e920fdca1c8e95bb8067954 | MATLAB | 5,667 | 162 | %% Compare step stimulus amplitude on AP morphology
clear
close all
% param.bcl = 800; % basic cycle length in ms
% param.model = @model_ToRORd_step_stimulus_rescaled_IKs; % which model is to be used
% param.verbose = true; % printing numbers of beats simulated.
% stim_amps = [-53, -80, -100];
% figure;
% hold on
%
% ... |
0aff4d8ec63dece85554806ccaacaf76299f354982e16341942de2eaa780ee35 | MATLAB | 5,671 | 147 | % NullDistribution
% Sarah West
% 5/19/22
% To be run with RunAnalysis. Makes shufflings between two datasets (parameters.data1 &
% parameters.data2). Also takes the mean of each distribution and subtracts
% the mean of dataset 2 from the mean of dataset 1, for convenience.
function [parameters] = NullDistribution(p... |
491bb485cb03a279d0713efc1e9f95b61fa27380689b4a9c872c6c10cb529d68 | MATLAB | 5,672 | 163 | function [ Total_Muscle_Fatigue ] = Cost_Function (xopt)
% MATLAB code provided by Seyed Mohammad Ali Rahmati
% Affiliation: Biomechanics and Motor Control Lab, Department of Biological Sciences, Georgia Institute of Technology, Atlanta, GA.
%
% Description:
% This M-file minimizes muscle fatigue: (FMT/PCSA)^3
% xopt... |
a483e6541d3270479b6cc0626ead4fa00abe2d505ec43f834a98e0a4a3d1d7ef | MATLAB | 5,674 | 166 | function varargout = imMlGauss( G, symmFlag, show )
% Calculates max likelihood params of Gaussian that gave rise to image G.
%
% Suppose G contains an image of a gaussian distribution. One way to
% recover the parameters of the gaussian is to threshold the image, and
% then estimate the mean/covariance based on the c... |
1b1cb8ac7ee39e3bbda1e94f1bb09f921023f09c620e075ed0ec866022317951 | MATLAB | 5,675 | 131 | % Various visualiztion scripts which might be useful
% Useful only if the user puts a breakpoint after the calc_affine.m script
% runs to completion. As of Dec 2015, the breakpoint should be put in line
% 218 of registerWithDescriptors.m, before the correspondences have been
% calculated and saved as a file globalkeys... |
2aa0721517a7378642dba08ba120811964a8a0d4991cee9430fe079c9865600e | MATLAB | 5,676 | 147 | function writeHsdHeader_ver4( fn, hsd_header )
% New hsd version 4 for saving filtered data (not generated at rig)
% 4/3/2017 M. Farries
% usage: writeHSDheader( fn, hsd_header )
%
% function to write an hsd header to a file; useful for replacing a header
% with mistakes in it
%
% INPUTS:
% fn - filename
% ... |
b9875bde42ebe371e0de72784412681cfbe35eb86c15eb9f061781c3cb3ef55d | MATLAB | 5,680 | 155 | function [downsample] = ft_volumedownsample(cfg, source)
% FT_VOLUMEDOWNSAMPLE downsamples an anatomical MRI or source reconstruction
% and optionally normalizes its coordinate axes, keeping the homogenous
% transformation matrix correct.
%
% Use as
% [volume] = ft_volumedownsample(cfg, mri)
% where the input mri sh... |
8d7c89457ade50c3ae319ed13982ea30c99f949a6b716672226a0802d9846f6e | MATLAB | 5,683 | 165 | %% MVGC "GCCA compatibility mode" demo
%
% Demonstrates usage of the MVGC toolbox in "GCCA compatibility mode"; see
% <mvgchelp.html#6 Miscellaneous issues> in the Help documentation. This is
% partly for the benefit of former users of the Granger Causal Connectivity
% Analysis (<http://www.sussex.ac.uk/Users/anils/aks... |
eb9eea70f38e919f912603ba2c8829fb3d67a2c24690c41b575f5d1754b12c92 | MATLAB | 5,683 | 155 | function [downsample] = ft_volumedownsample(cfg, source)
% FT_VOLUMEDOWNSAMPLE downsamples an anatomical MRI or source reconstruction
% and optionally normalizes its coordinate axes, keeping the homogenous
% transformation matrix correct.
%
% Use as
% [volume] = ft_volumedownsample(cfg, mri)
% where the input mri sh... |
e46e26aabde1b8e64f8a5a16560fd253541e6658c6078533002135acb6b29421 | MATLAB | 5,687 | 140 | function [type] = ft_headmodeltype(headmodel, desired)
% FT_HEADMODELTYPE determines the type of volume conduction model of the head
%
% Use as
% [type] = ft_headmodeltype(headmodel)
% to get a string describing the type, or
% [flag] = ft_headmodeltype(headmodel, desired)
% to get a boolean value.
%
% For EEG the ... |
88ebcc8ab694e82198be6b68ff1a0a6f1c11feb89c8b2438dfec00ef4a6739d4 | MATLAB | 5,689 | 172 | function meg_msFigs_TE_allTrials_mdlFit_slope_bar
% meg_msFigs_TE_allTrials_mdlFit_slope_bar
% Plot linear model slope (All trials)
%% Load data
user = 'kantian';
filename = sprintf('/Users/%s/Dropbox/github/ta-meg-analysis-model/model_anticipatory/ModelFit_SeparatePrecueT1T2_2Hz_session_231220.mat',user);
load(fi... |
ad5bf358aa720d7a82962cec6993e04fdc37ed3f7d4addf3f27234d0042bd6b7 | MATLAB | 5,691 | 209 | function [mix, options, errlog, post] = gmmem_weighted(mix, x, w, options)
%GMMEM EM algorithm for Gaussian mixture model.
%
% Description
% [MIX, OPTIONS, ERRLOG] = GMMEM(MIX, X, OPTIONS) uses the Expectation
% Maximization algorithm of Dempster et al. to estimate the parameters
% of a Gaussian mixture model defined b... |
71ac21d3e0e9ee27de23b99e1100cb8e40c9096b27669f2cb168656b188e9cd6 | MATLAB | 5,693 | 210 | %% CellHorzCat
% perform horizontal concatenation of array elements across a cell (dim 2)
% assumes that the 1st dimension is constant across all rows; tranpose if
% this assumption is violated
% Copyright (C) 2023 Trevor S. Smith
% Drexel University College of Medicine
%
% This program is free software: you ... |
815578a414b45c1e34e5aa46542af63dd9665dee35e60bc836e8831407f04167 | MATLAB | 5,695 | 187 | function [cfg] = ft_multiplotCC(cfg, data)
% FT_MULTIPLOTCC visualises the coherence between channels by using
% multiple topoplots. The topoplot at a given channel location shows the
% coherence of that channel with all other channels.
%
% Use as
% ft_multiplotCC(cfg, data)
%
% See also FT_PREPARE_LAYOUT, FT_TOPOPL... |
47731f4d46d4400e3343bf48430b6017f13eb5e06d6973de22fec145ba55c58a | MATLAB | 5,697 | 188 | function [hdr] = read_nmc_archive_k_hdr(paramfile)
% READ_NMC_ARCHIVE_K_HDR extracts 'header-data' for nmc_archive_k datasets
%
% Use as
% hdr = read_nmc_archive_k_hdr(paramfile)
%
%
% This function specifically only reads data from one of the archived
% datasets of the Neurophysiological Mechanisms of Cognition gro... |
8bff82b842148849833d075274e88ff15b436d91073f27ff0fb0698771ad7fc8 | MATLAB | 5,697 | 153 | function shape_classification_dendrogram_graph(data)
classes = data.classes;
for k = 1:size(classes,1)
colors{k} = unique(cell2mat(classes{k,4}));
end
colors = unique(vertcat(colors{:}));
c_map = colormap(jet);
c_map = interp1(1:size(c_map,1),c_map,linspace(1,size(c_map,1),max(colors)));
if size(classes... |
25fd43d996b0d1bfee17993d65e82d84caf0b5442aeb6ffba28208936d507b88 | MATLAB | 5,698 | 150 | function [backgroundIms, maskedIms, target] = contrastTarget(display, target)
%%% Creating Contrast Target Stimulus
%% Make the stimuli
contrasts = target.contrast;
positions = target.positions;
sigmaDeg = target.sigma;
phases = target.phases;
pixelsPerDegree = target.pixelsPerDegree;
stimSize = target.stimSize;
spa... |
60dbe3ec18b850df8ca828491df7317c3f94479abc06e09ae7a1cfd7f5075a0c | MATLAB | 5,699 | 150 | function [meg] = read_ctf_meg4(fname, hdr, begsample, endsample, chanindx)
% READ_CTF_MEG4 reads specified samples from a CTF continous datafile
% It neglects all trial boundaries as if the data was acquired in
% non-continous mode.
%
% Use as
% [meg] = read_ctf_meg4(filename, hdr, begsample, endsample, chanindx)
% ... |
2b8589c56b46d17f2388e003133ac8ad9e339c49da50cc621b277d8af32aba8f | MATLAB | 5,700 | 202 | % Analyze the results from 'compute_subpopulationRate.m'
% (1) Plot the average firing rate over all neurons as a function of time
% for each realization separately
% (2) Plot the integral of the square of the difference in average firing
% rate for discs as a function of disc radius
% Run this scripts on ... |
3bdf8cea39e5c58ac6d0dd0140319a1117e12eff71481beae4b267718fc0d6c2 | MATLAB | 5,702 | 211 | % AUTHORSHIP
% Primary Developer: Stephen Meehan <swmeehan@stanford.edu>
% Math Lead & Secondary Developer: Connor Meehan <connor.gw.meehan@gmail.com>
% Bioinformatics Lead: Wayne Moore <wmoore@stanford.edu>
% Provided by the Herzenberg Lab at Stanford University
% License: BSD 3 clause
%
function [answ... |
de07c60cc1c604bf3a61c2449cc96d4ed1a5514d664d40f083609c8cb19417d3 | MATLAB | 5,703 | 175 | % ========================================================================
% TMFC analysis for block design
% Requires SPM12 (v7771)
% ========================================================================
% Ruslan Masharipov, August 7, 2024
% email: ruslan.s.masharipov@gmail.com
% ===================================... |
56cff16e82f9ea5e4a0f66c44da8ae2067a3ed8e06c1d0babe35a42b2d8cc64f | MATLAB | 5,704 | 148 | %% Plot example GP trials for a representative animal. Show detected TWs.
% also show representative phase map and phase vs distance plot
clear
clc
repTrial = [83 48 52 56];%48 52 56
%% important setup
dataPath = 'D:\InVivo\Baclofen\2022-04-07_Baclofen\4-baseline_220407_141157';
load([dataPath '\Grid-LFP-... |
bead0400dff11a68931c1c98d2f5961e0c50c7ea6b0d68f457fed4bb8cfbf919 | MATLAB | 5,704 | 145 | classdef RealtimeLabelNNGraph < dspace_graphs.AbstractGraph
% k-NN-Graph based on one or more labels defined in the underlying datasource.
%
%
%
%<PRE>
% This file is part of dspace-core.
%
% Copyright (C) 2020 University Zurich, Sepp Kollmorgen
%
% This program is free softw... |
26682f1215f955dbb2ba9b46f91e98dc7c89a2bab0c4eedaf4a20f73266ca5d8 | MATLAB | 5,706 | 99 | function [ImageArrayDFTReg_AllImages,DeltaX_DFTReg_Whole,DeltaY_DFTReg_Whole]=...
Stream_DFT_Reg(RunParallel,myPool,StackSaveName,...
ImageArray_AllImages,ImageArrayCoarseReg_AllImages,...
ReferenceImage_FFT,ReferenceImage_Padded_Masked_Filtered_Enhanced_FFT,...
AllBoutonsRegion_Orig_Pad... |
4ae55dabe2bd53ebdf4a5a6650a8ea03ae409e50751daf5fae0f4fdb9806d519 | MATLAB | 5,706 | 167 | % Author: Milena Capiglioni, University of Bern
% Contact: milena.capiglioni@extern.insel.ch
% Last update: Nov.2023
% If you use/modify this code for your future publication, please cite the
% corresponding article: "Stimulus-Induced Rotary Saturation imaging of
%visually evoked neuroelectric response: preliminary r... |
79269b9aaf5798f4099e88362dc501c8de40564895f9506954947faf09ebfcb6 | MATLAB | 5,707 | 171 | function Matrix_Org3(Min,key,buffer,lims,Cmap,fig,CmapData)
% This function organizes a sorted matrix using lines to add visual
% separation between modules and block colors along the left and bottom.
% This 3rd version of Matrix_Org is designed to support rectangular input
% matrices. It will also work with square ma... |
a1a7717de38e3a689d74915f73f26d03cb3092ed4e5b6397a77f2bf5441a17ef | MATLAB | 5,707 | 171 | function Matrix_Org3(Min,key,buffer,lims,Cmap,fig,CmapData)
% This function organizes a sorted matrix using lines to add visual
% separation between modules and block colors along the left and bottom.
% This 3rd version of Matrix_Org is designed to support rectangular input
% matrices. It will also work with square ma... |
e5abc028104a645a8378ad858b594c96e29d286bd95d6e51f3e1b0b5250c2e2c | MATLAB | 5,708 | 157 | function CBIG_KRDNN_get_ukbb_krr_result(setup_file, lambda_set)
% CBIG_KRDNN_get_ukbb_krr_result(setup_file, lambda_set)
%
% This function get the result of kernel ridge regression based on the result
% of validation result and testing result.
%
% Inputs:
% - setup_file
% Path of the setup file (.txt file).
% ... |
3bb7e877b2481646673068354016c99f8d3258cff4d0f53281ab7eb9b999357c | MATLAB | 5,710 | 158 | %% Compare mean signal of words vs noise for NNMF principal components
H_noise_all = nan(length(noise_tasks),2);
H_word_all = nan(length(word_tasks),2);
for z = 1:length(word_tasks)
% [the_peak, the_index] = max(trials_aligned_Hall(250:650,word_tasks(z)));
% H_index = 250+the_index-1;
% H_word_all(z,1)= m... |
76152e8db2e310912a4811ec5ecc39ebea69b63675c9400628cc0314e4df7f0b | MATLAB | 5,710 | 211 | function [err_tables,ll] = label_outliers(lobj)
%%
ll = [];
ff = [];
mm = [];
tt = [];
for ndx = 1:numel(lobj.labels)
ll = cat(2,ll, lobj.labels{ndx}.p);
ff = cat(1, ff,lobj.labels{ndx}.frm);
tt = cat(1,tt,lobj.labels{ndx}.tgt);
mm(end+1:end+numel(lobj.labels{ndx}.frm)) = ndx;
end
all_ll = reshape(ll,size(ll,1... |
82f9f7dfba6159cf32a73a8b31c38c122536af8bd58c03ebcd08680666e480db | MATLAB | 5,711 | 145 | PlaybackFrameInterval=5;
fileNames = uigetfile('registerNMJ_*.mat','Select registerNMJ Files','MultiSelect', 'on');
if ischar(fileNames)
temp=fileNames;clear fileNames
fileNames{1}=temp;
clear temp
end
disp('Checking file contents...')
for i=1:length(fileNames)
TempData(i).vars = whos('-file',fileNames... |
58e43075ab724e42ec53232a373514bb3399ab3ed3b4ec673e68d588653ada4d | MATLAB | 5,712 | 120 | %% This function returns the numerical derivative of an analytic function.
% Of special note, is the incorporation of the "complex step-derivative"
% approach which offers greatly improved derivative accuracy compared to
% forward and central difference approximations. This is especially germain
% when accuracy at t... |
d9a7acef66d04bead8b85433c5d291b710a58b371b16bdf6b0b0dbd34c07266e | MATLAB | 5,716 | 150 | %{
Copyright (c) 2025 Axion BioSystems, Inc.
Contact: support@axion-biosystems.com
All Rights Reserved
%}
classdef DiscontinuousBlockVectorHeaderEntry < CombinedBlockVectorHeaderEntry
%CONTINUOUSBLOCKVECTORHEADERENTRY Summary of this class goes here
% Detailed explanation goes here
properties... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.