sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
8b4d25f4dbe1384e39587b7571727da729f9a5d470731b6be5a620430f660198
MATLAB
3,856
183
clear % Load wfs from method file seq = bpv_method2seq('method_example'); [gwfc, rfc, dtc] = bpv_seq2gwf(seq); for i = 1:numel(gwfc) gwfc{i} = fwf.gwf.force.bval(gwfc{i}, rfc{i}, dtc{i}, 2e9, 'amp'); end xps = fwf.gwf.toXps(gwfc, rfc, dtc); clist = fix.cmap.blackredwhite; if 0 % gray clist = mean(clist, 2...
17aa3c7f6de1fdc0ddd6771fc7ecf10ea3b51de3b952cf0074f6a8e82a7cddd5
MATLAB
3,858
107
function spt_video_plot(data) if isempty(data)~=1 for j = 1:length(data) input_data = data{j}.tracks; video_slider_figure(input_data) end end end function video_slider_figure(input_data) for i=1:length(input_data) time{i} = input_data{i}(:,1); end time = vertcat(time{:}); ...
f8c0d64aae18f987eb77753ef5f06cc66f8b0ec900f516f0cce0e6f8af7ebb0f
MATLAB
3,878
111
function string = user_string(string_name, string) %USER_STRING Get/set a user specific string % % Examples: % string = user_string(string_name) % isSaved = 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 pat...
75f3f4f4875ccdeda0767f23ff2b4442cba632397efdf6ced977b0df3e279997
MATLAB
3,889
111
% current working directory needs to be /path/to/scripts mainpath = pwd; disp('setting up environment...') addpath([mainpath filesep 'toolboxes' filesep 'analyzePRF']) addpath([mainpath filesep 'toolboxes' filesep 'analyzePRF' filesep 'utilities']) addpath([mainpath filesep 'toolboxes' filesep 'knkutils']) addpath([mai...
bf474108e0465a1a53ca8da14e48724bd5540ce167fe42dc6934a11cb9277036
MATLAB
3,891
106
function [ pval, peak, clus, clusid ] = SurfStatP( slm, mask, clusthresh ); %Corrected P-values for vertices and clusters. % % Usage: [ pval, peak, clus, clusid ] = % SurfStatP( slm [, mask, [, clusthresh] ] ); % % slm.t = l x v matrix of test statistics, v=#vertices; the first % ...
9cf2fa3b2a386a317b270e635fda570c0cebb78c4e78297dba067c1259cd86a3
MATLAB
3,896
129
function [v]=arsim(w,A,C,n_ntr,ndisc) %ARSIM Simulation of AR process. % % v=ARSIM(w,A,C,n) simulates n time steps of the AR(p) process % % v(k,:)' = w' + A1*v(k-1,:)' +...+ Ap*v(k-p,:)' + eta(k,:)', % % where A=[A1 ... Ap] is the coefficient matrix, and w is a vector of % intercept terms that is included to a...
6babc8c36489943848bbfc095c74717949d810d42cfdf00937761b1764f8c909
MATLAB
3,899
180
function [beta, tstr, ha] = mipp_resQ_plot_v2(S, xps, h, h2, opt) % function beta = resQ_plot(S, xps, h, h2, opt) if (nargin < 3), h = gca; end if (nargin < 4), h2 = []; end if nargin < 5 opt = mdm_opt(); opt = resQ_opt(opt); end ind = ones(xps.n, 1, 'logical'); S = abs(S); if ~isfield(xps, 'b_delta') ...
286dca7770e071d7ae6e09560e451f9cb2c49692fa563fc8b89d1793d60caf7f
MATLAB
3,907
106
function [ pval, peak, clus, clusid ] = SurfStatP( slm, mask, clusthresh ); %Corrected P-values for vertices and clusters. % % Usage: [ pval, peak, clus, clusid ] = % SurfStatP( slm [, mask, [, clusthresh] ] ); % % slm.t = l x v matrix of test statistics, v=#vertices; the first % ...
6e7f16aa73323d3a3c9dbb1441ab489bcf5e12cfd35164aacb72c625e44d8a5f
MATLAB
3,911
126
function surrogateData = generate_surrogate_iaaft(originalData, varargin) % GENERATE_SURROGATE_IAAFT Generates surrogates of a time series. % % surrogateData = GENERATE_SURROGATE_IAAFT(originalData, ...) % Generates, by means of the Iterative Amplitude Adjusted Fourier Transform % (IAAFT) algorithm, surrogate time ser...
a9acefd61db7a4c9130682a5acb93f4c6f082f38e6bc013336b80db060b19cd6
MATLAB
3,911
106
if ~(exist([subjectDataDir filesep '4_retinotopy' filesep 'results_analyzePRF_all.mat'], 'file') == 2) disp('waiting for parts to complete...') parts=dir([subjectDataDir filesep '4_retinotopy' filesep 'results_analyzePRF_part_*_of_*.mat']); while size(parts,1)<num_parts parts=dir([subjectDataD...
3f83f26ab425962d3c4bc1c603c645a6654fe11fe387bb26945bec6bae3a6a5a
MATLAB
3,924
68
classdef PermutationNode < handle %PERMUTATIONNODE Node which defines one grouping of each permutatino tree % % node = permutationNode(level, input_data, permutation_groups) % node = One grouping of data for each permutation group. Each group contains the data (functional connectivity) % along wit...
d85be93d416a7d3a1863b7c04838a31b54b9b5d57524b692c006df67b45f145d
MATLAB
3,937
101
function J = nst_mne_lcurve_MAP(HM,OPTIONS) % nst_mne_lcurve - this function solve the inverse probleme using a l-curve % approach in the MAP formalism. This approach is inefficient and should % not be used. Consider using nst_mne_lcurve instead. % Input: HM - struct % | - HM.Gain : Gain matrix % OPTIONS...
d788000132dbbef7aeb087a8f92e02f4e3b5328ca2678fc6202f92dc180c2b68
MATLAB
3,938
99
function spt_particles_velocity(data) for i=1:length(data) input_data = data{i}.tracks; for k = 1:length(input_data) v{k} = calculate_velocity(input_data{k}); end velocity{i}.velocity = v; velocity{i}.name = data{i}.name; velocity{i}.type = 'spt_velocity'; clear input_data v...
0faf3b68346ea8e7698e1420615f6b7a0111df42d89b1bd304dbc0f281f584c4
MATLAB
3,940
111
function loc_list_distance_clustering(data) answer = inputdlg({'Minimum Number of Points to Cluster:','Epsilon:'},'Input',[1 50],{'5','0.5'}); if isempty(answer)~=1 N = str2double(answer{1}); epsilon = str2double(answer{2}); for i=1:length(data) counter(1) = i; counter(2) = length(dat...
0a220c660deb509765a365f7543613406603848842ca01810a82865e4b04459f
MATLAB
3,951
140
function [R] = randomizer_bin_und(R,alpha) %RANDOMIZER_BIN_UND Random graph with preserved in/out degree distribution % % R = randomizer_bin_und(A,alpha); % % This function randomizes a binary undirected network, while preserving % the degree distribution. The function directly searches for rewirable % ed...
30bbe41d34ddb024ebb00fb5d3493018705b0973f5cc1819de936ee69d1536f0
MATLAB
3,957
140
function hhh=vline_new(x,in1,in2,in3) % function h=vline(x, linetype, linewidth, label) % % Draws a vertical line on the current axes at the location specified by 'x'. Optional arguments are % 'linetype' (default is 'r:'), linewidth, which specifies the width of the line plotted % and 'label', which applies a te...
e89b83198b103ff222304833a784312dbe053c360ea2645d4cb8a814ae594338
MATLAB
3,957
83
classdef SpearmanEstimator < nla.edge.BaseTest %SPEARMANESTIMATOR Fast estimator of the edge-level Spearman correlation % Similar to the internal implementation of SpearmanTest, but removes % an expensive call to tiedrank. This causes it to run several times % faster, but produce slightly incorrec...
ac105905a72e5454990abf96bc5f40a09d8d6e2bc002df56de1ccbb2b450d111
MATLAB
3,969
119
function [ silhouettes,alternativeid ] = silhouette_mod( parcels, D, neigh ) %SILHOUETTE_COEF Silhouette coefficient of a parcellation. % For each vertex in a cortical surface, SILHOUETTE_COEF compares the % within-parcel dissimilarity defined as the average distance to all % vertices in the same parcel, to the i...
4bfc8b667198fe473c3411bafeffb5af5a1d83ca677b45e17f0a4b771073b2c2
MATLAB
3,979
172
clear % Get paths and some info paths = mipp_getDataPaths(2); % paths = mipp_getDataPaths(103); I_rare = mdm_nii_read(paths.fn_rare); I_rare = mipp_signalEveningFilter(I_rare); p_qti = mdm_dps_load(paths.fn_qti); p_resq = mdm_dps_load(paths.fn_resq); I_roi = mdm_nii_read(paths.fn_roi_plt); I_tum = mdm_...
7c2c67df505f5ee5c1055dd829a6494262e72521789122292312d0e69da8e51c
MATLAB
3,988
106
function dam_index = computeDAMindex(A) % COMPUTEDAMINDEX Compute a data-availability/adjacency-missingness (DAM) index % % dam_index = computeDAMindex(A) computes a normalized index in the range % [0, 1] that summarizes how "missing" a 2-D matrix is, taking into account % the number of missing elements and...
bc69b6fbc60e90a9caf369972e6ef0a70f1e165670e1bd5644cf09000ae979ac
MATLAB
3,989
128
function slm = SurfStatF( slm1, slm2 ); %F statistics for comparing two uni- or multi-variate fixed effects models. % % Usage: slm = SurfStatF( slm1, slm2 ); % % slm1 and slm2 must have the following fields: % slm.X = n x p design matrix. % slm.df = degrees of freedom. % slm.SSE = k*(k+1)/2 x v matrix of...
fd06b3c944f73ed0194cc5da50bd52f732f653db9af46b5da74cfd92e0553f8e
MATLAB
3,996
92
function spt_motion_classification(data) input_values = inputdlg({'r2 threshold','percentage of data to fit:','confined motion slope threshold (<):','directed motion slope threshold (>=):'},'',1,{'0.8','25','0.8','1.2'}); if isempty(input_values)==1 return else r2_threshold = str2double(input_values{1}); ...
307626c6f288c5eb7457d1a25cc2057c031e2e6c7d36ac9422cb888b4e59bc34
MATLAB
4,008
101
function spt_particles_velocity_correlation(data) for i=1:length(data) input_data = data{i}.tracks; for k = 1:length(input_data) v_corr{k} = calculate_velocity_correlation(input_data{k}); end velocity_correlation{i}.velocity_correlation = v_corr; velocity_correlation{i}.name = data{i}...
c2734d2a275971181dae23f74a7035dffc5f278525ad37a65206a0888ab686a4
MATLAB
4,014
114
%% clear % current working directory needs to be /path/to/scripts mainpath= pwd; thisSubject='S2'; computeForMultipleSubjects=[1:52]; visualROIs={'V1','V2','V3'}; hemiROIs={'lhV','rhV'}; tapsmofrq=5; freqAnalysisToi=-1:0.05:2; slidingWindow=0.5; method={'plv','coh','granger'}; % addpath([mainpath filesep 'toolboxes' ...
450f75b2d338146a9d28ac2cc93000ba4ed8f7ae8cd50e7930e572d3a6757c94
MATLAB
4,015
89
classdef PermutationTestPlotter < handle properties network_atlas end methods function obj = PermutationTestPlotter(network_atlas) if nargin > 0 obj.network_atlas = network_atlas; end end function [w, h, matrix_plot] = plotProbabilit...
5010ad711aafd0f5446d1472673d5236aa7a147942b526a0536a61eb6bd04f91
MATLAB
4,020
76
classdef WilcoxonTest < handle %WILCOXON Wilcoxon rank sum test properties (Constant) name = "wilcoxon" display_name = "Wilcoxon Rank Sum" statistics = ["ranksum_statistic", "single_sample_ranksum_statistic", "z_statistic"] ranking_statistic = "z_statistic" allows_within_...
dc88d566dd1118bc981033435aad03b6f34820393d68b207d81259cbcb0b5858
MATLAB
4,020
117
function SI = search_information(W, L, has_memory) % SEARCH_INFORMATION Search information % % SI = search_information(W, L,has_memory) % % Computes the amount of information (measured in bits) that a random % walker needs to follow the shortest path between a given pair of nodes. % % ...
0954005b712d928581fa695fd7e65ddbc649e1bfb723e9ae0364e6509b5200ef
MATLAB
4,028
84
function [Z, P] = AS_TFRtoZ(Data,Flag,Df1,Df2) % This is from software rest. % The orginal version is [Z P Header] = rest_TFRtoZ(ImgFile,OutputName,Flag,Df1,Df2,Header) % The bellow is the orginal annotation. % function [Z P Header] = rest_TFRtoZ(ImgFile,OutputName,Flag,Df1,Df2,Header) % FORMAT [Z P Header] = y_...
82d8e3ef1e1d22d2bbcff94295ac6a88e59e818b8fccbc70ca1ea95c94313582
MATLAB
4,032
177
%% file TMS2=xlsread('X:\Qexactive\Alexey\20130827_tMS2_JPT_01.xlsx'); [~,~,IL]=tblread('X:\Qexactive\Alexey\incl.CSV',','); FMS2EX=xlsread('X:\Qexactive\Alexey\20130827_FullMS-MS2_JPT_Ecxl_01.xlsx'); %% compare inclusion list with search input hist(mze) a=unique(sort(str2num(IL))); %mze=a+(rand(size(a,1),1)...
d53f694a64132f619641a6d34afd20146fc8230b5753540df55f99501125a081
MATLAB
4,034
140
function hhh=hline_new(y,in1,in2,in3) % function h=hline(y, linetype, linewidth, label) % % Draws a horizontal line on the current axes at the location specified by 'y'. Optional arguments are % 'linetype' (default is 'r:'), linewidth, which specifies the width of the plotted line % and 'label', which applies a ...
f8ab2c43d3413cd093e07d2a39e3009dc22e43944c1a972f422b2c1864f791f8
MATLAB
4,035
162
%% load data load('/media/DATA/documents/courses_uib/bmed360/presentation/svm_mat555.mat'); [s v t]=size(svm_mat); sn=Design_Para(:,6)'; mn=Design_Para(:,4)'; corrcoef(mn,sn) crosscorr(mn,sn) autocorr(mn) autocorr(sn) for i = 1:size(svm_mat,1) for j = 1:size(svm_mat,3) svm_mat_norm(i,:,j)=mat2gray(svm_mat(i,:,j...
31affcd82e76bdeb45f96767ec876b2d9c697b818c47ab8732487a68e33129b3
MATLAB
4,041
108
function [h,C] = gradient_in_euclidean(gradients,surface,parcellation) % GRADIENT_IN_EUCLIDEAN Plots gradient values as a scatter plot. % % h = GRADIENT_IN_EUCLIDEAN(gradients) plots a scatter plot of n-by-2 or % n-by-3 matrix gradients where n is the number of datapoints. Each point % is colored by their posit...
37a21ca97f0f601451d973e99f7e4990a1be33d7ff4dec32dde61ccd7d890a0b
MATLAB
4,050
80
%% % current working directory needs to be /path/to/scripts mainpath = pwd; addpath(genpath([mainpath filesep 'toolboxes' filesep 'analyzePRF'])) addpath([mainpath filesep 'toolboxes' filesep 'tc_functions']) %% fcont=dir([subjectDataDir filesep '4_retinotopy']); fcont = fcont([fcont.isdir] & contains({fcont.name}, 're...
5da752cfc1442adc060086172653730b00ca292ad9718a4d33dca22dfda43d54
MATLAB
4,053
166
function [ pcntvar, U, V ] = SurfStatPCA( Y, mask, X, k ); %Principal Components Analysis (PCA). % % Usage: [ pcntvar, U, V ] = SurfStatPCA( Y [,mask [,X [,k] ] ] ); % % Y = n x v matrix or n x v x k array of data, v=#vertices, % or memory map of same. % mask = 1 x v vector, 1=inside, 0=outside, def...
7f31acacb596bea8d0865fdcfd67a073ce005097aa13daa66accc559fd64b45a
MATLAB
4,069
139
%% data [~,~,ss]=xlsread('X:\Elite\Aida\SS_1R\SS1RPGsortMGUS2MMmedvals.xls'); [cu,~,~]=xlsread('L:\Elite\gaute\test\CDS_CU_EntrezID.xls'); od=xlsread('L:\Elite\Aida\CellLines\cell-lines.xlsx'); comb=xlsread('L:\Elite\kamila\SILACmRNA.xlsx'); comb=xlsread('L:\Elite\kamila\Heart\combolfqs.xlsx'); comb=xlsread('L:\E...
f74498d341147b05bf8abf5b83ed8f58c3f739370f37d890bdb17b395898cf91
MATLAB
4,094
109
% current working directory needs to be /path/to/scripts mainpath = pwd; %% addpath([mainpath filesep 'toolboxes' filesep 'OpenFmriAnalysis']) addpath([mainpath filesep 'toolboxes' filesep 'spm12']) addpath([mainpath filesep 'toolboxes' filesep 'tc_functions']) tvm_installOpenFmriAnalysisToolbox; freeSurferFolder = [...
bfafcaa5ba624d0f0d7ac55312af66d16b6841525eb084a8b9a26b69e532116e
MATLAB
4,099
93
function O = InducedResponses_Morlet_WholeBrain_LBPD_D( S ) O = []; % It computes time-frequency analysis (induced responses) using Morlet % wavelet. % It computes Morlet wavelet transform independently on each voxel of the brain % and each trial. % This should be used in connection with LBPD functions, after computi...
7da42b648b93c93ffb64d0f838f426618cca4a2b3aef15b86f574e2904928a25
MATLAB
4,100
107
%% define parameter sets for analysis if ~(exist('mainpath','var') && exist('thisSubject','var')) clearvars % current working directory needs to be /path/to/scripts mainpath= pwd; thisSubject = 'S1'; else clearvars -except mainpath thisSubject end load([mainpath filesep '..' filesep 'subjectData' f...
5f1e14bd4e1309b41b375c2784d03bade889bed11cae15d637b66ebac9010dc4
MATLAB
4,114
58
function fn = digest(s,e,m,l,dct,tct,cl,ch,ntlc,mod,msite) fprintf('Sequence %s\t Enzyme %s\t Missed Cleavage %d\t Minimum Length %d MZ Range %d-%d\t Charge Range %d-%d\t N-term truncation %d\tModification %s-%s',s,e,m,l,dct,tct,cl,ch, ntlc, mod,msite); fn=[s,e,'MC',int2str(m),'L',int2str(l),'MZl',int2str(dct...
3a246880d4e7185e294eb83257d91e886ed383c57664ae0aeb02a25730f7800d
MATLAB
4,116
91
function [I,Q,F]=motif4struct_wei(W) %MOTIF4STRUCT_WEI Intensity and coherence of structural class-4 motifs % % [I,Q,F] = motif4struct_wei(W); % % Structural motifs are patterns of local connectivity in complex % networks. Such patterns are particularly diverse in directed networks. % The motif fre...
289ffa6774aaabbe6e9096525713495675b095b283558d6ca4fb88a8f09ed14a
MATLAB
4,123
135
function MC = dFCstream2MC(dFCstream, verbose) % FUNCTION MC = dFCstream2MC(dFCstream, [verbose]) % Thus function takes as input a dFCstream, either 3D or 2D, % and outputs a square MC matrix (in a redundant form to find more easily % meta-links impinging a region % NB: Set optional argument 'verbose' to zero for sile...
b74ac1e5019946e957a5666f03ef43443530482cbae42208ffef1abbfe730478
MATLAB
4,123
115
function [ MATF ] = signROIdegree_otherROI_prepareplotting_LBPD_D( POS, NEG, label_path ) % It creates an ROIs x ROIs matrix, ordering ROIs according to labels % provided (example that I provide consists in AAL ordered like LRLRLR), % showing the number of significant connections between couple of ROIs % over time. %...
db170c170fc0862a624b91a68906451b1c61c959bb898acebd0a5fda8ceedafc
MATLAB
4,129
119
function [Rlatt,Rrp,ind_rp,eff] = latmio_dir_connected(R,ITER,D) %LATMIO_DIR_CONNECTED Lattice with preserved in/out degree distribution % % [Rlatt,Rrp,ind_rp,eff] = latmio_dir_connected(R,ITER,D); % % This function "latticizes" a directed network, while preserving the in- % and out-degree distributions...
809432cfb5dd16b8310a111ab1e1bb2ff67db0c0f6453b2547f32671d2538c17
MATLAB
4,132
105
classdef PermBase < handle properties avg_prob_sig = NaN perm_count = uint32(0) coeff = [] prob = [] prob_sig = [] perm_seed end properties (Access = protected) lastResultIdx = 0; end methods function obj = PermBase() ...
d296e2290d90fa94f64bda27dc1f00e8b090ef82cd18944c94a5397c41042457
MATLAB
4,140
121
function varargout = process_nst_cpt_cortex_to_head_distance( varargin ) % Compute the distance of each vertex of the cortical surface to the head % in mm % @============================================================================= % This software is part of the Brainstorm software: % http://neuroimage.usc.edu/b...
40ad9d2ee84d48fa805993142579fe4ef196d434ee3b886cd5be37ca138fcabb
MATLAB
4,148
124
function shape_classification_supervised_clustering(data) classes = data.classes; if size(classes,1)<200 disp('calculating nodes and edges') parameters = classes(:,3); parameters = vertcat(parameters{:}); parameters = zscore(parameters); number_of_nodes = size(parameters,1); [x,y] = mesh...
d7c59a1cfcf3940a685766b510d680c629a458ef711d3474e5294dd3f13de09e
MATLAB
4,152
109
function [siglev,res, lmp, dof_lmp]=arres(w,A,v,k) %ARRES Test of residuals of fitted AR model. % % [siglev,res]=ARRES(w,A,v) computes the time series of residuals % % res(k,:)' = v(k+p,:)'- w - A1*v(k+p-1,:)' - ... - Ap*v(k,:)' % % of an AR(p) model with A=[A1 ... Ap]. If v has three dimensions, % the 3rd...
09d6fb7fdbb34197af5d5476bb49810fa7e1868fad1709e75b605676fa318aac
MATLAB
4,153
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) % ...
a7fdcc2505225df4498cd65f3ac134e8b856a02e5ff3face02d5602f1db413a6
MATLAB
4,170
110
function [XN,IOTA,EPS,U]=quasi_idempotence(X,K) %QUASI_IDEMPOTENCE Connection matrix quasi-idempotence % % [XN,IOTA,EPS,U]=quasi_idempotence(X) % [XN,IOTA,EPS,U]=quasi_idempotence(X,K) % % The degree of quasi-idempotence of a matrix represents how close it % is to being idempotent, i.e. invariant to squari...
58e888dab6e75d514624697e2b49d3cf4512700553e20c5e7f3577cb8b8bf374
MATLAB
4,178
124
%% in silico digestion UNG2 with trypsin, lys-c and arg-c name=digest('P13051','trypsin',2,8,400,2000,2,3,20,'HPO3','[STY]') name=digestNphosphorylate('P05387','trypsin',2,8,400,2000); name=digest('P13051','trypsin',2,8,400,2000,1,4,'HPO3','[STY]') fprintf('Results written to file %s\n',name); %% xrcc1 ...
0fe5265d830c639971d5637244431cba80017c3c92bcb66b7cf82568c75970c6
MATLAB
4,232
135
%% load example of training data load('training_set/data749.mat') %visualize absorption and scattering targets figure subplot 121 patch('Faces',mesh.H,'Vertices',mesh.r,'FaceVertexCData', mua, 'FaceColor', 'flat', 'EdgeColor', 'none'); axis tight axis square title('\mu_a') subplot 122 patch('Faces',mesh.H,'Vertices',m...
439e961cc424fbe63a84c34a64dfc235da5defca3ead8bebb850b6ec5acd2807
MATLAB
4,248
81
function [isSignificant,adjusted_pvals,alpha]= bonferroni_holm(pvals,optional_alpha) %% bonferroni_holm, bonferroni_holm(pvals), bonferroni_holm(pvals, alpha); % Corrects for testing multiple hypotheses. % This method is more powerful, but less conservative than the Bonferroni method. % Fixed so that a...
a39e8b2a7a9d4bea5e27a1ec31041b64a9072ee1bcb6ad39954ff7b92258c8f5
MATLAB
4,252
112
%% Plot and count Fig 3D-F data points % Reproduces the D-F scatter/trend plots and reports exact counts if ~exist('DATA_ROOT','var'), run(fullfile(pwd, 'matlab', 'config.m')); end % load(FIG3_DATA); % uncomment if workspace not already loaded metrics = {mergedDFF, mergedTrendsOnset, mergedTrendsDur}; metricNames = {...
4074d7419c54a11bbe12dfc57df28f6bbd55f0b99b644e1c059fd1ac02e0da2a
MATLAB
4,253
121
% This script processes shows an example of how to process several % recorded sessions (in this example the video data is already converted to % .mat format but the script works for any matlab supported video format, % you should just adapt step 0 below for the loading part). % files and concatenates the results (step...
651e9e6b91cb380d7286f644b1ccb761834ae3cb751756082378eecb7bf5c345
MATLAB
4,255
103
function [ MAG_data_pos, MAG_data_neg, GRAD_data, MAG_GRAD_tval ] = MEG_sensors_MCS_reshapingdata_LBPD_D( S ) % It reshapes the order of data according to labels that are % submitted, providing 2D approximation of MEG sensors layout. % This function works in combination with a following function that finds % spatio-te...
299e8848a365689ea2fd6290ae5675bedb37629f0a3fe1ffbef549e6438a66e9
MATLAB
4,259
103
classdef SandwichEstimator < nla.edge.result.Base properties % test result specific properties go here (things that are % specific to a particular data input, ie: results of running the sandwich % estimator on said data, or covariates which are specific to a % particular data se...
0274c972a544ed0566cbd55629a49a18ec85663cdc6addd1b84e1fcb12758ecb
MATLAB
4,269
146
function BCCT_makefinalMask clc;clear all;close all; ASMASK.fig = figure('Name','Make final mask for calculation',... 'units','normalized',... 'menubar','none',... 'numbertitle','off',... 'color',[0.95 0.95 0.95],... 'position',[0.20 0.15 0.5 0.5]); movegui(ASMASK.f...
f98286a5893b2308fc56722f16a1eb691e8e8acb28212fae1fd88709b43be445
MATLAB
4,281
121
function [Kernel, M, J] = nst_mne_lcurve(HM,OPTIONS) % nst_mne_lcurve - this function solve the inverse probleme using a l-curve % approach % Input: HM - struct % | - HM.Gain : Gain matrix % OPTIONS - struct % | - OPTIONS.Data : data matrix (nChannel x nTimes) % | - OPTIONS.DataTime: Corres...
cf77906e3fda39214ef344ecb01efd7d39475c45c1b3bf24b9865bd79fd489d4
MATLAB
4,282
147
function [ peak, clus, clusid ] = SurfStatPeakClus( slm, mask, thresh, ... reselspvert, edg ); %Finds peaks (local maxima) and clusters for surface data. % % Usage: [ peak, clus, clusid ] = SurfStatPeakClus( slm, mask, thresh ... % [, reselspvert [, edg ] ] ); % % slm.t ...
a567f53b0512cc0192b317a2a0d904ab090548a876d831e455371d8ad3062305
MATLAB
4,283
117
function [cellpos,trac,modnum,aflow,polyrate,gactin,trec,Forcec,t,msd,sem,gof,rmc,traction,rgflow,modulenum,modulel,csl,gact,area,aratio]=... analyzeCMSoutputv1_0(tint,tanalysis,texc,nucr,mc,trec,Forcec,cellpos,polyrate,gactin,trac,aflow,modnum,sdist,mdist) % Original code written by Benjamin Bangasser and ...
9f5f55f6a220f25c2b7ba2558c7e2ecb5698e73dc8f9585fd0de986f234c24ef
MATLAB
4,291
96
function [Z,out] = AS_PtoTRF(pval,Flag,Df1,Df2) % This is from software rest. % The orginal version is [Z P Header] = rest_TFRtoZ(ImgFile,OutputName,Flag,Df1,Df2,Header) % The bellow is the orginal annotation. % function [Z P Header] = rest_TFRtoZ(ImgFile,OutputName,Flag,Df1,Df2,Header) % FORMAT [Z P Header] = y...
2649d7f4de8dd06182b49199f179f4ec8dcd0d6828a461737aaf22f8c0a7ca00
MATLAB
4,305
87
function [O] = GED_single_subject_singletrial(S) O = []; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Loads a single subject, computed GED on it and store the data in a .mat file % the covariance matrix is computed on each trial independently and then averaged % INPUTS : -S.fil...
d8f8eea3c0d19b7059b079591521cde06069a8307a1cc699714833877e242f35
MATLAB
4,310
192
function [efs,F,cdfs,p,eps,dfs,b,y2,sig,mse]=repanova5(d,D,fn,gg,alpha); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version5 has return of mse added (eg for plotting Loftus error bars) % % [efs,F,cdfs,p,eps,dfs,b,y2,sig] = repanova(d,D,fn,gg,alpha); % % R.Henson, 17/3/03; rik.henson@mrc-cbu.cam.ac.uk % %...
639cfe7bad96c9ce8463ca8dde2f09fd18b22c0a9d951eb1bdf5a4c22a3556b1
MATLAB
4,336
111
function [ a, cb ] = SurfStatView( struct, surf, title, background); %Viewer for surface data or P-value or Q-value structures. % % Usage: [ a, cb ] = SurfStatView( struct, surf [,title [,background] ] ); % % struct = 1 x v vector of data, v=#vertices, zeros(1,v) if empty, % or one of t...
f10128d3b8d8608da56d4ff22ed7b7fd552c025349517438a42b8e73aaed297b
MATLAB
4,338
144
clear % NOTES % v5 is with updated file names so that dt and non dt dont overwrite % v6 has homogenized fitting bounds and includes biQTI % v7 is using the new resQ functions % v8 is same as v7 but fixes overwrite issue maindir =[path_ludisc '\Common\DATA\MIPCART pilot\Pilot MRI\']; dir_name = 'analysis_v8_'; % This...
7da3f5d37edc193ee2e9b63cdb741a12484040aa61aabe66aa6cd4c89dba5136
MATLAB
4,341
135
function slidetraj = slideFilter(type,data,win,dimorig) %%% J. Otterstrom, Matlab 2012a, July 2013 % sliding filter that makes a window around each time point in a % trajectory of width 2*win. If a difference filter is used, then the % difference between the later half of the window from the first half of % t...
8919d562a364ab95327d5faa07596fce1cfbebcb0251c67e1c0257641435bbaa
MATLAB
4,348
119
function surface_group_pipeline_V1() % Example for the template- and surface-based full pipeline, using the % function NST_PPL_SURFACE_TEMPLATE_V1. % % This script downloads some sample data of 10 "dummy" subjects (27 Mb), % as well as the Colin27_4NIRS template (19 Mb) if not available. % All downloaded data wi...
ac039282ba05a7c5bf4dc3d67b2b4be8ad2905b5c88b5af8a03acdd00b7fd9a9
MATLAB
4,364
88
function [O] = GED_single_subject_LandR_separately(S) O = []; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Why this dumb name? I chose it because I wanted to distinguish the % function to perform GED when Listening and resting were divided before % source reconstruction. This re...
48ef3eb4af009e3797002fd17279242b472b83c2002d907913f5ae0644fa8f7c
MATLAB
4,369
120
function [anat_hr_seg, vc_mask] = Segment_anatomy(anat_hr,output_folder) % Segment_anatomy - Segments anatomy, normalizes to MNI, % and extracts visual cortex mask from atlas. % % INPUT: % anat_hr (string) - full path to anatomical T1w NIfTI image % % OUTPUT: % anat_hr_seg (struct) - GM/WM/CSF probability maps % ...
290328b184ba4198f0bde8bc6502bb2480aa1c8ebfdde5225e416eedf1235b7a
MATLAB
4,371
133
function [surf,ab]=SurfStatReadSurf(filenames,ab,numfields,dirname,maxmem); %Reads coordinates and triangles from an array of .obj or FreeSurfer files. % % Usage: [ surf, ab ] = SurfStatReadSurf( filenames [,ab [,numfields ... % [, dirname [, maxmem ] ] ] ] ); % % filenames = .o...
651b4dcd988e43ffbd8aa2e32a6754583da8230e40bff1d9f948fa62d248fc50
MATLAB
4,372
160
function varargout=shadedErrorBar(x,y,errBar,lineProps,transparent) % function H=shadedErrorBar(x,y,errBar,lineProps,transparent) % % Purpose % Makes a 2-d line plot with a pretty shaded error bar made % using patch. Error bar color is chosen automatically. % % Inputs % x - vector of x values [optional, can be left em...
9526a7a2787cc469f084cd7cc50bb4d8dfc1b6d2e72bae7eeb613bdef0d6db70
MATLAB
4,388
141
function [ t, df, pval ] = SurfStatPlot( x, y, M, g, varargin ); %Numeric or string variables against numeric, adjusted and/or by groups. % % Usage: [ t, df, pval ] = SurfStatPlot( x, y [,M [,g [,varargin]]] ); % % x = n x 1 vector of numbers or cell array of strings or a term of these. % y = n x 1 vector of ...
8fe5d78896cc000713a58848bf996f2a4e40ab07781ddcc1db6398695187bd4c
MATLAB
4,400
126
classdef SpreeTest < matlab.unittest.TestCase properties tmp_dir end methods(TestMethodSetup) function setup(testCase) tmpd = tempname; mkdir(tmpd); testCase.tmp_dir = tmpd; utest_bst_setup(); end end methods(Test...
7628bd32c8e21a8d818dd88b979bd7600c090b8e81ef6c4a3fecc107af161001
MATLAB
4,409
184
function [preimages,images,averages,mask] = OMimprocess(fname,im,rect,num_images,cropchoice,mask,sfilt,sfiltsize,inversion,tfilt,removef,camopt,sfiltsigma,pbefore,pafter,n) %funtion for reading in and processimg all images in the tif stack/ rhs [rows cols] = size(im); [qq,token,remain] = fileparts(fname); fileisrsh...
692377fb269fa62055f86b38eca8868231fb3b5d1282af9279f27f61f54846c6
MATLAB
4,414
114
function jds_normPopulationActivityREM(animalprefixlist,area) %JDS_NORMPOPULATIONACTIVITYREM Ripple-aligned normalized population activity in REM. % jds_normPopulationActivityREM(animalprefixlist,area) plots cortical % REM-ripple-aligned population activity ('CA1' or PFC), normalized to % the mean population rate...
ed21a5be65513153c65f44528da04bb149d34820ae4387124416a868dbc836c1
MATLAB
4,417
130
function tc_show_single_boundary_frame(configuration) % Hack to show single frame of video. % % TVM_VOLUMEWITHBOUNDARIESTOMOVIE(configuration) % TVM_VOLUMEWITHBOUNDARIESTOMOVIE(configuration) % @todo Add description % % Input: % i_SubjectDirectory % i_ReferenceVolume % i_Boundaries % i_Axis % i_FramesPerS...
d648767b3434cc3f2808e16de68931b2a140e62b0d8c2c316892add1ad497738
MATLAB
4,425
134
function run_tests(to_run, stop_on_error, do_coverage, re_match_filter) % Run unit test suites from files located in './test' % Test scenarios to run are specificied by given to_run: % - package: tests related to functions in bst_plugin % - source: tests of tools used on package sources (eg dist_tools) % - scr...
cfa265768ae0802935c73bb665d026ed2d64a3358dcbb4c31244011edea7b447
MATLAB
4,430
113
function Plot_K_diffs_transitions(data_dir,selectedK) % % Plot the the results from the hypothesis tests obtained from comparing % the mean state-to-state transition probability between conditions. % INPUT: % data_dir directory with the results from running the hypothesis % tests on the state-to-sta...
dc13f0a4bca07912f626cb60404dcf49e576a111fc82b8477bf5c74f2801a6a7
MATLAB
4,433
126
function [ POS, NEG ] = signROIs_degree_connotherROIs_LBPD_D( INT, COUP, lab_ab, r, X ) % It identifies the connections between the ROIs significantly central within % the brain network and the other ROIs. % Currently, it is implemented for the contrast between two conditions or for % working with only condition 1 or ...
0b3c91bfbae680c5a1a2cbebda89a2111b6c201b107a27c5df9ab6a765dfcd4c
MATLAB
4,443
110
function Plot_K_state_time(data_dir,save_dir,selectedK) % % Plot the state time courses for all participants and make pie plots with % the percentage of time spent in each state. % % INPUT: % data_dir directory where LEiDA results are stored % save_dir directory to save results for selected optimal K % select...
9598ddcc6094020945ed75e186576d0d8400ea09a0dd70ee98d0833dc16aa11b
MATLAB
4,444
102
function EEGpav_prepStan4Reeg(dirs) % Generate EEG4stan.mat % Input: % dirs.singletrial = '.../EEGsingletrial.mat' % dirs.stan = '.../EEG4stan.mat' % ---- Load single-trial data ---- S = load(dirs.singletrial, 'data', 'par'); data = S.data; par = S.par; % ---- Feedback r: support outco...
a4eaf8a6f32636df90658da62a9138488a0e5f54c378a4f82ea69ef7e633c5f5
MATLAB
4,444
118
function [isrcs, idets, measures, measure_type] = nst_unformat_channels(channel_labels, warn_bad_channels) % NST_UNFORMAT_CHANNELS extract sources, dectectors and measures information % from channel labels with *homogeneous* type (eg wavelength or Hb). % % [ISRCS, IDETS, MEAS, CHAN_TYPE] = NST_UNFORMAT_CHANNELS(CHAN...
9c63ed840e917637655631e941327c5fdc3901f2da7e3fe7e20a0de524d9e855
MATLAB
4,445
102
classdef ResultPool %RESULTPOOL Summary of this class goes here % TODO Detailed explanation goes here properties network_atlas test_options network_test_options edge_test_results network_test_results permutation_edge_test_results permutation_net...
426bbc7a4018e0f93461468c07376daf71b12c65890f487c620f401a50552c97
MATLAB
4,450
131
function [clustersize,clusters,numcluster] = pl_conncomp(map) % % Finds clusters (connected components) in maps of any dimension. The clusters consist of map locations with non-zero elements. % Useful for cluster-based statistical procedures % % This function is part of the permutationlab software: % Author:...
e6a2a83ad9368ddc1f8c2dadf4652f4dc370963f8cb30bcf4d943a2aa89eaf2a
MATLAB
4,466
119
function [ a, cb ] = SurfStatView( struct, surf, title, background); %Viewer for surface data or P-value or Q-value structures. % % Usage: [ a, cb ] = SurfStatView( struct, surf [,title [,background] ] ); % % struct = 1 x v vector of data, v=#vertices, zeros(1,v) if empty, % or one of t...
0d1067cccbc17b7f03e18c8f3502201cb558c9aa8735f3ec6a620086e8f3a692
MATLAB
4,467
107
%jds_assemblyFieldMetricsShuffle %Computes 2D spatial rate maps for PFC assembly activation events (run %epochs, reactivation strength > 5) and quantifies their spatial %information and sparsity against a null distribution from circularly %shifted activation times (n=1000 shuffles, minimum 20 s shift). Plots %z-scored ...
3d681876799ad893b08e4b6ad0cbf37568ec2cf150baaa8a8f7aa5fed57affd0
MATLAB
4,472
164
function BCCT_SCN_statGUI D.fig = figure('Name','BCCT stastic(two groups)',... 'units','normalized',... 'menubar','none',... 'numbertitle','off',... 'color',[0.95 0.95 0.95],... 'position',[0.3 0.4 0.4 0.3]); movegui(D.fig,'center'); %% D.OutputText = uicon...
428ccc697ff846d5e9a6f3ffa9f3786706704c8e8b7ebe5133e6a3c6b1350762
MATLAB
4,476
164
function BCCT_CaSCN_statGUI D.fig = figure('Name','BCCT stastic(two groups CaSCN)',... 'units','normalized',... 'menubar','none',... 'numbertitle','off',... 'color',[0.95 0.95 0.95],... 'position',[0.3 0.4 0.4 0.3]); movegui(D.fig,'center'); %% D.OutputText...
6dc5c6fddf9011016d2368e2dba1d76cf7948bd923b667794c27c0d9b1101e6b
MATLAB
4,482
129
%-------------------------------------------------------------------------- % Till Habersetzer, 23.06.2025 % Communication Acoustics, CvO University Oldenburg % till.habersetzer@uol.de % % This script performs a quality control (QC) check by visualizing the % outputs of the MRI processing and MEG/MRI coregistration pi...
9f37f684b04854f355b227a4c54cc176170c25cc094eefd7cbb8fd795a2d18c5
MATLAB
4,485
132
function dm_prep(dataFolder,subName,taskName,icaTriggers,icaWindow,filters,reference,badChannels,appendString,exportAsBV) %DM_PREP Preprocess DM lab data % dataFolder: high-level BIDS folder % subName: subject name, e.g. 'sub-01' % taskName: task name, e.g. 'cooltask' % icaTriggers: the triggers around w...
d3d1fdf5ce2c107ada30f35fcec6f4a6555ed885a8e5f7917db5e983da081864
MATLAB
4,497
164
% Return time frame of a NIFTI dataset. Support both *.nii and % *.hdr/*.img file extension. If file extension is not provided, % *.hdr/*.img will be used as default. % % It is a lightweighted "load_nii_hdr", and is equivalent to % hdr.dime.dim(5) % % Usage: [ total_scan ] = get_nii_frame(filename) % ...
4a5b0cce5059a16ee73340824cd168ad21d6891eb62fbad7a2f9c5e837f2b9d2
MATLAB
4,511
92
function vox_coor = get_schaefer_neurosynth_vox_coor() vox_coor = [ 43.2445652173913 86.6413043478261 39.7364130434783 47.8008849557522 86.6637168141593 41.7300884955752 21.3996840442338 31.9447077409163 53.4849921011058 69.8309037900875 32.7026239067055 53.5393586005831 41.3212435233161 34.2849740932642 42.953...
a1f97f95fb8220d017e0a62455416a9b96417cab2e9a4f3f3706da5f8f7d218c
MATLAB
4,521
104
function O = Replay_TG_Plot_Stats(S) O = []; %It computes plots (and/or statistics against 50% chance level (time %consuming)) for temporal generalisation (TG) decoding. %It is designed to work on the Aarhus Cluster % INPUT: % -S structure with folloring fields: % -list_TG: directory wi...
4025cd66adb3e0cc6cb99f2c2ef991bd88ee73f2f3e39ec0f6832829707c4cae
MATLAB
4,522
116
function b_first_level_contrasts(parameters, delete_spm_files) %% b_first_level_contrasts(mainpath, subject, delete_spm_files) %mainpath = '/project/3018037.01/Experiment3.2_ERC/AnalysisFolder/scripts/scriptTemplates/..'; tc_struct2ws('caller', parameters.main); %% paths tc_struct2ws('caller', parameters.paths); tc_st...
be7b876c7361b1ba212da99d337a9b321ef86a9d85c86a95654231d88ecb2e1e
MATLAB
4,523
115
%% % current working directory needs to be /path/to/scripts mainpath= pwd; addpath([mainpath filesep 'toolboxes' filesep 'tc_functions']) addpath([mainpath filesep 'fmriRegAnalysis']) addpath([mainpath filesep 'toolboxes' filesep 'fieldtrip']) addpath([mainpath filesep 'toolboxes' filesep 'OpenFmriAnalysis']) tvm_inst...
7a9922ebd1ece42cf5d2a8c8e6b17968c13667dd511ebf0c398e99b01fc1b34f
MATLAB
4,526
101
function [I,Q,F]=motif3funct_wei(W) %MOTIF3FUNCT_WEI Intensity and coherence of functional class-3 motifs % % [I,Q,F] = motif3funct_wei(W); % % *Structural motifs* are patterns of local connectivity in complex % networks. In contrast, *functional motifs* are all possible subsets of % patterns of lo...
618224917eedb5c50ac44476c524e6c534cbdf86ea46bb22f8a89e3dcfda98fa
MATLAB
4,549
190
clear;clc;close all; load('trait_score.mat') load distance_beta.mat %% %% all subjects vs 0 result_permuation=zeros(85,1001,4,2); for condition=1:4 for i=1:1001 for time=1:85 a11=squeeze(distance_beta(:,time,i,condition)); [h,p,ci,stats] = ttest(a11); result_permuation(time,i,co...
f1d77f3fa33bf861d066352c86815f9d2645713e3481b07cf886dacca5d1b5ce
MATLAB
4,549
113
% ------------------------------------------------------------------------- % Script: make_figureS3.m % % Description: % This script generates Figure S3 for the manuscript, comparing the % circular distribution of respiratory phases in newly collected data % according to 4 separate groupings: W trials, M trials, first ...
e60e944dd0de2179b0b6941a25ee5ee9ce506d71dee142e82d4bedab561e1075
MATLAB
4,555
107
function data_simulated = loc_list_storm_image_simulation() input_values = inputdlg({'clusters density (um^-2):','clusters radius (nm):','clusters localizations density (um^-2):','background density (um^-2):','connections density (um^-2):','connections distance (um):','connections probability [0 1]:','image size (um):...
c122b128bcb2f91992344a4d2beb9eb055300c8ccdbda55dcd9cbfccc08035dd
MATLAB
4,556
94
function image_laplacian_filter(data) figure() set(gcf,'name','Laplacian Filter','NumberTitle','off','color','w','units','normalized','position',[0.25 0.15 0.4 0.6],'menubar','none','toolbar','figure') if length(data)>1 slider_step=[1/(length(data)-1),1]; slider_one = uicontrol('style','slider','unit...