sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
48697c92c15d887fa14516bd60721dce19a56dfe33fc49d50fc7c77de9f7594a
MATLAB
2,393
83
function BackgroundSubtraction(animal,probetype) %Averages signal across all channels for a given shank and subtracts this average from each %channel on that shank %Inputs: Animal ID, Probetype, raw data files in LFP\Full folder. %Outputs: Background subtracted data files to be used for spiking sorting %and...
f33062c37bdeaed00b769c9de09552f00dc8ce5f8efbbae2f7ad91cf3de12579
MATLAB
2,395
66
function parcel_components = CBIG_ArealMSHBM_compute_components_general(lh_labels,rh_labels,mesh,num_parcel) % parcel_components = CBIG_ArealMSHBM_compute_components_general(lh_labels,rh_labels,mesh,num_parcel) % % This script will compute the number of components for each parcel of a given parcellation <lh_labels> % ...
026ac30bda188f62773a65c22120dc95b0b7e0f98a6861928c39aebd3dfa215a
MATLAB
2,396
80
function [ux,ispos] = psdfactor(x,K) % [ux,ispos] = psdfactor(x,K) % % PSDFACTOR UX'*UX Cholesky factorization % % ********** INTERNAL FUNCTION OF SEDUMI ********** % % See also sedumi % This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko % Copyright (C) 2005 McMaster University, Hamilton, CANADA (s...
3c4acc68f221b97be94c7b935eb946b13c94bb31c4da8b955729d012bcacd806
MATLAB
2,396
89
function [freq_range, time_range, rect_img, clust_size, b] = G_Outline_Range( img2plot, varargin) % range of clusters % % Usage % [freq_range, time_range, rect_img] = G_Outline_Range( img2plot, varargin) % % Input % img2plot, binarmized matrix % % key-value pairs % 'xaxis', e.g. time vector % 'yaxi...
3d1ff2158636d566f79f91224bb499c42852815c04680b4219f42f9ba808c7a5
MATLAB
2,396
59
% scanfold() - scan folder content % % Usage: % >> [cellres textres] = scanfold(foldname); % >> [cellres textres] = scanfold(foldname, ignorelist, maxdepth); % % Inputs: % foldname - [string] name of the folder % ignorelist - [cell] list of folders to ignore % maxdepth - [integer] maximum folder dep...
3ddab2632efdb559b8095ae10cc9666a4d3e5caac1532f17f326a6853acd009c
MATLAB
2,396
86
function [data] = cleanPulses(ts, varargin) % [data] = cleanPulses(ts, varargin) % % Find square tsses % % INPUTS % ts - List of artifacts that will be removed from data (in seconds) % <OPTIONALS> % filename % basepath % correctDC - Logical variable to indicate if DC is corrected, default % ...
a2fb08f01575c40915ce2be76fdb16ddf2084e0376d0a64a01799483702c0f94
MATLAB
2,398
69
function rid_icv_vol = CBIG_getVol(ridList, structNames) % rid_icv_vol = CBIG_getVol(ridList, structNames) % Get baseline structure volumes from FS stats % % Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md imgDir = '//share/users/imganalysis/yeolab/data/ADNI_mert/'; ri...
899da8eac1a0e96d37acca9b38258c0d6cfc05f5a0ae84f859828a254e596142
MATLAB
2,399
101
function [y,dimage,header]=readOIS(fname,im) % Usage ... y=readOIS(fname,im) % % If a range of images is selected, a 3D set is returned verbose_flag=0; fid=fopen(fname,'rb','l'); if (fid<3), error('Could not open file!'); end; if (fname(end-5:end)=='oldraw'), verinfo=' '; dateinfo=' ...
e79257699003f1b98919aa7eb3693e587ce3b18ccd3b039e907aa1369f050440
MATLAB
2,399
76
% readeetraklocs() - read 3-D location files saved using the EETrak % digitizing software. % Usage: % >> CHANLOCS = readeetraklocs( filename ); % % Inputs: % filename - [string] file name % % Outputs: % CHANLOCS - EEGLAB channel location data structure. % See hel...
459c127009869d9818bfcec94b89f99705b2441fb34c26f7cc692f8de4648772
MATLAB
2,400
67
function obj=stat_qq(obj,varargin) % stat_qq Makes a quantile-quantile plot from the data in x % % 'distribution' is used to provide a custom distribution % constructed with Matlab's makedist(). Default is % makedist('Normal',0,1). Use 'y' instead of a custom % distrubution to plot the distribution of y against the % d...
58a3b0b52b40a871f45f26bd238602adab6e79f0383ea8f94e4c5bb63c8b464d
MATLAB
2,400
66
% std_findsameica() - find groups of datasets with identical ICA decomposiotions % (search identical weight*sphere matrices) % % Usage: % >> clusters = std_findsameica(ALLEEG); % >> clusters = std_findsameica(ALLEEG,icathreshold); % Inputs: % ALLEEG - a vector of loaded EE...
761f1f31b9f54e51deb4d29602739492aeccc28d7628788466ef3cdd135c776e
MATLAB
2,402
92
function allenMapSMc(dorsalMaps, axLims, alpha) % allenMapSMc(dorsalMaps) % % Produce a dorsal-view Allen atlas map using polygons, centered on the % sensorimotor cortex. % % Input "dorsalMaps" should be from allenDorsalMap.mat. %% Parameters lineWidth = 0.9; % Line width for area outlines lineWidthBox = 0....
2d473add482842cb5308f01cef6485553430275f80218117c51b9c3796c41a63
MATLAB
2,403
49
% 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...
38c6bb6c076d5a5a074089cb8af0d6f8e248b6451cbccef799e303860ac2a136
MATLAB
2,403
64
function id=ea_unifiedmapping_method2methodid(obj,efm) obj.compat_statmetric; % old compatibility for old statmetric notation (used to be stored as integers). obj=ea_unified_discfibers_compat_statmetrics2statsettings(obj); if ~exist('efm','var') efm=obj.statsettings.efieldmetric; end switch obj.calcsettings.conn...
d77adeb72aa73fcb6e511bccf0d5fa567a3d170332f06f75f931a79d2d63fc99
MATLAB
2,403
77
function [ynew2,tmpi]=myTBfix1(y,ref,thr,off1) % Usage ... [y_new,ii]=myTBfix1(y,ref_tb,thr,aoff) % % Uses REF and THR to correct changes in Y if nargin<4, off1=[]; end; do_many=1; if prod(size(y))==length(y), do_many=0; end; if do_many, if size(ref,2)==1, ref=ref(:)*ones(length(ref),size(y,2)); end; end...
2ec7f7d53554509ccee50f06b780f20e5f396e6b78c5b6c32606aa4d96aca610
MATLAB
2,404
66
%% Plot line&shadow for i = 1:numel(power_log) % power_log_pre{i} = power_log{i}(:, 1:xx, :); % power_log_post{i} = power_log{i}(:,xx:xx, :); end power_fre_log = cellfun(@(x) squeeze(mean(x(roi_band, :, roi_trial), 2)), power_log_stim, 'UniformOutput', false); power_fre_base_log = cellfun(@(x) squeeze(m...
ad7743f8bc9e5d39524794b44cc2a7e3f05a53f90b98a56f8f6ceca22c009b98
MATLAB
2,405
62
% demo file for applying the NoRMCorre motion correction algorithm on % 1-photon widefield imaging data using low memory (good for long datasets) % Example file is provided from the miniscope project page % www.miniscope.org clear; gcp; %% read data and convert to double name = 'msCam13.avi'; if ~exist(name,'file') ...
1d95e37964ead35399d2706071c6d1e34fa63156ebf4bded395b2009764e07f9
MATLAB
2,406
62
function permSet = CBIG_ASDf_genPermSetForNBS(id_factor, id_con, sub_info_file, Nperm) % permSet = CBIG_ASDf_genPermSetForNBS(id_factor, id_con, sub_info_file, Nperm) % % This function generates the within-site permutation set using PALM package. % ASD and control subjects from the same site are permuted. % % Input: ...
1a90eaf8c67ee37442a36d3aa5d715638cdd699fe2c49af6e8c7ce15343acf94
MATLAB
2,407
60
function [Dr_pos_file, Dr_neg_variable_file, Dr_neg_constant_file] = calculate_Dr(input_nifti_path, angle_nifti_path) % Define output file paths Dr_pos_file = 'data/maps/Dr_positive.nii.gz'; Dr_neg_variable_file = 'data/maps/Dr_negative_variable.nii.gz'; Dr_neg_constant_file = 'data/maps/Dr_negative...
51202819da39447d2789fa7897d3a8f3618264008d1cbb67ae227e75b3409796
MATLAB
2,407
21
%EEGLAB time-frequency functions (timefreqfunc folder): % <a href="matlab:helpwin angTimeWarp">angTimeWarp</a> - Given two event marker vectors, angTimeWarp computes a... % <a href="matlab:helpwin bootstat">bootstat</a> - Accumulate surrogate data to assess significance by permutation of some... ...
716c24c3ae18e0fbd74c1507e382343dcb5bab64548a081f1e84abe3558b6801
MATLAB
2,407
78
% DENDPLOT: Plots a dendrogram given a topology matrix. % % Usage: dendplot(topology,{labels},{fontsize}) % % topology = [(n-1) x 4] matrix summarizing dendrogram topology: % col 1 = 1st OTU/cluster being grouped at current step % col 2 = 2nd OTU/cluster % ...
815afd831e4499b423a7aa3c2ce210ae6a2ee2c524f255a27f595db0045a77bc
MATLAB
2,407
49
function ClincFreq_Norm2MNI_withT1_clinc(indat,inroi,indatT1,outdir,outname,voxelsize,pth) try [patdat,namdat,extdat] = fileparts(indat); % [patroi,namroi,extroi] = fileparts(inroi); [patdatT1,namdatT1,extdatT1] = fileparts(indatT1); %% [patdat,namdat,extdat] = fileparts(indat); % [patroi,namroi,extroi] = fileparts(in...
8eea2103dbb2505d3d0bec33cbecf1599d02fe6b0d0234f0a219385aa31c792a
MATLAB
2,407
66
function d=edit_distance_levenshtein_keylist(s,t) % Calculate the Levenshtein edit distance for cell arrays of (string) % keys, e.g. % edit_distance_levenshtein_keylist({'the','quick','brown','fox'},{'the','lazy','dog'}) % % @author B. Schauerte <schauerte@ieee.org> % @date 2010 % Copyright 2010 B. ...
904f88e88919dc2d34ce3b18f02fead9a8a7bb21672c317b17a625b29056c19b
MATLAB
2,407
79
function CBIG_IndCBM_create_surf_gifti(mesh, output_dir, varargin) % CBIG_IndCBM_create_surf_gifti(mesh, output_dir) % % This function will create .func.gii files of different meshes for cifti % templates creating. % % Input: % % - mesh: % Mesh name. Can be 'fsaverage5', 'fsaverage6', 'fsaverage', % ...
9c3101bf9287152a7dabb43360c5f9ab5b4f16c764c0f0b80f8ca822efc4fedc
MATLAB
2,407
57
% Logic: Identify a set of "good" subjects for which no condition images are marked as outliers % If a subject has one condition image that is an outlier, any contrast % involving that image is also likely to be an outlier. % % Use fmri_data.outliers( ) to get outlier status for combined set of % condition images. (Co...
32706606504d00e1ba18c8098e9ed827d3f653b62a9d9f06ea8c416dab27d399
MATLAB
2,408
76
%% Generate the average map across all participants (in fsaverage space) clear all; clc; % Set environment setenv('FREESURFER_HOME','/tools/freesurfer'); % Setup paths p.Home = '/egor2/egor/MovieProject2'; p.FS_subDIR = fullfile(p.Home, 'bids_data', 'derivatives', 'freesurfer'); p.SamSrf = '/egor2/egor/MovieProject2/...
6c29188ca5e7eefcfecdcd8d28f9653a0dae3fff31d5efb25d94b15f9f643f95
MATLAB
2,408
67
% 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...
9ac3fe72e1ad9adbd8053fbdabf7900673b8179145dc80d0d74629040d5e2217
MATLAB
2,410
48
% 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...
10dd22bf09eae66e718bd375d37824fbcff259bde992b7f2ca338b45f7453b38
MATLAB
2,411
56
% SOFA API - demo script % Copyright (C) 2012-2013 Acoustics Research Institute - Austrian Academy of Sciences % Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the European Commission - subsequent versions of the EUPL (the "License") % You may not use this work except in compliance with t...
80fafc62ae011924fee790b91668956913047cf18b292ea172af5ba0cd9ebdd1
MATLAB
2,411
75
% std_indvarmatch - match independent variable value in a list of values % % Usage: % indices = std_indvarmatch(value, valuelist); % % Input: % value - [string|real|cell] value to be matched % valuelist - [cell array] cell array of string, numerical values or % cell array % % Output:...
6cbaaae1ab5eea3b497f7104bf2a798aaae65761ee4cc693510426fee6a1a9d0
MATLAB
2,412
80
%%*************************************************************************** %% blkeig: compute eigenvalue decomposition of a cell array %% whose contents are square matrices or the diagonal %% of a diagonal matrix. %% %% [d,V] = blkeig(blk,X); %% %% SDPT3: version 3.1 %% Copyright (c) 1997 by %% K.C. ...
8a06d33a62f0a49d889910c1f73a5db0fc75575d909f50a1092b10d62e8b4733
MATLAB
2,412
94
function [ftr lens] = saveFTR(finame,P,I,offset,info,saveit) if nargin == 5, saveit = true; end; cc = {}; csc = {}; lens = []; if isempty(offset), warning('Empty field offset: guessing'); offset = eye(4); offset(1,1) = 2; offset(2,2) = 2; offset(3,3) = 2; end; vox = [offset(1,1) offset(2,2...
b91f6811a03e55ca9ef844c2597d25a0a0c580d1d1c98f2cac3d84b41e63be5f
MATLAB
2,412
78
function filter = makeGaborFilterGBVS(gaborParams, angle, phase, varargin) % makeGaborFilter - returns a 2d Gabor filter. % % filter = makeGaborFilter(gaborParams, angle, phase, makeDisc) % Returns a two-dimensional Gabor filter with the parameter: % gaborParams - a struct with the following fields: % filte...
06c26f432b6bf3ad51efb50a655d9de8d71ce06d3e94563dae4035a776d2d7b8
MATLAB
2,414
47
function SANDIinput = ProcessAllDatasets(SANDIinput) StudyMainFolder = fullfile(SANDIinput.StudyMainFolder,'derivatives','preprocessed'); SubList = dir(fullfile(StudyMainFolder,'sub-*')); SANDIinput.DatasetList = SubList; %SANDIinput.report = []; for subj_id = 1:numel(SubList) SesList = dir(fullfile(StudyMai...
df6b2cd907856d77df0637f53ae565f49ee9acb8650249b844604160c775ea44
MATLAB
2,414
63
function [I,idx] = bfGetPlaneAtZCT( r, z, c, t, varargin ) %bfGetPlaneAtCZT Obtains an image plane for the Z, C, T % % I = bfGetPlaneAtZCT(r, z, c, t) returns a specified plane from the input % format reader. The indices specifying the plane to retrieve should be % contained between 1 and the number of planes for...
48520362f711704d85b9e9377c5ac1f1ccef449952528381121d17c63c2210ad
MATLAB
2,415
45
function cvx_begin( varargin ) %CVX_BEGIN Starts a new CVX specification. % CVX_BEGIN marks the beginning of a new CVX model. Following this command % may be variable declarations, objective functions, and constraints, and % a CVX_END to mark the completion of the model. % % If another model has already bee...
7b0a55b06afa98faf6f378b22cf0c8fe339af008140da1bdd86995c49458ab7e
MATLAB
2,415
61
%% applyANTSTransformToPoints - transform points in world coordinats of a sourceRefImage to % world coordinates in targetRefImage applying a ANTS affine transformation % % Parameters: transPoints - Nx3 matrix of points in world cooridnates % antsTransformFileStrings - '[antsTransformFile, useInverseFlag]'...
a59caabb7c056df90d4f1a60978df3e1122f663cc8c63b63aa897764d879839e
MATLAB
2,415
66
function dataOut = dan_field_search(specData, thingy, stages) % Search a specData struct for spindles or so (thingy) in a particular % sleep stage %% % Authors: Dan Denis % Date: 2021-07-14 %% specDataFields = fieldnames(specData); fieldIndex = ~cellfun('isempty', regexp(specDataFields, thingy)); if any(fieldIn...
d86b2fd38cbe33455e89464e6433f1d9e99cfa650e753db0229bcb8149a483e9
MATLAB
2,415
80
function stats = CBIG_fitLME_4t(subInfoFile, GMICVFile, q) % stats = CBIG_fitLME_4t(subInfoFile, GMICVFile, q) % What is the subtype order? % Offset by 1, the RID column % % Written by CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md SUB_COL = 1+2; FRO_COL = 1+3; PAR_COL = 1+1; fpri...
14de3fd4ec15137464ff24cf9ecd49071f5a55c8ccd98122102fce3913eafbb2
MATLAB
2,416
52
%% sleepDanalyzer montage. % Montage scripts provide a conveinient way to control how the data looks % when sleep scoring. % chanList. A list of channel names and (optionally) channel coordinates. % This should be an EEGLAB chanlocs struct. Alternatively you can read in a % .txt file using the readlocs function (EE...
6792b60eb8bf4bc0966a271537a34e38bac49a956ecce5b5416476d6d429efe5
MATLAB
2,416
72
function newname = decodevarname(name,varargin) % % newname = decodevarname(name) % % Decode a hex-encoded variable name (from encodevarname) and restore % its original form % % This function is sensitive to the default charset % settings in MATLAB, please call feature('DefaultCharacterSet','utf8') % ...
28034b58c6879a28e1f3c255eb9da20e83852b99016d8ae77eb8f8b84a970ba8
MATLAB
2,417
71
function CBIG_ASDf_getBootstrappedSamples(output_dir, N) % CBIG_ASDf_getBootstrappedSamples(output_dir, N) % % Wrapper function to perform bootstrapping on ABIDE-II+GENDAAR ASD % participants. % % Input: % - output_dir: % Absolute path to output directory where the results will be % saved % ...
5999658cae74e7f5d8bb9a8289218cb81647e01f9696b015a267f28a4e4493d0
MATLAB
2,419
68
%% Running LDA model on bag of words data from stream for use with % SWR model %% % Choose the dataset dataset = 2; % 1 = psych review abstracts 2 = NIPS papers 5 = NYTimes if (dataset == 1) load 'psychreviewbagofwordsfromstream'; % WO DS WS ORIGWSPOS; T = 50; % Set the number of topics BE...
8ca17484ed96a7a1e778bd347a180d78e9c645c2ae80e6ccb39986dc4e20439a
MATLAB
2,419
61
function [params, results] = CBIG_hMRF_generate_parcellation_for_diff_rand_inits(params) % [params, results] = CBIG_hMRF_generate_parcellation_for_diff_rand_inits(params) % % This function runs the clustering algorithm based on the input parameter structure. % % Input % - params: (struct) % The structure that c...
a476ccb9cfa5c6b4851f1420d703555201ea5b27da8163fd9c85f3e3438b5d78
MATLAB
2,420
52
%% sleepDanalyzer montage. % Montage scripts provide a conveinient way to control how the data looks % when sleep scoring. % chanList. A list of channel names and (optionally) channel coordinates. % This should be an EEGLAB chanlocs struct. Alternatively you can read in a % .txt file using the readlocs function (EE...
f346167278cc60f2a387b12c93dfb8765ba81d07ac85364ceed881eb02f34957
MATLAB
2,420
74
% Exercise 4.60: Log-optimal investment strategy % Boyd & Vandenberghe "Convex Optimization" % Joëlle Skaf - 04/24/08 % (a figure is generated) % % The investment strategy x that maximizes the long term growth rate % R = sum_{j=1}^m pi_j*log(p_j^Tx) % is called the log-optimal investment strategy, and c...
b93fdd8363e9b1e25283f8adc2ed3c43f9c625dd2320f6c8a789eaccb55f090a
MATLAB
2,422
79
% pop_delset() - Delete a dataset from the variable containing % all datasets. % % Usage: >> ALLEEG = pop_delset(ALLEEG, indices); % % Inputs: % ALLEEG - array of EEG datasets % indices - indices of datasets to delete. None -> a pop_up window asks % the user to choose. Index < 0 -> i...
d0d128284deef1a121888ed3a09901525aa5afd5f897bb59bd9b44dcd5641342
MATLAB
2,422
66
function bfUpgradeCheck(varargin) % Check for new version of Bio-Formats and update it if applicable % % SYNOPSIS: bfUpgradeCheck(autoDownload, 'STABLE') % % Input % autoDownload - Optional. A boolean specifying of the latest version % should be downloaded % % versions - Optional: a string sepecifying the ver...
da1b97d87d2578955b115becbefacd9e4a5294ccdb8d46700ed1f7e8c85a274c
MATLAB
2,422
75
% <Insert fig_rates and gnd_rates as 3d matrices containing figure vs. ground data (channels, trials, times)> % <These matrices should be extracted directly from the Kirchberger et. al, 2021 VIP dataset> x = cat(2,fig_rates(1).vals,gnd_rates(1).vals); y = [ones(size(fig_rates(1).vals,2),1) ; zeros(size(gnd_rates(1)....
daa2563c6bbfc3637b52c68e60250a657bac9447a2862b05593b6beacf7c5bff
MATLAB
2,423
62
function [V,F,nF,T,nT]=collapse_edge(V,F,nF,T,nT,Volume_Original,Options) % Make list with all vertices which have not collapsed yet Vind=make_left_vertice_list(V,F,nF,Options) ; collapse_possible=false; vs=0; while(~collapse_possible) % Select the first vertice vs=vs+1; if(vs>length(Vind)), return,...
4c954030eb72121a53be1c110350547f0ef107e95d61e39e67e997f07501440e
MATLAB
2,424
63
% std_clustmaxelec() - function to find the electrode with maximum absolute projection % for each component of a cluster % Usage: % >> [STUDY, ALLEEG] = std_clustmaxelec(STUDY, ALLEEG, clustind); % % Inputs: % STUDY - STUDY set structure containing (loaded) EEG dataset structures % ...
09b341c2741373b4baad37f0b4a5bfa160dfa163a2c4567922dcd1952b719e10
MATLAB
2,426
62
function z = qjmul(x,y,K) % z = qjmul(x,y,K) % % QJMUL Implements Jordan product for Lorentz cones % % ********** INTERNAL FUNCTION OF SEDUMI ********** % % See also sedumi % This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko % Copyright (C) 2005 McMaster University, Hamilton, CANADA (since 1.1) % ...
0bd7ef7a9fdf17d32bb86dad7b0516e7e94f58c8242a26284e312db4c4c86aa8
MATLAB
2,426
97
function handles = dan_edit_montage(handles) % Pull up an inputdlg to change montage parameters on the fly %% % Authors: Dan Denis % Date: 2021-07-14 %% montage = handles.montage; if ~isempty(montage.scaleLine) scaleChan = montage.scaleLine{1}; else scaleChan = ''; end scaleLineStr = ['[' sprintf('%g;'...
1361d237a9aac99124f65201ed31e25e110026109e0b5e12b1022a468db38881
MATLAB
2,426
78
function [F,V]=solveInterSections(F,V) FV.faces=F; FV.vertices=V; nInter=inf; nInterOld=inf; while(nInter>0) [FV,nInter]=solveInterSectionsSub(FV); if((nInter>0)&&(nInter==nInterOld)) error('solveInterSections:process','Mesh intersections not solved'); end nInterOld=nInter; end F=FV.fa...
b6c534252aa68f616fab04fff0bec09bd9c48d57b0f2714076eef61e8d07ee1b
MATLAB
2,427
3
function cmap=canlabCmap %create colormap from yellow to dark blue/purple cmap=[0.0201307199895382,0,0.986666679382324;0.0402614399790764,0,0.973333358764648;0.0603921599686146,0,0.959999978542328;0.0805228799581528,0,0.946666657924652;0.100653596222401,0,0.933333337306976;0.120784319937229,0,0.920000016689301;0.140915...
68fbaa4bdf8403a5efbc798638b121419c1445cbfdfa12b7d2dcfe9709af6740
MATLAB
2,428
78
%% Compare pain-related brain patterns %% About this script % % This script compares several pain-related 'signature' patterns developed in the % CANlab over the past years. It uses a test dataset of N = 270 % participants from Kragel et al. 2018 to test the patterns' sensitivity % and specificity to pain. % % it col...
77e3f1d689ac256b3c899016d9373050a875a217ace72e1a5e76326ee062f5dd
MATLAB
2,428
69
function [mlnS, mlnSneuman, mlnSnp, bardelta, b] = my_murdaycotts(Delta,delta,r,D0,bb) % % [mlnS, mlnSneuman, mlnSnp, bardelta] = murdaycotts(Delta,delta,r,D0,g) % % calculates diffusion attenuation, mlnS = - ln(S/S0), % inside a perfectly reflecting sphere of radius r, free diffusion % coefficient D0, bvalue b ...
f7303dfd82f91d9365d3cc11bf916f9e8eaf69abe9786a5cb491b5cf44248b1c
MATLAB
2,429
70
function [ind,peak,cor,lag] = b_thetaIndex(self,cel,varargin) % Calculates thetaindex per Ulanovsky % % [ind,peak,cor,lag] = b_thetaIndex(self,cel,varargin) %% Constructed from the methods from % Grid cells without theta oscillations in the entorhinal cortex of bats % Michael M. Yartsev, Menno P. Witter & Nachum Ula...
643926140d75a3ff9ecfe9b173eaad82cb8e73fd8b86ae72a464d4ddbb9adba2
MATLAB
2,431
54
% 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...
bf5074aa8bb09a99d4f664ef8619843f607e98a8beb80c5e74a2ffa700a06670
MATLAB
2,431
61
function ncopies = checkworkspace(obj); stack = dbstack; stack(1:2) = []; stack = rmfield(stack, 'line'); ncopies = 0; if ~isempty(stack) % empty stack means the base workspace % check if we are in a different workspace if ~isequal(stack, obj.workspace) % is the current stack a subset of the o...
cb3dae90ce0c2c2925c636b1d4366d4f31aca15fcb0574b664a4c8d52b91bd1a
MATLAB
2,432
57
function [handles, refreshflag] = addDendrites(handles) flagadd = 1; refreshflag = 0; im_norm = handles.im_norm; while flagadd == 1 handles.current_dend_pixel = []; handles.current_dend_outline = []; handles.current_pt_all = []; handles.current_cspoints = []; handles.current_dend_trace = []; han...
cddb68bfd997d93865889c6607063df55dc9d922493e0569b417a37063142d65
MATLAB
2,432
93
function [res, errStr]= maskstruct_istype(dataIn, maskType) %function [res, errStr]= maskstruct_istype(dataIn, maskType) % % test function returns 1 if dataIn is a valid maskStruct of % the version specified in maskType. % % dataIn: arbitary data .. may be a ftrStruct or a fiberStruct % fiberType: {'Ver1' ...
d389da1f195c2f0980040bedadfadc482e6c04d7cebb2569d01ec99f7a6d867c
MATLAB
2,432
74
%% Trajectory - represents a (straight line) trajectory by two Point3D (entry and target) objects % % Andreas Husch % Centre Hospitalier de Luxembourg, Dep. of Neurosurgery / % University of Luxembourg - Luxembourg Centre for Systems Biomedicne % 2013 - 2017 % mail@andreashusch.de classdef Trajectory < handle & matlab....
382325d6fc2bff900519aacb7147e803857034c75e1e81fe894cd3bf65def948
MATLAB
2,435
81
% Polynomial discrimination % Section 8.6.2, Boyd & Vandenberghe "Convex Optimization" % Original by Lieven Vandenberghe % Adapted for CVX by Joelle Skaf - 10/23/05 % (a figure is generated) % % The goal is to find the polynomial of degree 3 on R^n that separates % two sets of points {x_1,...,x_N} and {y_1,...,y_N}. We...
6f41f2b7d5acf615c96611b0caa0c591f34a3a885ae267ce985e2ace18c80510
MATLAB
2,435
48
% 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...
0be81bb07eb67ba25e7db1847312cda29a1e3b5d1d20b13ec46b35de74c0f3df
MATLAB
2,436
61
function tree = xmltree(varargin) % XMLTREE/XMLTREE Constructor of the XMLTree class % FORMAT tree = xmltree(varargin) % % varargin - XML filename or XML string % tree - XMLTree Object % % tree = xmltree; % creates a minimal XML tree: '<tag/>' % tree = xmltree('foo.xml'); % creates a t...
7f5680b0140566402817e9b92f49635a0da2af876b9d9e4d594a53b710a427e3
MATLAB
2,436
90
function [H] = traditionaldipfit(f); % TRADITIONALDIPFIT creates the homogenous spatial transformation matrix % for a 9 parameter traditionaldipfit "Talairach-model" transformation % % H = traditionaldipfit(f) % % The transformation vector f should contain the % x-shift % y-shift % z-shift % (in length-units ...
146f9909c6a43362d036d40cd73d5f91e753f994b72cab690fc1dc63c42c1e6f
MATLAB
2,437
103
function sim = type2_SDT_sim(d, noise, c, c1, c2, Ntrials) % Type 2 SDT simulation with variable noise % sim = type2_SDT_sim(d, noise, c, c1, c2, Ntrials) % % INPUTS % d - type 1 dprime % noise - standard deviation of noise to be added to type 1 internal % response for type 2 judgment. If noise is a 1 x 2 vector then t...
c959b513d584ba64b6c59331fdc7a1108f8569ac2ea0a19b1da9d0e8abb339da
MATLAB
2,437
109
function [borderness, Cm, Dm] = Borderness(self,cel,plotIt) % Calculates the borderness score, as in Solstad 2008 % Bill 2012.10.26 % METHOD: % Dm = Mean Distance to wall: % Firing Field: FR >= 0.3*Max(FR). % Area of field > 200cm^2 % % % % Cm = Max coverage of a wall % (Number of pixels in wall also in field) / (...
ac8da426305772f1dc588fe444230cfe6110dc3a52a24373752729f4851e12ea
MATLAB
2,439
88
function NSxToHL(fname) % NSxToHL % % Opens and reads an NSx file without the header information and saves % the binary data into a .dat file with the same name. This can be used for % specific applications that require this type of data, e.g. Klusters. % Works with File Spec 2.1, 2.2 and 2.3. % % It does not suppor...
13e014052cc59619bc1f8f65b6bd3ab9ea3ad986924c8b607ab970678f45a84c
MATLAB
2,441
64
function CBIG_IndCBM_write_cerebellum_dlabel(surf_labels, cbm_labels, template_file, colortable, output_name) % CBIG_IndCBM_write_cerebellum_dlabel(surf_labels, cbm_labels, template_file, colortable, output_name) % % This function write parcellation labels into a dlabel file. Including the % cerebral cortical parcella...
7ab9891785b0d9683e9d0d8265c39cb14d015c025014793fc31a57806ad3f6c2
MATLAB
2,441
77
function [m,ll,ul,llj,ulj]=den_jack(X,family,varargin) % Function to compute smooth estimates of the mean of x using locfit, % the corresponding confidence intervals, and jackknife estimates of % the confidence intervals % Usage: [m,ll,ul,llj,ulj]=den_jack(x) % % Inputs: % X: data in the form samples x trials % family...
da8b30d0b318ffe9420bba62066273022c6190b938f2446681fd9069c09d0fcf
MATLAB
2,441
63
% std_rmalldatafields - remove all data fields from STUDY (before saving % it for instance. % % Usage: % STUDY = std_rmalldatafields(STUDY, type); % % Input: % STUDY - EEGLAB study structure % % Optional input: % type - ['chan'|'clust'|'both'] remove from changrp channel loc...
9fe4397ad07995c9f405a31f3c59bca2642af03f47bf8135d6b8b6e94391d1ec
MATLAB
2,444
65
% written by Yiyuan Han, Essex BCI-NE Lab, 11/12/2019 % Inter-subject classification % interISPCBinclass: Using ISPC as the feature to create SVM classfier for % classifying conditions in the binary mode % Input: % -datatrial: the segmented EEG data with same length % -trailtag: confition tags of the input data trials ...
a0f7dbfe6d3f38aee23b4672a3c0fdcedba64004205c2fa5dfa3de205c7586d6
MATLAB
2,444
66
function [err, err_O, err_R, err_rat, dHb_opt, dmu_a_opt] = muA_ls_obj_HbT_rel( ... x, mean_mu_a760, mean_mu_a850, thres_HbO, thres_HbR, ... epsilon_mm_uM, J_chrom_brain, meas_HbO, meas_HbR, lambda, relative_beta_SNR) %MUA_LS_OBJ_HBT_REL HbO/HbR LS fit + 3:1 ratio regularization (+ optional SNR weig...
5a4509c68e6086bc7a57bd28aafdd4e09ccfb2f18e137672c9a21c81f4da1010
MATLAB
2,448
78
% get holdout set for SVM contrasts, 2nd-level batch scripts % hard-coded options % 'fivefold_leave_whole_subject_out' : 5-fold cross-validation, leaving % whole subject out (all images from subject across all conditions) % 'leave_one_subject_out' : leave one whole subject out % holdout_set_type = 'fivefold_leave_who...
c54d0220358cbb64aa53033b5cdf734b70334a38798bfb153b39e18265f60e1f
MATLAB
2,448
60
function handles = spineROI_regmater(handles, t_points, R_points, roi_seed_master, dendID_master) roi_seed = R_points*[roi_seed_master'; 1*randn(1,size(roi_seed_master,1))]; roi_seed = bsxfun(@plus, roi_seed, t_points); roi_seed = roi_seed(1:2,:)'; im_norm = handles.im_norm; d1 = handles.size(1); d2 = handles.size(2); ...
fdc98838a85cf407f60f96fcd1756c5ea52a0b0811a29cc07e5e551599540c0b
MATLAB
2,449
52
function [p, s] = fit_prf_V7(p,s,ApFrm,apsFile,Hemis,WhichFolder) % [p, s] = fit_prf(p,s,subnr) Ecc = Visual_Angle(s.ScreenWidth, s.totdist); % diameter Ecc = Ecc/2; % radius prfFolder= char(fullfile(p.FS_subDIR, p.subNames, WhichFolder)); FS_surfDir = char(fullfile(p.FS_subDIR, p.subNames, 'surf')); disp(prfFolder...
346741dd476a0494f4631ad436fe6403f99c0d61e328efae120661317da3a362
MATLAB
2,450
73
function [trans_mat,elfv,xg,yg,zg] = get_trans_mat(electrode,electrode_patient,grid_vec,side,electrode_native) % inputs: % electrode: is the electrode model % electrode_patient: is the location of the patient's electrode in mni % space % grid_vec: is the standard grid points, on whihc the standard efield is % calculate...
3125bf59079590d4c85d644ec499619234747c88bd14702af9a2dbf512551b13
MATLAB
2,451
67
function [counts,t_inds,x_inds] = histxt(x, varargin) %HISTXT Column-by-column Histograms. % COUNTS = HISTXT(X,D), where X is an M x T matrix returns a D x T % matrix COUNTS in which each column contains the histogrammed (with D % bins) values from the corresponding column in X. If D is not % specif...
d306cf114ee7d8db573c779e5e2f820dd396137deb9363bedc447b96776ed721
MATLAB
2,451
62
function [C_calc] = LCN_calc_model_2T4k_vasc2k(params,midscantimes,frameduration,CA_FINETIMES,CA_WB_FINETIMES,FINETIMES,calc_option,STEP) % % calculates the output value for the LCN_calc_model_2TCM_K1.m (with parameters params) % FORMAT C_calc = LCN_calc_model_2TCM_K1(params, midscantimes, frameduration, calc_option) %...
a284d488714a003f209cb910d1851b6f02b4f4d8870c7b116873451e870f0309
MATLAB
2,452
60
ccc; % RAWDATAPATHs = dir("..\MAT Data\pre (granger)\single\**\*Active\**\Prediction Data_*.mat"); RAWDATAPATHs = dir("..\MAT Data\pre (granger)\single\**\*Passive\**\Prediction Data_*.mat"); MATNAMEs = {RAWDATAPATHs.name}'; AREAs = cellfun(@(x) x(strfind(x, '_') + 1:end - 4), MATNAMEs, "UniformOutput", false); RAWDAT...
4e7328eee88716fe773e45865f0e569aedf500b0373526db87ef44fdf47ab415
MATLAB
2,453
82
function [slice,slicebw,maskslice,maskslicebw]=ea_prepare_slice(nii,mask,sliceno,imgsliceno,options) % this function binarizes each axial slice (resulting in plane slicebw) by % thresholding the variable slice by x times the standard-deviation of its % intensity values. x here refers to the sum of a factor defined in t...
2c0285b69d3a258f15652015d083ab922b13877a0656d1733d4a25c8578f8ec4
MATLAB
2,454
87
function h=ea_checkgenesim(map,smooth,geneidx,cols) prefs=ea_prefs; if ~iscell(geneidx) geneidx={geneidx}; end load([prefs.genetics.dbdir,'geneinfo.mat'],'geneinfo'); for g=1:length(geneidx) id{g}=[]; tableheaders=fieldnames(geneinfo); for header=[2,4,5] id{g}=ismember(geneinfo.(tableheaders{he...
61cfe975ee9b9bd2d2f0313551edf78dab4dec8b48267cc40006d55f94cc81a3
MATLAB
2,454
65
function param = loadParameters_balloon_func %% loadParameters_balloon_func.m % % Contains all the parameters of the model and the % computational parameters for the simulations/calculations. It is % necessary to make an instance of the class before you can use the % parameters. % % Example: % >> param = loadPar...
76f28e7fb064f74cee1d326f53be9e94e1c1f91245658bdfd099279670236090
MATLAB
2,455
55
function Lden = symbcholden(L,dense,DAt) % Lden = symbcholden(L,dense,DAt) % % SYMBCHOLDEN Creates Lden.{LAD, perm,dz, sign, first} % % ******************** INTERNAL FUNCTION OF SEDUMI ******************** % % See also sedumi, dpr1fact % This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko % Copyright ...
a41cb85e09890ee70587bb6d0d272df7514b3000e7ade23a66c022c40867b93a
MATLAB
2,457
55
function CBIG_MMLDA_visualize_factors_wrapper(mmlda_dir, visualize_dir) % This wrapper visualize factors after MMLDA estimation % Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md unit_test_path = [getenv('CBIG_REPDATA_DIR') '/stable_projects/disorder_subtypes/...
4c6bf12f1b07d68605e5d4f0da3d378124eb15396398d8bf6093980e006ce428
MATLAB
2,458
70
function out = rotoball_fileimporter(filename, startRow, endRow) %IMPORTFILE Import numeric data from a text file as a matrix. % E9CLDATA20201002162310 = IMPORTFILE(FILENAME) Reads data from text file % FILENAME for the default selection. % % E9CLDATA20201002162310 = IMPORTFILE(FILENAME, STARTROW, ENDROW) Reads %...
0097038fb00c8f41590cf647bd6f8589961fa96785a5166c12d90030d4fc2f22
MATLAB
2,459
49
% std_itcplot() - Commandline function to plot cluster ITCs. Either displays mean cluster % ITCs, or else all cluster component ITCs, plus the mean cluster ITC, in % one figure per cluster and condition. ITCs can be visualized only if % component ITCs were calculated a...
1eb5cef26289e635b9887774cbfa2cead9aa3768ecb04c2af3c934bddde6a9bb
MATLAB
2,462
87
%USER_STRING Get/set a user specific string % % Examples: % string = user_string(string_name) % saved = user_string(string_name, new_string) % % Function to get and set a string in a system or user specific file. This % enables, for example, system specific paths to binaries to be saved. % % IN: % string_name - ...
9062fb6def186b854f378cea2f70f4d0b1ca7572b95904118fc339c043044bdc
MATLAB
2,462
87
function Par = LoadPar_SleepScore(FileName, varargin) % LoadPar(FileName) % loads the specified par file and returns a structure with these elements: % % .FileName -> name of file loaded from % .nChannels -> number of total channels % .nBits -> number of bits of the file % .SampleTime -> time, in mi...
df041c0a3f1e25b25b734f5c7f219cb539ba83d84db4a2227e1a5fcdca2e0c80
MATLAB
2,462
81
function [z, r, tp] = fsLR2roizmat_ciftidat_giftinode(cii, roiL, roiR) % DESCRIPTION: % Extract node time series from 32k by 32k fsLR saved in CIFTI dtseries. % Outputs correlation matrix (r), fishers-z-transfromed corr matrix (z), % and node-by-timepoint matrix (tp). % % Node...
eb62c45fbe840ec51937eb82f8b406398fc087f7174201ccc139637c33dcd2f2
MATLAB
2,462
58
% 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...
3b7874805b6ac04de3d014c2c3d256dadc2d55eba211b68c8f95d6ac6a9d7dc6
MATLAB
2,463
50
% 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...
8c2a864d1d879abde99856d60fdb92fd21424aba2d32bc7965ce5f7c6e4625e4
MATLAB
2,464
85
function p = PlotSamples(X,varargin) %PlotSamples - Plot samples (multiple time series). % % Plot columns 2...M of a matrix as a function of its first column. % % USAGE % % p = PlotSamples(X,<options>,<options2>) % % X list of (t,x1,x2...xN) data to plot (N variables) % <options> optional l...
072ae71d32e71904e4d310b243832a3e5447d7d3da98d726ae8d58153fb8ddab
MATLAB
2,465
78
% gettext() - This function prints a dialog box on screen and waits for % the user to enter a string. There is a cancel button which % returns a value of []. % Usage: % >> out = gettext(label1,label2,...,label7); % % Author: Colin Humphries, CNL / Salk Institute, La Jolla, 1997 % Copyright ...
9597f87924683f071b43d33e6d81d18f9c1f16449bee97d914d019e0e2031885
MATLAB
2,465
48
% 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...
14e3067cb35cf0eb64a69dad995440066edd2230df5b81aae930aeb721881920
MATLAB
2,466
68
function mem_ef = CBIG_get_mem_ef(rid, predementedOnly) % mem_ef = CBIG_get_mem_ef(rid, predementedOnly) % Fetch MEM and EF scores from .csv files % % Input: % - rid: the RID's of subjects of interest % % Output: % - mem_ef: 1st col is RID, 2nd is VISCODE, 3rd is EXAMDATE, 4th is MEM, % 5th is EF % % Written...
9b2d98ae893549b04f49d2670be18a0483dad4cf45cb052f61d1e703f200d91a
MATLAB
2,466
80
function VisualizeTopics( DP , ALPHA , S , VIZMODE ); %% Function VisualizeTopics %% % Visualizes topics in a 2D map %% % |visualizetopics( DP,ALPHA,S,VIZMODE )| takes the topic strings in |S| and % the document-topic count matrix |DP| where |DP(i,j)| contains the number of % times a word in document |i| has bee...
8715384807cb8b3cea9c906fafe61f612776c4bfeadb4d7673d5decb08e8c1a2
MATLAB
2,467
63
function lambda = CBIG_hMRF_initialize_lambda_in_vonmises_partition_func(lambda_init, dimension_for_bessel_func) % lambda = CBIG_hMRF_initialize_lambda_in_vonmises_partition_func(lambda_init, dimension_for_bessel_func) % % This function determines the initial value for lambda in the partition function of von Mises dist...