sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
5f06c4b2061aeb284a2a2f399566c014d31f292890af887afa30731edeb9795b | MATLAB | 3,925 | 124 | % #!/usr/bin/octave -q
function palm_makeniimask(varargin)
% Make a 3D mask from a 4D NIFTI file, removing all NaN,
% Inf, as well as voxels with constant values along the
% fourth dimension. The main feature of this command is
% that it can operate in large files.
%
% Usage:
% makeniimask 4dfile.nii mask.nii
%
% ___... |
62798c398f0253a3e6a2afae6ef04a9cc5230e1ebabef3aba7ba96732fea1d8b | MATLAB | 3,928 | 108 | function tests = testDfa
%TESTDFA Known-answer recovery tests for dfa.
%
% DFA has exact analytic answers on standard processes. Feed a series whose
% scaling exponent is known by construction and check the estimator returns
% it. This is the only kind of test that can distinguish "runs without
% error" from "c... |
8bfe122592f8ebbde2f171af40f1f7a000bd7dc7472503dc439dbd74e91a39b3 | MATLAB | 3,930 | 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... |
68764811a7181ced62e8b6f033c58fadcd8cbb1ceaac1f1d087496e4f263aa2e | MATLAB | 3,932 | 116 | %% Modeling Raw Data Compiler
% Read behavior outputs from ".mat" and compile into hBayesDM format
% only for prl_rp function currently
% subjID, trial, choice, outcome
% choice: (1=Left, 2=Right)
% outcome: (1=Reward, -1=No Reward)
% Liang-Yin Lu
clear all; close all;
%% Read behavior data
datapath = fu... |
869d21fd066b05bf01c6a3ad86162d8c9f8727ea909e040e2ec6753cd7a08482 | MATLAB | 3,932 | 117 | function rms = fastrms(x,window,dim,amp)
%FASTRMS Instantaneous root-mean-square (RMS) power via convolution.
%
%FASTRMS(X), when X is a vector, is the time-varying RMS power of X,
%computed using a 5-point rectangular window centered at each point in the
%signal. The output is the same size as X and contains, for each... |
50d58bc589c42b73bef6e9563d577f4a57d4a82bba2d75b9ed9fbfed728548c7 | MATLAB | 3,934 | 112 | function map = colormap(arg1,arg2)
%COLORMAP Color look-up table.
% COLORMAP(MAP) sets the current figure's colormap to MAP.
% COLORMAP('default') sets the current figure's colormap to
% the root's default, whose setting is PARULA.
% MAP = COLORMAP returns the three-column matrix of RGB triplets defining
% t... |
03a2987554a371cf1879ab15663217bcef8f2a88db6d4526a185381a6aae5acb | MATLAB | 3,936 | 94 | % std_selectdataset() - select datasets and trials for a given independent
% variable with a given set of values.
%
% Usage:
% >> [STUDY] = std_selectdataset(STUDY, ALLEEG, indvar, indvarvals);
%
% Inputs:
% STUDY - EELAB STUDY structure
% ALLEEG - EELAB dataset structure
% indv... |
15fea5f863ad3e3362637a957efd1c0e04698c98a287c8639116e56019b6f0f9 | MATLAB | 3,938 | 211 | function trainmodel
%%
%scheme = evalin('base','scheme');
d1 = 0.5+(0:0.05:1)*2.5;
d2 = 0+(0:0.05:1)*3;
d3 = 0.15+(0:0.05:1)*2.5;
v = 0:0.05:1;
[D1 D2 D3 V] = ndgrid(d1,d2,d3,v);
nt = 2*10^5;
D1 = 0.5+rand(nt,1)*2.5;
D2 = 0.5+rand(nt,1)*2.5;
D3 = 0+(rand(nt,1))*2.5;
V = rand(nt,1)*1;
Vw = (1-V).*rand(nt,1)*1;
idx = fi... |
76688313db173b54d7231c53c4955ee265355876134537aeeccaa8d5d694597a | MATLAB | 3,938 | 77 | function [C,phi,S12,f,confC,phistd,Cerr]=cohmatrixc(data,params)
% Multi-taper coherency,cross-spectral matrix - continuous process
%
% Usage:
%
% [C,phi,S12,f,confC,phistd,Cerr]=cohmatrixc(data,params)
% Input:
% Note units have to be consistent. See chronux.m for more information.
% data (in form samples x cha... |
5da4941883ec93eecf01b5bad29465af4055156ab7ead7ad10d979fa2d787fc3 | MATLAB | 3,940 | 112 | % del2map() - compute the discrete laplacian of an EEG distribution.
%
% Usage:
% >> [ laplac ] = del2map( map, filename, draw );
%
% Inputs:
% map - level of activity (size: nbChannel)
% filename - filename (.loc file) countaining the coordinates
% of the electrodes, or array countaining c... |
98fbf270aa711f251aa9ec1f9d0204036e21b090fd356fae1b069ace53079da7 | MATLAB | 3,944 | 97 | function [coltInt] = getIntensityByFrameFromTrack(tracksClean, endFrame, beginFrame)
%GETINTENSITYBYFRAMEFROMTRACK User inputs X number of frame and function outputs column vector of intensities of detections from first X frames of all tracks
%
%SYNOPSIS: [coltInt] = getIntensityByFrameFromTrack(tracksClean, endFrame,... |
4ac076bb75ab08a72e2e7bd20b5af44625d55ef9256eda8a35bc517e9a9625a7 | MATLAB | 3,946 | 218 | % This video was uploaded and converted to .gif with Giphy:
% https://giphy.com/create/gifmaker
%
% https://media.giphy.com/media/ybSv8dGOxnVZ45TsR4/giphy.gif
myfile = which('canlab_dartmouth_brainlogo.m')
mypath = fileparts(myfile);
cd(mypath)
D = imread('D-Pine_Black.jpg');
Dflat = any(D, 3); % fl... |
c2a6c26568670a50ac483bf1e1e67d70aa030c102898d9eb58a1bb94ccd4e881 | MATLAB | 3,946 | 91 | function LaBGAScore_blob_montage(dat, r, label, varargin)
% LaBGAScore_blob_montage Overview + regioncenters montages for a thresholded map.
%
% Display only: it draws, it does not threshold, label or tabulate. Callers that
% already built a region object and table (thresholded_fmri_data_from_pval_nii,
% LaBGAScore_pd... |
a7f253a83d4a2d3562dc73d6c9bde9c76d07d47f8408832fa02d76fa35b556ef | MATLAB | 3,949 | 79 | function [dS,f]=mtdspectrumpb(data,phi,params)
% Multi-taper spectral derivative - binned point process
%
% Usage:
%
% [dS,f]=mtdspectrumpb(data,phi,params)
% Input:
% Note that all times can be in arbitrary units. But the units have to be
% consistent. So, if E is in secs, win, t have to be in secs, and F... |
e7e9bc62f0e75ab0ca4dc3456f10fbdfd5d15ed57a07a91446bdee33eb2bcbed | MATLAB | 3,949 | 103 | function CBIG_MSHBM_generate_ini_params(seed_mesh, targ_mesh, num_clusters, num_initialization, out_dir)
% CBIG_MSHBM_generate_ini_params(seed_mesh, targ_mesh, num_clusters, num_initialization, out_dir)
% This function will be used to generate initialization parameters. We will
% apply Yeo2011 clustering algorithm on ... |
0913b4b72ec08f6bd04a628595b0ba0fa60e2640c25122697c88ea049a9be7e8 | MATLAB | 3,953 | 122 | % Two-input NAND gate sizing (GP)
% Boyd, Kim, Patil, and Horowitz, "Digital circuit optimization
% via geometric programming"
% Written for CVX by Almir Mutapcic 02/08/06
% (a figure is generated)
%
% This is an example taken directly from the paper:
%
% Digital circuit optimization via geometrical programming
% b... |
1eb4805dae4cc3cbf7d2bb0fec820dfd52cd6c1ef57dd7ea7ff6950bba1b2a6c | MATLAB | 3,953 | 81 | function [P,Fstat,f0]=mtpowerandfstatc(data,params,f0)
% Multi-taper computation of the power and the fstatistic for a particular frequency - continuous process
%
% Usage:
%
% [P,Fstat,f0]=mtpowerandfstatc(data,params,f0)
% Input:
% Note units have to be consistent. See chronux.m for more information.
% data (in... |
b7682d90e76be210fd9f0d18f41571448f774f119f3330ef13d4d857d5ebaaca | MATLAB | 3,953 | 114 | function amplitudes = GetSpikeAmplitudes(units,varargin)
%GetSpikeAmplitudes - Get spike amplitudes.
%
% USAGE
%
% amplitudes = GetSpikeAmplitudes(units,<options>)
%
% units list of [electrode group,cluster] pairs
% special conventions:
% cluster = -1 all cluster... |
dd5d25929888f6f0f0ead953dbc9131a6e53f30bc569fe0e940152066a7ae2dc | MATLAB | 3,957 | 150 | %%*************************************************************************
%% symqmr: symmetric QMR with left (symmetric) preconditioner.
%% The preconditioner used is based on the analytical
%% expression of inv(A).
%%
%% [x,resnrm,solve_ok] = symqmr(A,b,L,tol,maxit)
%%
%% child function: linsysolvefu... |
19786c2a6282e0a28b1ffa7acd4db49b362dcbea43e320933cd78179b12b56b3 | MATLAB | 3,958 | 212 | function trainmodel
%%
%scheme = evalin('base','scheme');
d1 = 0.5+(0:0.05:1)*2.5;
d2 = 0+(0:0.05:1)*3;
d3 = 0.15+(0:0.05:1)*2.5;
v = 0:0.05:1;
[D1 D2 D3 V] = ndgrid(d1,d2,d3,v);
nt = 2*10^5;
D1 = 0.5+rand(nt,1)*2.5;
D2 = 0.5+rand(nt,1)*2.5;
D3 = 0+sqrt(rand(nt,1))*2.5;
V = rand(nt,1)*1;
Vw = (1-V).*rand(nt,1)*0;
%idx... |
c3c08771353d41f82833ef0046897b8949f8b64d0be4e31d0d65c64b2a39fe29 | MATLAB | 3,959 | 103 | function ChangeBinaryGain(filename,varargin)
%ChangeBinaryGain - Change gain in a multiplexed binary file.
%
% USAGE
%
% ChangeBinaryGain(filename,<options>)
%
% filename file to read
% <options> optional list of property-value pairs (see table below)
%
% =======================================... |
1d56e53b7197878ec0966e001c29f1235a518c11dc2259e6461485c3eb41447c | MATLAB | 3,961 | 114 | function ea_connectomics_run_struct(app, event)
%EA_CONNECTOMICS_RUN_STRUCT
% Helper to run structural Lead-Connectome from the main lead_dbs app.
%
% ea_connectomics_run_struct(app, event) is intended to be called from the
% Connectomics tab "Run" button callback inside lead_dbs.mlapp
% (App Designer). It:
%
% ... |
863c9334fdc2ad098e11093452620a7380682a5c3b78ef6c7886c50ab9b14a3a | MATLAB | 3,961 | 114 | function [output,status] = urlread(urlChar,method,params)
%URLREAD Returns the contents of a URL as a string.
% S = URLREAD('URL') reads the content at a URL into a string, S. If the
% server returns binary data, the string will contain garbage.
%
% S = URLREAD('URL','method',PARAMS) passes information to the se... |
ebc5d90659cd2ddca25c1f2366d1b2aac862a1487cef9d9d35d5249d8f44dc76 | MATLAB | 3,962 | 153 | function varargout = G_fdr(varargin)
%
% Slightly modified version of fdr.m
%
%
% Computes the FDR-threshold for a vector of p-values.
%
% Usage:
% [pthr,pcor,padj, binarize_pval] = fdr(pvals)
% fdr(pval,q)
% fdr(pval,q,cV)
%
% Inputs:
% pvals = Ma... |
1a204060eaafc65e0010a24fc51631b8fd017a91f0559d33c9ed7ab6181c8208 | MATLAB | 3,964 | 119 | function fancy(select)
%FANCY Collection of graphics test figures.
% fancy(1) Sphere with a cloudy (transparency-mapped) ring
% fancy(2) World map, mapped onto a sphere, with transparent oceans
% fancy(3) 3-D relief model of a US penny, with colored lighting
%
% Each of the figures will brief... |
993753a5d8d893d833a2e531adfd4bd99e760f401f5667367928a4e7cf5e3845 | MATLAB | 3,965 | 90 | function [if_both_hemi_match] = CBIG_gwMRF_check_example_results(output_folder, seed)
% This function checks if the generated example results are identical with
% the reference files provided for a given seed.
%
% Input:
% - output_folder: The path under which the generated example results is saved.
% - seed: indic... |
e1f81cfe39b1fc89f88d41dbbfbb34ce4dac5352675e724f06411ec2622bedd1 | MATLAB | 3,965 | 95 | function [imgRGB, imgMask, xBounds, yBounds, smoothGrad, cmap] = makeGradientMap(metricVals, valPositions, gridRes, xLimits, yLimits, cmapInfo, sdPts, sdGrad)
% Creates a gridded color image from smoothed metric values, interpolates
% missing grid pieces, computes 2D gradient, Gaussian kernel smoothes and
% maps ... |
0ee19b629a504a29312273e4ceb9506daf0325807eddf2620c19fe62d145366f | MATLAB | 3,966 | 199 | function outFiles = save_all_open_figures_smart(outDir, prefix, formats, closeFigs)
% save_all_open_figures_smart
%
% Save all open MATLAB figures with smart filenames.
%
% Priority for naming:
% 1) figure Name
% 2) axes title
% 3) fallback: fig01, fig02, ...
%
% INPUTS
% outDir - output directory (default:... |
cc4c329cb4fec527504379a7dd9f236d318547028e8d974099a7a0ba766a612f | MATLAB | 3,966 | 94 | function [actinPropPerTimeIntClnSpeed,actinPropPerTimeIntClnLft,...
actinPropPerTimeIntClnSpeedLft] = cleanActinPropPerTimeInt(...
actinPropPerTimeInt,speedThresh)
%CLEANACTINPROPPERTIMEINT replaces small speckle speeds and incomplete speckle lifetimes with 0 and NaN, respectively
%
%SYNOPSIS [actinPropPerTimeI... |
156669fa61a1bcf3904093b411e8b22fc1ec8f36e799f9b905225f8b02502409 | MATLAB | 3,970 | 108 | function CBIG_ASDf_visualizeFactorComp(sub_info_file, factorComp, K, output_name)
% CBIG_ASDf_visualizeFactorComp(sub_info_file, factorComp, K, output_name)
%
% This function plots participants' factor compositions for K = 2 and 3.
% For K = 2, the visualization is created using histogram; for K = 3, the
% visualizatio... |
b8398832b0640d27d062d586c354f3ccff390512d193a3aae8c882b40bf0dc86 | MATLAB | 3,970 | 84 | function [theseSpikeTimes, theseAmplis, theseSpikeTemplates, useThisTimeStart, useThisTimeStop, useTauR] = defineTimechunksToKeep(percSpikesMissing, ...
fractionRPVs, param, theseAmplis, theseSpikeTimes, theseSpikeTemplates, timeChunks, spikeTimes_seconds)
% JF
% define time chunks where the current unit has low re... |
6918ad3e16cfa80c8e3eb082f421f8c79924ae04d3d22ebe88630bb397087411 | MATLAB | 3,973 | 163 | function [W, H, w, h, x, y] = floorplan(adj_H, adj_V, rho, Amin, l, u )
% Computes a minimum-perimeter bounding box subject to positioning constraints
%
% Inputs:
% adj_H,adj_V: adjacency matrices
% Amin: minimum spacing: w_i * h_i >= Amin
% rho: boundaries: rho <= x_i <= W-rho, rho <= y_... |
42d3e84e3f77cc391bd4ec5290687703334e0622b2c456186bebc1a3aa3088c4 | MATLAB | 3,974 | 179 | % Imbed a file menu to any figure. If file menu exist, it will append
% to the existing file menu. This file menu includes: Copy to clipboard,
% print, save, close etc.
%
% Usage: rri_file_menu(fig);
%
% rri_file_menu(fig,0) means no 'Close' menu.
%
% - Jimmy Shen (jimmy@rotman-baycrest.on.ca)
%
%---------... |
fb3c451c5f424913f8cda9f61c0a2f74e077f5721f2ac84153a04c21ce39bdb1 | MATLAB | 3,974 | 89 |
% Inputs
sEEG_table = '/home/interscan/Documents/data/EM1271/sub-EM1271_ses-implantation-01_two_electrodes.tsv';
sEEG_stim_protocols = {'/home/interscan/Documents/data/EM1271/sub-EM1271_ses-stimulations-01_electrodes.csv'};
anchor = '/home/interscan/Documents/data/EM1271/anat_t2.nii';
reslice2segmask = true; % if true... |
76a66bdc73f842fdd2f160d0a4ec36e9ef2b88d0366962cd7ea7d83ba4b31623 | MATLAB | 3,979 | 72 | function behavior_scores = CBIG_MMLDA_get_behavior_scores(ADAS_ADNI1_spreadsheet, ...
ADAS_ADNI2_spreadsheet, MMSE_spreadsheet, NEUROBAT_spreadsheet, ADAS_phase, phase, rid, viscode)
% behavior_scores = CBIG_MMLDA_get_behavior_scores(ADAS_ADNI1_spreadsheet, ...
% ADAS_ADNI2_spreadsheet, MMSE_spreadsheet, NEUROB... |
45cc3efa03f0a227335d39c88b02ca900b39c247d32011fe0a5b3394705eaa13 | MATLAB | 3,981 | 103 | function [ ] = post_processing( cfg )
% This file is a part of the MDSINE program.
%
% MDSINE: Microbial Dynamical Systems INference Engine
% Infers dynamical systems models from microbiome time-series datasets, and
% predicts biologically relevant behaviors of the ecosystems.
% Copyright (C) 2015 Vanni Bucci, Georg Ge... |
0320c06914b58ecd2c1209ea26b6b5f50ec8bad97d2b759075a2d00c78713e21 | MATLAB | 3,982 | 153 | function [] = run_model_fitting_only(img_data, mask_data, output_folder, Mdl, MLmodel, model, diagnostics)
% Main script to fit the SANDI model using Random
% Forest (RF) and/or multi-layers perceptron (MLP)
%
% Author:
% Dr. Marco Palombo
% Cardiff University Brain Research Imaging Centre (CUBRIC)
% Cardiff Universi... |
a853c431aa16a134139f37f0cf886e4c2d1c1bf040962507b479993143c19645 | MATLAB | 3,982 | 111 | function varargout = attributes(varargin)
% XMLTREE/ATTRIBUTES Method (handle attributes of an element node)
% FORMAT varargout = attributes(varargin)
%
% tree - XMLTree object
% method - 'set','get','add','del' or 'length'
% uid - the UID of an element node
% n - indice of the attribute
% key - stri... |
0f05063bcce78d55a257882b6009f58578d5c81b12150a436c8575e44e1a7f86 | MATLAB | 3,983 | 122 | function gen_object_display( obj_struct,indent )
%
% gen_object_display - general function to display an object's content
%
% format: gen_object_display( obj_struct,indent )
%
% input: obj_struct - a copy of the object stored inside a structure
% indent - amount of "indent" when printing to ... |
4e661bd8ff1040d35bf74ba97316defca05c3115b76b7a86d639724a9e700523 | MATLAB | 3,983 | 147 | function [ S ] = WriteTopics( WP , BETA , WO , K , E , M , FILENAME )
%% Function WriteTopics
%%
% |[ S ] = WriteTopics( WP , BETA , WO )| writes the most likely entities
% (e.g. words, authors) per topic to a cell array of strings. |WP| is a
% sparse |W| x |T| count matrix such that |WP(i,j)| contains the number ... |
dc7a70019705161a121b8e4981e34ab61ae14c84f83d7226a2f8c7013a612f32 | MATLAB | 3,986 | 93 | % test_dat = load_image_set('npsplus', 'noverbose');
% image_obj = get_wh_image(test_dat, 1);
% test_dat = load_image_set('emotionreg', 'noverbose');
% image_obj = mean(test_dat);
test_dat = load_image_set('pain_pdm');
image_obj = test_dat.get_wh_image(1);
% Note: You need the Neurosynth Feature Set 1 file
% It c... |
f0690ccb84b8820dacb9b1f1ff5df3501d8aa259bd76b918d7a513d18ffffad5 | MATLAB | 3,986 | 140 | function [Un, Dn] = circcor( circvar, linearvar )
% % CIRCCOR correlates a circular variable with a linear variable
%
% [UN, DN] = circcor( circvar, linearvar )
%
% and returns a U-value, which should be compared to the lookup
% table on pg. 231 of 'Statistical analysis of circular data.'
% Fisher (1993).
% ... |
d08ff9a12cba1b23889d1a850385355603df8e27c737597fec0ec42ec00f73b1 | MATLAB | 3,987 | 127 | function [xx1,im1new]=myaffine2d_scr(im1,im2,parms,mask,x0)
% Usage ... y=myaffine2d_scr(im1,im2,parms,mask,x0)
%
% place im1 in the space of im2:
% im1new=myaffine2d_f(im1,xx1(1),xx1(2),xx1(3),xx1(4),xx1(5),size(im2));
% parms=[ranges_for_x0,y0,rot0,xs,ys] -- no parameter options for now
%
if nargin<3, parms=... |
bceb20b786f885f3effc929fa43f44bcc1c7935b256d55a671f069e9e8b30922 | MATLAB | 3,989 | 105 | function [itk_fwd_field, itk_inv_field] = ea_easyreg(target_image, source_image)
% Wrapper to run EasyReg and get ANTs-like transforms
%
% EasyReg
%
target_seg = strrep(target_image, '.nii', '_synthseg.nii');
source_seg = strrep(source_image, '.nii', '_synthseg.nii');
fs_fwd_field = strrep... |
9c95908f4125492b85ff57847578bcfbf8c5cdfbb8b3387793a704139a8a219c | MATLAB | 3,990 | 65 | function matlabbatch = batch_job_3T_single(b)
%-----------------------------------------------------------------------% Job saved on 15-Jan-2022 18:39:57 by cfg_util (rev $Rev: 7345 $)
% spm SPM - SPM12 (7771)
% cfg_basicio BasicIO - Unknown
%-----------------------------------------------------------------------
%% R... |
edb5a4a497b35c5fd78e0eb2b971c06d108b1ebfc2d5420fd643fc474b368fa7 | MATLAB | 3,991 | 71 | function [S,f,R,Serr]=mtspectrumtrigpb(data,E,win,params,fscorr)
% Multi-taper event triggered time-frequency spectrum - binned point process
%
% Usage:
%
% [S,f,R,Serr]=mtspectrumtrigpb(data,E,win,params,fscorr)
% Input:
% data (single channel data) -- required
% E (event times) -... |
095349f916e0eac466991d2fd89b27b3f5261e71de6d80a6bdc09dfd81cc3b36 | MATLAB | 3,993 | 126 | function RemoveDCfromDatRecursive(basedir, fakeRunYN)
% function RemoveDCfromDatRecursive(basedir, fakeRunYN)
%
% This function recursively searches basedir and all subdirectories and
% finds all of the .dat files. The number of channels is read in
% automatically from the corresponding .meta files, and RemoveDCfromDa... |
d0d7267af3ee2fa9d2058aa0ade72e9507918b147c4f3f0e09d72a7100fbc288 | MATLAB | 3,994 | 110 | % configure file for operations on streamline trackings results
%
% for BATCH EDITOR system (Volkmar Glauche)
%
% File created by Susanne Schnell
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function logroi = dti_cfg_logroi
% ------------------------------------------------------------... |
743bb1f4ce32e77272793dd3c53901d0f59d7bc300c58f65c11889ef1cbcbe36 | MATLAB | 3,995 | 99 | function metadata = createMinimalOMEXMLMetadata(I, varargin)
% CREATEMINIMALOMEXMLMETADATA Create an OME-XML metadata object from an input matrix
%
% createMinimalOMEXMLMetadata(I) creates an OME-XML metadata object from
% an input 5-D array. Minimal metadata information is stored such as the
% pixels dimensio... |
1bdb985044d6d00656f80f254b2238f19f774064deda62c1408ba6344c9f1ea2 | MATLAB | 3,998 | 99 | % std_setcomps2cell - convert .sets and .comps to cell array. The .sets and
% .comps format is useful for GUI but the cell array
% format is used for plotting and statistics.
%
% Usage:
% [ struct setinds allinds ] = std_setcomps2cell(STUDY, clustind);
% [ struct ... |
52d1318211e868a1d481c4e54c773ce5297fb27f79fde9b1b9f631599c71893a | MATLAB | 3,999 | 141 | function [meas_HbO, meas_HbR, have_group, all_HbO, all_HbR] = ...
resolve_measured_betas(B)
%FNIRSPOWER.IO.RESOLVE_MEASURED_BETAS
% Resolve measured channel-level HbO and HbR beta estimates.
%
% Supported inputs
% ----------------
% Unmasked GLM beta file:
%
% B.GLM_Hb.all_subj_beta_hbo
% B.GLM_Hb.all... |
c83badb3c49916b447f625c45cd6e381eee8dc259edc7ae9eab6485f0c61afca | MATLAB | 3,999 | 87 | function ea_disctract_crossval_visualize(tractset,I,Ihat,cvs,posthoccorrectforgroup,sel,group)
if ~exist('group','var')
group=nan;
end
% check if groups exist:
if length(unique(tractset.M.patient.group))>1 && posthoccorrectforgroup
Ihat=ea_resid(ea_cohortregressor(tractset.M.patient.group(sel)),Ihat);
suf... |
f91379df78c1c035c7f9492582ae99515877221e65b3599797758af3a1e82bd6 | MATLAB | 4,001 | 116 | function palm_ciftiwrite(varargin)
% Provides limited support for writing CIFTI files
% (surface only) using the wb_command as the backend.
%
% C = palm_ciftiwrite(filename,data,extra,wb_command)
%
% Inputs:
% - filename : Filename of the CIFTI (surface only, dtseries).
% - data : Actual data that will be sav... |
9aed01320a549defb152a8e1ece9a06af1ef4a7c5cdf8a60423300ab6471b7c8 | MATLAB | 4,002 | 128 | function [modlist, type] = ea_genmodlist(directory,selectedparc,options,conntype)
cnt=1;
modlist=cell(0);
type=[];
% Check 'fmri', 'dmri' or 'both' connectomes
if ~exist('conntype', 'var')
conntype = 'both';
end
switch lower(conntype)
case 'both'
checkdmri = 1;
checkfmri = 1;
checkdmri... |
1b72e2865d2a54ce28d4c777baa1a4a63778b45f8b22f0fcca3b65f58a595759 | MATLAB | 4,003 | 112 | function [g,a,mu2]=ar1(x)
% AR1 - Allen and Smith AR(1) model estimation.
% Syntax: [g,a,mu2]=ar1(x);
%
% Input: x - time series (univariate).
%
% Output: g - estimate of the lag-one autocorrelation.
% a - estimate of the noise variance.[unbiased_var(x)~=a^2/(1-g^2)]
% mu2 - estimated square on... |
be06c694bed111e02f071ec68175367635a8da0c7a4b5afd4c084104616b1f12 | MATLAB | 4,003 | 120 | function ea_compute_scrf(handles)
options = getappdata(handles.scrf,'options');
% Hard-code the coregistration method to ANTs
options.coregmr.method = 'ANTs (Avants 2008)';
ea_prepareImages(options); % Redo each time since coreg may have changed.
if ~handles.mask0.Value % Use mask
% Masks to be used
masks =... |
2f108e6ea0f77dd178b06cd473a41b15f3452b2e4c6c329ae00d2919e48a61ef | MATLAB | 4,004 | 87 | function ea_unifiedmapping_crossval_visualize(explorer,I,Ihat,cvs,posthoccorrectforgroup,sel,group)
if ~exist('group','var')
group=nan;
end
% check if groups exist:
if length(unique(explorer.M.patient.group))>1 && posthoccorrectforgroup
Ihat=ea_resid(ea_cohortregressor(explorer.M.patient.group(sel)),Ihat);
... |
1d1fda11884fa103c0c97408e50f4537b7724db8d13a127e2a5f346e2570f865 | MATLAB | 4,006 | 108 | % Name: Robert Kim
% Date: 05-12-2023
% Email: robert.f.kim@gmail.com
% fnc_instr2_neus_v2.m
% Description: Variant of fnc_instr2_neus.m with the same selectivity
% categories. The two versions differ only in inline annotations on the
% trial x neurons matrices; behaviour is unchanged. Kept around so that
% downstream ... |
0290879999e79339c8861febed61e89125f30e13e5a24760bf9c4082f53b4b75 | MATLAB | 4,010 | 117 | % Minimize transition bandwidth of a linear phase lowpass FIR filter
% "Filter design" lecture notes (EE364) by S. Boyd
% (figures are generated)
%
% Designs a linear phase FIR lowpass filter such that it:
% - minimizes the transition band width (i.e. minimize w_stop)
% - has a constraint on the maximum passband ripple... |
650f81c7de7a16bfdbbb456782b9d23531f36a000cccae543ff51a940aee10ce | MATLAB | 4,010 | 94 | function CBIG_hMRF_check_example_results(output_dir)
% CBIG_hMRF_check_example_results(output_dir)
%
% This script is used to compare the example results generated by user with the reference results.
%
% Input:
% - out_dir:
% The output_directory that saves the example results generated by the user.
%
% Example:
... |
2a1fa332d3d63eafc91a353b505c1758d9e039cea8e54eb88484946732512afc | MATLAB | 4,014 | 108 | function sleepstagesOUT = dan_import_sleepstages(sleepstagesIN, values)
% Generic sleep stage conversion file. Input is a list of sleep stages (one
% row = one epoch), and a list of values that correspond to Wake, N1, N2,
% N3, N4, REM, Movement, Unstaged
%%
% Authors: Dan Denis
% Date: 2021-07-14
%%
if isa(slee... |
57caa247a2bd7401253e71a4cda7e979abe6503e8787e05e73f985185488992b | MATLAB | 4,014 | 97 | function [digitalReward, digitalPunish, digitalLick] = intanADC(rhdFile)
% For better interpretation, convert analog noise signal in a digital
% trigger signal.
workingDir = fileparts(rhdFile);
if ~exist(fullfile(workingDir,'intanVariables.mat'),'file')
fprintf('\nReading the intan variables...\n')
read_Intan_... |
449bc33e33cf2f9f5b97dce5dd1214f8dfaa1f4e2d3514b7db4d6e8590175e29 | MATLAB | 4,015 | 77 | function [C,phi,S12,f,confC,phistd,Cerr]=cohmatrixc(data,params)
% Multi-taper coherency,cross-spectral matrix - continuous process
%
% Usage:
%
% [C,phi,S12,f,confC,phistd,Cerr]=cohmatrixc(data,params)
% Input:
% Note units have to be consistent. See chronux.m for more information.
% data (in form sampl... |
4ed685c8a6ac30f698415b92a31eda4d006810da51d947ba3272ea25131c9bd0 | MATLAB | 4,018 | 113 | function varargout = lfgui(varargin)
% LFGUI M-file for lfgui.fig
% LFGUI, by itself, creates a new LFGUI or raises the existing
% singleton*.
%
% H = LFGUI returns the handle to a new LFGUI or the handle to
% the existing singleton*.
%
% LFGUI('CALLBACK',hObject,eventData,handles,...) calls th... |
945a7ce9e945ef4bccaf88453dbe29d2626121594eef7401b5f7b8088199571a | MATLAB | 4,018 | 100 | function [C, covInfo] = validateCovariates(opts, n, pipelineName)
% validateCovariates Resolve and check opts.covariates once, up front.
%
% [C, covInfo] = validateCovariates(opts, n, pipelineName)
%
% Reads the optional opts.covariates field, validates it against the sample
% size, and returns both the matrix a... |
1e7c9b410a8c005baef19894c4f4d8ca7848fc3de0f5ce7b196d864d1e2723a8 | MATLAB | 4,019 | 125 | function crossgenotimecourse(chosenfluor,chosenROIs,chosentemps,chosenFrameRate)
%maybe ask it to skip some ROIs that clearly don't fit?
len=15;%change
fig=figure('Position',[1 1 509 458]);
hold on;
fig2=figure('Position',[509, 1, 500, 900]);%make 5 subplots here
%fig3=figure('Position',[509, 200, 500, 200]);
fn=fiel... |
42871a1da2b1465b667da672c79a5dce1efd7aab645a80752a01bfb86512b5e0 | MATLAB | 4,019 | 90 | function CBIG_visualize_factorComp(subInfoFile, GMICVFile, K, GRP)
% CBIG_visualize_factorComp(subInfoFile, GMICVFile, K, GRP)
%
% Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
C_EDGE = 'k';
C_AP = 'r';
%--------------- Get barycentric coordinates (probability vector... |
e98efc8704aee27576959c268f85d80bb944ab94c8970c76fe515d49e6ea7288 | MATLAB | 4,019 | 105 | % eeg_lat2point() - convert latencies in time units relative to the
% time locking event of an eeglab() data epoch to
% latencies in data points (assuming concatenated epochs).
% Usage:
% >> [newlat] = eeg_lat2point( lat_array, epoch_array,...
% ... |
824307812ddb5430deb0ab4e406618f135e13c5e43d6724946fad88c074c427b | MATLAB | 4,020 | 98 | %% LaBGAScore_firstlevel_s3_diagnose_model.m
%
% This script will run diagnostics on first level models and publish them
% as an html report using the CANlab function scn_spm_design_check, and
% save variance inflation factors as a .mat file
%
%
% *DOCUMENTATION*
%
% type "help scn_spm_design_check" in Matlab command ... |
c675e64ee7d6ec447a37229c16a7fb6dcde9566cad4aafb83817c4fe60feb837 | MATLAB | 4,020 | 116 | function plotSubpopContourROItSNE(allROIs, contConfig, colors, coordField)
% Plots tSNE coordinates for allROIs, colored by subpop
if nargin < 5
coordField = 'tsneCoords';
end
% Create plot
fig;
axis square
axis off
alpha = 0.1;
thresholds = sort(contConfig.thresholds, 'descend');
% Get data
allCoords = cat(1,a... |
bd6f60331eb7f6ec4cc22283a422e28da47cc72dc859622499d1981bf7b895a5 | MATLAB | 4,021 | 87 | mainfolder0 = '/Users/yiyuan/OneDrive - University of Essex/PG Research/0A_Journal/202004_unknown Journal_Probability Score/1_Results/0_Final Results/Results_Main/';
figurefolder = '/Users/yiyuan/OneDrive - University of Essex/PG Research/0A_Journal/202004_unknown Journal_Probability Score/1_Results/0_Final Results/Res... |
288bdd8fe75ec4d660d7f426346f41492d188ff6d9e9b46e42d2f45ab41e0160 | MATLAB | 4,024 | 111 | %% LaBGAScore_prep_s0_define_directories.m
%
%
% *USAGE*
%
% This script defines the paths for the standard BIDS-compliant
% directory structure for LaBGAS neuroimaging (datalad) datasets.
%
% Script should be run from the root directory of the superdataset, e.g.
% /data/proj_discoverie
% It can be used standalone, but... |
e289f650eea9af72d9b963f7ad53c217a75cdf8b7b6940594eb7f652a4d99074 | MATLAB | 4,024 | 139 | function [RP, RESULTS]=jrqa(data,tau,dim,param,threshold,options)
arguments
data double {mustbeAtLeastTwoColumns}
tau (1,2) {mustBeInteger, mustBePositive} = [1 1]
dim (1,2) {mustBeInteger, mustBePositive} = [1 1]
param (1,1) string {mustBeMember(param,["rad", "rec"])} = "rec"
threshold (1,1) double... |
12ee68a2784f21bbbac0e1b9a4b5d606b01a4b4a3cbf8d07fd0f6ec9365a054c | MATLAB | 4,025 | 94 | % Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions
%
%=========================================================================
%
% Copyright (c) 2008 Thomas Yeo and Mert Sabuncu
% All rights reserved.
%
%Redistribution and use in source and binary forms, with or without
%modification, a... |
aea449d6e06902c0bfd2da488536075a8fcc8a5bfd2f734c8d99598c10021f40 | MATLAB | 4,025 | 122 | function [database_train, database_train_noisy, params_train, sigma_mppca, bunique, Ndirs_per_Shell] = build_training_set_with_dot(SANDIinput)
% Builds the dataset for supervised training of the machine learning models
% for SANDI fitting.
%
% Author:
% Dr. Marco Palombo
% Cardiff University Brain Research Imaging Cen... |
deee4554e82f308c59b4c1d42c85a0c5affb466877db13e753ba84647f487960 | MATLAB | 4,025 | 86 | function analyzeCalciumExperiment_newThor5D_roishift(headpath,fileexpnum,imskip,expskip,correction,fluor,copy,deltamode,savemode)
%give this function the experimental path you want to start in
%and the filename and experiment number (ie vt019532_f3e4)
%correction if the motion correction needs to be done, fluor if t... |
72569f9dd821e60ffb77ddc0036436feaa190410fddfc51bff16f63810ba4e74 | MATLAB | 4,033 | 75 | function [permEnt, hist] = ent_permu(data, m, tau)
% [permEnt, hist] = ent_permu(data, m, tau)
% inputs - data: 1-D array of data being analyzed
% m: embedding dimension (order of permutation entropy)
% tau: time delay
% outputs - permuEnt: value calculated using a log base of 2
% hist: ... |
d8564cfe5195370ba15faa4c4f17e62841e9c3b1affc68e0d5c7ef08ec2d9dcd | MATLAB | 4,033 | 80 | function handles = dan_update_epoch_info_string(handles)
% Updates the epoch information bar at the bottom of the GUI
%%
% Authors: Dan Denis
% Date: 2021-07-14
%%
if handles.psg.stages.s1.stages(handles.plotParam.epochIdx) == 0
set(handles.current_epoch_info, 'String', 'Wake');
set(handles.mark_wake, 'Ba... |
28e64072c7020d50685a896e498fde819a1ad343d1b9bf0c1c1eee3ec0787bff | MATLAB | 4,034 | 81 | function [P,Fstat,f0]=mtpowerandfstatc(data,params,f0)
% Multi-taper computation of the power and the fstatistic for a particular frequency - continuous process
%
% Usage:
%
% [P,Fstat,f0]=mtpowerandfstatc(data,params,f0)
% Input:
% Note units have to be consistent. See chronux.m for more information.
% ... |
b9645b559b1b5d949f8845956122bc7ca19ff0295870702933dc383563f90515 | MATLAB | 4,034 | 129 | %XMLDEMO1 Demonstrate how to create an XML tree and save it
%
% Description
% This script demonstrates the use of the xmltree class to
% create an XML tree from scratch and save it in a file.
% Copyright (C) 2003 Guillaume Flandin
% Please note that this script is only a demonstration of how
% t... |
e9fe86e8fb3616aaf904787623332393211879f4f40727c0b74ccdc5fe1f9c27 | MATLAB | 4,037 | 133 | function [subpopModels, dists] = clusterGMMsBD(models)
% Clusters many different GMM components from a struct using the
% Bhattacharyya distance between multivariate Gaussians
% models is a struct of area-specific GMM models, gets converted to a list
% of individual components separated
% Refactor struct
comps = stru... |
8c02f5c1a2a91f5aac15c3dbc29080d8ec902dc688c89277c5bb698d1250c586 | MATLAB | 4,038 | 109 | function varargout = dual( varargin )
%DUAL Declares one or more dual variables.
%
% DUAL VARIABLE x
% where x is a valid MATLAB variable name, declares a dual variable
% for the current cvx problem. A dual variable with that name is added
% to the problem and a cvxdual object with that name is created in
% ... |
22aa21b4540fc4a5ec776e3a6aad5f8346b732d397762ace6c96bc8d6ea4ddf5 | MATLAB | 4,042 | 144 | function[H,P,M1,M2,N1,N2] = countsig(data1,data2,T1,T2,parametric,p,quiet)
% Give the program two spike data sets and one
% or two time intervals and it will decide if
% the counts are significantly different.
% this is either with a non-parametric method
% or with a sqrt transformation followed by a ... |
20f31dfbe3e491441eb96cd17869b06fbc74da57209431401d1412e6674700a7 | MATLAB | 4,043 | 89 | function restartEeglabFlag = plugin_managedeactivated(pluginlist)
% type may be 'import' or 'process'
restartEeglabFlag = false;
plugin = plugin_getweb('import' , pluginlist);
plugin = plugin_getweb('process', plugin);
for iRow = 1:length(plugin)
plugin(iRow).remove = 0;
plugin(iRow).reactivate = 0;
e... |
5a4403952370407a1135ec7edd7cd48d915f72420f71cd956a37a230f6cc0101 | MATLAB | 4,043 | 121 | function CoD=corr_dim(x,tau,de,plotOption)
%Correlation Dimension
%Scaling region mid-one quarter of vertical axis -- mid + OneQuarter
%2/5/2008
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%x: a time series
%tau: time delay
%de: embedding diemnsion
%plotOption: set plotOption=1 to see plots
%... |
7ed9af61cadb2f1031ac76f5047f82dbfa01ac0325289434468f07cf97a94520 | MATLAB | 4,043 | 111 | % Define test conditions of interest
% -------------------------------------------------------------------------
mysignature = { 'Amused', 'Angry', 'Content', 'Fearful', 'Neutral', 'Sad','Surprised'}; % 'NPS' 'NPSpos' 'NPSneg' 'SIIPS' etc. See load_image_set('npsplus')
scalenames = {'raw'}; ... |
51bbdb1ab9881c8a207bba4b5f03cfd585398073c48c9aa4b06c6e400fd390d4 | MATLAB | 4,044 | 140 | % Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions
%
%=========================================================================
%
% Copyright (c) 2008 Thomas Yeo and Mert Sabuncu
% All rights reserved.
%
%Redistribution and use in source and binary forms, with or without
%modification, a... |
0c2a848dce53cfc6aa2046486ebd424935e18cd70ca09e4c54ccbc146ab3a55b | MATLAB | 4,045 | 90 | %% plotableImage - Abstract Class to inherit by objects providing 2D plot methods
%
% Andreas Husch, Florian Bernard
% Centre Hospitalier de Luxembourg, Dep. of Neurosurgery /
% University of Luxembourg - Luxembourg Centre for Systems Biomedicne
% 2014 - 2017
% mail@andreashusch.de, fbernardpi@gmail.com
classdef (Abst... |
cde1d930bac1979bf99160720608265e88ef1080e982ef542d94d5c319e38911 | MATLAB | 4,047 | 90 | %%*****************************************************************************
%% sqlpsummary: print summary
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************************
function sq... |
ea14c41b34264d23ab70927c6cebba2e61217cfdbf53fc5f2b4d4099c50ff05e | MATLAB | 4,049 | 122 | function fImg = locmax2d(img, mask, keepFlat)
%LOCALMAX searches for local maxima in an image
%
% SYNOPSIS fImg = locmax2d(img, mask, keepFlat)
%
% INPUT img image matrix
% mask EITHER a scalar that defines the window dimensions
% OR a vector [m n] that defines the wi... |
ab98d16949445a6451d677ab19e1704a825625dc8049f89eeaf0f5beca8d3a90 | MATLAB | 4,050 | 97 | % Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions
%
%=========================================================================
%
% Copyright (c) 2008 Thomas Yeo and Mert Sabuncu
% All rights reserved.
%
%Redistribution and use in source and binary forms, with or without
%modification, a... |
a7f927e06fce97815fec82a9a4c688e41d6ecead45998b210e2e72a15656065e | MATLAB | 4,051 | 142 | function [ts_smooth] = circ_smoothTS(varargin)
% USAGE
% [ts_smooth] = circ_smoothTS(varargin)
%
% Given a timeseries input of circular data, this function smooths over the
% desired number of bins and returns a circularly smooth timeseries
%
% INPUTS
%
% ts a time series of circular data
% nBins in... |
becff629633688cffd1d6e23c0db5bfe2b6d3c6973d68954ea0795db9101ba6d | MATLAB | 4,052 | 110 | % EUCL: Calculates the euclidean distances among a set of points, or between a
% reference point and a set of points, or among all possible pairs of two
% sets of points, in P dimensions. Returns a single distance for two points.
%
% Syntax: dists = eucl(crds1,crds2)
%
% crds1 = [N1 x P] matrix... |
2c4675403b3ab4093f250ab1590dbcd3e17e7de1f5e9e68ef28c2e0fcfb359a7 | MATLAB | 4,053 | 136 | function y = log( x )
% Disciplined convex programming information:
% LOG(X) is concave and nondecreasing in X. When used in CVX
% expressions, X must be concave.
%
% Disciplined geometric programming information:
% LOG(X) is typically not used in geometric programs. Technically it
% ... |
8343447d7d121f8c1c38a40112650dc46e9f59640bc081404393b628e8e41a5f | MATLAB | 4,057 | 108 | function [otu_scale,X,F_hat_prime,growth_mean_p,growth_std_p,self_reg_mean_p,interact_std_p,deriv_std,perturb_std_p] = estMatricesHyperparametersFDiff(f,df_dt,intervene_matrix,rescale,perturbations)
% This file is a part of the MDSINE program.
%
% MDSINE: Microbial Dynamical Systems INference Engine
% Infers dynamica... |
b70feecf347b0ee63cb6bc075d97a10d97d6bf0087387b8c3dc4588e4e94b59e | MATLAB | 4,057 | 148 | %% LaBGAScore_secondlevel_MS_mat_pipeline.m
%
%
% *USAGE*
%
% MACS Toolbox: Model Space Pipeline
%
% This script assists in setting up a batch for defining a model space that
% can be viewed and executed in the SPM batch editor. It is particularly
% advantageous when the number of subjects or the number of models in yo... |
872570ad9d26bf4090a0802b5826a5c74b27a3bf562e749d315a50c5dc601a76 | MATLAB | 4,058 | 135 | function [] = mdsine(config_filename)
% This file is a part of the MDSINE program.
%
% MDSINE: Microbial Dynamical Systems INference Engine
% Infers dynamical systems models from microbiome time-series datasets, and
% predicts biologically relevant behaviors of the ecosystems.
% Copyright (C) 2015 Vanni Bucci, Georg Ge... |
bb242dd2b0ca621249acd5bfab30938575a9b34c1ce19da8a6839592a66f1232 | MATLAB | 4,061 | 101 | % pop_timtopo() - call the timtopo() function for epoched EEG datasets.
% Plots the epoch mean for each channel on a single axis,
% plus scalp maps of the data at specified latencies.
% Usage:
% >> pop_timtopo( EEG, timerange, topotimes, title, 'key', 'val', ...);
%
% Inputs:
% EEG ... |
9d4e036597fec45031de1edc9eee088eac41f063fa037beb80aafa286d198caa | MATLAB | 4,063 | 100 | function varargout = save_string(tree, formatting)
% XMLTREE/SAVE Save an XML tree in an XML file
% FORMAT varargout = save(tree,formatting)
%
% tree - XMLTree
% formatting - 1 for indenting of tags, 0 for no formatting
% varargout - XML string
%_______________________________________... |
3447e74e3603e7e781083dd93e2bc88642a5f6c3de788b2d75d13dfbf4d47a96 | MATLAB | 4,066 | 73 | function [results,prams]=CBIG_gwMRF_build_data_and_perform_clustering(input_fullpaths,output_path,start_idx,end_idx,...
num_left_cluster,num_right_cluster,smoothcost,num_iterations,num_runs,start_gamma,exponential, iter_reduce_gamma)
% This function reads in the data, computes the multiplication matrix and per... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.